Public Member Functions |
| FRegion () |
| Default constructor.
|
| FRegion (const Factor &x, Real c) |
| Constructs from a factor and a counting number.
|
const Real & | c () const |
| Returns constant reference to counting number.
|
Real & | c () |
| Returns reference to counting number.
|
| TFactor (T p=1) |
| Constructs factor depending on no variables with value p.
|
| TFactor (const Var &v) |
| Constructs factor depending on the variable v with uniform distribution.
|
| TFactor (const VarSet &vars) |
| Constructs factor depending on variables in vars with uniform distribution.
|
| TFactor (const VarSet &vars, T p) |
| Constructs factor depending on variables in vars with all values set to p.
|
template<typename S > |
| TFactor (const VarSet &vars, const std::vector< S > &x) |
| Constructs factor depending on variables in vars, copying the values from a std::vector<>
|
| TFactor (const VarSet &vars, const T *p) |
| Constructs factor depending on variables in vars, copying the values from an array.
|
| TFactor (const VarSet &vars, const TProb< T > &p) |
| Constructs factor depending on variables in vars, copying the values from p.
|
| TFactor (const std::vector< Var > &vars, const std::vector< T > &p) |
| Constructs factor depending on variables in vars, permuting the values given in p accordingly.
|
void | set (size_t i, T val) |
| Sets i 'th entry to val.
|
T | get (size_t i) const |
| Gets i 'th entry.
|
const TProb< T > & | p () const |
| Returns constant reference to value vector.
|
TProb< T > & | p () |
| Returns reference to value vector.
|
T | operator[] (size_t i) const |
| Returns a copy of the i 'th entry of the value vector.
|
const VarSet & | vars () const |
| Returns constant reference to variable set (i.e., the variables on which the factor depends)
|
VarSet & | vars () |
| Returns reference to variable set (i.e., the variables on which the factor depends)
|
size_t | nrStates () const |
| Returns the number of possible joint states of the variables on which the factor depends, .
|
T | entropy () const |
| Returns the Shannon entropy of *this , .
|
T | max () const |
| Returns maximum of all values.
|
T | min () const |
| Returns minimum of all values.
|
T | sum () const |
| Returns sum of all values.
|
T | sumAbs () const |
| Returns sum of absolute values.
|
T | maxAbs () const |
| Returns maximum absolute value of all values.
|
bool | hasNaNs () const |
| Returns true if one or more values are NaN.
|
bool | hasNegatives () const |
| Returns true if one or more values are negative.
|
T | strength (const Var &i, const Var &j) const |
| Returns strength of this factor (between variables i and j), as defined in eq. (52) of [MoK07b].
|
bool | operator== (const TFactor< T > &y) const |
| Comparison.
|
TFactor< T > | operator- () const |
| Returns negative of *this .
|
TFactor< T > | abs () const |
| Returns pointwise absolute value.
|
TFactor< T > | exp () const |
| Returns pointwise exponent.
|
TFactor< T > | log (bool zero=false) const |
| Returns pointwise logarithm.
|
TFactor< T > | inverse (bool zero=true) const |
| Returns pointwise inverse.
|
TFactor< T > | normalized (ProbNormType norm=NORMPROB) const |
| Returns normalized copy of *this , using the specified norm.
|
TFactor< T > & | randomize () |
| Draws all values i.i.d. from a uniform distribution on [0,1)
|
TFactor< T > & | setUniform () |
| Sets all values to where n is the number of states.
|
TFactor< T > & | takeAbs () |
| Applies absolute value pointwise.
|
TFactor< T > & | takeExp () |
| Applies exponent pointwise.
|
TFactor< T > & | takeLog (bool zero=false) |
| Applies logarithm pointwise.
|
T | normalize (ProbNormType norm=NORMPROB) |
| Normalizes factor using the specified norm.
|
TFactor< T > & | fill (T x) |
| Sets all values to x.
|
TFactor< T > & | operator+= (T x) |
| Adds scalar x to each value.
|
TFactor< T > & | operator-= (T x) |
| Subtracts scalar x from each value.
|
TFactor< T > & | operator*= (T x) |
| Multiplies each value with scalar x.
|
TFactor< T > & | operator/= (T x) |
| Divides each entry by scalar x.
|
TFactor< T > & | operator^= (T x) |
| Raises values to the power x.
|
TFactor< T > | operator+ (T x) const |
| Returns sum of *this and scalar x.
|
TFactor< T > | operator- (T x) const |
| Returns difference of *this and scalar x.
|
TFactor< T > | operator* (T x) const |
| Returns product of *this with scalar x.
|
TFactor< T > | operator/ (T x) const |
| Returns quotient of *this with scalar x.
|
TFactor< T > | operator^ (T x) const |
| Returns *this raised to the power x.
|
template<typename binOp > |
TFactor< T > & | binaryOp (const TFactor< T > &g, binOp op) |
| Applies binary operation op on two factors, *this and g.
|
TFactor< T > & | operator+= (const TFactor< T > &g) |
| Adds g to *this .
|
TFactor< T > & | operator-= (const TFactor< T > &g) |
| Subtracts g from *this .
|
TFactor< T > & | operator*= (const TFactor< T > &g) |
| Multiplies *this with g.
|
TFactor< T > & | operator/= (const TFactor< T > &g) |
| Divides *this by g (where division by zero yields zero)
|
template<typename binOp > |
TFactor< T > | binaryTr (const TFactor< T > &g, binOp op) const |
| Returns result of applying binary operation op on two factors, *this and g.
|
TFactor< T > | operator+ (const TFactor< T > &g) const |
| Returns sum of *this and g.
|
TFactor< T > | operator- (const TFactor< T > &g) const |
| Returns *this minus g.
|
TFactor< T > | operator* (const TFactor< T > &g) const |
| Returns product of *this with g.
|
TFactor< T > | operator/ (const TFactor< T > &g) const |
| Returns quotient of *this by f (where division by zero yields zero)
|
TFactor< T > | slice (const VarSet &vars, size_t varsState) const |
| Returns a slice of *this , where the subset vars is in state varsState.
|
TFactor< T > | embed (const VarSet &vars) const |
| Embeds this factor in a larger VarSet.
|
TFactor< T > | marginal (const VarSet &vars, bool normed=true) const |
| Returns marginal on vars, obtained by summing out all variables except those in vars, and normalizing the result if normed == true .
|
TFactor< T > | maxMarginal (const VarSet &vars, bool normed=true) const |
| Returns max-marginal on vars, obtained by maximizing all variables except those in vars, and normalizing the result if normed == true .
|
An FRegion is a factor with a counting number.