48#ifndef GUM_SIMPLICIAL_SET_H
49#define GUM_SIMPLICIAL_SET_H
59#define GUM_QUASI_RATIO 0.99
60#define GUM_WEIGHT_THRESHOLD 0.0
173 bool avoid_check =
false);
The base class for all undirected edges.
const PriorityQueue< NodeId, double > & allSimplicialNodes()
returns all the simplicial nodes
void addEdge(NodeId first, NodeId second)
adds a new edge to the graph and recomputes the simplicial set
void _updateList_(const NodeId id)
put node id in the correct simplicial/almost simplicial/quasi simplicial list
NodeId bestSimplicialNode()
returns the simplicial node with the lowest clique weight
NodeProperty< Size > _nb_adjacent_neighbours_
for each node, the number of pairs of adjacent neighbours
SimplicialSet(const SimplicialSet &)
prevent the default copy constructor
NodeProperty< _Belong_ > _containing_list_
bool hasSimplicialNode()
indicates whether there exists a simplicial node
void _updateAllNodes_()
put all the nodes in their appropriate list
bool hasAlmostSimplicialNode()
indicates whether there exists an almost simplicial node
SimplicialSet(const SimplicialSet &simplicial_from, UndiGraph *graph, const NodeProperty< double > *log_domain_sizes, NodeProperty< double > *log_weights, bool avoid_check=false)
copy constructor
SimplicialSet(UndiGraph *graph, const NodeProperty< double > *log_domain_sizes, NodeProperty< double > *log_weights, double theRatio=GUM_QUASI_RATIO, double theThreshold=GUM_WEIGHT_THRESHOLD)
constructor. initializes the simplicial set w.r.t. a given graph
_Belong_
indicates for each node to which list (simplicial, almost simplicial, quasi simplicial) it belongs
bool isSimplicial(const NodeId id)
indicates whether a given node is a simplicial node
NodeId bestAlmostSimplicialNode()
gets the almost simplicial node with the lowest clique weight
SimplicialSet(SimplicialSet &&from)
move constructor
const PriorityQueue< NodeId, double > & allQuasiSimplicialNodes()
returns all the quasi simplicial nodes
const NodeProperty< double > * _log_domain_sizes_
the log of the modalities of the nodes
NodeId bestQuasiSimplicialNode()
gets a quasi simplicial node with the lowest clique weight
EdgeProperty< Size > _nb_triangles_
for each edge, keep track of the number of triangles passing through this egde
const PriorityQueue< NodeId, double > & allAlmostSimplicialNodes()
returns all the almost simplicial nodes
void makeClique(const NodeId id)
adds the necessary edges so that node 'id' and its neighbors form a clique
double _quasi_ratio_
for a given node, if the number of pairs of neighbors that are adjacent / the number of adjacent neig...
void setFillIns(bool on_off)
sets/unset the fill-ins storage in the standard triangulation procedure
bool _we_want_fill_ins_
a boolean indicating if we want fill-ins list with the standard triangulation method
void eraseNode(const NodeId id)
removes a node and its adjacent edges from the underlying graph
PriorityQueue< NodeId, double > _almost_simplicial_nodes_
a queue of the almost simplicial nodes ordered by increasing node weight
~SimplicialSet()
destructor
void replaceLogWeights(NodeProperty< double > *old_weigths, NodeProperty< double > *new_weights)
reassigns a new set of cliques' log weights (with the same content)
double _log_threshold_
quasi and almost simplicial nodes may not be eliminated unless their weight is lower than (1 + thresh...
void eraseClique(const NodeId id)
removes a node and its adjacent edges from the underlying graph
PriorityQueue< NodeId, double > _quasi_simplicial_nodes_
a queue of the quasi simplicial nodes ordered by increasing node weight
NodeSet _changed_status_
the set of nodes that have tensorly changed of status
void _initialize_()
initialize: compute nb_triangles, nb_adjacent_neighbors, etc when a new graph is set
bool hasQuasiSimplicialNode()
indicates whether there exists a quasi simplicial node
UndiGraph * _graph_
the graph on which we perform the simplicial computations
void setGraph(UndiGraph *graph, const NodeProperty< double > *log_domain_sizes, NodeProperty< double > *log_weights, double theRatio=GUM_QUASI_RATIO, double theThreshold=GUM_WEIGHT_THRESHOLD)
initialize the simplicial set w.r.t. a new graph
PriorityQueue< NodeId, double > _simplicial_nodes_
a queue of the simplicial nodes ordered by increasing node weight
EdgeSet _fill_ins_list_
fill-ins list
SimplicialSet & operator=(const SimplicialSet &)
prevent a copy operator to be used
double _log_tree_width_
the current (induced) tree width
NodeProperty< double > * _log_weights_
the weights of the nodes (i.e., weight of their clique)
const EdgeSet & fillIns() const
returns the set of all the fill-ins added to the graph so far
void eraseEdge(const Edge &edge)
removes an edge from the graph and recomputes the simplicial set
Base class for undirected graphs.
Basic class for all graphs of cliques (join trees, etc).
Set< Edge > EdgeSet
Some typdefs and define for shortcuts ...
Size NodeId
Type for node ids.
HashTable< Edge, VAL > EdgeProperty
Property on graph elements.
HashTable< NodeId, VAL > NodeProperty
Property on graph elements.
Set< NodeId > NodeSet
Some typdefs and define for shortcuts ...
gum is the global namespace for all aGrUM entities
priority queues (in which an element cannot appear more than once)
#define GUM_WEIGHT_THRESHOLD
inline implementations of simplicial set