53#ifndef DOXYGEN_SHOULD_SKIP_THIS
63 NodeId node3) noexcept : type_{type} {
77 std::memcpy(nodes_, from.nodes_, 4 *
sizeof(
LearnNodeId));
88 std::memcpy(nodes_, from.nodes_, 4 *
sizeof(
LearnNodeId));
103 std::memcpy(nodes_, from.nodes_, 4 *
sizeof(
LearnNodeId));
116 std::memcpy(nodes_, from.nodes_, 4 *
sizeof(
LearnNodeId));
134 GUM_ERROR(InvalidNode,
"GraphChange " << (
int)(
type_) <<
" does not involve a third node")
146 return std::memcmp(nodes_, from.nodes_, 4 *
sizeof(
LearnNodeId)) == 0;
193 return std::memcmp(nodes_, from.nodes_, 2 *
sizeof(
LearnNodeId)) == 0;
240 return std::memcmp(nodes_, from.nodes_, 2 *
sizeof(
LearnNodeId)) == 0;
287 return std::memcmp(nodes_, from.nodes_, 2 *
sizeof(
LearnNodeId)) == 0;
339 return std::memcmp(nodes_, from.nodes_, 3 *
sizeof(
LearnNodeId)) == 0;
394 return std::memcmp(nodes_, from.nodes_, 3 *
sizeof(
LearnNodeId)) == 0;
410 std::min(node1, node2),
411 std::max(node1, node2)) {
446 return std::memcmp(nodes_, from.nodes_, 2 *
sizeof(
LearnNodeId)) == 0;
459 std::min(node1, node2),
460 std::max(node1, node2)) {
495 return std::memcmp(nodes_, from.nodes_, 2 *
sizeof(
LearnNodeId)) == 0;
521 const Size*
const nodes = (
const Size*)key.nodes_;
529 return castToSize(key) >> this->right_shift_;
538 const Size*
const nodes = (
Size*)key.nodes_;
546 return castToSize(key) >> this->right_shift_;
555 const Size*
const nodes = (
Size*)key.nodes_;
563 return castToSize(key) >> this->right_shift_;
572 const Size*
const nodes = (
Size*)key.nodes_;
580 return castToSize(key) >> this->right_shift_;
592 const Size*
const nodes = (
const Size*)key.nodes_;
600 return castToSize(key) >> this->right_shift_;
612 const Size*
const nodes = (
const Size*)key.nodes_;
620 return castToSize(key) >> this->right_shift_;
629 const Size*
const nodes = (
Size*)key.nodes_;
637 return castToSize(key) >> this->right_shift_;
646 const Size*
const nodes = (
Size*)key.nodes_;
654 return castToSize(key) >> this->right_shift_;
static Size castToSize(const learning::ArcAddition &key)
Returns the value of a key as a Size.
Size operator()(const learning::ArcAddition &key) const final
computes the hashed value of a key
Size operator()(const learning::ArcDeletion &key) const final
computes the hashed value of a key
static Size castToSize(const learning::ArcDeletion &key)
Returns the value of a key as a Size.
Size operator()(const learning::ArcReversal &key) const final
computes the hashed value of a key
static Size castToSize(const learning::ArcReversal &key)
Returns the value of a key as a Size.
static Size castToSize(const learning::ArcTriangleDeletion1 &key)
Returns the value of a key as a Size.
Size operator()(const learning::ArcTriangleDeletion1 &key) const final
computes the hashed value of a key
static Size castToSize(const learning::ArcTriangleDeletion2 &key)
Returns the value of a key as a Size.
Size operator()(const learning::ArcTriangleDeletion2 &key) const final
computes the hashed value of a key
Size operator()(const learning::EdgeAddition &key) const final
computes the hashed value of a key
static Size castToSize(const learning::EdgeAddition &key)
Returns the value of a key as a Size.
static Size castToSize(const learning::EdgeDeletion &key)
Returns the value of a key as a Size.
Size operator()(const learning::EdgeDeletion &key) const final
computes the hashed value of a key
static Size castToSize(const learning::GraphChange &key)
Returns the value of a key as a Size.
Size operator()(const learning::GraphChange &key) const final
computes the hashed value of a key
The class for notifying learning algorithms of new arc additions.
bool operator!=(const ArcAddition &from) const noexcept
returns whether two arc additions are different or not
ArcAddition & operator=(const ArcAddition &from) noexcept
copy constructor
ArcAddition(NodeId node1, NodeId node2) noexcept
default constructor
bool operator==(const ArcAddition &from) const noexcept
returns whether two arc additions are identical or not
~ArcAddition() noexcept
destructor
The class for notifying learning algorithms of arc removals.
bool operator!=(const ArcDeletion &from) const noexcept
returns whether two arc deletions are different or not
bool operator==(const ArcDeletion &from) const noexcept
returns whether two arc deletions are identical or not
ArcDeletion(NodeId node1, NodeId node2) noexcept
default constructor
ArcDeletion & operator=(const ArcDeletion &from) noexcept
copy constructor
~ArcDeletion() noexcept
destructor
The class for notifying learning algorithms of arc reversals.
ArcReversal & operator=(const ArcReversal &from) noexcept
copy constructor
bool operator!=(const ArcReversal &from) const noexcept
returns whether two arc reversals are different or not
ArcReversal(NodeId node1, NodeId node2) noexcept
default constructor
~ArcReversal() noexcept
destructor
bool operator==(const ArcReversal &from) const noexcept
returns whether two arc reversals are identical or not
The graph change substituting a triangle node1->node2->node3 + node1->node3 into v-structure node2->n...
ArcTriangleDeletion1(NodeId node1, NodeId node2, NodeId node3) noexcept
default constructor
ArcTriangleDeletion1 & operator=(const ArcTriangleDeletion1 &from) noexcept
copy constructor
NodeId node3() const
returns the third node involved in the modification (if any)
bool operator!=(const ArcTriangleDeletion1 &from) const noexcept
returns whether two ArcTriangleDeletion1 are different or not
bool operator==(const ArcTriangleDeletion1 &from) const noexcept
returns whether two ArcTriangleDeletion1 are identical or not
~ArcTriangleDeletion1() noexcept
destructor
The graph change substituting a triangle node1->node2->node3 + node1->node3 into v-structure node1->n...
bool operator==(const ArcTriangleDeletion2 &from) const noexcept
returns whether two ArcTriangleDeletion2 are identical or not
bool operator!=(const ArcTriangleDeletion2 &from) const noexcept
returns whether two ArcTriangleDeletion2 are different or not
ArcTriangleDeletion2 & operator=(const ArcTriangleDeletion2 &from) noexcept
copy constructor
~ArcTriangleDeletion2() noexcept
destructor
NodeId node3() const
returns the third node involved in the modification (if any)
ArcTriangleDeletion2(NodeId node1, NodeId node2, NodeId node3) noexcept
default constructor
The class for notifying learning algorithms of new edge additions.
bool operator!=(const EdgeAddition &from) const noexcept
returns whether two edge additions are different or not
bool operator==(const EdgeAddition &from) const noexcept
returns whether two edge additions are identical or not
EdgeAddition & operator=(const EdgeAddition &from) noexcept
copy constructor
EdgeAddition(NodeId node1, NodeId node2) noexcept
default constructor
~EdgeAddition() noexcept
destructor
The class for notifying learning algorithms of edge removals.
EdgeDeletion & operator=(const EdgeDeletion &from) noexcept
copy constructor
EdgeDeletion(NodeId node1, NodeId node2) noexcept
default constructor
~EdgeDeletion() noexcept
destructor
bool operator!=(const EdgeDeletion &from) const noexcept
returns whether two edge deletions are different or not
bool operator==(const EdgeDeletion &from) const noexcept
returns whether two edge deletions are identical or not
GraphChange(GraphChangeType type, NodeId node1, NodeId node2, NodeId node3=0) noexcept
default constructor
bool operator==(const GraphChange &from) const noexcept
returns whether two graph changes are identical or not
GraphChangeType type_
the type of modification
NodeId node1() const noexcept
returns the first node involved in the modification
GraphChangeType type() const noexcept
returns the type of the operation
GraphChange & operator=(const GraphChange &from) noexcept
copy constructor
LearnNodeId nodes_[3]
the nodes involved in the edge or arc to be modified
NodeId node2() const noexcept
returns the second node involved in the modification
NodeId node3() const
returns the third node involved in the modification (if any)
~GraphChange() noexcept
destructor
bool operator!=(const GraphChange &from) const noexcept
returns whether two graph changes are different or not
#define GUM_ERROR(type, msg)
the classes to account for structure changes in a graph
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Size NodeId
Type for node ids.
include the inlined functions if necessary
GraphChangeType
the type of modification that can be applied to the graph
uint32_t LearnNodeId
the internal type of the nodes involved in the arc/edge modifications
gum is the global namespace for all aGrUM entities
bool operator==(const HashTableIteratorSafe< Key, Val > &from) const noexcept
Checks whether two iterators are pointing toward equal elements.
static constexpr Size sqrt3
static constexpr Size gold