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

PLearn::JoinVMatrix Class Reference

#include <JoinVMatrix.h>

Inheritance diagram for PLearn::JoinVMatrix:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 JoinVMatrix ()
 JoinVMatrix (VMat mas, VMat sla, TVec< int > mi, TVec< int > si)
void addStatField (const string &statis, const string &namefrom, const string &nameto)
 PLEARN_DECLARE_OBJECT (JoinVMatrix)
virtual void build ()
 Should call simply inherited::build(), then this class's build_().

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

virtual const map< string,
real > & 
getStringToRealMapping (int col) const
 returns the string->value mapping for field 'fld'

virtual const map< real, string > & getRealToStringMapping (int col) const
 returns the value->string mapping for field 'fld'

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)

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


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

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


Private Types

typedef RowBufferedVMatrix inherited
typedef hash_multimap< Vec,
int
Maptype
 the fields generated by the join operation (declared with addStatField)


Private Member Functions

void build_ ()
 This does the actual building.


Private Attributes

vector< JoinFieldStatfld
VMat master
VMat slave
Vec temp
Vec tempkey
TVec< intmaster_idx
TVec< intslave_idx
Maptype mp

Member Typedef Documentation

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

Reimplemented from PLearn::RowBufferedVMatrix.

Definition at line 72 of file JoinVMatrix.h.

Referenced by JoinVMatrix().

typedef hash_multimap<Vec,int> PLearn::JoinVMatrix::Maptype [private]
 

the fields generated by the join operation (declared with addStatField)

Definition at line 75 of file JoinVMatrix.h.


Constructor & Destructor Documentation

PLearn::JoinVMatrix::JoinVMatrix  )  [inline]
 

Definition at line 86 of file JoinVMatrix.h.

PLearn::JoinVMatrix::JoinVMatrix VMat  mas,
VMat  sla,
TVec< int mi,
TVec< int si
 

Definition at line 48 of file JoinVMatrix.cc.

References build(), and inherited.


Member Function Documentation

void PLearn::JoinVMatrix::addStatField const string statis,
const string namefrom,
const string nameto
 

Definition at line 93 of file JoinVMatrix.cc.

References fld, PLERROR, slave, and PLearn::VMatrix::width().

Referenced by PLearn::VVMatrix::processJoinSection().

void PLearn::JoinVMatrix::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 55 of file JoinVMatrix.cc.

References build_().

Referenced by JoinVMatrix().

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

This does the actual building.

Reimplemented from PLearn::VMatrix.

Definition at line 62 of file JoinVMatrix.cc.

References PLearn::VMat::fieldName(), PLearn::VMat::length(), master, master_idx, mp, PLERROR, PLearn::TVec< T >::resize(), PLearn::TVec< int >::size(), slave, slave_idx, temp, tempkey, PLearn::VMat::width(), and PLearn::VMatrix::width().

Referenced by build().

void PLearn::JoinVMatrix::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 84 of file JoinVMatrix.cc.

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

void PLearn::JoinVMatrix::getNewRow int  idx,
const Vec v
const [protected, virtual]
 

This is the only method requiring implementation in subclasses.

Implements PLearn::RowBufferedVMatrix.

Definition at line 126 of file JoinVMatrix.cc.

References count, fld, PLearn::is_missing(), master, master_idx, PLearn::max(), PLearn::min(), mp, PLERROR, PLearn::TVec< int >::size(), slave, PLearn::sqrt(), PLearn::TVec< T >::subVec(), PLearn::sum(), PLearn::sumsquare(), temp, tempkey, val, PLearn::VMatrix::width(), and PLearn::VMat::width().

const map< real, string > & PLearn::JoinVMatrix::getRealToStringMapping int  col  )  const [virtual]
 

returns the value->string mapping for field 'fld'

Reimplemented from PLearn::VMatrix.

Definition at line 232 of file JoinVMatrix.cc.

References master, slave, and PLearn::VMat::width().

string PLearn::JoinVMatrix::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 241 of file JoinVMatrix.cc.

References master, slave, and PLearn::VMat::width().

const map< string, real > & PLearn::JoinVMatrix::getStringToRealMapping int  col  )  const [virtual]
 

returns the string->value mapping for field 'fld'

Reimplemented from PLearn::VMatrix.

Definition at line 223 of file JoinVMatrix.cc.

References master, slave, and PLearn::VMat::width().

real PLearn::JoinVMatrix::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 215 of file JoinVMatrix.cc.

References master, slave, and PLearn::VMat::width().

string PLearn::JoinVMatrix::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 207 of file JoinVMatrix.cc.

References master, slave, val, and PLearn::VMat::width().

PLearn::JoinVMatrix::PLEARN_DECLARE_OBJECT JoinVMatrix   ) 
 


Member Data Documentation

vector<JoinFieldStat> PLearn::JoinVMatrix::fld [private]
 

Definition at line 77 of file JoinVMatrix.h.

Referenced by addStatField(), and getNewRow().

VMat PLearn::JoinVMatrix::master [private]
 

Definition at line 78 of file JoinVMatrix.h.

Referenced by build_(), getNewRow(), getRealToStringMapping(), getString(), getStringToRealMapping(), getStringVal(), and getValString().

TVec<int> PLearn::JoinVMatrix::master_idx [private]
 

Definition at line 80 of file JoinVMatrix.h.

Referenced by build_(), and getNewRow().

Maptype PLearn::JoinVMatrix::mp [private]
 

Definition at line 82 of file JoinVMatrix.h.

Referenced by build_(), and getNewRow().

VMat PLearn::JoinVMatrix::slave [private]
 

Definition at line 78 of file JoinVMatrix.h.

Referenced by addStatField(), build_(), getNewRow(), getRealToStringMapping(), getString(), getStringToRealMapping(), getStringVal(), and getValString().

TVec<int> PLearn::JoinVMatrix::slave_idx [private]
 

Definition at line 81 of file JoinVMatrix.h.

Referenced by build_().

Vec PLearn::JoinVMatrix::temp [private]
 

Definition at line 79 of file JoinVMatrix.h.

Referenced by build_(), and getNewRow().

Vec PLearn::JoinVMatrix::tempkey [private]
 

Definition at line 79 of file JoinVMatrix.h.

Referenced by build_(), and getNewRow().


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