49#ifndef GUM_SIMPLE_BAYES_NET_H
50#define GUM_SIMPLE_BAYES_NET_H
60 template <
typename GUM_SCALAR >
74 template <
typename GUM_SCALAR >
114 virtual const Tensor< GUM_SCALAR >&
cpt(
NodeId varId)
const = 0;
175 std::vector< std::string >
check()
const;
231 virtual std::string
toDot()
const;
240 Tensor< GUM_SCALAR >
evEq(
const std::string& name,
double value)
const;
246 Tensor< GUM_SCALAR >
evIn(
const std::string& name,
double val1,
double val2)
const;
252 Tensor< GUM_SCALAR >
evLt(
const std::string& name,
double value)
const;
259 Tensor< GUM_SCALAR >
evGt(
const std::string& name,
double value)
const;
270#ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
276 template <
typename GUM_SCALAR >
Class representing probabilistic DAG model.
Template implementation of bns/bayesNet.h classes.
A factory class to ease BayesNet construction.
DAGmodel()
Default constructor.
Base class for discrete random variable.
GUM_SCALAR minNonZeroParam() const
GUM_SCALAR jointProbability(const Instantiation &i) const
Compute a parameter of the joint probability for the BN (given an instantiation of the vars).
Size dim() const
Returns the dimension (the number of free parameters) in this bayes net.
Size memoryFootprint() const
compute the (approximated) footprint in memory of the model (the footprints of CPTs)
virtual const DiscreteVariable & variableFromName(const std::string &name) const =0
Getter by name.
GUM_SCALAR maxParam() const
std::string toString() const
std::vector< std::string > check() const
Check if the BayesNet is consistent (variables, CPT).
Tensor< GUM_SCALAR > evIn(const std::string &name, double val1, double val2) const
Size maxVarDomainSize() const
GUM_SCALAR log2JointProbability(const Instantiation &i) const
Compute a parameter of the log joint probability for the BN (given an instantiation of the vars).
GUM_SCALAR maxNonOneParam() const
virtual const DiscreteVariable & variable(NodeId id) const =0
Returns a constant reference over a variable given it's node id.
GUM_SCALAR minParam() const
virtual const VariableNodeMap & variableNodeMap() const =0
Returns a constant reference to the VariableNodeMap of thisBN.
Tensor< GUM_SCALAR > evEq(const std::string &name, double value) const
Tensor< GUM_SCALAR > evGt(const std::string &name, double value) const
IBayesNet< GUM_SCALAR > & operator=(const IBayesNet< GUM_SCALAR > &source)
Copy operator.
Tensor< GUM_SCALAR > evLt(const std::string &name, double value) const
virtual NodeId nodeId(const DiscreteVariable &var) const =0
Return id node from discrete var pointer.
IBayesNet()
Default constructor.
virtual NodeId idFromName(const std::string &name) const =0
Getter by name.
virtual std::string toDot() const
bool operator==(const IBayesNet< GUM_SCALAR > &from) const
This operator compares 2 BNs !
virtual const Tensor< GUM_SCALAR > & cpt(NodeId varId) const =0
Returns the CPT of a variable.
bool operator!=(const IBayesNet< GUM_SCALAR > &from) const
virtual ~IBayesNet()
Destructor.
Class for assigning/browsing values to tuples of discrete variables.
Container used to map discrete variables with nodes.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Size NodeId
Type for node ids.
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
Header of the Tensor class.