31 #ifndef GUM_LEARNING_GRAPH_CHANGE_H 32 #define GUM_LEARNING_GRAPH_CHANGE_H 37 #include <agrum/agrum.h> 38 #include <agrum/tools/core/hashFunc.h> 39 #include <agrum/tools/graphs/parts/nodeGraphPart.h> 73 GraphChange(GraphChangeType type, NodeId node1, NodeId node2)
noexcept;
76 GraphChange(
const GraphChange& from)
noexcept;
79 GraphChange(GraphChange&& from)
noexcept;
82 ~GraphChange()
noexcept;
92 GraphChange& operator=(
const GraphChange& from)
noexcept;
95 GraphChange& operator=(GraphChange&& from)
noexcept;
98 bool operator==(
const GraphChange& from)
const noexcept;
101 bool operator!=(
const GraphChange& from)
const noexcept;
111 GraphChangeType type()
const noexcept;
114 NodeId node1()
const noexcept;
117 NodeId node2()
const noexcept;
120 virtual std::string toString()
const;
126 GraphChangeType _type_;
150 class ArcAddition:
public GraphChange {
158 ArcAddition(NodeId node1, NodeId node2)
noexcept;
161 ArcAddition(
const ArcAddition& from)
noexcept;
164 ArcAddition(ArcAddition&& from)
noexcept;
167 ~ArcAddition()
noexcept;
177 ArcAddition& operator=(
const ArcAddition& from)
noexcept;
180 ArcAddition& operator=(ArcAddition&& from)
noexcept;
183 bool operator==(
const ArcAddition& from)
const noexcept;
186 bool operator!=(
const ArcAddition& from)
const noexcept;
196 virtual std::string toString()
const final;
216 class ArcDeletion:
public GraphChange {
224 ArcDeletion(NodeId node1, NodeId node2)
noexcept;
227 ArcDeletion(
const ArcDeletion& from)
noexcept;
230 ArcDeletion(ArcDeletion&& from)
noexcept;
233 ~ArcDeletion()
noexcept;
243 ArcDeletion& operator=(
const ArcDeletion& from)
noexcept;
246 ArcDeletion& operator=(ArcDeletion&& from)
noexcept;
249 bool operator==(
const ArcDeletion& from)
const noexcept;
252 bool operator!=(
const ArcDeletion& from)
const noexcept;
262 virtual std::string toString()
const final;
282 class ArcReversal:
public GraphChange {
290 ArcReversal(NodeId node1, NodeId node2)
noexcept;
293 ArcReversal(
const ArcReversal& from)
noexcept;
296 ArcReversal(ArcReversal&& from)
noexcept;
299 ~ArcReversal()
noexcept;
309 ArcReversal& operator=(
const ArcReversal& from)
noexcept;
312 ArcReversal& operator=(ArcReversal&& from)
noexcept;
315 bool operator==(
const ArcReversal& from)
const noexcept;
318 bool operator!=(
const ArcReversal& from)
const noexcept;
328 virtual std::string toString()
const final;
348 class EdgeAddition:
public GraphChange {
356 EdgeAddition(NodeId node1, NodeId node2)
noexcept;
359 EdgeAddition(
const EdgeAddition& from)
noexcept;
362 EdgeAddition(EdgeAddition&& from)
noexcept;
365 ~EdgeAddition()
noexcept;
375 EdgeAddition& operator=(
const EdgeAddition& from)
noexcept;
378 EdgeAddition& operator=(EdgeAddition&& from)
noexcept;
381 bool operator==(
const EdgeAddition& from)
const noexcept;
384 bool operator!=(
const EdgeAddition& from)
const noexcept;
394 virtual std::string toString()
const final;
414 class EdgeDeletion:
public GraphChange {
422 EdgeDeletion(NodeId node1, NodeId node2)
noexcept;
425 EdgeDeletion(
const EdgeDeletion& from)
noexcept;
428 EdgeDeletion(EdgeDeletion&& from)
noexcept;
431 ~EdgeDeletion()
noexcept;
441 EdgeDeletion& operator=(
const EdgeDeletion& from)
noexcept;
444 EdgeDeletion& operator=(EdgeDeletion&& from)
noexcept;
447 bool operator==(
const EdgeDeletion& from)
const noexcept;
450 bool operator!=(
const EdgeDeletion& from)
const noexcept;
460 virtual std::string toString()
const final;
466 std::ostream& operator<<(std::ostream& stream,
const GraphChange& change);
469 std::ostream& operator<<(std::ostream& stream,
const ArcAddition& change);
472 std::ostream& operator<<(std::ostream& stream,
const ArcDeletion& change);
475 std::ostream& operator<<(std::ostream& stream,
const ArcReversal& change);
478 std::ostream& operator<<(std::ostream& stream,
const EdgeAddition& change);
481 std::ostream& operator<<(std::ostream& stream,
const EdgeDeletion& change);
487 class HashFunc< learning::GraphChange >:
public HashFuncBase< learning::GraphChange > {
494 static Size castToSize(
const learning::GraphChange& key);
497 virtual Size operator()(
const learning::GraphChange& key)
const override final;
502 class HashFunc< learning::ArcAddition >:
public HashFuncBase< learning::ArcAddition > {
509 static Size castToSize(
const learning::ArcAddition& key);
512 virtual Size operator()(
const learning::ArcAddition& key)
const override final;
517 class HashFunc< learning::ArcDeletion >:
public HashFuncBase< learning::ArcDeletion > {
524 static Size castToSize(
const learning::ArcDeletion& key);
527 virtual Size operator()(
const learning::ArcDeletion& key)
const override final;
532 class HashFunc< learning::ArcReversal >:
public HashFuncBase< learning::ArcReversal > {
539 static Size castToSize(
const learning::ArcReversal& key);
542 virtual Size operator()(
const learning::ArcReversal& key)
const override final;
547 class HashFunc< learning::EdgeAddition >:
public HashFuncBase< learning::EdgeAddition > {
553 static Size castToSize(
const learning::EdgeAddition& key);
556 virtual Size operator()(
const learning::EdgeAddition& key)
const override final;
561 class HashFunc< learning::EdgeDeletion >:
public HashFuncBase< learning::EdgeDeletion > {
568 static Size castToSize(
const learning::EdgeDeletion& key);
571 virtual Size operator()(
const learning::EdgeDeletion& key)
const override final;
576 #ifndef GUM_NO_INLINE 577 # include <agrum/BN/learning/structureUtils/graphChange_inl.h>