|
Gymbo
|
Represents a symbolic probability with a numerator and denominator. More...
#include <type.h>

Public Member Functions | |
| SymProb () | |
| Default constructor for SymProb. More... | |
| SymProb (Sym *numerator, Sym *denominator) | |
| Parameterized constructor for SymProb. More... | |
| std::string | toString () |
| Converts SymProb to a string. More... | |
| SymProb | operator* (SymProb other) |
| Multiplies two SymProb instances. More... | |
| SymProb * | pmul (SymProb *other) |
| Multiplies two SymProb instances. More... | |
| std::pair< Sym *, Sym * > | marginalize (std::unordered_map< int, DiscreteDist > &var2dist, std::vector< std::vector< int >> &D) |
| Marginalizes the SymProb over given variable assignments. More... | |
| float | eval (std::unordered_map< int, float > ¶ms, float eps, std::unordered_map< int, DiscreteDist > &var2dist, std::vector< std::vector< int >> &D) |
| Evaluates the SymProb for given parameters, epsilon, variable assignments, and distributions. More... | |
| Sym | query (SymType symtype, Sym &other, std::unordered_map< int, DiscreteDist > &var2dist, std::vector< std::vector< int >> &D) |
| Queries the SymProb with a given symbolic type, another symbolic expression, and variable assignments. More... | |
Public Attributes | |
| Sym * | numerator |
| Sym * | denominator |
Represents a symbolic probability with a numerator and denominator.
The SymProb struct is designed to handle symbolic probabilities using symbolic expressions.
|
inline |
Default constructor for SymProb.
Initializes the numerator and denominator with constant symbolic expressions representing 1.0.
Parameterized constructor for SymProb.
| numerator | Pointer to the symbolic expression representing the numerator. |
| denominator | Pointer to the symbolic expression representing the denominator. |
|
inline |
Evaluates the SymProb for given parameters, epsilon, variable assignments, and distributions.
| params | Map of variable index to parameter values. |
| eps | Epsilon value for numerical stability. |
| var2dist | Map of variable index to DiscreteDist. |
| D | Vector of variable assignments. |
|
inline |
Marginalizes the SymProb over given variable assignments.
| var2dist | Map of variable index to DiscreteDist. |
| D | Vector of variable assignments. |
|
inline |
Queries the SymProb with a given symbolic type, another symbolic expression, and variable assignments.
| symtype | Symbolic type for the resulting Sym. |
| other | Another symbolic expression. |
| var2dist | Map of variable index to DiscreteDist. |
| D | Vector of variable assignments. |
|
inline |
| Sym* gymbo::SymProb::denominator |
Pointer to the symbolic expression representing the denominator.
| Sym* gymbo::SymProb::numerator |
Pointer to the symbolic expression representing the numerator.