32 template <
typename GUM_SCALAR >
34 GUM_SCALAR external_weight, GUM_SCALAR default_weight) :
40 template <
typename GUM_SCALAR >
48 template <
typename GUM_SCALAR >
57 template <
typename GUM_SCALAR >
62 template <
typename GUM_SCALAR >
70 if (i.
val(C) > 1)
return (GUM_SCALAR)0.0;
74 GUM_SCALAR fact = (GUM_SCALAR)ratio;
76 if (fact != (GUM_SCALAR)0) {
77 for (
Idx j = 1; j < this->
nbrDim(); j++) {
83 if (pr == (GUM_SCALAR)0.0) {
84 fact = (GUM_SCALAR)0.0;
93 return (i.
val(C) != 1) ? fact : (GUM_SCALAR)1.0 - fact;
96 template <
typename GUM_SCALAR >
99 s << MultiDimImplementation< GUM_SCALAR >::variable(0) <<
"=noisyORNet([" 102 for (
Idx i = 1; i < MultiDimImplementation< GUM_SCALAR >::nbrDim(); i++) {
103 s << MultiDimImplementation< GUM_SCALAR >::variable(i) <<
"[" 116 template <
typename GUM_SCALAR >
122 template <
typename GUM_SCALAR >
130 template <
typename GUM_SCALAR >
132 static const std::string str =
"MultiDimNoisyORNet";
class for NoisyOR-net implementation as multiDim
virtual GUM_SCALAR get(const Instantiation &i) const
Returns the real name of the multiDimArray.
virtual const DiscreteVariable & variable(Idx i) const override
Returns a const ref to the ith var.
Base class for discrete random variable.
gum is the global namespace for all aGrUM entities
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.
std::ostream & operator<<(std::ostream &output, const BayesNet< GUM_SCALAR > &bn)
Prints map's DAG in output using the Graphviz-dot format.
abstract class for Conditional Indepency Models
const std::string toString() const
Returns the real name of the multiDimArray.
virtual const std::string & name() const
Returns the real name of the multiDimArray.
GUM_SCALAR __default_weight
in Henrion (89) in a hashtable with a default_value.
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()
Set of pairs of elements with fast search for both elements.
virtual Idx nbrDim() const override
Returns the number of vars in the multidimensional container.
Class for assigning/browsing values to tuples of discrete variables.
GUM_SCALAR causalWeight(const DiscreteVariable &v) const
Copy of a multiDimICIModel.
<agrum/multidim/multiDimImplementation.h>
Size Idx
Type for indexes.
MultiDimNoisyORNet(GUM_SCALAR external_weight, GUM_SCALAR default_weight=(GUM_SCALAR) 1.0)
Default constructor.
#define GUM_ERROR(type, msg)
virtual ~MultiDimNoisyORNet()
Destructor.