aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
gum::ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ > Struct Template Reference

Class to handle efficiently argMaxSet. More...

#include <agrum/base/multidim/patterns/argMaxSet.h>

Collaboration diagram for gum::ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ >:

Public Member Functions

Idx size () const
 Gives the size.
const GUM_SCALAR_VAL & value () const
 Returns the value on which comparison are made.
bool exists (const GUM_SCALAR_SEQ &elem) const
CNL
 ArgMaxSet ()
 Constructor.
 ArgMaxSet (const GUM_SCALAR_VAL &val, const GUM_SCALAR_SEQ &elem)
 Constructor.
 ArgMaxSet (const ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ > &src)
 Copy Constructor.
ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ > & operator= (const ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ > &src)
 Constructor.
 ~ArgMaxSet ()
 Destructor.
void * operator new (size_t s)
 Allocators and Deallocators redefinition.
void operator delete (void *p)
 Constructor.
Iterators
SequenceIteratorSafe< GUM_SCALAR_SEQ > beginSafe () const
 Iterator beginning.
SequenceIteratorSafe< GUM_SCALAR_SEQ > endSafe () const
 Iterator end.
Operators
ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ > & operator+= (const GUM_SCALAR_SEQ &elem)
 Ajout d'un élément.
ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ > & operator+= (const ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ > &src)
 Use to insert the content of another set inside this one.
const GUM_SCALAR_SEQ & operator[] (const Idx i) const
 Gives the ith element.
bool operator== (const ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ > &compared) const
 Compares two ArgMaxSet to check if they are equals.
bool operator!= (const ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ > &compared) const
 Ajout d'un élément.
bool operator< (const ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ > &compared) const
 Checks if val is lower or higher from the compared ArgMaxSet val.
bool operator> (const ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ > &compared) const
 Ajout d'un élément.
bool operator<= (const ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ > &compared) const
 Ajout d'un élément.
bool operator>= (const ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ > &compared) const
 Ajout d'un élément.

Private Attributes

Sequence< GUM_SCALAR_SEQ > * _argMaxSeq_
 The very bone of the ArgMaxSet.
GUM_SCALAR_VAL _val_

Friends

std::ostream & operator<< (std::ostream &streamy, const ArgMaxSet &objy)

Detailed Description

template<typename GUM_SCALAR_VAL, typename GUM_SCALAR_SEQ>
struct gum::ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ >

Class to handle efficiently argMaxSet.

A class containing the set of object assoicated to a maximum.

This set contains the ids of the obj

Definition at line 78 of file argMaxSet.h.

Constructor & Destructor Documentation

◆ ArgMaxSet() [1/3]

template<typename GUM_SCALAR_VAL, typename GUM_SCALAR_SEQ>
gum::ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ >::ArgMaxSet ( )

Constructor.

Definition at line 61 of file argMaxSet_tpl.h.

61 {
64 }
Class to handle efficiently argMaxSet.
Definition argMaxSet.h:78
ArgMaxSet()
Constructor.
Sequence< GUM_SCALAR_SEQ > * _argMaxSeq_
The very bone of the ArgMaxSet.
Definition argMaxSet.h:203

References ArgMaxSet(), and _argMaxSeq_.

Referenced by ArgMaxSet(), ArgMaxSet(), ArgMaxSet(), ~ArgMaxSet(), operator delete(), operator!=(), operator+=(), operator<(), operator<<, operator<=(), operator=(), operator==(), operator>(), and operator>=().

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

◆ ArgMaxSet() [2/3]

template<typename GUM_SCALAR_VAL, typename GUM_SCALAR_SEQ>
gum::ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ >::ArgMaxSet ( const GUM_SCALAR_VAL & val,
const GUM_SCALAR_SEQ & elem )

Constructor.

Definition at line 70 of file argMaxSet_tpl.h.

71 {
74 _argMaxSeq_->insert(elem);
75 _val_ = val;
76 }
GUM_SCALAR_VAL _val_
Definition argMaxSet.h:204

References ArgMaxSet(), _argMaxSeq_, and _val_.

Here is the call graph for this function:

◆ ArgMaxSet() [3/3]

template<typename GUM_SCALAR_VAL, typename GUM_SCALAR_SEQ>
gum::ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ >::ArgMaxSet ( const ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ > & src)

Copy Constructor.

Definition at line 82 of file argMaxSet_tpl.h.

83 {
86 this->operator+=(src);
87 _val_ = src.value();
88 }
const GUM_SCALAR_VAL & value() const
Returns the value on which comparison are made.
Definition argMaxSet.h:197
ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ > & operator+=(const GUM_SCALAR_SEQ &elem)
Ajout d'un élément.

References ArgMaxSet(), _argMaxSeq_, _val_, gum::operator+=(), and value().

Here is the call graph for this function:

◆ ~ArgMaxSet()

template<typename GUM_SCALAR_VAL, typename GUM_SCALAR_SEQ>
gum::ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ >::~ArgMaxSet ( )

Destructor.

Definition at line 104 of file argMaxSet_tpl.h.

104 {
106 delete _argMaxSeq_;
107 }

References ArgMaxSet(), and _argMaxSeq_.

Here is the call graph for this function:

Member Function Documentation

◆ beginSafe()

template<typename GUM_SCALAR_VAL, typename GUM_SCALAR_SEQ>
SequenceIteratorSafe< GUM_SCALAR_SEQ > gum::ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ >::beginSafe ( ) const
inline

Iterator beginning.

Definition at line 129 of file argMaxSet.h.

129{ return _argMaxSeq_->beginSafe(); }

References _argMaxSeq_.

Referenced by gum::StructuredPlaner< GUM_SCALAR >::_transferActionIds_(), operator+=(), and operator==().

Here is the caller graph for this function:

◆ endSafe()

template<typename GUM_SCALAR_VAL, typename GUM_SCALAR_SEQ>
SequenceIteratorSafe< GUM_SCALAR_SEQ > gum::ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ >::endSafe ( ) const
inline

Iterator end.

Definition at line 134 of file argMaxSet.h.

134{ return _argMaxSeq_->endSafe(); }

References _argMaxSeq_.

Referenced by gum::StructuredPlaner< GUM_SCALAR >::_transferActionIds_(), operator+=(), and operator==().

Here is the caller graph for this function:

◆ exists()

template<typename GUM_SCALAR_VAL, typename GUM_SCALAR_SEQ>
bool gum::ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ >::exists ( const GUM_SCALAR_SEQ & elem) const
inline

Definition at line 199 of file argMaxSet.h.

199{ return _argMaxSeq_->exists(elem); }

References _argMaxSeq_.

Referenced by operator==().

Here is the caller graph for this function:

◆ operator delete()

template<typename GUM_SCALAR_VAL, typename GUM_SCALAR_SEQ>
void gum::ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ >::operator delete ( void * p)
inline

Constructor.

Definition at line 113 of file argMaxSet.h.

113 {
115 p,
117 }
static SmallObjectAllocator & instance()
void deallocate(void *pDeallocatedObject, const size_t &objectSize)
Deallocates an object.

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

Here is the call graph for this function:

◆ operator new()

template<typename GUM_SCALAR_VAL, typename GUM_SCALAR_SEQ>
void * gum::ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ >::operator new ( size_t s)
inline

Allocators and Deallocators redefinition.

Definition at line 111 of file argMaxSet.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:

◆ operator!=()

template<typename GUM_SCALAR_VAL, typename GUM_SCALAR_SEQ>
bool gum::ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ >::operator!= ( const ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ > & compared) const
inline

Ajout d'un élément.

Definition at line 164 of file argMaxSet.h.

164 {
165 return !(*this == compared);
166 }

References ArgMaxSet().

Here is the call graph for this function:

◆ operator+=() [1/2]

template<typename GUM_SCALAR_VAL, typename GUM_SCALAR_SEQ>
ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ > & gum::ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ >::operator+= ( const ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ > & src)

Use to insert the content of another set inside this one.

Definition at line 128 of file argMaxSet_tpl.h.

129 {
130 for (auto iter = src.beginSafe(); iter != src.endSafe(); ++iter)
131 if (!_argMaxSeq_->exists(*iter)) _argMaxSeq_->insert(*iter);
132 return *this;
133 }
SequenceIteratorSafe< GUM_SCALAR_SEQ > beginSafe() const
Iterator beginning.
Definition argMaxSet.h:129
SequenceIteratorSafe< GUM_SCALAR_SEQ > endSafe() const
Iterator end.
Definition argMaxSet.h:134

References ArgMaxSet(), _argMaxSeq_, beginSafe(), and endSafe().

Here is the call graph for this function:

◆ operator+=() [2/2]

template<typename GUM_SCALAR_VAL, typename GUM_SCALAR_SEQ>
ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ > & gum::ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ >::operator+= ( const GUM_SCALAR_SEQ & elem)

Ajout d'un élément.

Definition at line 118 of file argMaxSet_tpl.h.

118 {
119 _argMaxSeq_->insert(elem);
120 return *this;
121 }

References _argMaxSeq_.

◆ operator<()

template<typename GUM_SCALAR_VAL, typename GUM_SCALAR_SEQ>
bool gum::ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ >::operator< ( const ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ > & compared) const
inline

Checks if val is lower or higher from the compared ArgMaxSet val.

Definition at line 171 of file argMaxSet.h.

171 {
172 return _val_ < compared.value() ? true : false;
173 }

References ArgMaxSet(), _val_, and value().

Here is the call graph for this function:

◆ operator<=()

template<typename GUM_SCALAR_VAL, typename GUM_SCALAR_SEQ>
bool gum::ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ >::operator<= ( const ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ > & compared) const
inline

Ajout d'un élément.

Definition at line 179 of file argMaxSet.h.

179 {
180 return !(*this > compared);
181 }

References ArgMaxSet().

Here is the call graph for this function:

◆ operator=()

template<typename GUM_SCALAR_VAL, typename GUM_SCALAR_SEQ>
ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ > & gum::ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ >::operator= ( const ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ > & src)

Constructor.

Definition at line 92 of file argMaxSet_tpl.h.

93 {
94 this->_argMaxSeq_->clear();
95 this->operator+=(src);
96 _val_ = src.value();
97 return *this;
98 }

References ArgMaxSet(), _argMaxSeq_, _val_, gum::operator+=(), and value().

Here is the call graph for this function:

◆ operator==()

template<typename GUM_SCALAR_VAL, typename GUM_SCALAR_SEQ>
bool gum::ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ >::operator== ( const ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ > & compared) const

Compares two ArgMaxSet to check if they are equals.

Definition at line 139 of file argMaxSet_tpl.h.

140 {
141 if (_val_ != compared.value()) return false;
142 for (auto iter = compared.beginSafe(); iter != compared.endSafe(); ++iter)
143 if (!_argMaxSeq_->exists(*iter)) return false;
144 for (auto iter = this->beginSafe(); iter != this->endSafe(); ++iter)
145 if (!compared.exists(*iter)) return false;
146 return true;
147 }
bool exists(const GUM_SCALAR_SEQ &elem) const
Definition argMaxSet.h:199

References ArgMaxSet(), _argMaxSeq_, _val_, beginSafe(), endSafe(), exists(), and value().

Here is the call graph for this function:

◆ operator>()

template<typename GUM_SCALAR_VAL, typename GUM_SCALAR_SEQ>
bool gum::ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ >::operator> ( const ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ > & compared) const
inline

Ajout d'un élément.

Definition at line 175 of file argMaxSet.h.

175 {
176 return compared < *this;
177 }

References ArgMaxSet().

Here is the call graph for this function:

◆ operator>=()

template<typename GUM_SCALAR_VAL, typename GUM_SCALAR_SEQ>
bool gum::ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ >::operator>= ( const ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ > & compared) const
inline

Ajout d'un élément.

Definition at line 183 of file argMaxSet.h.

183 {
184 return !(*this < compared);
185 }

References ArgMaxSet().

Here is the call graph for this function:

◆ operator[]()

template<typename GUM_SCALAR_VAL, typename GUM_SCALAR_SEQ>
const GUM_SCALAR_SEQ & gum::ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ >::operator[] ( const Idx i) const
inline

Gives the ith element.

Definition at line 157 of file argMaxSet.h.

157{ return _argMaxSeq_->atPos(i); }

References _argMaxSeq_.

◆ size()

template<typename GUM_SCALAR_VAL, typename GUM_SCALAR_SEQ>
Idx gum::ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ >::size ( ) const
inline

Gives the size.

Definition at line 192 of file argMaxSet.h.

192{ return _argMaxSeq_->size(); }

References _argMaxSeq_.

◆ value()

template<typename GUM_SCALAR_VAL, typename GUM_SCALAR_SEQ>
const GUM_SCALAR_VAL & gum::ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ >::value ( ) const
inline

Returns the value on which comparison are made.

Definition at line 197 of file argMaxSet.h.

197{ return _val_; }

References _val_.

Referenced by ArgMaxSet(), operator<(), operator<<, operator=(), and operator==().

Here is the caller graph for this function:

◆ operator<<

template<typename GUM_SCALAR_VAL, typename GUM_SCALAR_SEQ>
std::ostream & operator<< ( std::ostream & streamy,
const ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ > & objy )
friend

Member Data Documentation

◆ _argMaxSeq_

template<typename GUM_SCALAR_VAL, typename GUM_SCALAR_SEQ>
Sequence< GUM_SCALAR_SEQ >* gum::ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ >::_argMaxSeq_
private

◆ _val_

template<typename GUM_SCALAR_VAL, typename GUM_SCALAR_SEQ>
GUM_SCALAR_VAL gum::ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ >::_val_
private

Definition at line 204 of file argMaxSet.h.

Referenced by ArgMaxSet(), ArgMaxSet(), operator<(), operator=(), operator==(), and value().


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