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

PLearn::InterleaveVMatrix Class Reference

#include <InterleaveVMatrix.h>

Inheritance diagram for PLearn::InterleaveVMatrix:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 InterleaveVMatrix ()
 default constructor (for automatic deserialization)

 InterleaveVMatrix (Array< VMat > distributions)
 The field names are copied from the first VMat in the array.

 InterleaveVMatrix (VMat d1, VMat d2)
 The field names are copied from the first VMat d1.

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

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 reset_dimensions ()
 in case the dimensions of an underlying vmat has changed, recompute it


Static Public Member Functions

void declareOptions (OptionList &ol)
 redefine this in subclasses: call declareOption(...) for each option, and then call inherited::declareOptions(options) ( see the declareOption function further down)


Protected Attributes

Array< VMatvm

Private Types

typedef VMatrix inherited

Private Member Functions

void build_ ()
 This does the actual building.


Detailed Description

This class interleaves several VMats (with consecutive rows always coming from a different underlying VMat) thus possibly including more than once the rows of the small VMats. For example, if VM1.length()==10 and VM2.length()==30 then the resulting VM will have 60 rows, and 3 repetitions of each row of VM1, with rows taken as follows: VM1.row(0), VM2.row(0), VM1.row(1), VM2.row(1), ..., VM1.row(9), VM2.row(9), VM1.row(0), VM2.row(10), ... Note that if VM2.length() is not a multiple of VM1.length() some records from VM1 will be repeated once more than others.

Definition at line 64 of file InterleaveVMatrix.h.


Member Typedef Documentation

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

Reimplemented from PLearn::VMatrix.

Definition at line 66 of file InterleaveVMatrix.h.


Constructor & Destructor Documentation

PLearn::InterleaveVMatrix::InterleaveVMatrix  ) 
 

default constructor (for automatic deserialization)

Definition at line 51 of file InterleaveVMatrix.cc.

PLearn::InterleaveVMatrix::InterleaveVMatrix Array< VMat distributions  ) 
 

The field names are copied from the first VMat in the array.

Definition at line 55 of file InterleaveVMatrix.cc.

References build().

PLearn::InterleaveVMatrix::InterleaveVMatrix VMat  d1,
VMat  d2
 

The field names are copied from the first VMat d1.

Definition at line 61 of file InterleaveVMatrix.cc.

References build().


Member Function Documentation

void PLearn::InterleaveVMatrix::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 68 of file InterleaveVMatrix.cc.

References build_().

Referenced by InterleaveVMatrix().

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

This does the actual building.

Reimplemented from PLearn::VMatrix.

Definition at line 75 of file InterleaveVMatrix.cc.

References PLERROR, PLearn::TVec< VMat >::size(), vm, and PLearn::VMatrix::width().

Referenced by build().

void PLearn::InterleaveVMatrix::declareOptions OptionList ol  )  [static]
 

redefine this in subclasses: call declareOption(...) for each option, and then call inherited::declareOptions(options) ( see the declareOption function further down)

ex: static void declareOptions(OptionList& ol) { declareOption(ol, "inputsize", &MyObject::inputsize_, OptionBase::buildoption, "the size of the input\n it must be provided"); declareOption(ol, "weights", &MyObject::weights, OptionBase::learntoption, "the learnt model weights"); inherited::declareOptions(ol); }

Reimplemented from PLearn::VMatrix.

Definition at line 99 of file InterleaveVMatrix.cc.

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

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

returns element (i,j)

Reimplemented from PLearn::VMatrix.

Definition at line 105 of file InterleaveVMatrix.cc.

References PLearn::TVec< VMat >::length(), PLearn::VMatrix::length(), PLERROR, PLearn::TVec< VMat >::size(), vm, and PLearn::VMatrix::width().

void PLearn::InterleaveVMatrix::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 117 of file InterleaveVMatrix.cc.

References PLearn::TVec< VMat >::length(), PLearn::TVec< T >::length(), PLearn::VMatrix::length(), PLERROR, PLearn::TVec< VMat >::size(), PLearn::Vec, vm, and PLearn::VMatrix::width().

PLearn::InterleaveVMatrix::PLEARN_DECLARE_OBJECT InterleaveVMatrix   ) 
 

virtual void PLearn::InterleaveVMatrix::reset_dimensions  )  [inline, virtual]
 

in case the dimensions of an underlying vmat has changed, recompute it

Reimplemented from PLearn::VMatrix.

Definition at line 90 of file InterleaveVMatrix.h.

References PLERROR, PLearn::TVec< VMat >::size(), vm, and PLearn::VMatrix::width().


Member Data Documentation

Array<VMat> PLearn::InterleaveVMatrix::vm [protected]
 

Definition at line 69 of file InterleaveVMatrix.h.

Referenced by build_(), get(), getSubRow(), and reset_dimensions().


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