49 #ifndef GUM_LEARNING_GRAPH_CHANGES_GENERATOR_ON_SUBDIGRAPH_H 50 #define GUM_LEARNING_GRAPH_CHANGES_GENERATOR_ON_SUBDIGRAPH_H 52 #include <agrum/agrum.h> 53 #include <agrum/tools/core/OMPThreads.h> 54 #include <agrum/tools/core/set.h> 55 #include <agrum/tools/graphs/diGraph.h> 56 #include <agrum/BN/learning/structureUtils/IGraphChangesGenerator4DiGraph.h> 57 #include <agrum/BN/learning/structureUtils/graphChange.h> 93 template <
typename STRUCT_CONSTRAINT >
157 STRUCT_CONSTRAINT&
constraint()
const noexcept;
160 void setGraph(
const DiGraph& graph);
172 void setTails(
const NodeSet& nodes);
224 #if defined(_OPENMP) && !defined(GUM_DEBUG_MODE) 236 #include <agrum/BN/learning/structureUtils/graphChangesGeneratorOnSubDiGraph_tpl.h> GraphChangesGeneratorOnSubDiGraph< STRUCT_CONSTRAINT > & operator=(const GraphChangesGeneratorOnSubDiGraph< STRUCT_CONSTRAINT > &from)
copy operator
GraphChangesGeneratorOnSubDiGraph< STRUCT_CONSTRAINT > & operator=(GraphChangesGeneratorOnSubDiGraph< STRUCT_CONSTRAINT > &&from)
move operator
STRUCT_CONSTRAINT & constraint() const noexcept
returns the constraint that is used by the generator
The basic class for computing the next graph changes possible in a structure learning algorithm...
INLINE void emplace(Args &&... args)
void eraseTarget(NodeId node)
removes a target
GraphChangesGeneratorOnSubDiGraph(STRUCT_CONSTRAINT &constraint)
default constructor
void eraseTail(NodeId node)
removes a tail node
NodeSet target_nodes_
the set of target nodes
const iterator & end() const
returns an (unsafe) iterator on the end of the list of operators
virtual ~GraphChangesGeneratorOnSubDiGraph()
destructor
void setTails(const NodeSet &nodes)
assign a set of "tail" nodes
void clearChanges() noexcept
empty the set of possible change operators that can be applied
Size _max_threads_number_
the max number of threads authorized
Set< GraphChange > legal_changes_
the current set of operators
void setGraph(const DiGraph &graph)
sets a new graph from which the operator will compute possible changes
iterator begin() const
returns an (unsafe) iterator on the beginning of the list of operators
void modifyGraph(const GraphChange &change)
notify the operator set of a change applied to the graph
NodeSet tail_nodes_
the tail nodes (other extremities than the targets)
void createChanges_()
create the set of legal and illegal changes from a given graph
void setMaxNbThreads(Size nb) noexcept
sets the maximum number of threads used to compute the set of changes
void setTails(Size nb_nodes)
assign a set of "tail" nodes from 0 to nb_nodes - 1
void setTargets(const NodeSet &nodes)
assign a set of target nodes
void addTarget(NodeId node)
adds a new target node
Database(const std::string &filename, const BayesNet< GUM_SCALAR > &bn, const std::vector< std::string > &missing_symbols)
STRUCT_CONSTRAINT * constraint_
a reference on the structural constraint used to restrict the changes
void addTail(NodeId node)
adds a new "tail" node
GraphChangesGeneratorOnSubDiGraph(const GraphChangesGeneratorOnSubDiGraph< STRUCT_CONSTRAINT > &from)
copy constructor
void notifyGetCompleted()
notifies the generator that we have parsed all its legal changes
GraphChangesGeneratorOnSubDiGraph(GraphChangesGeneratorOnSubDiGraph< STRUCT_CONSTRAINT > &&from)
move operator