aGrUM 3.1.1
a C++ library for (probabilistic) graphical models
gum::prm::PRMAggregate< GUM_SCALAR > Class Template Reference

#include <PRMAggregate.h>

Inheritance diagram for gum::prm::PRMAggregate< GUM_SCALAR >:
Collaboration diagram for gum::prm::PRMAggregate< GUM_SCALAR >:

Public Member Functions

Constructor & destructor.
 PRMAggregate (std::string_view name, AggregateType aggType, const PRMType &rvType)
 Default constructor.
 PRMAggregate (std::string_view name, AggregateType aggType, const PRMType &rvType, Idx label)
 Default constructor.
 ~PRMAggregate () override
 Destructor.
Getters and Setters.
PRMClassElement< GUM_SCALAR >::ClassElementType elt_type () const override
 See gum::PRMClassElement::elt_type().
AggregateType agg_type () const
 Returns the aggregate of *this.
Idx label () const
 Returns the label's index on which this aggregate applies.
const std::string & labelValue () const
 See gum::PRMClassElement::elt_type().
std::shared_ptr< IdxsharedLabel () const
 Returns the shared_ptr holding this Aggregate label.
void sharedLabel (std::shared_ptr< Idx > label)
 Sets the shared_ptr of this Aggregate.
void setLabel (Idx idx)
 Set the aggregator's label.
void setLabel (std::string_view label)
 See gum::PRMClassElement::elt_type().
bool hasLabel () const
 Returns true if the label is defined.
bool isDecomposable () const
 Returns true if the aggregator is decomposable.
void addParent (const PRMClassElement< GUM_SCALAR > &elt) override
 See gum::PRMClassElement::addParent_().
void addChild (const PRMClassElement< GUM_SCALAR > &elt) override
 See gum::PRMClassElement::addChild_().
PRMTypetype () override
 See gum::PRMClassElement::type().
const PRMTypetype () const override
 See gum::PRMClassElement::type().
virtual Tensor< GUM_SCALAR > & cpf ()
 Aggregates don't have Tensor until they are instantiated as PRMAttribute, so this will raise an OperationNotAllowed exception.
const Tensor< GUM_SCALAR > & cpf () const override
 Aggregates don't have Tensor until they are instantiated as PRMAttribute, so this will raise an OperationNotAllowed exception.
MultiDimImplementation< GUM_SCALAR > * buildImpl () const
 Returns a pointer over an empty gum::MultiDimImplementation of the good type for this PRMAggregate.
PRMAttribute< GUM_SCALAR > * getCastDescendant () const override
 See gum::PRMClassElement::elt_type().
Getters & setters
NodeId id () const
 Returns the NodeId of this element in it's class DAG.
virtual void setId (NodeId id)
 Used to assign the id of this element.
PRMObject::prm_type obj_type () const override
Fast access to random variable's properties
const std::string & safeName () const
 Returns the safe name of this PRMClassElement, if any.
virtual std::string cast (const PRMType &t) const
 Returns the name of the cast descendant with PRMType t of this PRMClassElement.
Getters & setters.
const std::string & name () const
 Returns the name of this object.
void name (std::string_view name)
 Change the name of the PRM Object.
Operators
bool operator== (const PRMObject &obj) const
 To PRMObject are equal if they have the same name (which is unique).
bool operator!= (const PRMObject &obj) const
 To PRMObject are equal if they have the same name (which is unique).

Protected Attributes

std::string safeName_
 The safe name of this PRMClassElement.

Private Member Functions

Private methods.
 PRMAggregate (const PRMAggregate< GUM_SCALAR > &source)
 Copy constructor. Don't use it.
PRMAggregate< GUM_SCALAR > & operator= (const PRMAggregate< GUM_SCALAR > &source)
 Copy operator. Don't use it.

Private Attributes

NodeId _id_
 The node's id of this element.
Private members.
AggregateType _agg_type_
 The AggregateType of this aggregate.
PRMType_type_
 The random variable type of this aggregate It is deleted with the aggregate.
std::shared_ptr< Idx_label_
 Some aggregators applies only on a given label. This attribute must have the concerned Idx. If not initialized the pointer equals 0. It is deleted with the aggregate.
std::string _label_value_
 The AggregateType of this aggregate.
Private members.
std::string _name_

Friends

class PRMClass< GUM_SCALAR >

Built-in types.

enum class  AggregateType : char {
  MIN , MAX , COUNT , EXISTS ,
  FORALL , OR , AND , AMPLITUDE ,
  MEDIAN , SUM
}
 The different type of aggregates we can have. More...
static AggregateType str2enum (std::string_view str)
 Static method which returns the AggregateType given its string representation.

Built-in type

enum  ClassElementType {
  prm_attribute , prm_aggregate , prm_refslot , prm_slotchain ,
  prm_parameter
}
 Returns true if obj_ptr is of type PRMReferenceSlot. More...
static std::string enum2str (ClassElementType type)
 Returns true if obj_ptr is of type PRMReferenceSlot.
static INLINE bool isReferenceSlot (const PRMClassElement< GUM_SCALAR > &elt)
 Returns true if obj_ptr is of type PRMReferenceSlot.
static INLINE bool isAttribute (const PRMClassElement< GUM_SCALAR > &elt)
 Returns true if obj_ptr is of type PRMAttribute.
static INLINE bool isAggregate (const PRMClassElement< GUM_SCALAR > &elt)
 Return true if obj is of type PRMAggregate.
static INLINE bool isSlotChain (const PRMClassElement< GUM_SCALAR > &elt)
 Return true if obj is of type PRMSlotChain.
static INLINE bool isParameter (const PRMClassElement< GUM_SCALAR > &elt)
 Return true if obj is of type PRMParameter.

Built-in types.

enum class  prm_type : char {
  ALL , CLASS , PRM_INTERFACE , CLASS_ELT ,
  TYPE , SYSTEM , INSTANCE
}
 Enumeration of the different types of objects handled by a PRM. More...
static std::string enum2str (prm_type type)
 Returns the string representation of a PRMObject.
static std::string LEFT_CAST ()
 Enumeration of the different types of objects handled by a PRM.
static std::string RIGHT_CAST ()
 Enumeration of the different types of objects handled by a PRM.
static INLINE bool isClass (const PRMObject &obj)
 Returns true if obj_ptr is of type Class.
static INLINE bool isInterface (const PRMObject &obj)
 Returns true if obj_ptr is of type PRMInterface.
static INLINE bool isInstance (const PRMObject &obj)
 Returns true if obj_ptr is of type PRMInstance.

Detailed Description

template<GUM_Numeric GUM_SCALAR>
class gum::prm::PRMAggregate< GUM_SCALAR >

Definition at line 83 of file PRMAggregate.h.

Member Enumeration Documentation

◆ AggregateType

template<GUM_Numeric GUM_SCALAR>
enum class gum::prm::PRMAggregate::AggregateType : char
strong

The different type of aggregates we can have.

Enumerator
MIN 
MAX 
COUNT 
EXISTS 
FORALL 
OR 
AND 
AMPLITUDE 
MEDIAN 
SUM 

