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

PLearn::VecExtendedVMatrix Class Reference

#include <VecExtendedVMatrix.h>

Inheritance diagram for PLearn::VecExtendedVMatrix:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 VecExtendedVMatrix ()
 default constructor (for automatic deserialization)

 VecExtendedVMatrix (VMat underlying, Vec extend_data)
 The fieldinfos of the underlying are copied, the extension fieldinfos are left empty (fill them yourself).

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

virtual void reset_dimensions ()
 in case the dimensions of an underlying vmat has changed, recompute it


Protected Member Functions

virtual void getNewRow (int i, const Vec &v) const
 This is the only method requiring implementation in subclasses.


Static Protected 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 underlying_
Vec extend_data_

Private Types

typedef RowBufferedVMatrix inherited

Private Member Functions

void build_ ()
 This does the actual building.


Detailed Description

A VecExtendedVMatrix is similar to an ExtendedVMatrix: it extends the underlying VMat by appending COLUMNS to its right. The appended columns are filled with a constant vector passed upon construction. For example, if the vector [1,2,3] is passed at construction, then every row of the underlying VMat will be extended by 3 columns, containing [1,2,3] (constant).

Definition at line 62 of file VecExtendedVMatrix.h.


Member Typedef Documentation

typedef RowBufferedVMatrix PLearn::VecExtendedVMatrix::inherited [private]
 

Reimplemented from PLearn::RowBufferedVMatrix.

Definition at line 64 of file VecExtendedVMatrix.h.

Referenced by VecExtendedVMatrix().


Constructor & Destructor Documentation

PLearn::VecExtendedVMatrix::VecExtendedVMatrix  ) 
 

default constructor (for automatic deserialization)

Definition at line 52 of file VecExtendedVMatrix.cc.

PLearn::VecExtendedVMatrix::VecExtendedVMatrix VMat  underlying,
Vec  extend_data
 

The fieldinfos of the underlying are copied, the extension fieldinfos are left empty (fill them yourself).

Definition at line 56 of file VecExtendedVMatrix.cc.

References build(), inherited, and PLearn::Vec.


Member Function Documentation

void PLearn::VecExtendedVMatrix::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 65 of file VecExtendedVMatrix.cc.

References build_().

Referenced by VecExtendedVMatrix().

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

This does the actual building.

Reimplemented from PLearn::VMatrix.

Definition at line 72 of file VecExtendedVMatrix.cc.

References underlying_.

Referenced by build().

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

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 79 of file VecExtendedVMatrix.cc.

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

void PLearn::VecExtendedVMatrix::getNewRow int  i,
const Vec v
const [protected, virtual]
 

This is the only method requiring implementation in subclasses.

Implements PLearn::RowBufferedVMatrix.

Definition at line 86 of file VecExtendedVMatrix.cc.

References PLearn::TVec< T >::begin(), std::copy(), PLearn::TVec< T >::end(), extend_data_, PLearn::TVec< T >::length(), PLearn::VMatrix::length(), PLERROR, PLearn::TVec< T >::subVec(), underlying_, PLearn::VMat::width(), and PLearn::VMatrix::width().

PLearn::VecExtendedVMatrix::PLEARN_DECLARE_OBJECT VecExtendedVMatrix   ) 
 

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

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

Reimplemented from PLearn::VMatrix.

Definition at line 87 of file VecExtendedVMatrix.h.

References extend_data_, PLearn::VMat::length(), PLearn::TVec< T >::length(), underlying_, and PLearn::VMat::width().


Member Data Documentation

Vec PLearn::VecExtendedVMatrix::extend_data_ [protected]
 

Definition at line 95 of file VecExtendedVMatrix.h.

Referenced by getNewRow(), and reset_dimensions().

VMat PLearn::VecExtendedVMatrix::underlying_ [protected]
 

Definition at line 94 of file VecExtendedVMatrix.h.

Referenced by build_(), getNewRow(), and reset_dimensions().


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