aGrUM  0.20.3
a C++ library for (probabilistic) graphical models
gum::learning::ArcAddition Class Reference

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

#include <graphChange.h>

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

Public Member Functions

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

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 150 of file graphChange.h.

Constructor & Destructor Documentation

◆ ArcAddition() [1/3]

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

default constructor

◆ ArcAddition() [2/3]

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

copy constructor

◆ ArcAddition() [3/3]

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

move constructor

◆ ~ArcAddition()

gum::learning::ArcAddition::~ArcAddition ( )
noexcept

destructor

Member Function Documentation

◆ node1()

NodeId gum::learning::GraphChange::node1 ( ) const
noexceptinherited

returns the first node involved in the modification

◆ node2()

NodeId gum::learning::GraphChange::node2 ( ) const
noexceptinherited

returns the second node involved in the modification

◆ operator!=() [1/2]

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

returns whether two graph changes are different or not

◆ operator!=() [2/2]

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

returns whether two arc additions are different or not

◆ operator=() [1/2]

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

copy constructor

◆ operator=() [2/2]

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

move operator

◆ operator==() [1/2]

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

returns whether two graph changes are identical or not

◆ operator==() [2/2]

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

returns whether two arc additions are identical or not

◆ toString()

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

put the content of the ArcAddition into a string

Reimplemented from gum::learning::GraphChange.

Definition at line 71 of file graphChange.cpp.

References gum::learning::genericBNLearner::Database::Database().

71  {
72  std::stringstream stream;
73  stream << "ArcAddition ( " << node1() << " , " << node2() << " )";
74  return stream.str();
75  }
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:

◆ type()

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

returns the type of the operation


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