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

PLearn::ConcatColumnsVMatrix Class Reference

#include <ConcatColumnsVMatrix.h>

Inheritance diagram for PLearn::ConcatColumnsVMatrix:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ConcatColumnsVMatrix (Array< VMat > the_array=Array< VMat >())
 The lists of VMFields are appended upon construction.

 ConcatColumnsVMatrix (VMat d1, VMat d2)
virtual real getStringVal (int col, const string &str) const
 returns value associated with a string (or MISSING_VALUE if there's no association for this string)

const map< string, real > & getStringMapping (int col) const
 returns the whole string->value mapping

virtual string getValString (int col, real val) const
 returns the string associated with value val for field# col.

virtual string getString (int row, int col) const
 returns element as a string, even if value doesn't map to a string, in which case tostring(value) is returned

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

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).

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


Public Attributes

bool no_duplicate_fieldnames

Protected Member Functions

virtual void getNewRow (int i, const Vec &samplevec) 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

Array< VMatarray

Private Types

typedef RowBufferedVMatrix inherited

Private Member Functions

void build_ ()
 This does the actual building.


Member Typedef Documentation

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

Reimplemented from PLearn::RowBufferedVMatrix.

Definition at line 56 of file ConcatColumnsVMatrix.h.


Constructor & Destructor Documentation

PLearn::ConcatColumnsVMatrix::ConcatColumnsVMatrix Array< VMat the_array = ArrayVMat >()  ) 
 

The lists of VMFields are appended upon construction.

The case where some VMat may have some fields and others not is handled properly.

Definition at line 50 of file ConcatColumnsVMatrix.cc.

References array, build_(), and PLearn::TVec< VMat >::size().

PLearn::ConcatColumnsVMatrix::ConcatColumnsVMatrix VMat  d1,
VMat  d2
 

Definition at line 55 of file ConcatColumnsVMatrix.cc.

References build_().


Member Function Documentation

void PLearn::ConcatColumnsVMatrix::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 69 of file ConcatColumnsVMatrix.cc.

References build_().

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

This does the actual building.

Reimplemented from PLearn::VMatrix.

Definition at line 75 of file ConcatColumnsVMatrix.cc.

References array, PLearn::TVec< VMat >::length(), no_duplicate_fieldnames, PLERROR, PLearn::TVec< VMField >::resize(), PLearn::TVec< VMat >::size(), PLearn::tostring(), and PLearn::VMatrix::unduplicateFieldNames().

Referenced by build(), and ConcatColumnsVMatrix().

void PLearn::ConcatColumnsVMatrix::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 61 of file ConcatColumnsVMatrix.cc.

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

real PLearn::ConcatColumnsVMatrix::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::RowBufferedVMatrix.

Definition at line 210 of file ConcatColumnsVMatrix.cc.

References array, PLearn::TVec< T >::length(), PLERROR, PLearn::TVec< VMat >::size(), PLearn::TVec< T >::subVec(), and PLearn::VMatrix::width().

real PLearn::ConcatColumnsVMatrix::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::RowBufferedVMatrix.

Definition at line 189 of file ConcatColumnsVMatrix.cc.

References array, k, and PLearn::VMat::width().

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

This is the only method requiring implementation in subclasses.

Implements PLearn::RowBufferedVMatrix.

Definition at line 117 of file ConcatColumnsVMatrix.cc.

References array, PLERROR, PLearn::TVec< VMat >::size(), PLearn::TVec< T >::subVec(), and PLearn::Vec.

string PLearn::ConcatColumnsVMatrix::getString int  row,
int  col
const [virtual]
 

returns element as a string, even if value doesn't map to a string, in which case tostring(value) is returned

Reimplemented from PLearn::VMatrix.

Definition at line 173 of file ConcatColumnsVMatrix.cc.

References array, k, and PLERROR.

const map< string, real > & PLearn::ConcatColumnsVMatrix::getStringMapping int  col  )  const
 

returns the whole string->value mapping

Definition at line 159 of file ConcatColumnsVMatrix.cc.

References array, k, and PLERROR.

real PLearn::ConcatColumnsVMatrix::getStringVal int  col,
const string str
const [virtual]
 

returns value associated with a string (or MISSING_VALUE if there's no association for this string)

Reimplemented from PLearn::VMatrix.

Definition at line 131 of file ConcatColumnsVMatrix.cc.

References array, k, and PLERROR.

string PLearn::ConcatColumnsVMatrix::getValString int  col,
real  val
const [virtual]
 

returns the string associated with value val for field# col.

Or returns "" if no string is associated.

Reimplemented from PLearn::VMatrix.

Definition at line 145 of file ConcatColumnsVMatrix.cc.

References array, k, PLERROR, and val.

PLearn::ConcatColumnsVMatrix::PLEARN_DECLARE_OBJECT ConcatColumnsVMatrix   ) 
 

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

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

Reimplemented from PLearn::VMatrix.

Definition at line 82 of file ConcatColumnsVMatrix.h.

References PLERROR.


Member Data Documentation

Array<VMat> PLearn::ConcatColumnsVMatrix::array [protected]
 

Definition at line 59 of file ConcatColumnsVMatrix.h.

Referenced by build_(), ConcatColumnsVMatrix(), dot(), getNewRow(), getString(), getStringMapping(), getStringVal(), and getValString().

bool PLearn::ConcatColumnsVMatrix::no_duplicate_fieldnames
 

Definition at line 63 of file ConcatColumnsVMatrix.h.

Referenced by build_().


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