35 template <
typename GUM_SCALAR >
37 GUM_SCALAR external_weight, GUM_SCALAR default_weight) :
44 template <
typename GUM_SCALAR >
53 template <
typename GUM_SCALAR >
63 template <
typename GUM_SCALAR >
68 template <
typename GUM_SCALAR >
77 if (i.
val(C) > 1)
return (GUM_SCALAR)0.0;
81 GUM_SCALAR fact = (GUM_SCALAR)ratio;
83 if (fact != (GUM_SCALAR)0) {
84 for (
Idx j = 1; j < this->
nbrDim(); j++) {
90 if (pr == (GUM_SCALAR)0.0) {
91 fact = (GUM_SCALAR)0.0;
100 return (i.
val(C) != 1) ? fact : (GUM_SCALAR)1.0 - fact;
103 template <
typename GUM_SCALAR >
106 s << MultiDimImplementation< GUM_SCALAR >::variable(0) <<
"=noisyORCompound([" 109 for (
Idx i = 1; i < MultiDimImplementation< GUM_SCALAR >::nbrDim(); i++) {
110 s << MultiDimImplementation< GUM_SCALAR >::variable(i) <<
"[" 124 template <
typename GUM_SCALAR >
126 operator<<(std::ostream& s, const MultiDimNoisyORCompound< GUM_SCALAR >& ag) {
127 return s << ag.toString();
130 template <
typename GUM_SCALAR >
138 template <
typename GUM_SCALAR >
140 static const std::string str =
"MultiDimNoisyORCompound";
virtual const std::string & name() const
returns the real name of the multiDimArray
virtual const DiscreteVariable & variable(Idx i) const override
Returns a const ref to the ith var.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Base class for discrete random variable.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Abstract base class for all multi dimensionnal containers.
GUM_SCALAR __external_weight
in Henrion (89).
Idx val(Idx i) const
Returns the current value of the variable at position i.
GUM_SCALAR externalWeight() const
Copy of a multiDimICIModel.
virtual MultiDimContainer< GUM_SCALAR > * newFactory() const
This method creates a clone of this object, withouth its content (including variable), you must use this method if you want to ensure that the generated object has the same type than the object containing the called newFactory() For example : MultiDimArray<double> y; MultiDimContainer<double>* x = y.newFactory(); Then x is a MultiDimArray<double>*.
abstract class for Conditional Indepency Models
GUM_SCALAR __default_weight
in Henrion (89) in a hashtable with a default_value.
Set of pairs of elements with fast search for both elements.
virtual ~MultiDimNoisyORCompound()
Destructor.
const std::string toString() const
returns the real name of the multiDimArray
virtual Idx nbrDim() const override
Returns the number of vars in the multidimensional container.
Class for assigning/browsing values to tuples of discrete variables.
MultiDimNoisyORCompound(GUM_SCALAR external_weight, GUM_SCALAR default_weight=(GUM_SCALAR) 1.0)
Default constructor.
GUM_SCALAR causalWeight(const DiscreteVariable &v) const
Copy of a multiDimICIModel.
<agrum/multidim/multiDimImplementation.h>
Size Idx
Type for indexes.
virtual GUM_SCALAR get(const Instantiation &i) const
returns the real name of the multiDimArray
#define GUM_ERROR(type, msg)