49#ifndef GUM_SIMPLE_BAYES_NET_H
50#define GUM_SIMPLE_BAYES_NET_H
60 template < GUM_Numeric GUM_SCALAR >
74 template < GUM_Numeric GUM_SCALAR >
86 explicit IBayesNet(std::string_view name);
124 virtual const Tensor< GUM_SCALAR >&
cpt(
NodeId varId)
const = 0;
153 std::vector< std::string >
check()
const;
206 virtual std::string
toDot()
const;
215 Tensor< GUM_SCALAR >
evEq(std::string_view name,
double value)
const;
221 Tensor< GUM_SCALAR >
evIn(std::string_view name,
double val1,
double val2)
const;
227 Tensor< GUM_SCALAR >
evLt(std::string_view name,
double value)
const;
234 Tensor< GUM_SCALAR >
evGt(std::string_view name,
double value)
const;
245#ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
251 template < GUM_Numeric GUM_SCALAR >
Class representing probabilistic DAG model.
Template implementation of bns/bayesNet.h classes.
A factory class to ease BayesNet construction.
DAGmodel()
Default constructor.
Class representing the minimal interface for Bayesian network with no numerical data.
Tensor< GUM_SCALAR > evGt(std::string_view name, double value) const
GUM_SCALAR minNonZeroParam() const
IBayesNet()
Default constructor.
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.
GUM_SCALAR maxParam() const
std::vector< std::string > check() const
Check if the BayesNet is consistent (variables, CPT).
~IBayesNet() override
Destructor.
Tensor< GUM_SCALAR > evIn(std::string_view name, double val1, double val2) const
Tensor< GUM_SCALAR > evLt(std::string_view name, double value) const
Size memoryFootprint() const
compute the (approximated) footprint in memory of the model (the footprints of CPTs)
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
std::string toString() const
GUM_SCALAR minParam() const
IBayesNet< GUM_SCALAR > & operator=(const IBayesNet< GUM_SCALAR > &source)
Copy operator.
virtual std::string toDot() const
Tensor< GUM_SCALAR > evEq(std::string_view name, double value) 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.
Class for assigning/browsing values to tuples of discrete variables.
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.