![]() |
aGrUM
0.20.3
a C++ library for (probabilistic) graphical models
|
The basic class for computing the next graph changes possible in an undirected structure learning algorithm. More...
#include <graphChangesGenerator4UndiGraph.h>
Public Member Functions | |
Constructors / Destructors | |
GraphChangesGenerator4UndiGraph (STRUCT_CONSTRAINT &constraint) | |
default constructor More... | |
GraphChangesGenerator4UndiGraph (const GraphChangesGenerator4UndiGraph< STRUCT_CONSTRAINT > &from) | |
copy constructor More... | |
GraphChangesGenerator4UndiGraph (GraphChangesGenerator4UndiGraph< STRUCT_CONSTRAINT > &&from) | |
move operator More... | |
virtual | ~GraphChangesGenerator4UndiGraph () |
destructor More... | |
Operators | |
GraphChangesGenerator4UndiGraph< STRUCT_CONSTRAINT > & | operator= (const GraphChangesGenerator4UndiGraph< STRUCT_CONSTRAINT > &from) |
copy operator More... | |
GraphChangesGenerator4UndiGraph< STRUCT_CONSTRAINT > & | operator= (GraphChangesGenerator4UndiGraph< STRUCT_CONSTRAINT > &&from) |
move operator More... | |
Iterators | |
iterator | begin () const |
returns an (unsafe) iterator on the beginning of the list of operators More... | |
const iterator & | end () const |
returns an (unsafe) iterator on the end of the list of operators More... | |
Accessors / Modifiers | |
STRUCT_CONSTRAINT & | constraint () const noexcept |
returns the constraint that is used by the generator More... | |
void | setGraph (const UndiGraph &graph) |
sets a new graph from which the operator will compute possible changes More... | |
void | modifyGraph (const EdgeAddition &change) |
notify the operator set of a change applied to the graph More... | |
void | modifyGraph (const EdgeDeletion &change) |
notify the operator set of a change applied to the graph More... | |
void | modifyGraph (const GraphChange &change) |
notify the operator set of a change applied to the graph More... | |
void | clearChanges () noexcept |
empty the set of possible change operators that can be applied More... | |
void | notifyGetCompleted () |
notifies the generator that we have parsed all its legal changes More... | |
void | setMaxNbThreads (Size nb) noexcept |
sets the maximum number of threads used to compute the set of changes More... | |
Public Types | |
using | iterator = typename Set< GraphChange >::const_iterator |
the iterator for parsing the list of possible graph change operators More... | |
using | const_iterator = iterator |
the const iterator for parsing the list of graph change operators More... | |
Protected Attributes | |
UndiGraph | graph_ |
the graph on which we generate operators More... | |
STRUCT_CONSTRAINT * | constraint_ |
a reference on the structural constraint used to restrict the changes More... | |
Set< GraphChange > | legal_changes_ |
the current set of operators More... | |
Protected Member Functions | |
void | createChanges_ () |
create the set of legal and illegal changes from a given graph More... | |
The basic class for computing the next graph changes possible in an undirected structure learning algorithm.
Structure learning algorithm try different modifications of the graph. Class GraphChangesGenerator4UndiGraph provides a simple way to compute those that we wish to perform. For instance, in the basic PC algorithm for learning undirected graphs, one may expect that all possible edge additions and deletions can be applied and GraphChangesGenerator4UndiGraph provides exactly this set of operations. This class provides the following minimal methods:
Basically, the idea is to use method setGraph at the beginning of the structure learning in order to initialize the possible set of operators. Then, parse this set using a for ( auto iter = operator_set.begin (); iter != operator_set.end (); ++iter ) loop and compute the scores induced by these changes. When this is done, flush the operator set by calling method clearChanges. Then iterate changes and after each new change applied, used again the iterator for loop, and so on. Note that, whenever you execute method modifyGraph, this will automatically flush the current list of changes and put into the list only the changes that are affected by the graph modification.
Definition at line 110 of file graphChangesGenerator4UndiGraph.h.
using gum::learning::GraphChangesGenerator4UndiGraph< STRUCT_CONSTRAINT >::const_iterator = iterator |
the const iterator for parsing the list of graph change operators
Definition at line 116 of file graphChangesGenerator4UndiGraph.h.
using gum::learning::GraphChangesGenerator4UndiGraph< STRUCT_CONSTRAINT >::iterator = typename Set< GraphChange >::const_iterator |
the iterator for parsing the list of possible graph change operators
Definition at line 113 of file graphChangesGenerator4UndiGraph.h.
gum::learning::GraphChangesGenerator4UndiGraph< STRUCT_CONSTRAINT >::GraphChangesGenerator4UndiGraph | ( | STRUCT_CONSTRAINT & | constraint | ) |
default constructor
gum::learning::GraphChangesGenerator4UndiGraph< STRUCT_CONSTRAINT >::GraphChangesGenerator4UndiGraph | ( | const GraphChangesGenerator4UndiGraph< STRUCT_CONSTRAINT > & | from | ) |
copy constructor
gum::learning::GraphChangesGenerator4UndiGraph< STRUCT_CONSTRAINT >::GraphChangesGenerator4UndiGraph | ( | GraphChangesGenerator4UndiGraph< STRUCT_CONSTRAINT > && | from | ) |
move operator
|
virtual |
destructor
|
virtual |
returns an (unsafe) iterator on the beginning of the list of operators
Implements gum::learning::IGraphChangesGenerator4UndiGraph.
|
virtualnoexcept |
empty the set of possible change operators that can be applied
Implements gum::learning::IGraphChangesGenerator4UndiGraph.
|
noexcept |
returns the constraint that is used by the generator
|
protected |
create the set of legal and illegal changes from a given graph
|
virtual |
returns an (unsafe) iterator on the end of the list of operators
Implements gum::learning::IGraphChangesGenerator4UndiGraph.
|
virtual |
notify the operator set of a change applied to the graph
Implements gum::learning::IGraphChangesGenerator4UndiGraph.
|
virtual |
notify the operator set of a change applied to the graph
Implements gum::learning::IGraphChangesGenerator4UndiGraph.
|
virtual |
notify the operator set of a change applied to the graph
Implements gum::learning::IGraphChangesGenerator4UndiGraph.
|
virtual |
notifies the generator that we have parsed all its legal changes
Implements gum::learning::IGraphChangesGenerator4UndiGraph.
GraphChangesGenerator4UndiGraph< STRUCT_CONSTRAINT >& gum::learning::GraphChangesGenerator4UndiGraph< STRUCT_CONSTRAINT >::operator= | ( | const GraphChangesGenerator4UndiGraph< STRUCT_CONSTRAINT > & | from | ) |
copy operator
GraphChangesGenerator4UndiGraph< STRUCT_CONSTRAINT >& gum::learning::GraphChangesGenerator4UndiGraph< STRUCT_CONSTRAINT >::operator= | ( | GraphChangesGenerator4UndiGraph< STRUCT_CONSTRAINT > && | from | ) |
move operator
|
virtual |
sets a new graph from which the operator will compute possible changes
Implements gum::learning::IGraphChangesGenerator4UndiGraph.
|
noexcept |
sets the maximum number of threads used to compute the set of changes
|
private |
the max number of threads authorized
Definition at line 215 of file graphChangesGenerator4UndiGraph.h.
|
protected |
a reference on the structural constraint used to restrict the changes
Definition at line 202 of file graphChangesGenerator4UndiGraph.h.
|
protected |
the graph on which we generate operators
Definition at line 199 of file graphChangesGenerator4UndiGraph.h.
|
protected |
the current set of operators
Definition at line 205 of file graphChangesGenerator4UndiGraph.h.