![]() |
aGrUM
0.16.0
|
Structure used to represent a node internal structure. More...
#include <agrum/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 __nodeVar.
|
explicit |
Class constructor.
Creates a node and attached the specified variable. Initializes the sons.
Definition at line 46 of file internalNode.cpp.
References __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 51 of file internalNode.cpp.
References __nodeSons, and __nodeVar.
gum::InternalNode::~InternalNode | ( | ) |
Class destructors.
Definition at line 60 of file internalNode.cpp.
References __nodeSons, __nodeVar, and deallocateNodeSons().
|
private |
Set the node variable.
Definition at line 100 of file internalNode.cpp.
References __nodeSons, __nodeVar, and allocateNodeSons().
Referenced by InternalNode(), and setNodeVar().
Adds a parent.
Definition at line 108 of file internalNode.cpp.
References __nodeParents.
|
static |
Allocates a table of nodeid of the size given in parameter.
Definition at line 68 of file internalNode.cpp.
References ALLOCATE, and gum::DiscreteVariable::domainSize().
Referenced by gum::MultiDimFunctionGraphManager< bool, ExactTerminalNodePolicy >::__adjacentSwap(), and __setNodeVar().
|
static |
Deallocates a NodeSons table.
Definition at line 79 of file internalNode.cpp.
References DEALLOCATE, and gum::DiscreteVariable::domainSize().
Referenced by setNode(), setNodeVar(), and ~InternalNode().
INLINE Idx gum::InternalNode::nbSons | ( | ) | const |
Returns the number of sons.
Definition at line 92 of file internalNode_inl.h.
Referenced by gum::MultiDimFunctionGraphManager< bool, ExactTerminalNodePolicy >::_addInternalNode(), gum::MultiDimFunctionGraphManager< bool, ExactTerminalNodePolicy >::_migrateNode(), gum::MultiDimFunctionGraph< bool, ExactTerminalNodePolicy >::copy(), gum::MultiDimFunctionGraph< bool, ExactTerminalNodePolicy >::copyAndMultiplyByScalar(), gum::MultiDimFunctionGraph< bool, ExactTerminalNodePolicy >::copyAndReassign(), gum::StructuredPlaner< double >::optimalPolicy2String(), and gum::MultiDimFunctionGraph< bool, ExactTerminalNodePolicy >::toDot().
INLINE const DiscreteVariable * gum::InternalNode::nodeVar | ( | ) | const |
Returns the node variable.
Definition at line 81 of file internalNode_inl.h.
Referenced by gum::Regress< GUM_SCALAR, COMBINEOPERATOR, PROJECTOPERATOR, TerminalNodePolicy >::__compute(), gum::MultiDimFunctionGraphOperator< GUM_SCALAR, FUNCTOR, TerminalNodePolicy >::__compute(), gum::StatesCounter::__incState(), gum::StatesChecker::__insertState(), gum::StructuredPlaner< double >::__recurArgMaxCopy(), gum::StructuredPlaner< double >::__recurExtractOptPol(), gum::TreeOperator< GUM_SCALAR, COMBINEOPERATOR, TerminalNodePolicy >::__xPloreDT2(), gum::TreeRegress< GUM_SCALAR, COMBINEOPERATOR, PROJECTOPERATOR, TerminalNodePolicy >::__xPloreVFunc(), gum::StatesChecker::addState(), gum::MultiDimFunctionGraphGenerator::generate(), gum::MultiDimFunctionGraph< bool, ExactTerminalNodePolicy >::get(), gum::StatesCounter::incState(), gum::StatesCounter::nodeVar(), gum::StructuredPlaner< double >::optimalPolicy2String(), gum::MultiDimFunctionGraphProjector< GUM_SCALAR, FUNCTOR, TerminalNodePolicy >::project(), and gum::MultiDimFunctionGraph< bool, ExactTerminalNodePolicy >::toDot().
INLINE void gum::InternalNode::operator delete | ( | void * | p | ) |
Delete operator.
Definition at line 76 of file internalNode_inl.h.
References gum::SmallObjectAllocator::deallocate(), and gum::SmallObjectAllocator::instance().
INLINE void * gum::InternalNode::operator new | ( | size_t | s | ) |
New operator.
Definition at line 71 of file internalNode_inl.h.
References gum::SmallObjectAllocator::allocate(), and gum::SmallObjectAllocator::instance().
Returns the list of parents.
Definition at line 95 of file internalNode_inl.h.
Referenced by gum::MultiDimFunctionGraphManager< bool, ExactTerminalNodePolicy >::_migrateNode(), gum::MultiDimFunctionGraphManager< bool, ExactTerminalNodePolicy >::eraseNode(), and gum::MultiDimFunctionGraph< bool, ExactTerminalNodePolicy >::toDot().
Returns the list of parents.
Definition at line 98 of file internalNode_inl.h.
Removes a parent.
Definition at line 112 of file internalNode.cpp.
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 86 of file internalNode.cpp.
References __nodeSons, __nodeVar, and deallocateNodeSons().
void gum::InternalNode::setNodeVar | ( | const DiscreteVariable * | v | ) |
Set the node variable.
Definition at line 95 of file internalNode.cpp.
References __nodeSons, __nodeVar, __setNodeVar(), and deallocateNodeSons().
Sets the node's son.
Definition at line 84 of file internalNode_inl.h.
References gum::Parent::modality.
Returns the son at a given index.
Definition at line 89 of file internalNode_inl.h.
References gum::Parent::modality.
Referenced by gum::MultiDimFunctionGraphManager< bool, ExactTerminalNodePolicy >::__checkIsomorphism(), gum::Regress< GUM_SCALAR, COMBINEOPERATOR, PROJECTOPERATOR, TerminalNodePolicy >::__compute(), gum::MultiDimFunctionGraphOperator< GUM_SCALAR, FUNCTOR, TerminalNodePolicy >::__compute(), gum::StructuredPlaner< double >::__recurArgMaxCopy(), gum::StructuredPlaner< double >::__recurExtractOptPol(), gum::TreeOperator< GUM_SCALAR, COMBINEOPERATOR, TerminalNodePolicy >::__xPloreDT2(), gum::TreeRegress< GUM_SCALAR, COMBINEOPERATOR, PROJECTOPERATOR, TerminalNodePolicy >::__xPloreVFunc(), gum::MultiDimFunctionGraphManager< bool, ExactTerminalNodePolicy >::_migrateNode(), gum::MultiDimFunctionGraphManager< bool, ExactTerminalNodePolicy >::_reduce(), gum::StatesChecker::addState(), gum::MultiDimFunctionGraph< bool, ExactTerminalNodePolicy >::copy(), gum::MultiDimFunctionGraph< bool, ExactTerminalNodePolicy >::copyAndMultiplyByScalar(), gum::MultiDimFunctionGraph< bool, ExactTerminalNodePolicy >::copyAndReassign(), gum::MultiDimFunctionGraphGenerator::generate(), gum::MultiDimFunctionGraph< bool, ExactTerminalNodePolicy >::get(), gum::StatesCounter::incState(), gum::StatesCounter::nodeSon(), gum::StructuredPlaner< double >::optimalPolicy2String(), gum::MultiDimFunctionGraphProjector< GUM_SCALAR, FUNCTOR, TerminalNodePolicy >::project(), and gum::MultiDimFunctionGraph< bool, ExactTerminalNodePolicy >::toDot().
|
private |
The list of the node's parent.
Definition at line 125 of file internalNode.h.
Referenced by addParent(), 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 122 of file internalNode.h.
Referenced by __setNodeVar(), InternalNode(), setNode(), setNodeVar(), and ~InternalNode().
|
private |
Variable associated to such node.
Definition at line 105 of file internalNode.h.
Referenced by __setNodeVar(), InternalNode(), setNode(), setNodeVar(), and ~InternalNode().