Construct version 5.4.3
An agent based modeling framework
Typeless_Graph Class Referenceabstract

Parent class for Graph. More...

Inheritance diagram for Typeless_Graph:
Collaboration diagram for Typeless_Graph:

Public Types

enum class  edge_types : char {
  dbool , dint , duint , dfloat ,
  dstring , vbool , vint , vuint ,
  vfloat , vstring , mbool , mint ,
  muint , mfloat , mstring
}
 Set of all edge types a Graph can have.
 

Public Member Functions

virtual void push_deltas (void) noexcept=0
 Virtual function that allows the deltas in a Graph to be pushed without needing to convert the Typeless_Graph into its child type. More...
 
virtual void get_data_state (std::ostream &out) const =0
 For each link in the graph, the lambda or function pointer is called on the value of that link. More...
 

Static Public Member Functions

template<typename T >
static constexpr edge_types get_edge_type (void) noexcept
 Returns an edge_types to represent the template type

  • dbool -> "bool" < / item >
  • dint -> "int" < / item >
  • duint -> "unsigned int" < / item >
  • dfloat -> "float" < / item >
  • dstring -> "string" < / item >
  • vbool -> "vector<bool>" < / item >
  • vint -> "vector<int>" < / item >
  • vuint -> "vector<unsigned int>" < / item >
  • vfloat -> "vector<float>" < / item >
  • vstring -> "vector<string>" < / item >
  • mbool -> "map<bool>" < / item >
  • mint -> "map<int>" < / item >
  • muint -> "map<unsigned int>" < / item >
  • mfloat -> "map<float>" < / item >
  • mstring -> "map<string>" < / item >

 
template<typename T >
static constexpr std::string get_type_name (void) noexcept
 Returns a string to represent the template type
 
template<>
Typeless_Graph::edge_types get_edge_type (void) noexcept
 
template<>
Typeless_Graph::edge_types get_edge_type (void) noexcept
 
template<>
Typeless_Graph::edge_types get_edge_type (void) noexcept
 
template<>
Typeless_Graph::edge_types get_edge_type (void) noexcept
 
template<>
std::string get_type_name (void) noexcept
 
template<>
std::string get_type_name (void) noexcept
 
template<>
std::string get_type_name (void) noexcept
 
template<>
std::string get_type_name (void) noexcept
 

Public Attributes

const Nodeset *const source_nodeset
 The nodeset in which each node corresponds to a row in the data structure.
 
const Nodeset *const target_nodeset
 The nodeset in which each node corresponds to a column in the data structure.
 
const Nodeset *const slice_nodeset
 The nodeset in which each node corresponds to a slice in the data structure.
 
const std::string name
 The name of the network.
 
const unsigned int row_size
 The number of rows in the data structure. Equalivilent to the size of the source nodeset.
 
const unsigned int col_size
 The number of columns in the data structure. Equalivilent to the size of the target nodeset.
 
const edge_types edge_type
 The edge's data type. Set by #dynet::get_type_name.
 
const bool col_dense
 
const bool row_dense
 True if the row representation is dense, false if the representation is sparse.
 

Detailed Description

Parent class for Graph.

By having Graph ineheriet from this non-templated class, we're able to hold the pointers for graphs in the same data structure regardless of the templated type of the child Graph class. In addition, this class also holds the data common to all networks such as name, edge type, nodesets, and dimension sizes.

Member Function Documentation

◆ get_data_state()

virtual void Typeless_Graph::get_data_state ( std::ostream &  out) const
pure virtual

For each link in the graph, the lambda or function pointer is called on the value of that link.

Implemented in Graph< link_type >, Graph< float >, Graph< std::map< unsigned int, float > >, Graph< bool >, Graph< unsigned int >, and Graph< std::vector< bool > >.

Here is the caller graph for this function:

◆ push_deltas()

virtual void Typeless_Graph::push_deltas ( void  )
pure virtualnoexcept

Virtual function that allows the deltas in a Graph to be pushed without needing to convert the Typeless_Graph into its child type.

Implemented in Graph< link_type >, Graph< float >, Graph< std::map< unsigned int, float > >, Graph< bool >, Graph< unsigned int >, and Graph< std::vector< bool > >.

Member Data Documentation

◆ col_dense

const bool Typeless_Graph::col_dense

True if the column representation is dense, false if the representation is sparse.