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

The class for notifying learning algorithms of new edge additions. More...

#include <graphChange.h>

Inheritance diagram for gum::learning::EdgeAddition:
Collaboration diagram for gum::learning::EdgeAddition:

Public Member Functions

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

Constructor & Destructor Documentation

◆ EdgeAddition() [1/3]

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

default constructor

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

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

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

◆ EdgeAddition() [2/3]

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

copy constructor

References EdgeAddition().

Here is the call graph for this function:

◆ EdgeAddition() [3/3]

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

move constructor

References EdgeAddition().

Here is the call graph for this function:

◆ ~EdgeAddition()

gum::learning::EdgeAddition::~EdgeAddition ( )
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::EdgeAddition::operator!= ( const EdgeAddition & from) const
noexcept

returns whether two edge additions are different or not

References EdgeAddition(), 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]

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

copy constructor

References EdgeAddition().

Here is the call graph for this function:

◆ operator=() [2/2]

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

move operator

References EdgeAddition().

Here is the call graph for this function:

◆ operator==() [1/2]

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

returns whether two edge additions are identical or not

References EdgeAddition().

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::EdgeAddition::toString ( ) const
finalvirtual

put the content of the EdgeAddition into a string

Reimplemented from gum::learning::GraphChange.

Definition at line 111 of file graphChange.cpp.

111 {
112 std::stringstream stream;
113 stream << "EdgeAddition ( " << node1() << " , " << node2() << " )";
114 return stream.str();
115 }
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: