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

PLearn::VMatrixFromDistribution Class Reference

#include <VMatrixFromDistribution.h>

Inheritance diagram for PLearn::VMatrixFromDistribution:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 VMatrixFromDistribution ()
virtual void build ()
 Should call simply inherited::build(), then this class's build_().

virtual void makeDeepCopyFromShallowCopy (map< const void *, void * > &copies)
 Transforms a shallow copy into a deep copy.

 PLEARN_DECLARE_OBJECT (VMatrixFromDistribution)
virtual real get (int i, int j) const
 returns element (i,j)

virtual void getSubRow (int i, int j, Vec v) const
 fills v with the subrow i lying between columns j (inclusive) and j+v.length() (exclusive)

virtual void getRow (int i, Vec v) const
 copies row i into v (which must have appropriate length equal to the VMat's width)

virtual void getColumn (int i, Vec v) const
 copies column i into v (which must have appropriate length equal to the VMat's length)

virtual void getMat (int i, int j, Mat m) const
 copies the submatrix starting at i,j into m (which must have appropriate length and width)

virtual Mat toMat () const

Public Attributes

PP< PDistributiondistr
string mode
long generator_seed
int nsamples
Vec mins
Vec maxs
int samples_per_dim

Static Protected Member Functions

void declareOptions (OptionList &ol)
 Declares this class' options.


Protected Attributes

Mat data
 Will hold the data sampled from the distribution.


Private Types

typedef VMatrix inherited

Private Member Functions

void build_ ()
 This does the actual building.


Member Typedef Documentation

typedef VMatrix PLearn::VMatrixFromDistribution::inherited [private]
 

Reimplemented from PLearn::VMatrix.

Definition at line 55 of file VMatrixFromDistribution.h.


Constructor & Destructor Documentation

PLearn::VMatrixFromDistribution::VMatrixFromDistribution  ) 
 

Definition at line 46 of file VMatrixFromDistribution.cc.

References mode, PLearn::sample(), and samples_per_dim.


Member Function Documentation

void PLearn::VMatrixFromDistribution::build  )  [virtual]
 

Should call simply inherited::build(), then this class's build_().

This method should be callable again at later times, after modifying some option fields to change the "architecture" of the object.

Reimplemented from PLearn::VMatrix.

Definition at line 153 of file VMatrixFromDistribution.cc.

References build_().

void PLearn::VMatrixFromDistribution::build_  )  [private]
 

This does the actual building.

Reimplemented from PLearn::VMatrix.

Definition at line 89 of file VMatrixFromDistribution.cc.

References data, distr, generator_seed, k, maxs, mins, mode, nsamples, PLERROR, PLearn::pow(), PLearn::TMat< T >::resize(), samples_per_dim, PLearn::TVec< T >::subVec(), PLearn::Vec, and PLearn::TMat< T >::width().

Referenced by build().

void PLearn::VMatrixFromDistribution::declareOptions OptionList ol  )  [static, protected]
 

Declares this class' options.

Reimplemented from PLearn::VMatrix.

Definition at line 58 of file VMatrixFromDistribution.cc.

References PLearn::declareOption(), and PLearn::OptionList.

real PLearn::VMatrixFromDistribution::get int  i,
int  j
const [virtual]
 

returns element (i,j)

Reimplemented from PLearn::VMatrix.

Definition at line 164 of file VMatrixFromDistribution.cc.

References data.

void PLearn::VMatrixFromDistribution::getColumn int  i,
Vec  v
const [virtual]
 

copies column i into v (which must have appropriate length equal to the VMat's length)

Reimplemented from PLearn::VMatrix.

Definition at line 167 of file VMatrixFromDistribution.cc.

References PLearn::TMat< T >::column(), and data.

void PLearn::VMatrixFromDistribution::getMat int  i,
int  j,
Mat  m
const [virtual]
 

copies the submatrix starting at i,j into m (which must have appropriate length and width)

Reimplemented from PLearn::VMatrix.

Definition at line 176 of file VMatrixFromDistribution.cc.

References data, PLearn::TMat< T >::length(), PLearn::TMat< T >::subMat(), and PLearn::TMat< T >::width().

void PLearn::VMatrixFromDistribution::getRow int  i,
Vec  v
const [virtual]
 

copies row i into v (which must have appropriate length equal to the VMat's width)

Reimplemented from PLearn::VMatrix.

Definition at line 173 of file VMatrixFromDistribution.cc.

References data.

void PLearn::VMatrixFromDistribution::getSubRow int  i,
int  j,
Vec  v
const [virtual]
 

fills v with the subrow i lying between columns j (inclusive) and j+v.length() (exclusive)

Reimplemented from PLearn::VMatrix.

Definition at line 170 of file VMatrixFromDistribution.cc.

References data, and PLearn::TVec< T >::length().

void PLearn::VMatrixFromDistribution::makeDeepCopyFromShallowCopy map< const void *, void * > &  copies  )  [virtual]
 

Transforms a shallow copy into a deep copy.

Reimplemented from PLearn::VMatrix.

Definition at line 159 of file VMatrixFromDistribution.cc.

PLearn::VMatrixFromDistribution::PLEARN_DECLARE_OBJECT VMatrixFromDistribution   ) 
 

Mat PLearn::VMatrixFromDistribution::toMat  )  const [virtual]
 

returns a Mat with the same data as this VMat The default version of this method copies the data in a fresh Mat created in memory However this method will typically be overrided by subclasses (such as MemoryVMatrix) whose internal representation is already a Mat in order to return this Mat directly to avoid a new memory allocation and copy of elements. In this case, and in this case only, modifying the elements of the returned Mat will logically result in modified elements in the original VMatrix view of it.

Reimplemented from PLearn::VMatrix.

Definition at line 179 of file VMatrixFromDistribution.cc.

References data.


Member Data Documentation

Mat PLearn::VMatrixFromDistribution::data [protected]
 

Will hold the data sampled from the distribution.

Definition at line 60 of file VMatrixFromDistribution.h.

Referenced by build_(), get(), getColumn(), getMat(), getRow(), getSubRow(), and toMat().

PP<PDistribution> PLearn::VMatrixFromDistribution::distr
 

Definition at line 68 of file VMatrixFromDistribution.h.

Referenced by build_().

long PLearn::VMatrixFromDistribution::generator_seed
 

Definition at line 72 of file VMatrixFromDistribution.h.

Referenced by build_().

Vec PLearn::VMatrixFromDistribution::maxs
 

Definition at line 76 of file VMatrixFromDistribution.h.

Referenced by build_().

Vec PLearn::VMatrixFromDistribution::mins
 

Definition at line 76 of file VMatrixFromDistribution.h.

Referenced by build_().

string PLearn::VMatrixFromDistribution::mode
 

Definition at line 69 of file VMatrixFromDistribution.h.

Referenced by build_().

int PLearn::VMatrixFromDistribution::nsamples
 

Definition at line 73 of file VMatrixFromDistribution.h.

Referenced by build_().

int PLearn::VMatrixFromDistribution::samples_per_dim
 

Definition at line 77 of file VMatrixFromDistribution.h.

Referenced by build_(), and VMatrixFromDistribution().


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