Definition at line 93 of file PRMAggregate.h.

93 : char {
94 MIN,
95 MAX,
96 COUNT,
97 EXISTS,
98 FORALL,
99 OR,
100 AND,
101 AMPLITUDE,
102 MEDIAN,
103 SUM
104 };

◆ ClassElementType

template<GUM_Numeric GUM_SCALAR>
enum gum::prm::PRMClassElement::ClassElementType
inherited

Returns true if obj_ptr is of type PRMReferenceSlot.

Enumerator
prm_attribute 
prm_aggregate 
prm_refslot 
prm_slotchain 
prm_parameter 

Definition at line 109 of file PRMClassElement.h.

◆ prm_type

enum class gum::prm::PRMObject::prm_type : char
stronginherited

Enumeration of the different types of objects handled by a PRM.

The "all" type is used to tell that we want any kind of PRMType (useful with iterators for example). No PRMObject will ever have "all" as type.

Enumerator
ALL 
CLASS 
PRM_INTERFACE 
CLASS_ELT 
TYPE 
SYSTEM 
INSTANCE 

Definition at line 90 of file PRMObject.h.

90: char { ALL, CLASS, PRM_INTERFACE, CLASS_ELT, TYPE, SYSTEM, INSTANCE };

Constructor & Destructor Documentation

◆ PRMAggregate() [1/3]

template<GUM_Numeric GUM_SCALAR>
gum::prm::PRMAggregate< GUM_SCALAR >::PRMAggregate ( std::string_view name,
AggregateType aggType,
const PRMType & rvType )

Default constructor.

Parameters
nameThe name of this aggregate.
aggTypeThe aggregate type of this aggregate.
rvTypeThe random variable type of this aggregate, which is copied.

Definition at line 69 of file PRMAggregate_tpl.h.

71 :
75 this->safeName_
77 this->_type_->variable().setName(name);
78 }
PRMAggregate(std::string_view name, AggregateType aggType, const PRMType &rvType)
Default constructor.
AggregateType _agg_type_
The AggregateType of this aggregate.
std::shared_ptr< Idx > _label_
Some aggregators applies only on a given label. This attribute must have the concerned Idx....
PRMType * _type_
The random variable type of this aggregate It is deleted with the aggregate.
PRMClassElement(std::string_view name)
Default constructor of a PRMClassElement.
std::string safeName_
The safe name of this PRMClassElement.
const std::string & name() const
Returns the name of this object.
static std::string RIGHT_CAST()
Enumeration of the different types of objects handled by a PRM.
static std::string LEFT_CAST()
Enumeration of the different types of objects handled by a PRM.
Size Idx
Type for indexes.
Definition types.h:79

References PRMAggregate(), gum::prm::PRMClassElement< GUM_SCALAR >::PRMClassElement(), _agg_type_, _label_, _type_, gum::prm::PRMObject::LEFT_CAST(), gum::prm::PRMObject::name(), gum::prm::PRMObject::RIGHT_CAST(), and gum::prm::PRMClassElement< GUM_SCALAR >::safeName_.

Referenced by PRMAggregate(), PRMAggregate(), PRMAggregate(), ~PRMAggregate(), operator=(), and PRMClass< GUM_SCALAR >.

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

◆ PRMAggregate() [2/3]

template<GUM_Numeric GUM_SCALAR>
gum::prm::PRMAggregate< GUM_SCALAR >::PRMAggregate ( std::string_view name,
AggregateType aggType,
const PRMType & rvType,
Idx label )

Default constructor.

Parameters
nameThe name of this aggregate.
aggTypeThe aggregate type of this aggregate.
rvTypeThe random variable type of this aggregate, which is copied.
labelThe index of the label on which this aggregate applies.

Definition at line 81 of file PRMAggregate_tpl.h.

84 :
88 this->safeName_
90 this->_type_->variable().setName(name);
91 }
Idx label() const
Returns the label's index on which this aggregate applies.

References PRMAggregate(), gum::prm::PRMClassElement< GUM_SCALAR >::PRMClassElement(), _agg_type_, _label_, _type_, label(), gum::prm::PRMObject::LEFT_CAST(), gum::prm::PRMObject::name(), gum::prm::PRMObject::RIGHT_CAST(), and gum::prm::PRMClassElement< GUM_SCALAR >::safeName_.

Here is the call graph for this function:

◆ ~PRMAggregate()

template<GUM_Numeric GUM_SCALAR>
gum::prm::PRMAggregate< GUM_SCALAR >::~PRMAggregate ( )
override

Destructor.

Definition at line 94 of file PRMAggregate_tpl.h.

94 {
96 delete _type_;
97 }

References PRMAggregate(), and _type_.

Here is the call graph for this function:

◆ PRMAggregate() [3/3]

template<GUM_Numeric GUM_SCALAR>
gum::prm::PRMAggregate< GUM_SCALAR >::PRMAggregate ( const PRMAggregate< GUM_SCALAR > & source)
private

Copy constructor. Don't use it.

Definition at line 100 of file PRMAggregate_tpl.h.

100 :
103 GUM_ERROR(FatalError, "illegal call to gum::PRMAggregate copy constructor.")
104 }
#define GUM_ERROR(type, msg)
Definition exceptions.h:76

References PRMAggregate(), gum::prm::PRMClassElement< GUM_SCALAR >::PRMClassElement(), and GUM_ERROR.

Here is the call graph for this function:

Member Function Documentation

◆ addChild()

template<GUM_Numeric GUM_SCALAR>
void gum::prm::PRMAggregate< GUM_SCALAR >::addChild ( const PRMClassElement< GUM_SCALAR > & elt)
overridevirtual

See gum::PRMClassElement::addChild_().

Implements gum::prm::PRMClassElement< GUM_SCALAR >.

Definition at line 255 of file PRMAggregate_tpl.h.

255{}

References gum::prm::PRMClassElement< GUM_SCALAR >::PRMClassElement().

Here is the call graph for this function:

◆ addParent()

template<GUM_Numeric GUM_SCALAR>
void gum::prm::PRMAggregate< GUM_SCALAR >::addParent ( const PRMClassElement< GUM_SCALAR > & elt)
overridevirtual

See gum::PRMClassElement::addParent_().

Implements gum::prm::PRMClassElement< GUM_SCALAR >.

Definition at line 251 of file PRMAggregate_tpl.h.

251{}

References gum::prm::PRMClassElement< GUM_SCALAR >::PRMClassElement().

Here is the call graph for this function:

◆ agg_type()

template<GUM_Numeric GUM_SCALAR>
PRMAggregate< GUM_SCALAR >::AggregateType gum::prm::PRMAggregate< GUM_SCALAR >::agg_type ( ) const

Returns the aggregate of *this.

Definition at line 120 of file PRMAggregate_tpl.h.

120 {
121 return _agg_type_;
122 }

References _agg_type_.

