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

The class for notifying learning algorithms of new arc additions. 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
 ArcAddition (const ArcAddition &from) noexcept
 copy constructor
 ArcAddition (ArcAddition &&from) noexcept
 move constructor
 ~ArcAddition () noexcept
 destructor
Operators
ArcAdditionoperator= (const ArcAddition &from) noexcept
 copy constructor
ArcAdditionoperator= (ArcAddition &&from) noexcept
 move operator
bool operator== (const ArcAddition &from) const noexcept
 returns whether two arc additions are identical or not
bool operator!= (const ArcAddition &from) const noexcept
 returns whether two arc additions are different or not
Accessors / Modifiers
virtual std::string toString () const final
 put the content of the ArcAddition into a string
Operators
bool operator== (const GraphChange &from) const noexcept
 returns whether two graph changes are identical or not
bool operator!= (const GraphChange &from) const noexcept
 returns whether two graph changes are different or not
Accessors/Modifiers
GraphChangeType type () const noexcept
 returns the type of the operation
NodeId node1 () const noexcept
 returns the first node involved in the modification
NodeId node2 () const noexcept
 returns the second node involved in the modification

Private Attributes

GraphChangeType _type_
 the type of modification
NodeId _node1_
 the first node in the edge or arc to be modified
NodeId _node2_
 the second node in the edge or arc to be modified

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

Constructor & Destructor Documentation

◆ ArcAddition() [1/3]

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

default constructor

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

Referenced by ArcAddition(), ArcAddition(), operator!=(), operator=(), operator=(), and operator==().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ArcAddition() [2/3]

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

copy constructor

References ArcAddition().

Here is the call graph for this function:

◆ ArcAddition() [3/3]

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

move constructor

References ArcAddition().

Here is the call graph for this function:

◆ ~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

References node1().

Referenced by gum::learning::ArcAddition::ArcAddition(), gum::learning::ArcDeletion::ArcDeletion(), gum::learning::ArcReversal::ArcReversal(), gum::learning::EdgeAddition::EdgeAddition(), gum::learning::EdgeDeletion::EdgeDeletion(), GraphChange(), gum::learning::GreedyHillClimbing::learnStructure(), gum::learning::LocalSearchWithTabuList::learnStructure(), node1(), gum::learning::ArcAddition::toString(), gum::learning::ArcDeletion::toString(), gum::learning::ArcReversal::toString(), gum::learning::EdgeAddition::toString(), gum::learning::EdgeDeletion::toString(), and toString().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ node2()

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

returns the second node involved in the modification

References node2(), and toString().

Referenced by gum::learning::ArcAddition::ArcAddition(), gum::learning::ArcDeletion::ArcDeletion(), gum::learning::ArcReversal::ArcReversal(), gum::learning::EdgeAddition::EdgeAddition(), gum::learning::EdgeDeletion::EdgeDeletion(), GraphChange(), gum::learning::GreedyHillClimbing::learnStructure(), gum::learning::LocalSearchWithTabuList::learnStructure(), node2(), gum::learning::ArcAddition::toString(), gum::learning::ArcDeletion::toString(), gum::learning::ArcReversal::toString(), gum::learning::EdgeAddition::toString(), gum::learning::EdgeDeletion::toString(), and toString().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator!=() [1/2]

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

returns whether two arc additions are different or not

References ArcAddition(), and toString().

Here is the call graph for this function:

◆ operator!=() [2/2]

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

returns whether two graph changes are different or not

References GraphChange().

Here is the call graph for this function:

◆ operator=() [1/2]

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

move operator

References ArcAddition().

Here is the call graph for this function:

◆ operator=() [2/2]

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

copy constructor

References ArcAddition().

Here is the call graph for this function:

◆ operator==() [1/2]

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

returns whether two arc additions are identical or not

References ArcAddition().

Here is the call graph for this function:

◆ operator==() [2/2]

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

returns whether two graph changes are identical or not

References GraphChange().

Here is the call graph for this function:

◆ 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 90 of file graphChange.cpp.

90 {
91 std::stringstream stream;
92 stream << "ArcAddition ( " << node1() << " , " << node2() << " )";
93 return stream.str();
94 }
NodeId node1() const noexcept
returns the first node involved in the modification
NodeId node2() const noexcept
returns the second node involved in the modification

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

Referenced by operator!=(), and gum::learning::operator<<().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ type()

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

returns the type of the operation

References type().

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

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _node1_

NodeId gum::learning::GraphChange::_node1_
privateinherited

the first node in the edge or arc to be modified

Definition at line 142 of file graphChange.h.

◆ _node2_

NodeId gum::learning::GraphChange::_node2_
privateinherited

the second node in the edge or arc to be modified

Definition at line 145 of file graphChange.h.

◆ _type_

GraphChangeType gum::learning::GraphChange::_type_
privateinherited

the type of modification

Definition at line 139 of file graphChange.h.


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