aGrUM  0.13.2
gum::learning::GraphChange Class Reference

#include <graphChange.h>

+ Inheritance diagram for gum::learning::GraphChange:

Public Member Functions

Constructors / Destructors
 GraphChange (GraphChangeType type, NodeId node1, NodeId node2) noexcept
 default constructor More...
 
 GraphChange (const GraphChange &from) noexcept
 copy constructor More...
 
 GraphChange (GraphChange &&from) noexcept
 move constructor More...
 
 ~GraphChange () noexcept
 destructor More...
 
Operators
GraphChangeoperator= (const GraphChange &from) noexcept
 copy constructor More...
 
GraphChangeoperator= (GraphChange &&from) noexcept
 move operator More...
 
bool operator== (const GraphChange &from) const noexcept
 returns whether two graph changes are identical or not More...
 
bool operator!= (const GraphChange &from) const noexcept
 returns whether two graph changes are different or not More...
 
Accessors/Modifiers
GraphChangeType type () const noexcept
 returns the type of the operation More...
 
NodeId node1 () const noexcept
 returns the first node involved in the modification More...
 
NodeId node2 () const noexcept
 returns the second node involved in the modification More...
 
virtual std::string toString () const
 put the content of the graph change into a string More...
 

Detailed Description

Definition at line 62 of file graphChange.h.

Constructor & Destructor Documentation

gum::learning::GraphChange::GraphChange ( GraphChangeType  type,
NodeId  node1,
NodeId  node2 
)
noexcept

default constructor

gum::learning::GraphChange::GraphChange ( const GraphChange from)
noexcept

copy constructor

gum::learning::GraphChange::GraphChange ( GraphChange &&  from)
noexcept

move constructor

gum::learning::GraphChange::~GraphChange ( )
noexcept

destructor

Member Function Documentation

bool gum::learning::GraphChange::operator!= ( const GraphChange from) const
noexcept

returns whether two graph changes are different or not

GraphChange& gum::learning::GraphChange::operator= ( const GraphChange from)
noexcept

copy constructor

GraphChange& gum::learning::GraphChange::operator= ( GraphChange &&  from)
noexcept

move operator

bool gum::learning::GraphChange::operator== ( const GraphChange from) const
noexcept

returns whether two graph changes are identical or not

std::string gum::learning::GraphChange::toString ( ) const
virtual

put the content of the graph change into a string

put the content of the GraphChange into a string

Reimplemented in gum::learning::EdgeDeletion, gum::learning::EdgeAddition, gum::learning::ArcReversal, gum::learning::ArcDeletion, and gum::learning::ArcAddition.

Definition at line 40 of file graphChange.cpp.

References gum::learning::ARC_ADDITION, gum::learning::ARC_DELETION, gum::learning::ARC_REVERSAL, gum::learning::EDGE_ADDITION, gum::learning::EDGE_DELETION, GUM_ERROR, node1(), node2(), and type().

Referenced by gum::learning::operator<<().

40  {
41  std::stringstream stream;
42  switch (type()) {
44  stream << "ArcAddition ( " << node1() << " , " << node2() << " )";
45  return stream.str();
46 
48  stream << "ArcDeletion ( " << node1() << " , " << node2() << " )";
49  return stream.str();
50 
52  stream << "ArcReversal ( " << node1() << " , " << node2() << " )";
53  return stream.str();
54 
56  stream << "EdgeAddition ( " << node1() << " , " << node2() << " )";
57  return stream.str();
58 
60  stream << "EdgeDeletion ( " << node1() << " , " << node2() << " )";
61  return stream.str();
62 
63  default:
64  GUM_ERROR(OperationNotAllowed,
65  "this graph modification is not supported yet");
66  }
67  }
GraphChangeType type() const noexcept
returns the type of the operation
NodeId node2() const noexcept
returns the second node involved in the modification
#define GUM_ERROR(type, msg)
Definition: exceptions.h:66
NodeId node1() const noexcept
returns the first node involved in the modification

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GraphChangeType gum::learning::GraphChange::type ( ) const
noexcept

returns the type of the operation

Referenced by gum::learning::GreedyHillClimbing::learnStructure(), gum::learning::LocalSearchWithTabuList::learnStructure(), and toString().

+ Here is the caller graph for this function:

Member Data Documentation

NodeId gum::learning::GraphChange::__node1
private

the first node in the edge or arc to be modified

Definition at line 126 of file graphChange.h.

NodeId gum::learning::GraphChange::__node2
private

the second node in the edge or arc to be modified

Definition at line 129 of file graphChange.h.

GraphChangeType gum::learning::GraphChange::__type
private

the type of modification

Definition at line 123 of file graphChange.h.


The documentation for this class was generated from the following files: