31 #ifndef GUM_ACTION_SET_H 32 #define GUM_ACTION_SET_H 57 template <
typename GUM_SCALAR >
64 const GUM_SCALAR&
operator()(
const GUM_SCALAR& x,
const GUM_SCALAR& y)
const {
65 if (x > y) {
return x; }
66 if (x < y) {
return y; }
107 __actionSeq->
insert(*idi);
113 __actionSeq->
insert(*idi);
128 void*
operator new(
size_t s) {
131 void operator delete(
void* p) {
146 return __actionSeq->beginSafe();
165 __actionSeq->insert(elem);
174 if (!__actionSeq->exists(*iter)) __actionSeq->insert(*iter);
183 if (__actionSeq->exists(*iter)) __actionSeq->erase(*iter);
197 if (!__actionSeq->exists(*iter))
return false;
198 for (
auto iter = this->beginSafe(); iter != this->endSafe(); ++iter)
199 if (!compared.
exists(*iter))
return false;
203 return !(*
this == compared);
213 bool exists(
const Idx& elem)
const {
return __actionSeq->exists(elem); }
225 #endif // GUM_ACTION_SET_H
const GUM_SCALAR & operator()(const GUM_SCALAR &x, const GUM_SCALAR &y) const
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
bool operator==(const ActionSet &compared) const
Compares two ActionSet to check if they are equals.
Size size() const
Gives the size.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
A class to store the optimal actions.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
ActionSet(const ActionSet &src)
Constructor.
friend std::ostream & operator<<(std::ostream &streamy, const ActionSet &objy)
std::string toString() const
Displays the content of the sequence.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
bool exists(const Idx &elem) const
SequenceIteratorSafe< Idx > endSafe() const
Iterator end.
Sequence< Idx > * __actionSeq
The very bone of the ActionSet.
ActionSet & operator=(const ActionSet &src)
Constructor.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
ActionSet & operator+=(const ActionSet &src)
Use to insert the content of another set inside this one.
ActionSet & operator-=(const ActionSet &src)
Use to insert the content of another set inside this one.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
SequenceIteratorSafe< Idx > beginSafe() const
Iterator beginning.
ActionSet & operator+=(const Idx &elem)
Ajout d'un élément.
void deallocate(void *pDeallocatedObject, const size_t &objectSize)
Deallocates an object.
bool operator!=(const ActionSet &compared) const
Ajout d'un élément.
const Idx & operator[](const Idx i) const
Gives the ith element.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Size Idx
Type for indexes.
void * allocate(const size_t &objectSize)
Allocates a block.
static SmallObjectAllocator & instance()
std::size_t Size
In aGrUM, hashed values are unsigned long int.
<agrum/FMDP/planning/actionSet.h>
void insert(const Key &k)
Insert an element at the end of the sequence.