aGrUM  0.13.2
gum::learning::ArcReversal Class Reference

The class for notifying learning algorithms of arc reversalsThis class is convenient to know at compile time which graph change we are dealing with. More...

#include <graphChange.h>

+ Inheritance diagram for gum::learning::ArcReversal:
+ Collaboration diagram for gum::learning::ArcReversal:

Public Member Functions

Constructors / Destructors
 ArcReversal (NodeId node1, NodeId node2) noexcept
 default constructor More...
 
 ArcReversal (const ArcReversal &from) noexcept
 copy constructor More...
 
 ArcReversal (ArcReversal &&from) noexcept
 move constructor More...
 
 ~ArcReversal () noexcept
 destructor More...
 
Operators
ArcReversaloperator= (const ArcReversal &from) noexcept
 copy constructor More...
 
ArcReversaloperator= (ArcReversal &&from) noexcept
 move operator More...
 
bool operator== (const ArcReversal &from) const noexcept
 returns whether two arc reversals are identical or not More...
 
bool operator!= (const ArcReversal &from) const noexcept
 returns whether two arc reversals are different or not More...
 
Accessors / Modifiers
virtual std::string toString () const final
 put the content of the ArcReversal into a string More...
 
Operators
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...
 

Detailed Description

The class for notifying learning algorithms of arc reversals

This class is convenient to know at compile time which graph change we are dealing with.

Thus, this enables to perform faster code (we can avoid using a switch on GraphChanges to determine which change corresponds to this class.

Definition at line 279 of file graphChange.h.

Constructor & Destructor Documentation

gum::learning::ArcReversal::ArcReversal ( NodeId  node1,
NodeId  node2 
)
noexcept

default constructor

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

copy constructor

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

move constructor

gum::learning::ArcReversal::~ArcReversal ( )
noexcept

destructor

Member Function Documentation

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

returns whether two graph changes are different or not

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

returns whether two arc reversals are different or not

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

copy constructor

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

move operator

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

returns whether two graph changes are identical or not

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

returns whether two arc reversals are identical or not

std::string gum::learning::ArcReversal::toString ( ) const
finalvirtual

put the content of the ArcReversal into a string

Reimplemented from gum::learning::GraphChange.

Definition at line 84 of file graphChange.cpp.

References gum::learning::GraphChange::node1(), and gum::learning::GraphChange::node2().

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

84  {
85  std::stringstream stream;
86  stream << "ArcReversal ( " << node1() << " , " << node2() << " )";
87  return stream.str();
88  }
NodeId node2() const noexcept
returns the second node involved in the modification
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
noexceptinherited

returns the type of the operation

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

+ Here is the caller graph for this function:


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