57 template < GUM_Numeric GUM_SCALAR >
64 template < GUM_Numeric GUM_SCALAR >
70 template < GUM_Numeric GUM_SCALAR >
75 template < GUM_Numeric GUM_SCALAR >
81 template < GUM_Numeric GUM_SCALAR >
88 template < GUM_Numeric GUM_SCALAR >
96 template < GUM_Numeric GUM_SCALAR >
114 template < GUM_Numeric GUM_SCALAR >
131 "given ClassElement<GUM_SCALAR> is not an "
132 "PRMAttribute or an PRMAggregate");
136 template < GUM_Numeric GUM_SCALAR >
141 return !(p->first || p->second);
144 template < GUM_Numeric GUM_SCALAR >
150 template < GUM_Numeric GUM_SCALAR >
154 if (!p)
GUM_ERROR(
NotFound,
"this ClassElement<GUM_SCALAR> does not have any IO flags")
158 template < GUM_Numeric GUM_SCALAR >
162 if (!p)
GUM_ERROR(
NotFound,
"this ClassElement<GUM_SCALAR> does not have any IO flags")
166 template < GUM_Numeric GUM_SCALAR >
169 const std::pair< bool, bool >& flags) {
177 template < GUM_Numeric GUM_SCALAR >
182 template < GUM_Numeric GUM_SCALAR >
187 }
catch (
NotFound const&) {
return false; }
190 template < GUM_Numeric GUM_SCALAR >
195 }
catch (
NotFound const&) {
return false; }
198 template < GUM_Numeric GUM_SCALAR >
206template < gum::GUM_Numeric GUM_SCALAR >
209 std::string tab =
" ";
210 output <<
"digraph \"" << container.
name() <<
"\" {" << std::endl;
215 output << tab <<
"\"" << container.
get(node).name() <<
"\" -> "
216 <<
"\"" << container.
get(chi).name() <<
"\";" << std::endl;
219 output << tab <<
"\"" << container.
get(node).name() <<
"\";" << std::endl;
223 output <<
"}" << std::endl;
Headers of gum::prm::PRMClassElementContainer.
std::ostream & operator<<(std::ostream &output, const gum::prm::PRMClassElementContainer< GUM_SCALAR > &container)
An << operator for PRMClassElementContainer. Output in the graphviz-dot format.
Headers of gum::PRMClassElement.
const NodeSet & parents(NodeId id) const
returns the set of nodes with arc ingoing to a given node
NodeSet children(const NodeSet &ids) const
returns the set of nodes which consists in the node and its parents returns the set of children of a ...
Exception : fatal (unknown ?) error.
const NodeGraphPart & nodes() const
return *this as a NodeGraphPart
Exception : the element we looked for cannot be found.
Size size() const noexcept
Returns the number of elements in the set.
Exception: wrong PRMClassElement for this operation.
<agrum/PRM/classElementContainer.h>
PRMClassElementContainer(std::string_view name)
Default constructor.
virtual bool isSuperTypeOf(const PRMClassElementContainer< GUM_SCALAR > &cec) const
Test if this PRMClassElementContainer is a super type of cec.
virtual const DAG & containerDag() const
Returns the gum::DAG of this PRMClassElementContainer.
virtual void copyIOFlags_(const PRMClassElementContainer< GUM_SCALAR > &c)
Copy the IO Flags of c in this PRMClassElementContainer.
virtual std::pair< bool, bool > & getIOFlag_(const PRMClassElement< GUM_SCALAR > &elt)
Returns the IO flags of a PRMClassElement<GUM_SCALAR>.
virtual bool exists(std::string_view name) const
Returns true if a member with the given name exists in this PRMClassElementContainer or in the PRMCla...
virtual void updateDescendants_(const PRMClassElement< GUM_SCALAR > &elt)=0
When a PRMClassElement<GUM_SCALAR> becomes an Output node we must update any the IO flags of every de...
HashTable< std::string, std::pair< bool, bool > > _IOFlags_
input / output flags, useful when inheriting or copying.
virtual bool isSubTypeOf(const PRMClassElementContainer< GUM_SCALAR > &cec) const =0
Test if this PRMClassElementContainer is a subtype of cec.
virtual void setIOFlag_(const PRMClassElement< GUM_SCALAR > &elt, const std::pair< bool, bool > &flags)
Defines the IO flags of a PRMClassElement<GUM_SCALAR>.
~PRMClassElementContainer() override
Destructor.
virtual bool isInputNode(const PRMClassElement< GUM_SCALAR > &elt) const
Returns true if the node is an input node.
virtual bool isInnerNode(const PRMClassElement< GUM_SCALAR > &elt) const
Returns true if the node is an inner node.
virtual void setInputNode(const PRMClassElement< GUM_SCALAR > &elt, bool b)
Set the input flag value of id at b.
PRMClassElementContainer< GUM_SCALAR > & operator=(const PRMClassElementContainer< GUM_SCALAR > &source)
Copy operator. Don't use it.
virtual void setOutputNode(const PRMClassElement< GUM_SCALAR > &elt, bool b)
Set the output flag value of id at b.
virtual bool belongsTo(const PRMClassElement< GUM_SCALAR > &elt) const
Returns true if elt belongs to this PRMClassElementContainer.
virtual PRMClassElement< GUM_SCALAR > & get(std::string_view name)=0
Getter on a member of this PRMClassElementContainer.
virtual const DAG & dag_() const =0
Abstract class representing an element of PRM class.
static INLINE bool isAggregate(const PRMClassElement< GUM_SCALAR > &elt)
Return true if obj is of type PRMAggregate.
static INLINE bool isAttribute(const PRMClassElement< GUM_SCALAR > &elt)
Returns true if obj_ptr is of type PRMAttribute.
const std::string & safeName() const
Returns the safe name of this PRMClassElement, if any.
PRMObject(std::string_view name)
Constructor.
const std::string & name() const
Returns the name of this object.
#define GUM_ERROR(type, msg)
Size NodeId
Type for node ids.
namespace for all probabilistic relational models entities
gum is the global namespace for all aGrUM entities