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

PLearn::RemapLastColumnVMatrix Class Reference

#include <RemapLastColumnVMatrix.h>

Inheritance diagram for PLearn::RemapLastColumnVMatrix:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 RemapLastColumnVMatrix ()
 default constructor (for automatic deserialization)

 RemapLastColumnVMatrix (VMat the_underlying_distr, Mat the_mapping)
 full explicit mapping.

 RemapLastColumnVMatrix (VMat the_underlying_distr, real if_equals_value, real then_value=+1, real else_value=-1)
 if-then-else mapping.

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

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

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 underlying_distr
Mat mapping
 If this is not empty, then it represents the mapping to apply.

real if_equals_val
real then_val
real else_val

Private Types

typedef RowBufferedVMatrix inherited

Private Member Functions

void build_ ()
 This does the actual building.


Member Typedef Documentation

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

Reimplemented from PLearn::RowBufferedVMatrix.

Definition at line 55 of file RemapLastColumnVMatrix.h.

Referenced by RemapLastColumnVMatrix().


Constructor & Destructor Documentation

PLearn::RemapLastColumnVMatrix::RemapLastColumnVMatrix  ) 
 

default constructor (for automatic deserialization)

Definition at line 51 of file RemapLastColumnVMatrix.cc.

PLearn::RemapLastColumnVMatrix::RemapLastColumnVMatrix VMat  the_underlying_distr,
Mat  the_mapping
 

full explicit mapping.

Warning: VMFields are NOT YET handled by this constructor

Definition at line 56 of file RemapLastColumnVMatrix.cc.

References inherited, and PLearn::Mat.

PLearn::RemapLastColumnVMatrix::RemapLastColumnVMatrix VMat  the_underlying_distr,
real  if_equals_value,
real  then_value = +1,
real  else_value = -1
 

if-then-else mapping.

Warning: VMFields are NOT YET handled by this constructor

Definition at line 62 of file RemapLastColumnVMatrix.cc.


Member Function Documentation

void PLearn::RemapLastColumnVMatrix::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 70 of file RemapLastColumnVMatrix.cc.

References build_().

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

This does the actual building.

Reimplemented from PLearn::VMatrix.

Definition at line 77 of file RemapLastColumnVMatrix.cc.

Referenced by build().

void PLearn::RemapLastColumnVMatrix::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 82 of file RemapLastColumnVMatrix.cc.

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

void PLearn::RemapLastColumnVMatrix::getNewRow int  i,
const Vec samplevec
const [virtual]
 

This is the only method requiring implementation in subclasses.

Implements PLearn::RowBufferedVMatrix.

Definition at line 92 of file RemapLastColumnVMatrix.cc.

References else_val, if_equals_val, PLearn::TMat< T >::isEmpty(), k, PLearn::TVec< T >::lastElement(), PLearn::TMat< T >::length(), PLearn::TVec< T >::length(), PLearn::VMatrix::length(), mapping, PLERROR, PLearn::TVec< T >::subVec(), then_val, underlying_distr, val, PLearn::Vec, PLearn::TMat< T >::width(), PLearn::VMat::width(), and PLearn::VMatrix::width().

PLearn::RemapLastColumnVMatrix::PLEARN_DECLARE_OBJECT RemapLastColumnVMatrix   ) 
 

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

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

Reimplemented from PLearn::VMatrix.

Definition at line 92 of file RemapLastColumnVMatrix.h.

References PLearn::VMat::length(), underlying_distr, and PLearn::VMat::width().


Member Data Documentation

real PLearn::RemapLastColumnVMatrix::else_val [protected]
 

Definition at line 70 of file RemapLastColumnVMatrix.h.

Referenced by getNewRow().

real PLearn::RemapLastColumnVMatrix::if_equals_val [protected]
 

These are used only if mapping is an empty Mat, in which case the value in the last column will be replaced by 'then_val' if it is equal to 'if_equals_val', otherwise it will be replaced by 'else_val'

Definition at line 68 of file RemapLastColumnVMatrix.h.

Referenced by getNewRow().

Mat PLearn::RemapLastColumnVMatrix::mapping [protected]
 

If this is not empty, then it represents the mapping to apply.

Definition at line 61 of file RemapLastColumnVMatrix.h.

Referenced by getNewRow().

real PLearn::RemapLastColumnVMatrix::then_val [protected]
 

Definition at line 69 of file RemapLastColumnVMatrix.h.

Referenced by getNewRow().

VMat PLearn::RemapLastColumnVMatrix::underlying_distr [protected]
 

Definition at line 58 of file RemapLastColumnVMatrix.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:35 2004 for PLearn by doxygen 1.3.7