Class sdm::Graph
template <typename TNode, typename TEdge>
Class List > sdm > Graph
A structure to manipulate graphs. More...
#include <graph.hpp>
Inherits the following classes: std::enable_shared_from_this< Graph< TNode, TEdge > >, sdm::BoostSerializable
Public Attributes
Type | Name |
---|---|
std::unordered_map< TNode, std::shared_ptr< GraphNode< TNode, TEdge > > > | node_space_ Space of nodes. |
Public Functions
Type | Name |
---|---|
Graph () Default constructor object. | |
void | addNode (const TNode & node_value) Add a node in the graph. |
void | addSuccessor (const TNode & node_value, const TEdge & edge_value, const TNode & succ_node_value) |
bool | contains (const TNode & node_value) const |
std::shared_ptr< GraphNode< TNode, TEdge > > | getNode (const TNode & belief) const Get the node associated to a given node's value . |
number | getNumNodes () const Get the number of node. |
std::shared_ptr< GraphNode< TNode, TEdge > > | getPredecessor (const TNode & node, const TEdge & edge) const |
std::shared_ptr< GraphNode< TNode, TEdge > > | getSuccessor (const TNode & node, const TEdge & edge) const |
std::shared_ptr< Graph > | getptr () |
std::string | node_str () const |
void | serialize (Archive & archive, const unsigned int) |
std::string | str () const |
virtual | ~Graph () Destructor of Graph (that's bad). |
Public Functions inherited from sdm::BoostSerializable
Type | Name |
---|---|
BoostSerializable () | |
void | load (std::string filename) Load a value function from a file. The extension of the file will indicate the type of formatage for reading ( .txt = text format, '.xml' = XML format, other = binary format). |
void | save (std::string filename) Save a value function into a file. The extension of the file will indicate the type of formatage for recording ( .txt = text format, '.xml' = XML format, other = binary format). |
Protected Functions inherited from sdm::BoostSerializable
Type | Name |
---|---|
void | serialize (Archive & archive, const unsigned int version) |
Detailed Description
Template parameters:
TNode
the type of the data contains in each nodeTEdge
the type of the edges between two nodes
Public Attributes Documentation
variable node_space_
std::unordered_map<TNode, std::shared_ptr<GraphNode<TNode, TEdge> > > sdm::Graph< TNode, TEdge >::node_space_;
Public Functions Documentation
function Graph
sdm::Graph::Graph ()
function addNode
void sdm::Graph::addNode (
const TNode & node_value
)
Parameters:
node_value
the value of the node
function addSuccessor
void sdm::Graph::addSuccessor (
const TNode & node_value,
const TEdge & edge_value,
const TNode & succ_node_value
)
function contains
bool sdm::Graph::contains (
const TNode & node_value
) const
function getNode
std::shared_ptr< GraphNode < TNode, TEdge > > sdm::Graph::getNode (
const TNode & belief
) const
Parameters:
node_value
a specific node value
Returns:
the address of the node
function getNumNodes
number sdm::Graph::getNumNodes () const
function getPredecessor
std::shared_ptr< GraphNode < TNode, TEdge > > sdm::Graph::getPredecessor (
const TNode & node,
const TEdge & edge
) const
function getSuccessor
std::shared_ptr< GraphNode < TNode, TEdge > > sdm::Graph::getSuccessor (
const TNode & node,
const TEdge & edge
) const
function getptr
std::shared_ptr< Graph > sdm::Graph::getptr ()
function node_str
std::string sdm::Graph::node_str () const
function serialize
template<class Archive class Archive>
void sdm::Graph::serialize (
Archive & archive,
const unsigned int
)
function str
std::string sdm::Graph::str () const
function ~Graph
virtual sdm::Graph::~Graph ()
Friends Documentation
friend operator<<
inline friend std::ostream & sdm::Graph::operator<< (
std::ostream & os,
Graph & graph
)
The documentation for this class was generated from the following file src/sdm/utils/struct/graph.hpp