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

PLearn::RemoveRowsVMatrix Class Reference

sees an underlying VMat with the specified rows excluded More...

#include <RemoveRowsVMatrix.h>

Inheritance diagram for PLearn::RemoveRowsVMatrix:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

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

 RemoveRowsVMatrix ()
 RemoveRowsVMatrix (VMat the_distr, Vec the_indices=Vec())
 Copy the original fieldinfos upon construction.

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

void remove (int rownum)
 the given rownum of the underlying distr will also be excluded

void unremove (int rownum)
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 real dot (int i1, int i2, int inputsize) const
virtual real dot (int i, const Vec &v) const
 returns the result of the dot product between row i and the given vec (only v.length() first elements of row i are considered).


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 Member Functions

int getrownum (int i) const
 returns the row number in distr corresponding to i in this VMat


Protected Attributes

VMat distr
Vec indices

Private Types

typedef VMatrix inherited

Private Member Functions

void build_ ()
 This does the actual building.


Detailed Description

sees an underlying VMat with the specified rows excluded

Definition at line 53 of file RemoveRowsVMatrix.h.


Member Typedef Documentation

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

Reimplemented from PLearn::VMatrix.

Definition at line 55 of file RemoveRowsVMatrix.h.

Referenced by RemoveRowsVMatrix().


Constructor & Destructor Documentation

PLearn::RemoveRowsVMatrix::RemoveRowsVMatrix  )  [inline]
 

Definition at line 70 of file RemoveRowsVMatrix.h.

PLearn::RemoveRowsVMatrix::RemoveRowsVMatrix VMat  the_distr,
Vec  the_indices = Vec()
 

Copy the original fieldinfos upon construction.

Definition at line 50 of file RemoveRowsVMatrix.cc.

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


Member Function Documentation

void PLearn::RemoveRowsVMatrix::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 58 of file RemoveRowsVMatrix.cc.

References build_().

Referenced by RemoveRowsVMatrix().

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

This does the actual building.

Reimplemented from PLearn::VMatrix.

Definition at line 65 of file RemoveRowsVMatrix.cc.

References distr, indices, and PLearn::sortElements().

Referenced by build().

void PLearn::RemoveRowsVMatrix::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 74 of file RemoveRowsVMatrix.cc.

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

real PLearn::RemoveRowsVMatrix::dot int  i,
const Vec v
const [virtual]
 

returns the result of the dot product between row i and the given vec (only v.length() first elements of row i are considered).

Reimplemented from PLearn::VMatrix.

Definition at line 101 of file RemoveRowsVMatrix.cc.

References distr, and getrownum().

real PLearn::RemoveRowsVMatrix::dot int  i1,
int  i2,
int  inputsize
const [virtual]
 

returns the dot product between row i1 and row i2 (considering only the inputsize first elements). The default version in VMatrix is somewhat inefficient, as it repeatedly calls get(i,j) The default version in RowBufferedVMatrix is a little better as it buffers the 2 Vecs between calls in case one of them is needed again. But the real strength of this method is for specialised and efficient versions in subbclasses. This method is typically used by SmartKernels so that they can compute kernel values between input samples efficiently.

Reimplemented from PLearn::VMatrix.

Definition at line 98 of file RemoveRowsVMatrix.cc.

References distr, and getrownum().

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

returns element (i,j)

Reimplemented from PLearn::VMatrix.

Definition at line 92 of file RemoveRowsVMatrix.cc.

References distr, and getrownum().

int PLearn::RemoveRowsVMatrix::getrownum int  i  )  const [protected]
 

returns the row number in distr corresponding to i in this VMat

Definition at line 81 of file RemoveRowsVMatrix.cc.

References indices, k, and PLearn::TVec< T >::length().

Referenced by dot(), get(), and getSubRow().

void PLearn::RemoveRowsVMatrix::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 95 of file RemoveRowsVMatrix.cc.

References distr, getrownum(), and PLearn::VMat::getSubRow().

PLearn::RemoveRowsVMatrix::PLEARN_DECLARE_OBJECT RemoveRowsVMatrix   ) 
 

void PLearn::RemoveRowsVMatrix::remove int  rownum  )  [inline]
 

the given rownum of the underlying distr will also be excluded

Definition at line 81 of file RemoveRowsVMatrix.h.

References indices, and PLearn::TVec< T >::insertSorted().

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

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

Reimplemented from PLearn::VMatrix.

Definition at line 65 of file RemoveRowsVMatrix.h.

References distr, and PLearn::VMat::width().

void PLearn::RemoveRowsVMatrix::unremove int  rownum  )  [inline]
 

Definition at line 87 of file RemoveRowsVMatrix.h.

References indices, PLearn::TVec< T >::removeSorted(), and unremove().

Referenced by unremove().


Member Data Documentation

VMat PLearn::RemoveRowsVMatrix::distr [protected]
 

Definition at line 58 of file RemoveRowsVMatrix.h.

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

Vec PLearn::RemoveRowsVMatrix::indices [protected]
 

Definition at line 59 of file RemoveRowsVMatrix.h.

Referenced by build_(), getrownum(), remove(), and unremove().


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