60 #ifndef GUM_LEARNING_GRAPH_CHANGES_GENERATOR_4_K2_H 61 #define GUM_LEARNING_GRAPH_CHANGES_GENERATOR_4_K2_H 63 #include <agrum/agrum.h> 64 #include <agrum/tools/core/OMPThreads.h> 65 #include <agrum/tools/core/sequence.h> 66 #include <agrum/tools/core/set.h> 68 #include <agrum/tools/graphs/diGraph.h> 69 #include <agrum/BN/learning/structureUtils/IGraphChangesGenerator4DiGraph.h> 70 #include <agrum/BN/learning/structureUtils/graphChange.h> 119 template <
typename STRUCT_CONSTRAINT >
183 STRUCT_CONSTRAINT&
constraint()
const noexcept;
187 void setGraph(
const DiGraph& graph);
211 void setOrder(
const Sequence< NodeId >& order);
214 void setOrder(
const std::vector< NodeId >& order);
236 #if defined(_OPENMP) && !defined(GUM_DEBUG_MODE) 248 #include <agrum/BN/learning/structureUtils/graphChangesGenerator4K2_tpl.h> GraphChangesGenerator4K2(GraphChangesGenerator4K2< STRUCT_CONSTRAINT > &&from)
move operator
GraphChangesGenerator4K2(STRUCT_CONSTRAINT &constraint)
default constructor
STRUCT_CONSTRAINT * constraint_
the structural constraint used to restrict the changes
void notifyGetCompleted()
notifies the generator that we have parsed all its legal changes
const iterator & end() const
returns an (unsafe) iterator on the end of the list of operators
INLINE void emplace(Args &&... args)
iterator begin() const
returns an (unsafe) iterator on the beginning of the list of operators
void setGraph(const DiGraph &graph)
sets a new graph from which the generator will compute possible changes
GraphChangesGenerator4K2(const GraphChangesGenerator4K2< STRUCT_CONSTRAINT > &from)
copy constructor
STRUCT_CONSTRAINT & constraint() const noexcept
returns the constraint that is used by the generator
Sequence< NodeId > order_
the order on the variables
void setMaxNbThreads(Size nb) noexcept
sets the maximum number of threads used to compute the set of changes
GraphChangesGenerator4K2< STRUCT_CONSTRAINT > & operator=(const GraphChangesGenerator4K2< STRUCT_CONSTRAINT > &from)
copy operator
Size _max_threads_number_
the max number of threads authorized
void modifyGraph(const GraphChange &change)
notify the generator of a change applied to the graph
GraphChangesGenerator4K2< STRUCT_CONSTRAINT > & operator=(GraphChangesGenerator4K2< STRUCT_CONSTRAINT > &&from)
move operator
Set< GraphChange > legal_changes_
the current set of graph changes
virtual ~GraphChangesGenerator4K2()
destructor
void clearChanges() noexcept
empty the set of possible change operators that can be applied
Database(const std::string &filename, const BayesNet< GUM_SCALAR > &bn, const std::vector< std::string > &missing_symbols)
The basic class for computing the next graph changes possible in a structure learning algorithm...
void setOrder(const std::vector< NodeId > &order)
set a new order on the random variables
void createChanges_()
create the set of legal and illegal changes from a given graph
DiGraph graph_
the graph on which we generate operators