PLearn 0.1
Public Member Functions | Protected Attributes
PLearn::RandomVarVMatrix Class Reference

This is a convenient wrapping around the required data structures for efficient repeated sampling from a RandomVar. More...

#include <RandomVar.h>

Inheritance diagram for PLearn::RandomVarVMatrix:
Inheritance graph
[legend]
Collaboration diagram for PLearn::RandomVarVMatrix:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 RandomVarVMatrix (ConditionalExpression conditional_expression)
virtual int nVars ()
virtual Vec sample ()

Protected Attributes

RandomVar rv
Var instance
VarArray prop_path

Detailed Description

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.


Constructor & Destructor Documentation

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
}

Member Function Documentation

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.

    {
      prop_path.fprop();
      return instance->value;
    }

Member Data Documentation

Definition at line 1543 of file RandomVar.h.

Referenced by RandomVarVMatrix().

Definition at line 1544 of file RandomVar.h.

Referenced by RandomVarVMatrix().

Definition at line 1542 of file RandomVar.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines