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

PLearn::ExtendedVMatrix Class Reference

#include <ExtendedVMatrix.h>

Inheritance diagram for PLearn::ExtendedVMatrix:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ExtendedVMatrix ()
 default constructor (for automatic deserialization)

 ExtendedVMatrix (VMat the_distr, int the_top_extent, int the_bottom_extent, int the_left_extent, int the_right_extent, real the_fill_value)
 Warning: VMFields are NOT YET handled by this constructor.

 PLEARN_DECLARE_OBJECT (ExtendedVMatrix)
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


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)


Public Attributes

VMat distr
int top_extent
int bottom_extent
int left_extent
int right_extent
real fill_value

Protected Member Functions

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


Private Types

typedef RowBufferedVMatrix inherited

Private Member Functions

void build_ ()
 This does the actual building.


Detailed Description

VMatrix that extends the underlying VMat by appending rows at its top and bottom and columns at its left and right. The appended rows/columns are filled with the given fill_value This can be used for instance to easily implement the usual trick to include the bias in the weights vectors, by appending a 1 to the inputs.

Definition at line 60 of file ExtendedVMatrix.h.


Member Typedef Documentation

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

Reimplemented from PLearn::RowBufferedVMatrix.

Definition at line 62 of file ExtendedVMatrix.h.

Referenced by ExtendedVMatrix().


Constructor & Destructor Documentation

PLearn::ExtendedVMatrix::ExtendedVMatrix  ) 
 

default constructor (for automatic deserialization)

Definition at line 51 of file ExtendedVMatrix.cc.

PLearn::ExtendedVMatrix::ExtendedVMatrix VMat  the_distr,
int  the_top_extent,
int  the_bottom_extent,
int  the_left_extent,
int  the_right_extent,
real  the_fill_value
 

Warning: VMFields are NOT YET handled by this constructor.

Definition at line 56 of file ExtendedVMatrix.cc.

References inherited.


Member Function Documentation

void PLearn::ExtendedVMatrix::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 79 of file ExtendedVMatrix.cc.

References build_().

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

This does the actual building.

Reimplemented from PLearn::VMatrix.

Definition at line 86 of file ExtendedVMatrix.cc.

Referenced by build().

void PLearn::ExtendedVMatrix::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 67 of file ExtendedVMatrix.cc.

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

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

This is the only method requiring implementation in subclasses.

Implements PLearn::RowBufferedVMatrix.

Definition at line 90 of file ExtendedVMatrix.cc.

References bottom_extent, distr, PLearn::TVec< T >::fill(), fill_value, left_extent, PLearn::TVec< T >::length(), PLearn::VMatrix::length(), PLERROR, right_extent, PLearn::TVec< T >::subVec(), top_extent, PLearn::Vec, PLearn::VMat::width(), and PLearn::VMatrix::width().

PLearn::ExtendedVMatrix::PLEARN_DECLARE_OBJECT ExtendedVMatrix   ) 
 

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

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

Reimplemented from PLearn::VMatrix.

Definition at line 88 of file ExtendedVMatrix.h.

References bottom_extent, distr, left_extent, PLearn::VMat::length(), right_extent, top_extent, and PLearn::VMat::width().


Member Data Documentation

int PLearn::ExtendedVMatrix::bottom_extent
 

Definition at line 67 of file ExtendedVMatrix.h.

Referenced by getNewRow(), and reset_dimensions().

VMat PLearn::ExtendedVMatrix::distr
 

Definition at line 65 of file ExtendedVMatrix.h.

Referenced by getNewRow(), and reset_dimensions().

real PLearn::ExtendedVMatrix::fill_value
 

Definition at line 70 of file ExtendedVMatrix.h.

Referenced by getNewRow().

int PLearn::ExtendedVMatrix::left_extent
 

Definition at line 68 of file ExtendedVMatrix.h.

Referenced by getNewRow(), and reset_dimensions().

int PLearn::ExtendedVMatrix::right_extent
 

Definition at line 69 of file ExtendedVMatrix.h.

Referenced by getNewRow(), and reset_dimensions().

int PLearn::ExtendedVMatrix::top_extent
 

Definition at line 66 of file ExtendedVMatrix.h.

Referenced by getNewRow(), and reset_dimensions().


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