PLearn 0.1
|
This is a convenient wrapping around the required data structures for efficient repeated sampling from a RandomVar. More...
#include <RandomVar.h>
Public Member Functions | |
RandomVarVMatrix (ConditionalExpression conditional_expression) | |
virtual int | nVars () |
virtual Vec | sample () |
Protected Attributes | |
RandomVar | rv |
Var | instance |
VarArray | prop_path |
This is a convenient wrapping around the required data structures for efficient repeated sampling from a RandomVar.
** WARNING ** DEPRECATED: this class should be rewritten entirely or erased. It probably won't work in its current state.
Definition at line 1539 of file RandomVar.h.
PLearn::RandomVarVMatrix::RandomVarVMatrix | ( | ConditionalExpression | conditional_expression | ) |
Definition at line 2403 of file RandomVar.cc.
References instance, and prop_path.
:VMatrix(-1,-1), instance(Sample(conditional_expression)) // extract the "sampling algorithm" { // make sure all non-random dependencies are computed instance->fprop_from_all_sources(); // extract the path of dependencies from all stochastically sampled Vars to instance instance->random_sources().setMark(); // mark the random sources instance->markPath(); // mark successors of the random sources instance->buildPath(prop_path); // extract path from the random sources to instance // and clear marks }
virtual int PLearn::RandomVarVMatrix::nVars | ( | ) | [inline, virtual] |
Definition at line 1548 of file RandomVar.h.
{ return instance->length(); }
virtual Vec PLearn::RandomVarVMatrix::sample | ( | ) | [inline, virtual] |
Definition at line 1549 of file RandomVar.h.
Var PLearn::RandomVarVMatrix::instance [protected] |
Definition at line 1543 of file RandomVar.h.
Referenced by RandomVarVMatrix().
VarArray PLearn::RandomVarVMatrix::prop_path [protected] |
Definition at line 1544 of file RandomVar.h.
Referenced by RandomVarVMatrix().
RandomVar PLearn::RandomVarVMatrix::rv [protected] |
Definition at line 1542 of file RandomVar.h.