30 #ifndef GUM_AGGREGATE_H 31 #define GUM_AGGREGATE_H 69 template <
typename GUM_SCALAR >
103 }
else if (
toLower(str) ==
"max") {
105 }
else if (
toLower(str) ==
"count") {
107 }
else if (
toLower(str) ==
"exists") {
109 }
else if (
toLower(str) ==
"or") {
111 }
else if (
toLower(str) ==
"and") {
113 }
else if (
toLower(str) ==
"forall") {
115 }
else if (
toLower(str) ==
"amplitude") {
117 }
else if (
toLower(str) ==
"median") {
120 std::string msg =
"Unknown aggregate: ";
198 void setLabel(
const std::string& label);
278 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
aGrUM's Potential is a multi-dimensional array with tensor operators.
virtual PRMClassElement< GUM_SCALAR >::ClassElementType elt_type() const
See gum::PRMClassElement::elt_type().
static AggregateType str2enum(const std::string &str)
Static method which returns the AggregateType given its string representation.
MultiDimImplementation< GUM_SCALAR > * buildImpl() const
Returns a pointer over an empty gum::MultiDimImplementation of the good type for this PRMAggregate...
const std::string & name() const
Returns the name of this object.
AggregateType __agg_type
The AggregateType of this aggregate.
virtual ~PRMAggregate()
Destructor.
virtual void addParent(const PRMClassElement< GUM_SCALAR > &elt)
See gum::PRMClassElement::_addParent().
Abstract class representing an element of PRM class.
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.
void setLabel(Idx idx)
Set the aggregator's label.
virtual PRMAttribute< GUM_SCALAR > * getCastDescendant() const
See gum::PRMClassElement::elt_type().
PRMAggregate< GUM_SCALAR > & operator=(const PRMAggregate< GUM_SCALAR > &source)
Copy operator. Don't use it.
std::shared_ptr< Idx > sharedLabel() const
Returns the shared_ptr holding this Aggregate label.
PRMAggregate(const std::string &name, AggregateType aggType, const PRMType &rvType)
Default constructor.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
std::string __label_value
The AggregateType of this aggregate.
virtual void addChild(const PRMClassElement< GUM_SCALAR > &elt)
See gum::PRMClassElement::_addChild().
const std::string & labelValue() const
See gum::PRMClassElement::elt_type().
std::string toLower(std::string str)
Returns the lowercase version of str.
AggregateType agg_type() const
Returns the aggregate of *this.
This is a decoration of the DiscreteVariable class.
PRMType * __type
The random variable type of this aggregate It is deleted with the aggregate.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
std::shared_ptr< Idx > __label
Some aggregators applies only on a given label. This attribute must have the concerned Idx...
virtual Potential< GUM_SCALAR > & cpf()
Aggregates don't have Potential until they are instantiated as PRMAttribute, so this will raise an Op...
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.
AggregateType
The different type of aggregates we can have.
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.
virtual PRMType & type()
See gum::PRMClassElement::type().
bool hasLabel() const
Returns true if the label is defined.
A PRMClass is an object of a PRM representing a fragment of a Bayesian Network which can be instantia...
<agrum/multidim/multiDimImplementation.h>
Size Idx
Type for indexes.
PRMAttribute is a member of a Class in a PRM.
Idx label() const
Returns the label's index on which this aggregate applies.
#define GUM_ERROR(type, msg)
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
ClassElementType
Returns true if obj_ptr is of type PRMReferenceSlot.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.