56 template <
typename GUM_SCALAR >
63 template <
typename GUM_SCALAR >
70 template <
typename GUM_SCALAR >
75 template <
typename GUM_SCALAR >
82 template <
typename GUM_SCALAR >
89 template <
typename GUM_SCALAR >
94 }
catch (
NotFound const&) {
return false; }
97 template <
typename GUM_SCALAR >
107 }
catch (
NotFound const&) { setIOFlag_(elt, std::make_pair(b,
false)); }
113 template <
typename GUM_SCALAR >
128 "given ClassElement<GUM_SCALAR> is not an "
129 "PRMAttribute or an PRMAggregate");
133 template <
typename GUM_SCALAR >
138 }
catch (
NotFound const&) {
return true; }
141 template <
typename GUM_SCALAR >
147 template <
typename GUM_SCALAR >
157 template <
typename GUM_SCALAR >
167 template <
typename GUM_SCALAR >
170 const std::pair< bool, bool >& flags) {
176 template <
typename GUM_SCALAR >
181 template <
typename GUM_SCALAR >
186 }
catch (
NotFound const&) {
return false; }
189 template <
typename GUM_SCALAR >
194 }
catch (
NotFound const&) {
return false; }
197 template <
typename GUM_SCALAR >
205template <
typename GUM_SCALAR >
208 std::string tab =
" ";
209 output <<
"digraph \"" << container.
name() <<
"\" {" << std::endl;
214 output << tab <<
"\"" << container.
get(node).name() <<
"\" -> "
215 <<
"\"" << container.
get(chi).name() <<
"\";" << std::endl;
218 output << tab <<
"\"" << container.
get(node).name() <<
"\";" << std::endl;
222 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 children of a set of nodes
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>
virtual PRMClassElement< GUM_SCALAR > & get(const std::string &name)=0
Getter on a member of this PRMClassElementContainer.
virtual bool isInnerNode(const PRMClassElement< GUM_SCALAR > &elt) const
Returns true if the node is an inner node.
virtual const DAG & containerDag() const
Returns the gum::DAG of this PRMClassElementContainer.
virtual std::pair< bool, bool > & getIOFlag_(const PRMClassElement< double > &elt)
virtual void copyIOFlags_(const PRMClassElementContainer< GUM_SCALAR > &c)
Copy the IO Flags of c in this PRMClassElementContainer.
PRMClassElementContainer< GUM_SCALAR > & operator=(const PRMClassElementContainer< GUM_SCALAR > &source)
Copy operator. Don't use it.
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...
virtual bool belongsTo(const PRMClassElement< GUM_SCALAR > &elt) const
Returns true if elt belongs to this PRMClassElementContainer.
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 bool isSuperTypeOf(const PRMClassElementContainer< GUM_SCALAR > &cec) const
Test if this PRMClassElementContainer is a super type of cec.
virtual ~PRMClassElementContainer()
Destructor.
virtual void setIOFlag_(const PRMClassElement< GUM_SCALAR > &elt, const std::pair< bool, bool > &flags)
Defines the IO flags of a PRMClassElement<GUM_SCALAR>.
PRMClassElementContainer(const std::string &name)
Default constructor.
virtual bool isInputNode(const PRMClassElement< GUM_SCALAR > &elt) const
Returns true if the node is an input node.
virtual bool exists(const std::string &name) const
Returns true if a member with the given name exists in this PRMClassElementContainer or in the PRMCla...
virtual void setInputNode(const PRMClassElement< GUM_SCALAR > &elt, bool b)
Set the input flag value of id at b.
virtual void setOutputNode(const PRMClassElement< GUM_SCALAR > &elt, bool b)
Set the output flag value of id at b.
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.
const std::string & safeName() const
Returns the safe name of this PRMClassElement, if any.
static INLINE bool isAttribute(const PRMClassElement< GUM_SCALAR > &elt)
Returns true if obj_ptr is of type PRMAttribute.
const std::string & name() const
Returns the name of this object.
PRMObject(const std::string &name)
Constructor.
#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