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

PLearn::CrossReferenceVMatrix Class Reference

#include <CrossReferenceVMatrix.h>

Inheritance diagram for PLearn::CrossReferenceVMatrix:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CrossReferenceVMatrix ()
 default constructor (for automatic deserialization)

 CrossReferenceVMatrix (VMat v1, int c1, VMat v2)
 The column headings are simply the concatenation of the headings in the two vmatrices.

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

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

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

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

VMat vm1
int col1
VMat vm2

Private Types

typedef VMatrix inherited

Private Member Functions

void build_ ()
 This does the actual building.


Detailed Description

This VMat is a concatenation of 2 VMat. The row of vm2, corresponding to the index set by col1 of vm1, is merged with vm1.

for i=1,vm1.length() vm.row(i) <- vm1.row(i) + vm2.row(vm1(i,col1))

Definition at line 60 of file CrossReferenceVMatrix.h.


Member Typedef Documentation

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

Reimplemented from PLearn::VMatrix.

Definition at line 62 of file CrossReferenceVMatrix.h.

Referenced by CrossReferenceVMatrix().


Constructor & Destructor Documentation

PLearn::CrossReferenceVMatrix::CrossReferenceVMatrix  ) 
 

default constructor (for automatic deserialization)

Definition at line 51 of file CrossReferenceVMatrix.cc.

PLearn::CrossReferenceVMatrix::CrossReferenceVMatrix VMat  v1,
int  c1,
VMat  v2
 

The column headings are simply the concatenation of the headings in the two vmatrices.

Definition at line 56 of file CrossReferenceVMatrix.cc.

References build(), and inherited.


Member Function Documentation

void PLearn::CrossReferenceVMatrix::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 75 of file CrossReferenceVMatrix.cc.

References build_().

Referenced by CrossReferenceVMatrix().

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

This does the actual building.

Reimplemented from PLearn::VMatrix.

Definition at line 82 of file CrossReferenceVMatrix.cc.

References vm1, and vm2.

Referenced by build().

void PLearn::CrossReferenceVMatrix::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 66 of file CrossReferenceVMatrix.cc.

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

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

returns element (i,j)

Reimplemented from PLearn::VMatrix.

Definition at line 108 of file CrossReferenceVMatrix.cc.

References col1, PLearn::VMatrix::length(), PLERROR, vm1, vm2, PLearn::VMat::width(), and PLearn::VMatrix::width().

void PLearn::CrossReferenceVMatrix::getRow int  i,
Vec  samplevec
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 90 of file CrossReferenceVMatrix.cc.

References col1, PLearn::TVec< T >::length(), PLearn::VMatrix::length(), PLERROR, PLearn::Vec, vm1, vm2, PLearn::VMat::width(), and PLearn::VMatrix::width().

PLearn::CrossReferenceVMatrix::PLEARN_DECLARE_OBJECT CrossReferenceVMatrix   ) 
 

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

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

Reimplemented from PLearn::VMatrix.

Definition at line 86 of file CrossReferenceVMatrix.h.

References PLERROR.


Member Data Documentation

int PLearn::CrossReferenceVMatrix::col1 [protected]
 

Definition at line 66 of file CrossReferenceVMatrix.h.

Referenced by get(), and getRow().

VMat PLearn::CrossReferenceVMatrix::vm1 [protected]
 

Definition at line 65 of file CrossReferenceVMatrix.h.

Referenced by build_(), get(), and getRow().

VMat PLearn::CrossReferenceVMatrix::vm2 [protected]
 

Definition at line 67 of file CrossReferenceVMatrix.h.

Referenced by build_(), get(), and getRow().


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