Referenced by gum::prm::PRMFactory< GUM_SCALAR >::_addParent_(), gum::prm::PRMSlotChain< GUM_SCALAR >::_copyLastElt_(), buildImpl(), and isDecomposable().

Here is the caller graph for this function:

◆ buildImpl()

template<GUM_Numeric GUM_SCALAR>
MultiDimImplementation< GUM_SCALAR > * gum::prm::PRMAggregate< GUM_SCALAR >::buildImpl ( ) const

Returns a pointer over an empty gum::MultiDimImplementation of the good type for this PRMAggregate.

This should be use when manipulating instantiations of aggregates.

Definition at line 210 of file PRMAggregate_tpl.h.

210 {
211 switch (agg_type()) {
212 case AggregateType::MIN : {
214 }
215 case AggregateType::MAX : {
217 }
218 case AggregateType::OR : {
219 return new aggregator::Or< GUM_SCALAR >();
220 }
221 case AggregateType::AND : {
223 }
226 }
227 case AggregateType::MEDIAN : {
229 }
230 case AggregateType::EXISTS : {
232 }
233 case AggregateType::FORALL : {
235 }
236 case AggregateType::COUNT : {
238 }
239 case AggregateType::SUM : {
241 }
242 default : {
243 GUM_ERROR(OperationNotAllowed, "Unknown aggregator.")
244 }
245 }
246 return nullptr;
247 }
AggregateType agg_type() const
Returns the aggregate of *this.

References agg_type(), AMPLITUDE, AND, COUNT, EXISTS, FORALL, GUM_ERROR, label(), MAX, MEDIAN, MIN, OR, and SUM.

Referenced by gum::prm::PRMInstance< GUM_SCALAR >::_copyAggregates_(), and gum::prm::PRMFactory< GUM_SCALAR >::addAggregator().

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

◆ cast()

template<GUM_Numeric GUM_SCALAR>
std::string gum::prm::PRMClassElement< GUM_SCALAR >::cast ( const PRMType & t) const
virtualinherited

Returns the name of the cast descendant with PRMType t of this PRMClassElement.

Parameters
tThe type in which we want to cast this PRMClassElement.
Exceptions
OperationNotAllowedIf the cast is impossible.

Definition at line 93 of file PRMClassElement_tpl.h.

93 {
94 if (type().isSubTypeOf(t)) {
96 } else {
97 GUM_ERROR(OperationNotAllowed, "illegal cast")
98 }
99 }
Abstract class representing an element of PRM class.
virtual PRMType & type()=0
Return a reference over the gum::PRMType of this class element.

References GUM_ERROR, gum::prm::PRMObject::LEFT_CAST(), gum::prm::PRMObject::name(), gum::prm::PRMType::name(), gum::prm::PRMObject::RIGHT_CAST(), and type().

