![]() |
aGrUM
0.20.3
a C++ library for (probabilistic) graphical models
|
Structure used to represent a node internal structure. More...
#include <agrum/tools/multidim/FunctionGraphUtilities/internalNode.h>
Public Member Functions | |
Constructors and Destructors | |
InternalNode () | |
Default Constructor Creates an empty node with no variable attached. More... | |
InternalNode (const DiscreteVariable *v) | |
Class constructor. More... | |
InternalNode (const DiscreteVariable *v, NodeId *sons) | |
Constructor. More... | |
~InternalNode () | |
Class destructors. More... | |
Allocators and Deallocators redefinition | |
void * | operator new (size_t s) |
New operator. More... | |
void | operator delete (void *p) |
Delete operator. More... | |
Node handlers | |
void | setNode (const DiscreteVariable *v, NodeId *sons) |
Allows you to respecify the node, changing its attached variable as well as its son map. More... | |
Var handlers | |
void | setNodeVar (const DiscreteVariable *v) |
Set the node variable. More... | |
const DiscreteVariable * | nodeVar () const |
Returns the node variable. More... | |
Sons handlers | |
void | setSon (Idx modality, NodeId son) |
Sets the node's son. More... | |
NodeId | son (Idx modality) const |
Returns the son at a given index. More... | |
Idx | nbSons () const |
Returns the number of sons. More... | |
Parent handlers | |
void | addParent (NodeId parent, Idx modality) |
Adds a parent. More... | |
void | removeParent (NodeId parent, Idx modality) |
Removes a parent. More... | |
Link< Parent > * | parents () |
Returns the list of parents. More... | |
const Link< Parent > * | parents () const |
Returns the list of parents. More... | |
Static Public Member Functions | |
Allocator/deallocator | |
static NodeId * | allocateNodeSons (const DiscreteVariable *v) |
Allocates a table of nodeid of the size given in parameter. More... | |
static void | deallocateNodeSons (const DiscreteVariable *v, NodeId *s) |
Deallocates a NodeSons table. More... | |
Structure used to represent a node internal structure.
Definition at line 102 of file internalNode.h.
gum::InternalNode::InternalNode | ( | ) |
Default Constructor Creates an empty node with no variable attached.
Definition at line 41 of file internalNode.cpp.
References gum::Set< Key, Alloc >::emplace().
|
explicit |
Class constructor.
Creates a node and attached the specified variable. Initializes the sons.
Definition at line 46 of file internalNode.cpp.
References gum::Set< Key, Alloc >::emplace().
gum::InternalNode::InternalNode | ( | const DiscreteVariable * | v, |
NodeId * | sons | ||
) |
Constructor.
Creates a node and attached the specified variable. Also attached the given on map (and will handle it by itself especially deallocate it)
Definition at line 51 of file internalNode.cpp.
References gum::Set< Key, Alloc >::emplace().
gum::InternalNode::~InternalNode | ( | ) |
Class destructors.
Definition at line 60 of file internalNode.cpp.
References gum::Set< Key, Alloc >::emplace().
|
private |
Set the node variable.
Definition at line 99 of file internalNode.cpp.
References gum::Set< Key, Alloc >::emplace().
Adds a parent.
Definition at line 107 of file internalNode.cpp.
References gum::Set< Key, Alloc >::emplace().
|
static |
Allocates a table of nodeid of the size given in parameter.
Definition at line 68 of file internalNode.cpp.
References gum::Set< Key, Alloc >::emplace().
|
static |
Deallocates a NodeSons table.
Definition at line 78 of file internalNode.cpp.
References gum::Set< Key, Alloc >::emplace().
INLINE Idx gum::InternalNode::nbSons | ( | ) | const |
Returns the number of sons.
Definition at line 86 of file internalNode_inl.h.
References gum::Set< Key, Alloc >::emplace().
INLINE const DiscreteVariable * gum::InternalNode::nodeVar | ( | ) | const |
Returns the node variable.
Definition at line 77 of file internalNode_inl.h.
References gum::Set< Key, Alloc >::emplace().
INLINE void gum::InternalNode::operator delete | ( | void * | p | ) |
Delete operator.
Definition at line 72 of file internalNode_inl.h.
References gum::Set< Key, Alloc >::emplace().
INLINE void * gum::InternalNode::operator new | ( | size_t | s | ) |
New operator.
Definition at line 67 of file internalNode_inl.h.
References gum::Set< Key, Alloc >::emplace().
Returns the list of parents.
Definition at line 89 of file internalNode_inl.h.
References gum::Set< Key, Alloc >::emplace().
Returns the list of parents.
Definition at line 92 of file internalNode_inl.h.
References gum::Set< Key, Alloc >::emplace().
Removes a parent.
Definition at line 111 of file internalNode.cpp.
References gum::Set< Key, Alloc >::emplace().
void gum::InternalNode::setNode | ( | const DiscreteVariable * | v, |
NodeId * | sons | ||
) |
Allows you to respecify the node, changing its attached variable as well as its son map.
Definition at line 85 of file internalNode.cpp.
References gum::Set< Key, Alloc >::emplace().
void gum::InternalNode::setNodeVar | ( | const DiscreteVariable * | v | ) |
Set the node variable.
Definition at line 94 of file internalNode.cpp.
References gum::Set< Key, Alloc >::emplace().
Sets the node's son.
Definition at line 80 of file internalNode_inl.h.
References gum::Set< Key, Alloc >::emplace().
Returns the son at a given index.
Definition at line 83 of file internalNode_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
private |
The list of the node's parent.
Definition at line 125 of file internalNode.h.
|
private |
Table of sons of the node.
Each son is bound to a modality of the variable. So those modalities are used has indexes for that table.
Definition at line 122 of file internalNode.h.
|
private |
Variable associated to such node.
Definition at line 105 of file internalNode.h.