55 template <
typename GUM_SCALAR >
57 GUM_SCALAR default_weight) :
64 template <
typename GUM_SCALAR >
72 template <
typename GUM_SCALAR >
82 template <
typename GUM_SCALAR >
87 template <
typename GUM_SCALAR >
93 if (i.
val(C) > 1)
return (GUM_SCALAR)0.0;
97 GUM_SCALAR fact = (GUM_SCALAR)ratio;
99 if (fact != (GUM_SCALAR)0) {
100 for (
Idx j = 1; j < this->
nbrDim(); j++) {
106 if (pr == (GUM_SCALAR)0.0) {
107 fact = (GUM_SCALAR)0.0;
116 return (i.
val(C) != 1) ? fact : (GUM_SCALAR)1.0 - fact;
119 template <
typename GUM_SCALAR >
122 s << MultiDimImplementation< GUM_SCALAR >::variable(0) <<
"=noisyORCompound(["
125 for (
Idx i = 1; i < MultiDimImplementation< GUM_SCALAR >::nbrDim(); i++)
135 template <
typename GUM_SCALAR >
141 template <
typename GUM_SCALAR >
142 INLINE MultiDimContainer< GUM_SCALAR >*
149 template <
typename GUM_SCALAR >
151 static const std::string str =
"MultiDimNoisyORCompound";
Set of pairs of elements with fast search for both elements.
Base class for discrete random variable.
Class for assigning/browsing values to tuples of discrete variables.
Idx val(Idx i) const
Returns the current value of the variable at position i.
GUM_SCALAR externalWeight() const
Copy of a multiDimICIModel.
GUM_SCALAR _default_weight_
in Henrion (89) in a hashtable with a default_value.
MultiDimICIModel(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.
GUM_SCALAR _external_weight_
in Henrion (89).
virtual Idx nbrDim() const override
Returns the number of vars in the multidimensional container.
const DiscreteVariable & variable(Idx i) const override
Returns a const ref to the ith var.
MultiDimNoisyORCompound(GUM_SCALAR external_weight, GUM_SCALAR default_weight=(GUM_SCALAR) 1.0)
Default constructor.
virtual MultiDimContainer< GUM_SCALAR > * newFactory() const
This method creates a clone of this object, withouth its content (including variable),...
virtual const std::string & name() const
returns the real name of the multiDimArray
virtual GUM_SCALAR get(const Instantiation &i) const
returns the real name of the multiDimArray
virtual ~MultiDimNoisyORCompound()
Destructor.
std::string toString() const
returns the real name of the multiDimArray
Exception : operation not allowed.
#define GUM_ERROR(type, msg)
Size Idx
Type for indexes.
class for multiDimNoisyORCompound
gum is the global namespace for all aGrUM entities
std::ostream & operator<<(std::ostream &stream, const AVLTree< Val, Cmp > &tree)
display the content of a tree