Referenced by gum::prm::PRMFactory< GUM_SCALAR >::addNoisyOrCompound(), gum::prm::PRMAggregate< GUM_SCALAR >::getCastDescendant(), gum::prm::PRMFormAttribute< GUM_SCALAR >::getCastDescendant(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::getCastDescendant(), gum::prm::PRMFormAttribute< GUM_SCALAR >::setAsCastDescendant(), and gum::prm::PRMScalarAttribute< GUM_SCALAR >::setAsCastDescendant().

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

◆ cpf() [1/2]

template<GUM_Numeric GUM_SCALAR>
Tensor< GUM_SCALAR > & gum::prm::PRMAggregate< GUM_SCALAR >::cpf ( )
virtual

Aggregates don't have Tensor until they are instantiated as PRMAttribute, so this will raise an OperationNotAllowed exception.

See gum::PRMClassElement::cpf().

Definition at line 200 of file PRMAggregate_tpl.h.

200 {
201 GUM_ERROR(OperationNotAllowed, "This is an aggregate.")
202 }

References GUM_ERROR.

◆ cpf() [2/2]

template<GUM_Numeric GUM_SCALAR>
const Tensor< GUM_SCALAR > & gum::prm::PRMAggregate< GUM_SCALAR >::cpf ( ) const
overridevirtual

Aggregates don't have Tensor until they are instantiated as PRMAttribute, so this will raise an OperationNotAllowed exception.

See gum::PRMClassElement::cpf().

Implements gum::prm::PRMClassElement< GUM_SCALAR >.

Definition at line 205 of file PRMAggregate_tpl.h.

205 {
206 GUM_ERROR(OperationNotAllowed, "This is an aggregate.")
207 }

References GUM_ERROR.

◆ elt_type()

template<GUM_Numeric GUM_SCALAR>
PRMClassElement< GUM_SCALAR >::ClassElementType gum::prm::PRMAggregate< GUM_SCALAR >::elt_type ( ) const
overridevirtual

See gum::PRMClassElement::elt_type().

Implements gum::prm::PRMClassElement< GUM_SCALAR >.

Definition at line 114 of file PRMAggregate_tpl.h.

114 {
115 return this->prm_aggregate;
116 }

References gum::prm::PRMClassElement< GUM_SCALAR >::prm_aggregate.

◆ enum2str() [1/2]

template<GUM_Numeric GUM_SCALAR>
std::string gum::prm::PRMClassElement< GUM_SCALAR >::enum2str ( ClassElementType type)
staticinherited

Returns true if obj_ptr is of type PRMReferenceSlot.

Definition at line 102 of file PRMClassElement_tpl.h.

102 {
103 switch (type) {
104 case prm_attribute : return "prm_attribute";
105
106 case prm_aggregate : return "prm_aggregate";
107
108 case prm_refslot : return "prm_refslot";
109
110 case prm_slotchain : return "prm_slotchain";
111
112 case prm_parameter : return "prm_parameter";
113
114 default : return "unknown";
115 }
116 }

References prm_aggregate, prm_attribute, prm_parameter, prm_refslot, prm_slotchain, and type().

Here is the call graph for this function:

◆ enum2str() [2/2]

INLINE std::string gum::prm::PRMObject::enum2str ( prm_type type)
staticinherited

Returns the string representation of a PRMObject.

Definition at line 75 of file PRMObject_inl.h.

75 {
76 switch (type) {
77 case prm_type::CLASS : return "PRMType::CLASS";
78
79 case prm_type::CLASS_ELT : return "PRMType::CLASS_ELT";
80
81 case prm_type::TYPE : return "PRMType::TYPE";
82
83 case prm_type::SYSTEM : return "PRMType::SYSTEM";
84
85 case prm_type::INSTANCE : return "PRMType::INSTANCE";
86
87 case prm_type::PRM_INTERFACE : return "PRMType::PRM_INTERFACE";
88
89 default : return "unknown";
90 }
91 }

References CLASS, CLASS_ELT, INSTANCE, PRM_INTERFACE, SYSTEM, and TYPE.

Referenced by gum::prm::operator<<().

Here is the caller graph for this function:

◆ getCastDescendant()

template<GUM_Numeric GUM_SCALAR>
PRMAttribute< GUM_SCALAR > * gum::prm::PRMAggregate< GUM_SCALAR >::getCastDescendant ( ) const
overridevirtual

See gum::PRMClassElement::elt_type().

Implements gum::prm::PRMClassElement< GUM_SCALAR >.

Definition at line 258 of file PRMAggregate_tpl.h.

258 {
259 if (!type().isSubType()) {
260 GUM_ERROR(OperationNotAllowed, "this PRMAggregate can not have cast descendant")
261 }
263
264 cast->addParent(*this);
266 DiscreteVariable& cast_var = cast->type().variable();
267 Instantiation inst(cast->cpf());
268
269 for (inst.setFirst(); !inst.end(); inst.inc()) {
270 if (type().label_map()[inst.val(my_var)] == inst.val(cast_var)) {
271 cast->cpf().set(inst, 1);
272 } else {
273 cast->cpf().set(inst, 0);
274 }
275 }
276
277 return cast;
278 }
PRMType & type() override
See gum::PRMClassElement::type().
virtual std::string cast(const PRMType &t) const
Returns the name of the cast descendant with PRMType t of this PRMClassElement.
DiscreteVariable & variable()
Return a reference on the DiscreteVariable contained in this.
Definition PRMType_inl.h:65

References gum::prm::PRMClassElement< GUM_SCALAR >::cast(), gum::Instantiation::end(), GUM_ERROR, gum::Instantiation::inc(), gum::prm::PRMObject::name(), gum::Instantiation::setFirst(), type(), and gum::Instantiation::val().

Here is the call graph for this function:

◆ hasLabel()

template<GUM_Numeric GUM_SCALAR>
bool gum::prm::PRMAggregate< GUM_SCALAR >::hasLabel ( ) const

Returns true if the label is defined.

Definition at line 146 of file PRMAggregate_tpl.h.

146 {
147 return *_label_ != INT_MAX;
148 }

References _label_.

Referenced by gum::prm::PRMFactory< GUM_SCALAR >::_addParent_().

Here is the caller graph for this function:

◆ id()

template<GUM_Numeric GUM_SCALAR>
NodeId gum::prm::PRMClassElement< GUM_SCALAR >::id ( ) const
inherited

Returns the NodeId of this element in it's class DAG.

Definition at line 73 of file PRMClassElement_tpl.h.

73 {
74 return _id_;
75 }
NodeId _id_
The node's id of this element.

References _id_.

Referenced by PRMClassElement(), gum::prm::PRMClass< GUM_SCALAR >::_addCastDescendants_(), gum::prm::PRMClass< GUM_SCALAR >::_addCastDescendants_(), gum::prm::PRMInterface< GUM_SCALAR >::_addCastDescendants_(), gum::prm::PRMClass< GUM_SCALAR >::_checkInterface_(), gum::prm::PRMClass< GUM_SCALAR >::_checkRefInterface_(), gum::prm::PRMInstance< GUM_SCALAR >::_copyAggregates_(), gum::prm::PRMInstance< GUM_SCALAR >::_copyAttribute_(), gum::prm::PRMSlotChain< GUM_SCALAR >::_copyLastElt_(), gum::prm::SVE< GUM_SCALAR >::_getAggTensor_(), gum::prm::PRMSystem< GUM_SCALAR >::_groundRef_(), gum::prm::PRMClass< GUM_SCALAR >::_inheritClass_(), gum::prm::ClassBayesNet< GUM_SCALAR >::_init_(), gum::prm::InstanceBayesNet< GUM_SCALAR >::_init_(), gum::prm::PRMInstance< GUM_SCALAR >::_instantiateSlotChain_(), gum::prm::PRMClass< GUM_SCALAR >::_overloadAttribute_(), gum::prm::PRMInterface< GUM_SCALAR >::_overloadAttribute_(), gum::prm::PRMClass< GUM_SCALAR >::_overloadParameter_(), gum::prm::PRMClass< GUM_SCALAR >::_overloadReference_(), gum::prm::PRMInterface< GUM_SCALAR >::_overloadReferenceSlot_(), gum::prm::PRMClass< GUM_SCALAR >::add(), gum::prm::PRMInterface< GUM_SCALAR >::add(), gum::prm::PRMClass< GUM_SCALAR >::addArc(), gum::prm::PRMClass< GUM_SCALAR >::inheritAggregates(), gum::prm::PRMClass< GUM_SCALAR >::overload(), gum::prm::PRMInterface< GUM_SCALAR >::overload(), gum::prm::SVE< GUM_SCALAR >::posterior_(), gum::prm::SVED< GUM_SCALAR >::posterior_(), setId(), and gum::prm::PRMFactory< GUM_SCALAR >::startAttribute().

◆ isAggregate()

template<GUM_Numeric GUM_SCALAR>
bool gum::prm::PRMClassElement< GUM_SCALAR >::isAggregate ( const PRMClassElement< GUM_SCALAR > & elt)
staticinherited

Return true if obj is of type PRMAggregate.

Definition at line 129 of file PRMClassElement_tpl.h.

129 {
130 return elt.elt_type() == prm_aggregate;
131 }
virtual ClassElementType elt_type() const =0
Return the type of class element this object is.

References PRMClassElement(), elt_type(), and prm_aggregate.

Referenced by gum::prm::StructuredInference< GUM_SCALAR >::CData::CData(), gum::prm::PRMClass< GUM_SCALAR >::_checkInterface_(), gum::prm::o3prm::O3ClassFactory< GUM_SCALAR >::_checkLocalParent_(), gum::prm::ClassBayesNet< GUM_SCALAR >::_init_(), gum::prm::SVE< GUM_SCALAR >::_initLiftedNodes_(), gum::prm::SVED< GUM_SCALAR >::_initLiftedNodes_(), gum::prm::PRMClass< GUM_SCALAR >::completeInheritance(), gum::prm::PRMFactory< GUM_SCALAR >::continueAggregator(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::setInputNode(), and gum::prm::PRMClassElementContainer< GUM_SCALAR >::setOutputNode().

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

◆ isAttribute()

◆ isClass()

INLINE bool gum::prm::PRMObject::isClass ( const PRMObject & obj)
staticinherited

Returns true if obj_ptr is of type Class.

Definition at line 93 of file PRMObject_inl.h.

93 {
94 return obj.obj_type() == prm_type::CLASS;
95 }

References PRMObject().

Referenced by gum::prm::PRMClass< GUM_SCALAR >::scope(), and gum::prm::PRMFactory< GUM_SCALAR >::startAttribute().

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

◆ isDecomposable()

template<GUM_Numeric GUM_SCALAR>
bool gum::prm::PRMAggregate< GUM_SCALAR >::isDecomposable ( ) const

Returns true if the aggregator is decomposable.

Definition at line 151 of file PRMAggregate_tpl.h.

151 {
152 switch (agg_type()) {
153 case AggregateType::MIN : {
155 }
156 case AggregateType::MAX : {
158 }
159 case AggregateType::OR : {
161 }
162 case AggregateType::AND : {
164 }
167 }
168 case AggregateType::MEDIAN : {
170 }
171 case AggregateType::EXISTS : {
173 }
174 case AggregateType::FORALL : {
176 }
177 case AggregateType::COUNT : {
179 }
180 case AggregateType::SUM : {
182 }
183 default : {
184 GUM_ERROR(OperationNotAllowed, "Unknown aggregator.")
185 }
186 }
187 }
bool isDecomposable() const
Returns true if the aggregator is decomposable.

References agg_type(), AMPLITUDE, AND, COUNT, EXISTS, FORALL, GUM_ERROR, gum::aggregator::MultiDimAggregator< GUM_ELEMENT >::isDecomposable(), label(), MAX, MEDIAN, MIN, OR, and SUM.

Here is the call graph for this function:

◆ isInstance()

INLINE bool gum::prm::PRMObject::isInstance ( const PRMObject & obj)
staticinherited

Returns true if obj_ptr is of type PRMInstance.

Definition at line 101 of file PRMObject_inl.h.

101 {
102 return obj.obj_type() == prm_type::INSTANCE;
103 }

References PRMObject(), INSTANCE, and obj_type().

Here is the call graph for this function:

◆ isInterface()

INLINE bool gum::prm::PRMObject::isInterface ( const PRMObject & obj)
staticinherited

Returns true if obj_ptr is of type PRMInterface.

Definition at line 97 of file PRMObject_inl.h.

97 {
98 return obj.obj_type() == prm_type::PRM_INTERFACE;
99 }

◆ isParameter()

template<GUM_Numeric GUM_SCALAR>
bool gum::prm::PRMClassElement< GUM_SCALAR >::isParameter ( const PRMClassElement< GUM_SCALAR > & elt)
staticinherited

Return true if obj is of type PRMParameter.

Definition at line 139 of file PRMClassElement_tpl.h.

139 {
140 return elt.elt_type() == prm_parameter;
141 }

References PRMClassElement(), elt_type(), and prm_parameter.

Referenced by gum::prm::o3prm::O3SystemFactory< GUM_SCALAR >::_checkParameters_(), and gum::prm::PRMClass< GUM_SCALAR >::add().

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

◆ isReferenceSlot()

template<GUM_Numeric GUM_SCALAR>
bool gum::prm::PRMClassElement< GUM_SCALAR >::isReferenceSlot ( const PRMClassElement< GUM_SCALAR > & elt)
staticinherited

Returns true if obj_ptr is of type PRMReferenceSlot.

Definition at line 119 of file PRMClassElement_tpl.h.

119 {
120 return elt.elt_type() == prm_refslot;
121 }

References PRMClassElement(), elt_type(), and prm_refslot.

Referenced by gum::prm::o3prm::O3SystemFactory< GUM_SCALAR >::_checkAssignments_(), gum::prm::o3prm::O3SystemFactory< GUM_SCALAR >::_checkIncrements_(), gum::prm::o3prm::O3InterfaceFactory< GUM_SCALAR >::_checkOverloadLegality_(), gum::prm::o3prm::O3ClassFactory< GUM_SCALAR >::_checkReferenceSlot_(), gum::prm::PRMInterface< GUM_SCALAR >::add(), and gum::prm::PRMFactory< GUM_SCALAR >::setReferenceSlot().

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

◆ isSlotChain()

template<GUM_Numeric GUM_SCALAR>
bool gum::prm::PRMClassElement< GUM_SCALAR >::isSlotChain ( const PRMClassElement< GUM_SCALAR > & elt)
staticinherited

Return true if obj is of type PRMSlotChain.

Definition at line 134 of file PRMClassElement_tpl.h.

134 {
135 return elt.elt_type() == prm_slotchain;
136 }

References PRMClassElement(), elt_type(), and prm_slotchain.

Referenced by gum::prm::o3prm::O3ClassFactory< GUM_SCALAR >::_checkLocalParent_(), gum::prm::PRMFactory< GUM_SCALAR >::_retrieveInputs_(), gum::prm::PRMClass< GUM_SCALAR >::add(), and gum::prm::PRMFactory< GUM_SCALAR >::addNoisyOrCompound().

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

◆ label()

template<GUM_Numeric GUM_SCALAR>
Idx gum::prm::PRMAggregate< GUM_SCALAR >::label ( ) const

Returns the label's index on which this aggregate applies.

Exceptions
OperationNotAllowedRaised if the aggregate does not applies on a label.

Definition at line 125 of file PRMAggregate_tpl.h.

125 {
126 if (*_label_ != INT_MAX) return *_label_;
127 GUM_ERROR(OperationNotAllowed, "no label defined for this aggregate")
128 }

References _label_, and GUM_ERROR.

Referenced by PRMAggregate(), gum::prm::PRMFactory< GUM_SCALAR >::addAggregator(), buildImpl(), isDecomposable(), and sharedLabel().

Here is the caller graph for this function:

◆ labelValue()

template<GUM_Numeric GUM_SCALAR>
const std::string & gum::prm::PRMAggregate< GUM_SCALAR >::labelValue ( ) const

See gum::PRMClassElement::elt_type().

Definition at line 131 of file PRMAggregate_tpl.h.

131 {
132 return _label_value_;
133 }
std::string _label_value_
The AggregateType of this aggregate.

References _label_value_.

Referenced by gum::prm::PRMFactory< GUM_SCALAR >::_addParent_().

Here is the caller graph for this function:

◆ LEFT_CAST()

INLINE std::string gum::prm::PRMObject::LEFT_CAST ( )
staticinherited

Enumeration of the different types of objects handled by a PRM.

The "all" type is used to tell that we want any kind of PRMType (useful with iterators for example). No PRMObject will ever have "all" as type.

Definition at line 71 of file PRMObject_inl.h.

71{ return "("; }

Referenced by gum::prm::PRMAggregate< GUM_SCALAR >::PRMAggregate(), gum::prm::PRMAggregate< GUM_SCALAR >::PRMAggregate(), gum::prm::PRMFormAttribute< GUM_SCALAR >::PRMFormAttribute(), gum::prm::PRMReferenceSlot< GUM_SCALAR >::PRMReferenceSlot(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::PRMScalarAttribute(), gum::prm::PRMSlotChain< GUM_SCALAR >::PRMSlotChain(), gum::prm::PRMClassElement< GUM_SCALAR >::cast(), and gum::prm::decomposePath().

Here is the caller graph for this function:

◆ name() [1/2]

INLINE const std::string & gum::prm::PRMObject::name ( ) const
inherited

Returns the name of this object.

Definition at line 57 of file PRMObject_inl.h.

57{ return _name_; }
std::string _name_
Definition PRMObject.h:193

References _name_.

Referenced by gum::prm::PRMAggregate< GUM_SCALAR >::PRMAggregate(), gum::prm::PRMAggregate< GUM_SCALAR >::PRMAggregate(), gum::prm::PRMAttribute< GUM_SCALAR >::PRMAttribute(), gum::prm::PRMClass< GUM_SCALAR >::PRMClass(), gum::prm::PRMClass< GUM_SCALAR >::PRMClass(), gum::prm::PRMClass< GUM_SCALAR >::PRMClass(), gum::prm::PRMClass< GUM_SCALAR >::PRMClass(), gum::prm::PRMClassElement< GUM_SCALAR >::PRMClassElement(), gum::prm::PRMClassElement< GUM_SCALAR >::PRMClassElement(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::PRMClassElementContainer(), gum::prm::PRMFormAttribute< GUM_SCALAR >::PRMFormAttribute(), gum::prm::PRMFormAttribute< GUM_SCALAR >::PRMFormAttribute(), gum::prm::PRMFuncAttribute< GUM_SCALAR >::PRMFuncAttribute(), gum::prm::PRMInstance< GUM_SCALAR >::PRMInstance(), gum::prm::PRMInterface< GUM_SCALAR >::PRMInterface(), gum::prm::PRMInterface< GUM_SCALAR >::PRMInterface(), gum::prm::PRMInterface< GUM_SCALAR >::PRMInterface(), PRMObject(), gum::prm::PRMParameter< GUM_SCALAR >::PRMParameter(), gum::prm::PRMParameter< GUM_SCALAR >::PRMParameter(), gum::prm::PRMReferenceSlot< GUM_SCALAR >::PRMReferenceSlot(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::PRMScalarAttribute(), gum::prm::PRMSlotChain< GUM_SCALAR >::PRMSlotChain(), gum::prm::PRMSlotChain< GUM_SCALAR >::PRMSlotChain(), gum::prm::PRMSlotChain< GUM_SCALAR >::PRMSlotChain(), gum::prm::PRMSystem< GUM_SCALAR >::PRMSystem(), gum::prm::__print_attribute__(), gum::prm::__print_instance__(), gum::prm::SVE< GUM_SCALAR >::_addDelayedVariable_(), gum::prm::PRMClass< GUM_SCALAR >::_addIOInterfaceFlags_(), gum::prm::PRMFactory< GUM_SCALAR >::_addParent_(), gum::prm::PRMInstance< GUM_SCALAR >::_addReferingInstance_(), gum::prm::PRMClass< GUM_SCALAR >::_checkInterface_(), gum::prm::PRMFactory< GUM_SCALAR >::_checkInterfaceImplementation_(), gum::prm::PRMClass< GUM_SCALAR >::_checkInterfaces_(), gum::prm::o3prm::O3ClassFactory< GUM_SCALAR >::_checkRawCPT_(), gum::prm::PRMClass< GUM_SCALAR >::_checkRefInterface_(), gum::prm::PRMClass< GUM_SCALAR >::_checkRefInterfaces_(), gum::prm::o3prm::O3ClassFactory< GUM_SCALAR >::_checkRuleCPTSumsTo1_(), gum::prm::PRMInstance< GUM_SCALAR >::_copyAggregates_(), gum::prm::PRMInstance< GUM_SCALAR >::_copyAttribute_(), gum::prm::PRMSlotChain< GUM_SCALAR >::_copyLastElt_(), gum::prm::PRMSystem< GUM_SCALAR >::_groundAgg_(), gum::prm::PRMSystem< GUM_SCALAR >::_groundRef_(), gum::prm::PRMSystem< GUM_SCALAR >::_groundTensor_(), gum::prm::PRMSystem< double >::_groundTensor_(), gum::prm::PRMClass< GUM_SCALAR >::_inheritClass_(), gum::prm::PRMClass< GUM_SCALAR >::_overloadAttribute_(), gum::prm::PRMInterface< GUM_SCALAR >::_overloadAttribute_(), gum::prm::PRMClass< GUM_SCALAR >::_overloadParameter_(), gum::prm::PRMClass< GUM_SCALAR >::_overloadReference_(), gum::prm::PRMInterface< GUM_SCALAR >::_overloadReferenceSlot_(), gum::prm::gspan::StrictSearch< GUM_SCALAR >::_str_(), gum::prm::gspan::StrictSearch< GUM_SCALAR >::_str_(), gum::prm::gspan::StrictSearch< GUM_SCALAR >::_str_(), gum::prm::StructuredInference< GUM_SCALAR >::_str_(), gum::prm::StructuredInference< GUM_SCALAR >::_str_(), gum::prm::StructuredInference< GUM_SCALAR >::_str_(), gum::prm::PRMClass< GUM_SCALAR >::add(), gum::prm::PRMInterface< GUM_SCALAR >::add(), gum::prm::PRMSystem< GUM_SCALAR >::add(), gum::prm::PRMFactory< GUM_SCALAR >::addAggregator(), gum::prm::PRMFormAttribute< GUM_SCALAR >::addParent(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::addParent(), gum::prm::PRMClassElement< GUM_SCALAR >::cast(), gum::prm::PRMClass< GUM_SCALAR >::completeInheritance(), gum::prm::PRMFormAttribute< GUM_SCALAR >::copy(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::copy(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::exists(), gum::prm::PRMInstance< GUM_SCALAR >::exists(), gum::prm::PRMSystem< GUM_SCALAR >::exists(), gum::prm::o3prmr::O3prmrInterpreter::findAttributeName(), gum::prm::o3prmr::O3prmrInterpreter::findInstanceName(), gum::prm::PRMClass< GUM_SCALAR >::get(), gum::prm::PRMClass< GUM_SCALAR >::get(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::get(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::get(), gum::prm::PRMInstance< GUM_SCALAR >::get(), gum::prm::PRMInstance< GUM_SCALAR >::get(), gum::prm::PRMInterface< GUM_SCALAR >::get(), gum::prm::PRMInterface< GUM_SCALAR >::get(), gum::prm::PRMSystem< GUM_SCALAR >::get(), gum::prm::PRMSystem< GUM_SCALAR >::get(), gum::prm::PRMSystem< GUM_SCALAR >::getArray(), gum::prm::PRMSystem< GUM_SCALAR >::getArrayType(), gum::prm::PRMSystem< GUM_SCALAR >::getArrayType(), gum::prm::PRMAggregate< GUM_SCALAR >::getCastDescendant(), gum::prm::PRMFormAttribute< GUM_SCALAR >::getCastDescendant(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::getCastDescendant(), gum::prm::PRMSystem< GUM_SCALAR >::groundedBN(), gum::prm::PRMClass< GUM_SCALAR >::inheritAggregates(), gum::prm::PRMSystem< GUM_SCALAR >::isArray(), gum::prm::PRMClass< GUM_SCALAR >::isCastDescendant(), gum::prm::PRMSystem< GUM_SCALAR >::isInstance(), name(), gum::prm::PRMType::name(), gum::prm::PRMFormAttribute< GUM_SCALAR >::newFactory(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::newFactory(), operator!=(), operator<<(), gum::prm::PRMClass< GUM_SCALAR >::operator=(), operator==(), gum::prm::PRMType::operator==(), gum::prm::PRMClass< GUM_SCALAR >::operator[](), gum::prm::PRMClass< GUM_SCALAR >::operator[](), gum::prm::PRMClassElementContainer< GUM_SCALAR >::operator[](), gum::prm::PRMClassElementContainer< GUM_SCALAR >::operator[](), gum::prm::PRMInterface< GUM_SCALAR >::operator[](), gum::prm::PRMInterface< GUM_SCALAR >::operator[](), gum::prm::PRMClass< GUM_SCALAR >::overload(), gum::prm::PRMInterface< GUM_SCALAR >::overload(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::PRMClassElementContainterConstIterator, gum::prm::PRMFormAttribute< GUM_SCALAR >::setAsCastDescendant(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::setAsCastDescendant(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::setInputNode(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::setOutputNode(), gum::prm::PRMFactory< GUM_SCALAR >::startClass(), gum::prm::PRMFactory< GUM_SCALAR >::startInterface(), and gum::prm::PRMFactory< GUM_SCALAR >::startSystem().

◆ name() [2/2]

INLINE void gum::prm::PRMObject::name ( std::string_view name)
inherited

Change the name of the PRM Object.

Warning
Don't do this unless you know what you are doing !

Definition at line 61 of file PRMObject_inl.h.

61{ _name_ = name; }

References _name_, and name().

Here is the call graph for this function:

◆ obj_type()

template<GUM_Numeric GUM_SCALAR>
PRMObject::prm_type gum::prm::PRMClassElement< GUM_SCALAR >::obj_type ( ) const
overridevirtualinherited
See also
gum::PRMObject::obj_type().

Implements gum::prm::PRMObject.

Definition at line 78 of file PRMClassElement_tpl.h.

78 {
80 }

References gum::prm::PRMObject::CLASS_ELT.

◆ operator!=()

INLINE bool gum::prm::PRMObject::operator!= ( const PRMObject & obj) const
inherited

To PRMObject are equal if they have the same name (which is unique).

Definition at line 69 of file PRMObject_inl.h.

69{ return _name_ != obj.name(); }

References PRMObject(), _name_, and name().

Here is the call graph for this function:

◆ operator=()

template<GUM_Numeric GUM_SCALAR>
PRMAggregate< GUM_SCALAR > & gum::prm::PRMAggregate< GUM_SCALAR >::operator= ( const PRMAggregate< GUM_SCALAR > & source)
private

Copy operator. Don't use it.

Definition at line 108 of file PRMAggregate_tpl.h.

108 {
109 GUM_ERROR(FatalError, "illegal call to gum::PRMAggregate copy operator.")
110 }

References PRMAggregate(), and GUM_ERROR.

Here is the call graph for this function:

◆ operator==()

INLINE bool gum::prm::PRMObject::operator== ( const PRMObject & obj) const
inherited

To PRMObject are equal if they have the same name (which is unique).

Definition at line 65 of file PRMObject_inl.h.

65{ return _name_ == obj.name(); }

References PRMObject(), _name_, and name().

Here is the call graph for this function:

◆ RIGHT_CAST()

INLINE std::string gum::prm::PRMObject::RIGHT_CAST ( )
staticinherited

Enumeration of the different types of objects handled by a PRM.

The "all" type is used to tell that we want any kind of PRMType (useful with iterators for example). No PRMObject will ever have "all" as type.

Definition at line 73 of file PRMObject_inl.h.

73{ return ")"; }

Referenced by gum::prm::PRMAggregate< GUM_SCALAR >::PRMAggregate(), gum::prm::PRMAggregate< GUM_SCALAR >::PRMAggregate(), gum::prm::PRMFormAttribute< GUM_SCALAR >::PRMFormAttribute(), gum::prm::PRMReferenceSlot< GUM_SCALAR >::PRMReferenceSlot(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::PRMScalarAttribute(), gum::prm::PRMSlotChain< GUM_SCALAR >::PRMSlotChain(), gum::prm::PRMClassElement< GUM_SCALAR >::cast(), and gum::prm::decomposePath().

Here is the caller graph for this function:

◆ safeName()

template<GUM_Numeric GUM_SCALAR>
const std::string & gum::prm::PRMClassElement< GUM_SCALAR >::safeName ( ) const
inherited

Returns the safe name of this PRMClassElement, if any.

This will only work if this PRMClassElement is an PRMAttribute or an PRMAggregate.

Returns
Returns the safe name of this PRMClassElement.
Exceptions
NotFound&Raised if this PRMClassElement does not have any safe name.

Definition at line 88 of file PRMClassElement_tpl.h.

88 {
89 return safeName_;
90 }

References safeName_.

Referenced by gum::prm::__print_attribute__(), gum::prm::PRMClass< GUM_SCALAR >::_addCastDescendants_(), gum::prm::PRMClass< GUM_SCALAR >::_addCastDescendants_(), gum::prm::PRMInterface< GUM_SCALAR >::_addCastDescendants_(), gum::prm::PRMFactory< GUM_SCALAR >::_addParent_(), gum::prm::PRMInstance< GUM_SCALAR >::_copyAttributeCPF_(), gum::prm::SVED< GUM_SCALAR >::_getAggTensor_(), gum::prm::PRMSystem< GUM_SCALAR >::_groundRef_(), gum::prm::PRMSystem< GUM_SCALAR >::_groundTensor_(), gum::prm::PRMClass< GUM_SCALAR >::_inheritClass_(), gum::prm::PRMClass< GUM_SCALAR >::_overloadAggregate_(), gum::prm::PRMClass< GUM_SCALAR >::_overloadAttribute_(), gum::prm::PRMInterface< GUM_SCALAR >::_overloadAttribute_(), gum::prm::PRMClass< GUM_SCALAR >::_overloadParameter_(), gum::prm::PRMClass< GUM_SCALAR >::_overloadReference_(), gum::prm::PRMInterface< GUM_SCALAR >::_overloadReferenceSlot_(), gum::prm::gspan::StrictSearch< GUM_SCALAR >::_str_(), gum::prm::gspan::StrictSearch< GUM_SCALAR >::_str_(), gum::prm::StructuredInference< GUM_SCALAR >::_str_(), gum::prm::StructuredInference< GUM_SCALAR >::_str_(), gum::prm::PRMClass< GUM_SCALAR >::add(), gum::prm::PRMInterface< GUM_SCALAR >::add(), gum::prm::PRMFactory< GUM_SCALAR >::addAggregator(), gum::prm::PRMFactory< GUM_SCALAR >::addAttribute(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::belongsTo(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::getIOFlag_(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::getIOFlag_(), gum::prm::PRMClass< GUM_SCALAR >::inheritAggregates(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::isInnerNode(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::isInputNode(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::setInputNode(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::setIOFlag_(), and gum::prm::PRMClassElementContainer< GUM_SCALAR >::setOutputNode().

◆ setId()

template<GUM_Numeric GUM_SCALAR>
void gum::prm::PRMClassElement< GUM_SCALAR >::setId ( NodeId id)
virtualinherited

◆ setLabel() [1/2]

template<GUM_Numeric GUM_SCALAR>
void gum::prm::PRMAggregate< GUM_SCALAR >::setLabel ( Idx idx)

Set the aggregator's label.

Definition at line 136 of file PRMAggregate_tpl.h.

136 {
137 (*_label_) = idx;
138 }

Referenced by gum::prm::PRMFactory< GUM_SCALAR >::_addParent_(), and gum::prm::PRMClass< GUM_SCALAR >::inheritAggregates().

Here is the caller graph for this function:

◆ setLabel() [2/2]

template<GUM_Numeric GUM_SCALAR>
void gum::prm::PRMAggregate< GUM_SCALAR >::setLabel ( std::string_view label)

See gum::PRMClassElement::elt_type().

Definition at line 141 of file PRMAggregate_tpl.h.

141 {
143 }

References _label_value_.

◆ sharedLabel() [1/2]

template<GUM_Numeric GUM_SCALAR>
std::shared_ptr< Idx > gum::prm::PRMAggregate< GUM_SCALAR >::sharedLabel ( ) const

Returns the shared_ptr holding this Aggregate label.

This is used for inherited Aggregates to share labels in O3PRM.

Definition at line 281 of file PRMAggregate_tpl.h.

281 {
282 return _label_;
283 }

References _label_.

Referenced by gum::prm::PRMClass< GUM_SCALAR >::inheritAggregates().

Here is the caller graph for this function:

◆ sharedLabel() [2/2]

template<GUM_Numeric GUM_SCALAR>
void gum::prm::PRMAggregate< GUM_SCALAR >::sharedLabel ( std::shared_ptr< Idx > label)

Sets the shared_ptr of this Aggregate.

This is used for inherited aggregates to share labels in O3PRM.

Definition at line 286 of file PRMAggregate_tpl.h.

286 {
287 this->_label_ = label;
288 }

References _label_, and label().

Here is the call graph for this function:

◆ str2enum()

template<GUM_Numeric GUM_SCALAR>
PRMAggregate< GUM_SCALAR >::AggregateType gum::prm::PRMAggregate< GUM_SCALAR >::str2enum ( std::string_view str)
static

Static method which returns the AggregateType given its string representation.

We suppose that str is given either entirely in lower case or upper case. It will also match if only the first letter is in upper case.

Exceptions
RaiseNotFound exception if no matches is found.

Definition at line 292 of file PRMAggregate_tpl.h.

292 {
293 const auto strLower = toLower(str);
294 if (strLower == "min") {
295 return AggregateType::MIN;
296 } else if (strLower == "max") {
297 return AggregateType::MAX;
298 } else if (strLower == "count") {
300 } else if (strLower == "exists") {
302 } else if (strLower == "or") {
303 return AggregateType::OR;
304 } else if (strLower == "and") {
305 return AggregateType::AND;
306 } else if (strLower == "forall") {
308 } else if (strLower == "amplitude") {
310 } else if (strLower == "median") {
312 } else if (strLower == "sum") {
313 return AggregateType::SUM;
314 } else {
315 std::string msg = "Unknown aggregate: ";
316 msg.append(str);
318 }
319 }
std::string toLower(std::string_view str)
Returns the lowercase version of str.

References AMPLITUDE, AND, COUNT, EXISTS, FORALL, GUM_ERROR, MAX, MEDIAN, MIN, OR, SUM, and gum::toLower().

Referenced by gum::prm::o3prm::O3ClassFactory< GUM_SCALAR >::_checkAggParameters_(), gum::prm::PRMFactory< GUM_SCALAR >::addAggregator(), and gum::prm::PRMFactory< GUM_SCALAR >::startAggregator().

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

◆ type() [1/2]

template<GUM_Numeric GUM_SCALAR>
const PRMType & gum::prm::PRMAggregate< GUM_SCALAR >::type ( ) const
overridevirtual

See gum::PRMClassElement::type().

Implements gum::prm::PRMClassElement< GUM_SCALAR >.

Definition at line 195 of file PRMAggregate_tpl.h.

195 {
196 return *_type_;
197 }

References _type_.

◆ type() [2/2]

template<GUM_Numeric GUM_SCALAR>
PRMType & gum::prm::PRMAggregate< GUM_SCALAR >::type ( )
overridevirtual

See gum::PRMClassElement::type().

Implements gum::prm::PRMClassElement< GUM_SCALAR >.

Definition at line 190 of file PRMAggregate_tpl.h.

190 {
191 return *_type_;
192 }

References _type_.

Referenced by gum::prm::PRMInstance< GUM_SCALAR >::_copyAggregates_(), gum::prm::PRMSlotChain< GUM_SCALAR >::_copyLastElt_(), gum::prm::PRMClass< GUM_SCALAR >::_inheritClass_(), gum::prm::PRMFactory< GUM_SCALAR >::addAggregator(), getCastDescendant(), and gum::prm::PRMClass< GUM_SCALAR >::inheritAggregates().

Here is the caller graph for this function:

◆ PRMClass< GUM_SCALAR >

template<GUM_Numeric GUM_SCALAR>
friend class PRMClass< GUM_SCALAR >
friend

Definition at line 268 of file PRMAggregate.h.

References PRMAggregate().

Member Data Documentation

◆ _agg_type_

template<GUM_Numeric GUM_SCALAR>
AggregateType gum::prm::PRMAggregate< GUM_SCALAR >::_agg_type_
private

The AggregateType of this aggregate.

Definition at line 250 of file PRMAggregate.h.

Referenced by PRMAggregate(), PRMAggregate(), and agg_type().

◆ _id_

template<GUM_Numeric GUM_SCALAR>
NodeId gum::prm::PRMClassElement< GUM_SCALAR >::_id_
privateinherited

The node's id of this element.

Definition at line 254 of file PRMClassElement.h.

Referenced by PRMClassElement(), id(), and setId().

◆ _label_

template<GUM_Numeric GUM_SCALAR>
std::shared_ptr< Idx > gum::prm::PRMAggregate< GUM_SCALAR >::_label_
private

Some aggregators applies only on a given label. This attribute must have the concerned Idx. If not initialized the pointer equals 0. It is deleted with the aggregate.

Definition at line 259 of file PRMAggregate.h.

Referenced by PRMAggregate(), PRMAggregate(), hasLabel(), label(), sharedLabel(), and sharedLabel().

◆ _label_value_

template<GUM_Numeric GUM_SCALAR>
std::string gum::prm::PRMAggregate< GUM_SCALAR >::_label_value_
private

The AggregateType of this aggregate.

Definition at line 261 of file PRMAggregate.h.

Referenced by labelValue(), and setLabel().

◆ _name_

std::string gum::prm::PRMObject::_name_
privateinherited

Definition at line 193 of file PRMObject.h.

Referenced by PRMObject(), PRMObject(), PRMObject(), name(), name(), operator!=(), operator=(), and operator==().

◆ _type_

template<GUM_Numeric GUM_SCALAR>
PRMType* gum::prm::PRMAggregate< GUM_SCALAR >::_type_
private

The random variable type of this aggregate It is deleted with the aggregate.

Definition at line 254 of file PRMAggregate.h.

Referenced by PRMAggregate(), PRMAggregate(), ~PRMAggregate(), type(), and type().

◆ safeName_


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