|
libDAI
|
Combines the abstract base class InfAlg with a graphical model (e.g., a FactorGraph or RegionGraph). More...
#include <dai/daialg.h>
Public Member Functions | |
Constructors/destructors | |
| DAIAlg () | |
| Default constructor. | |
| DAIAlg (const GRM &grm) | |
| Construct from GRM. | |
Queries | |
| FactorGraph & | fg () |
| Returns reference to underlying FactorGraph. | |
| const FactorGraph & | fg () const |
| Returns constant reference to underlying FactorGraph. | |
Changing the factor graph | |
| void | clamp (size_t i, size_t x, bool backup=false) |
Clamp variable with index i to value x (i.e. multiply with a Kronecker delta ) | |
| void | makeCavity (size_t i, bool backup=false) |
| Sets all factors interacting with variable with index i to one. | |
Backup/restore mechanism for factors | |
| void | backupFactor (size_t I) |
| Make a backup copy of factor I. | |
| void | backupFactors (const VarSet &vs) |
| Make backup copies of all factors involving the variables in vs. | |
| void | restoreFactor (size_t I) |
| Restore factor I from its backup copy. | |
| void | restoreFactors (const VarSet &vs) |
| Restore the factors involving the variables in vs from their backup copies. | |
Combines the abstract base class InfAlg with a graphical model (e.g., a FactorGraph or RegionGraph).
Inference algorithms in libDAI directly inherit from a DAIAlg, currently either from a DAIAlg<FactorGraph> or from a DAIAlg<RegionGraph>.
| GRM | Should be castable to FactorGraph |
| dai::DAIAlg< GRM >::DAIAlg | ( | ) | [inline] |
Default constructor.
| dai::DAIAlg< GRM >::DAIAlg | ( | const GRM & | grm | ) | [inline] |
Construct from GRM.
| FactorGraph& dai::DAIAlg< GRM >::fg | ( | ) | [inline, virtual] |
Returns reference to underlying FactorGraph.
Implements dai::InfAlg.
| const FactorGraph& dai::DAIAlg< GRM >::fg | ( | ) | const [inline, virtual] |
Returns constant reference to underlying FactorGraph.
Implements dai::InfAlg.
| void dai::DAIAlg< GRM >::clamp | ( | size_t | i, |
| size_t | x, | ||
| bool | backup = false |
||
| ) | [inline, virtual] |
Clamp variable with index i to value x (i.e. multiply with a Kronecker delta
)
If backup == true, make a backup of all factors that are changed.
Implements dai::InfAlg.
| void dai::DAIAlg< GRM >::makeCavity | ( | size_t | i, |
| bool | backup = false |
||
| ) | [inline, virtual] |
Sets all factors interacting with variable with index i to one.
If backup == true, make a backup of all factors that are changed.
Implements dai::InfAlg.
| void dai::DAIAlg< GRM >::backupFactor | ( | size_t | I | ) | [inline, virtual] |
Make a backup copy of factor I.
Implements dai::InfAlg.
| void dai::DAIAlg< GRM >::backupFactors | ( | const VarSet & | vs | ) | [inline, virtual] |
Make backup copies of all factors involving the variables in vs.
Implements dai::InfAlg.
| void dai::DAIAlg< GRM >::restoreFactor | ( | size_t | I | ) | [inline, virtual] |
Restore factor I from its backup copy.
Implements dai::InfAlg.
| void dai::DAIAlg< GRM >::restoreFactors | ( | const VarSet & | vs | ) | [inline, virtual] |
Restore the factors involving the variables in vs from their backup copies.
Implements dai::InfAlg.
1.7.4