aGrUM  0.16.0
internalNode_inl.h
Go to the documentation of this file.
1 
32 
33 namespace gum {
34 
35  INLINE
36  Parent::Parent(NodeId pi, Idx m) : parentId(pi), modality(m) {}
37 
38 
39  INLINE
40  Parent::Parent(const Parent& src) :
41  parentId(src.parentId), modality(src.modality) {}
42 
43  INLINE
44  void* Parent::operator new(size_t s) {
46  }
47 
48  INLINE
49  void Parent::operator delete(void* p) {
51  }
52 
53  INLINE
54  bool Parent::operator==(const Parent& comp) const {
55  if ((comp.parentId == this->parentId) && (comp.modality == this->modality))
56  return true;
57  return false;
58  }
59 
60  INLINE
61  bool Parent::operator!=(const Parent& comp) const { return !(comp == *this); }
62 
63  INLINE
65  this->parentId = src.parentId;
66  this->modality = src.modality;
67  return *this;
68  }
69 
70  INLINE
71  void* InternalNode::operator new(size_t s) {
73  }
74 
75  INLINE
76  void InternalNode::operator delete(void* p) {
78  }
79 
80  INLINE
81  const DiscreteVariable* InternalNode::nodeVar() const { return __nodeVar; }
82 
83  INLINE
85  __nodeSons[modality] = son;
86  }
87 
88  INLINE
89  NodeId InternalNode::son(Idx modality) const { return __nodeSons[modality]; }
90 
91  INLINE
92  Idx InternalNode::nbSons() const { return __nodeVar->domainSize(); }
93 
94  INLINE
95  Link< Parent >* InternalNode::parents() { return __nodeParents.list(); }
96 
97  INLINE
99  return __nodeParents.list();
100  }
101 } // namespace gum
bool operator==(const Parent &comp) const
NodeId parentId
Definition: internalNode.h:51
const DiscreteVariable * nodeVar() const
Returns the node variable.
Idx nbSons() const
Returns the number of sons.
void setSon(Idx modality, NodeId son)
Sets the node&#39;s son.
NodeId son(Idx modality) const
Returns the son at a given index.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Link< Parent > * parents()
Returns the list of parents.
Base class for discrete random variable.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
bool operator!=(const Parent &comp) const
Parent & operator=(const Parent &src)
Structure used to represent a node internal structure.
Definition: internalNode.h:102
Parent(NodeId pi, Idx m)
Class constructor.
void deallocate(void *pDeallocatedObject, const size_t &objectSize)
Deallocates an object.
Represent a node&#39;s parent.
Definition: internalNode.h:50
Size Idx
Type for indexes.
Definition: types.h:53
void * allocate(const size_t &objectSize)
Allocates a block.
static SmallObjectAllocator & instance()
Size NodeId
Type for node ids.
Definition: graphElements.h:98