![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
Structure used to represent a node internal structure. More...
#include <agrum/base/multidim/FunctionGraphUtilities/internalNode.h>
Public Member Functions | |
Constructors and Destructors | |
| InternalNode () | |
| Default Constructor Creates an empty node with no variable attached. | |
| InternalNode (const DiscreteVariable *v) | |
| Class constructor. | |
| InternalNode (const DiscreteVariable *v, NodeId *sons) | |
| Constructor. | |
| ~InternalNode () | |
| Class destructors. | |
Allocators and Deallocators redefinition | |
| void * | operator new (size_t s) |
| New operator. | |
| void | operator delete (void *p) |
| Delete operator. | |
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. | |
Var handlers | |
| void | setNodeVar (const DiscreteVariable *v) |
| Set the node variable. | |
| const DiscreteVariable * | nodeVar () const |
| Returns the node variable. | |
Sons handlers | |
| void | setSon (Idx modality, NodeId son) |
| Sets the node's son. | |
| NodeId | son (Idx modality) const |
| Returns the son at a given index. | |
| Idx | nbSons () const |
| Returns the number of sons. | |
Parent handlers | |
| void | addParent (NodeId parent, Idx modality) |
| Adds a parent. | |
| void | removeParent (NodeId parent, Idx modality) |
| Removes a parent. | |
| Link< Parent > * | parents () |
| Returns the list of parents. | |
| const Link< Parent > * | parents () const |
| Returns the list of parents. | |
Static Public Member Functions | |
Allocator/deallocator | |
| static NodeId * | allocateNodeSons (const DiscreteVariable *v) |
| Allocates a table of nodeid of the size given in parameter. | |
| static void | deallocateNodeSons (const DiscreteVariable *v, NodeId *s) |
| Deallocates a NodeSons table. | |
Private Member Functions | |
| void | _setNodeVar_ (const DiscreteVariable *v) |
| Set the node variable. | |
Private Attributes | |
| const DiscreteVariable * | _nodeVar_ |
| Variable associated to such node. | |
| NodeId * | _nodeSons_ |
| Table of sons of the node. | |
| LinkedList< Parent > | _nodeParents_ |
| The list of the node's parent. | |
Structure used to represent a node internal structure.
Definition at line 124 of file internalNode.h.
| gum::InternalNode::InternalNode | ( | ) |
Default Constructor Creates an empty node with no variable attached.
Definition at line 61 of file internalNode.cpp.
References InternalNode(), and _nodeVar_.
Referenced by InternalNode(), InternalNode(), InternalNode(), ~InternalNode(), and operator delete().
|
explicit |
Class constructor.
Creates a node and attached the specified variable. Initializes the sons.
Definition at line 66 of file internalNode.cpp.
References InternalNode(), and _setNodeVar_().
| 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 71 of file internalNode.cpp.
References InternalNode(), _nodeSons_, and _nodeVar_.
| gum::InternalNode::~InternalNode | ( | ) |
Class destructors.
Definition at line 80 of file internalNode.cpp.
References InternalNode(), _nodeSons_, _nodeVar_, and deallocateNodeSons().
|
private |
Set the node variable.
Definition at line 119 of file internalNode.cpp.
References _nodeSons_, _nodeVar_, and allocateNodeSons().
Referenced by InternalNode(), and setNodeVar().
Adds a parent.
Definition at line 127 of file internalNode.cpp.
References _nodeParents_.
|
static |
Allocates a table of nodeid of the size given in parameter.
Definition at line 88 of file internalNode.cpp.
References ALLOCATE, and gum::DiscreteVariable::domainSize().
Referenced by _setNodeVar_(), and gum::MultiDimFunctionGraphManager< double, ExactTerminalNodePolicy >::clean().
|
static |
Deallocates a NodeSons table.
Definition at line 98 of file internalNode.cpp.
References DEALLOCATE, and gum::DiscreteVariable::domainSize().
Referenced by ~InternalNode(), setNode(), and setNodeVar().
| INLINE Idx gum::InternalNode::nbSons | ( | ) | const |
Returns the number of sons.
Definition at line 106 of file internalNode_inl.h.
References _nodeVar_.
Referenced by gum::MultiDimFunctionGraphManager< GUM_SCALAR, TerminalNodePolicy >::addInternalNode_(), gum::MultiDimFunctionGraphManager< GUM_SCALAR, TerminalNodePolicy >::migrateNode_(), and gum::MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy >::toDot().
| INLINE const DiscreteVariable * gum::InternalNode::nodeVar | ( | ) | const |
Returns the node variable.
Definition at line 97 of file internalNode_inl.h.
References _nodeVar_.
Referenced by gum::MultiDimFunctionGraphOperator< GUM_SCALAR, FUNCTOR, TerminalNodePolicy >::_compute_(), gum::Regress< GUM_SCALAR, COMBINEOPERATOR, PROJECTOPERATOR, TerminalNodePolicy >::_compute_(), gum::StructuredPlaner< GUM_SCALAR >::_recurArgMaxCopy_(), gum::StructuredPlaner< GUM_SCALAR >::_recurExtractOptPol_(), gum::TreeOperator< GUM_SCALAR, COMBINEOPERATOR, TerminalNodePolicy >::_xPloreDT1_(), gum::TreeOperator< GUM_SCALAR, COMBINEOPERATOR, TerminalNodePolicy >::_xPloreDT2_(), gum::TreeRegress< GUM_SCALAR, COMBINEOPERATOR, PROJECTOPERATOR, TerminalNodePolicy >::_xPloreVFunc_(), gum::MultiDimFunctionGraphGenerator::generate(), gum::MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy >::get(), gum::StructuredPlaner< double >::makePlanning(), gum::MultiDimFunctionGraphProjector< GUM_SCALAR, FUNCTOR, TerminalNodePolicy >::project(), and gum::MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy >::toDot().
| INLINE void gum::InternalNode::operator delete | ( | void * | p | ) |
Delete operator.
Definition at line 92 of file internalNode_inl.h.
References InternalNode(), gum::SmallObjectAllocator::deallocate(), and gum::SmallObjectAllocator::instance().
| INLINE void * gum::InternalNode::operator new | ( | size_t | s | ) |
New operator.
Definition at line 87 of file internalNode_inl.h.
References gum::SmallObjectAllocator::allocate(), and gum::SmallObjectAllocator::instance().
Returns the list of parents.
Definition at line 109 of file internalNode_inl.h.
References _nodeParents_.
Referenced by gum::MultiDimFunctionGraphManager< GUM_SCALAR, TerminalNodePolicy >::migrateNode_(), and gum::MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy >::toDot().
Returns the list of parents.
Definition at line 112 of file internalNode_inl.h.
References _nodeParents_.
| 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 105 of file internalNode.cpp.
References _nodeSons_, _nodeVar_, and deallocateNodeSons().
| void gum::InternalNode::setNodeVar | ( | const DiscreteVariable * | v | ) |
Set the node variable.
Definition at line 114 of file internalNode.cpp.
References _nodeSons_, _nodeVar_, _setNodeVar_(), and deallocateNodeSons().
Sets the node's son.
Definition at line 100 of file internalNode_inl.h.
References _nodeSons_, and son().
Returns the son at a given index.
Definition at line 103 of file internalNode_inl.h.
References _nodeSons_.
Referenced by gum::MultiDimFunctionGraphManager< GUM_SCALAR, TerminalNodePolicy >::_checkIsomorphism_(), gum::MultiDimFunctionGraphOperator< GUM_SCALAR, FUNCTOR, TerminalNodePolicy >::_compute_(), gum::Regress< GUM_SCALAR, COMBINEOPERATOR, PROJECTOPERATOR, TerminalNodePolicy >::_compute_(), gum::StructuredPlaner< GUM_SCALAR >::_recurArgMaxCopy_(), gum::StructuredPlaner< GUM_SCALAR >::_recurExtractOptPol_(), gum::TreeOperator< GUM_SCALAR, COMBINEOPERATOR, TerminalNodePolicy >::_xPloreDT1_(), gum::TreeOperator< GUM_SCALAR, COMBINEOPERATOR, TerminalNodePolicy >::_xPloreDT2_(), gum::TreeRegress< GUM_SCALAR, COMBINEOPERATOR, PROJECTOPERATOR, TerminalNodePolicy >::_xPloreVFunc_(), gum::MultiDimFunctionGraphGenerator::generate(), gum::MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy >::get(), gum::StructuredPlaner< double >::initialize(), gum::MultiDimFunctionGraphManager< GUM_SCALAR, TerminalNodePolicy >::migrateNode_(), gum::MultiDimFunctionGraph< double >::model(), gum::MultiDimFunctionGraphProjector< GUM_SCALAR, FUNCTOR, TerminalNodePolicy >::project(), gum::MultiDimFunctionGraphManager< GUM_SCALAR, TerminalNodePolicy >::reduce_(), setSon(), and gum::MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy >::toDot().
|
private |
The list of the node's parent.
Definition at line 147 of file internalNode.h.
Referenced by addParent(), parents(), parents(), and removeParent().
|
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 144 of file internalNode.h.
Referenced by InternalNode(), ~InternalNode(), _setNodeVar_(), setNode(), setNodeVar(), setSon(), and son().
|
private |
Variable associated to such node.
Definition at line 127 of file internalNode.h.
Referenced by InternalNode(), InternalNode(), ~InternalNode(), _setNodeVar_(), nbSons(), nodeVar(), setNode(), and setNodeVar().