Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

PLearn::RandomVar Class Reference

we follow the same pattern as Var & Variable More...

#include <RandomVar.h>

Inheritance diagram for PLearn::RandomVar:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 RandomVar ()
 RandomVar (int length, int width=1)
 RandomVar (RandomVariable *v)
 RandomVar (const RandomVar &other)
 RandomVar (const Vec &vec)
 RandomVar (const Mat &mat)
 RandomVar (const Var &var)
 RandomVar (const RVArray &vars)
 make joint distribution

RandomVar operator[] (RandomVar index)
 extract from joint or element of vector

void operator= (const RVArray &vars)
void operator= (real f)
 fill value to f

void operator= (const Vec &v)
 copy v into value

void operator= (const Mat &m)
void operator= (const Var &v)
 assign value to v

RVInstance operator== (const Var &v) const
 associate a RV to an observation v, as in expressions of the form (V==v)

bool operator== (const RandomVar &rv) const
 compare two RandomVars: == if same underlying RandomVariable (same address)

bool operator!= (const RandomVar &rv) const
RVArray operator & (const RandomVar &v) const
 make an array of RV's, as in expressions like X&Y

ConditionalExpression operator| (RVArray rhs) const
ConditionalExpression operator| (RVInstanceArray rhs) const
 This operator represents expressions of the form Y|(X==x && Z==z).


Detailed Description

we follow the same pattern as Var & Variable

Definition at line 354 of file RandomVar.h.


Constructor & Destructor Documentation

PLearn::RandomVar::RandomVar  ) 
 

Definition at line 76 of file RandomVar.cc.

Referenced by operator=().

PLearn::RandomVar::RandomVar int  length,
int  width = 1
 

Definition at line 82 of file RandomVar.cc.

PLearn::RandomVar::RandomVar RandomVariable v  ) 
 

Definition at line 78 of file RandomVar.cc.

PLearn::RandomVar::RandomVar const RandomVar other  ) 
 

Definition at line 80 of file RandomVar.cc.

PLearn::RandomVar::RandomVar const Vec vec  ) 
 

Definition at line 85 of file RandomVar.cc.

References PLearn::Vec.

PLearn::RandomVar::RandomVar const Mat mat  ) 
 

Definition at line 87 of file RandomVar.cc.

References PLearn::Mat.

PLearn::RandomVar::RandomVar const Var var  ) 
 

Definition at line 89 of file RandomVar.cc.

PLearn::RandomVar::RandomVar const RVArray vars  ) 
 

make joint distribution

Definition at line 92 of file RandomVar.cc.


Member Function Documentation

RVArray PLearn::RandomVar::operator & const RandomVar v  )  const
 

make an array of RV's, as in expressions like X&Y

Definition at line 136 of file RandomVar.cc.

bool PLearn::RandomVar::operator!= const RandomVar rv  )  const [inline]
 

Definition at line 387 of file RandomVar.h.

References PLearn::PP< RandomVariable >::ptr.

void PLearn::RandomVar::operator= const Var v  ) 
 

assign value to v

Definition at line 123 of file RandomVar.cc.

References PLERROR.

void PLearn::RandomVar::operator= const Mat m  ) 
 

Definition at line 115 of file RandomVar.cc.

References PLERROR.

void PLearn::RandomVar::operator= const Vec v  ) 
 

copy v into value

Definition at line 108 of file RandomVar.cc.

References PLERROR.

void PLearn::RandomVar::operator= real  f  ) 
 

fill value to f

Definition at line 101 of file RandomVar.cc.

References PLERROR.

void PLearn::RandomVar::operator= const RVArray vars  ) 
 

Definition at line 98 of file RandomVar.cc.

References RandomVar().

bool PLearn::RandomVar::operator== const RandomVar rv  )  const [inline]
 

compare two RandomVars: == if same underlying RandomVariable (same address)

Definition at line 386 of file RandomVar.h.

References PLearn::PP< RandomVariable >::ptr.

RVInstance PLearn::RandomVar::operator== const Var v  )  const
 

associate a RV to an observation v, as in expressions of the form (V==v)

Definition at line 130 of file RandomVar.cc.

RandomVar PLearn::RandomVar::operator[] RandomVar  index  ) 
 

extract from joint or element of vector

Definition at line 95 of file RandomVar.cc.

ConditionalExpression PLearn::RandomVar::operator| RVInstanceArray  rhs  )  const
 

This operator represents expressions of the form Y|(X==x && Z==z).

Definition at line 152 of file RandomVar.cc.

ConditionalExpression PLearn::RandomVar::operator| RVArray  rhs  )  const
 

This operator represents expressions of the form Y|(X&Z). It is almost the same as & (i.e. it also builds a RVArray), but it allows us to know that the LHS of the | will always be the first element of the array, so if the user types ((Y&Z)|(X&U)) the result will be a 3-element array, because the first two-element array created by (Y&Z) is coerced into a JointRV, which will be the first element of the result.

Definition at line 141 of file RandomVar.cc.

References PLearn::TVec< RandomVar >::size().


The documentation for this class was generated from the following files:
Generated on Tue Aug 17 16:24:17 2004 for PLearn by doxygen 1.3.7