aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
gum::ComposedLeaf Class Referencefinal

<agrum/FMDP/learning/datastructure/leaves/composedLeaf.h> More...

#include <composedLeaf.h>

Inheritance diagram for gum::ComposedLeaf:
Collaboration diagram for gum::ComposedLeaf:

Public Member Functions

double effectif (Idx moda) const
 Gaves the leaf effectif for given modality.
double total () const
bool contains (NodeId testedId) const
 Returns true if abstractleaf has leaf in it.
Idx nbModa () const
std::string toString ()
NodeId id ()
Constructor & destructor.
 ComposedLeaf (NodeId leafId, AbstractLeaf *l1, AbstractLeaf *l2)
 Default constructor.
 ~ComposedLeaf ()
 Default destructor.
void * operator new (size_t s)
 Allocators and Deallocators redefinition.
void operator delete (void *p)
 Default constructor.

Private Attributes

AbstractLeaf_l1_
AbstractLeaf_l2_
NodeId _leafId_

Detailed Description

<agrum/FMDP/learning/datastructure/leaves/composedLeaf.h>

A leaf that has leaves inside

Definition at line 68 of file composedLeaf.h.

Constructor & Destructor Documentation

◆ ComposedLeaf()

gum::ComposedLeaf::ComposedLeaf ( NodeId leafId,
AbstractLeaf * l1,
AbstractLeaf * l2 )
inline

Default constructor.

Definition at line 78 of file composedLeaf.h.

78 :
79 AbstractLeaf(leafId), _l1_(l1), _l2_(l2) {
80 GUM_CONSTRUCTOR(ComposedLeaf);
81 }
AbstractLeaf(NodeId leafId)
Default constructor.
AbstractLeaf * _l2_
AbstractLeaf * _l1_
ComposedLeaf(NodeId leafId, AbstractLeaf *l1, AbstractLeaf *l2)
Default constructor.

References gum::AbstractLeaf::AbstractLeaf(), ComposedLeaf(), _l1_, and _l2_.

Referenced by ComposedLeaf(), ~ComposedLeaf(), and operator delete().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~ComposedLeaf()

gum::ComposedLeaf::~ComposedLeaf ( )
inline

Default destructor.

Definition at line 86 of file composedLeaf.h.

86 {
87 GUM_DESTRUCTOR(ComposedLeaf);
88 ;
89 }

References ComposedLeaf().

Here is the call graph for this function:

Member Function Documentation

◆ contains()

bool gum::ComposedLeaf::contains ( NodeId testedId) const
inlinevirtual

Returns true if abstractleaf has leaf in it.

Reimplemented from gum::AbstractLeaf.

Definition at line 112 of file composedLeaf.h.

112 {
113 return AbstractLeaf::contains(testedId) || _l1_->contains(testedId)
114 || _l2_->contains(testedId);
115 }
virtual bool contains(NodeId testedId) const
Returns true if abstractleaf has leaf in it.

References _l1_, _l2_, and gum::AbstractLeaf::contains().

Here is the call graph for this function:

◆ effectif()

double gum::ComposedLeaf::effectif ( Idx moda) const
inlinevirtual

Gaves the leaf effectif for given modality.

Implements gum::AbstractLeaf.

Definition at line 105 of file composedLeaf.h.

105{ return _l1_->effectif(moda) + _l2_->effectif(moda); }

References _l1_, and _l2_.

◆ id()

NodeId gum::AbstractLeaf::id ( )
inlineinherited

Definition at line 114 of file abstractLeaf.h.

114{ return _leafId_; }

References _leafId_.

Referenced by gum::ComposedLeaf::toString(), gum::ConcreteLeaf< AttributeSelection, isScalar >::toString(), and gum::LeafAggregator::updateLeaf().

Here is the caller graph for this function:

◆ nbModa()

Idx gum::ComposedLeaf::nbModa ( ) const
inlinevirtual

Implements gum::AbstractLeaf.

Definition at line 117 of file composedLeaf.h.

117{ return _l1_->nbModa(); }

References _l1_.

◆ operator delete()

void gum::ComposedLeaf::operator delete ( void * p)
inline

Default constructor.

Definition at line 96 of file composedLeaf.h.

96 {
98 }
static SmallObjectAllocator & instance()
void deallocate(void *pDeallocatedObject, const size_t &objectSize)
Deallocates an object.

References ComposedLeaf(), gum::SmallObjectAllocator::deallocate(), and gum::SmallObjectAllocator::instance().

Here is the call graph for this function:

◆ operator new()

void * gum::ComposedLeaf::operator new ( size_t s)
inline

Allocators and Deallocators redefinition.

Definition at line 94 of file composedLeaf.h.

void * allocate(const size_t &objectSize)
Allocates a block.

References gum::SmallObjectAllocator::allocate(), and gum::SmallObjectAllocator::instance().

Here is the call graph for this function:

◆ toString()

std::string gum::ComposedLeaf::toString ( )
virtual

Implements gum::AbstractLeaf.

Definition at line 56 of file composedLeaf.cpp.

56 {
57 std::stringstream ss;
58 ss << "{ Id : " << this->id() << " - Left : " << _l1_->toString()
59 << " - Right : " << _l2_->toString() << "}";
60 return ss.str();
61 }

References _l1_, _l2_, and gum::AbstractLeaf::id().

Here is the call graph for this function:

◆ total()

double gum::ComposedLeaf::total ( ) const
inlinevirtual

Implements gum::AbstractLeaf.

Definition at line 107 of file composedLeaf.h.

107{ return _l1_->total() + _l2_->total(); }

References _l1_, and _l2_.

Member Data Documentation

◆ _l1_

AbstractLeaf* gum::ComposedLeaf::_l1_
private

Definition at line 122 of file composedLeaf.h.

Referenced by ComposedLeaf(), contains(), effectif(), nbModa(), toString(), and total().

◆ _l2_

AbstractLeaf* gum::ComposedLeaf::_l2_
private

Definition at line 123 of file composedLeaf.h.

Referenced by ComposedLeaf(), contains(), effectif(), toString(), and total().

◆ _leafId_

NodeId gum::AbstractLeaf::_leafId_
privateinherited

Definition at line 121 of file abstractLeaf.h.

Referenced by AbstractLeaf(), contains(), and id().


The documentation for this class was generated from the following files: