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

PLearn::VVMatrix Class Reference

this class is a wrapper for a .vmat VMatrix. More...

#include <VVMatrix.h>

Inheritance diagram for PLearn::VVMatrix:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

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

const stringgetCode ()
bool isPrecomputedAndUpToDate ()
 returns true if the .vmat is precomputed *and* if that precomputed data is more recent than the .vmat file

string getPrecomputedDataName ()
 VVMatrix (const string &filename_)
 VVMatrix ()
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 void makeDeepCopyFromShallowCopy (map< const void *, void * > &copies)
 Transforms a shallow copy into a deep copy.


Static Public Member Functions

time_t getDateOfVMat (const string &filename)
 get "real" date of .vmat according to its dependencies

VMat buildFilteredVMatFromVPL (VMat source, const string &code, const string &ivfname, time_t date_of_code)
 returns the source VMat after filtering it with 'code' .


Public Attributes

string the_filename

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)

VMat createPreproVMat (const string &filename)
 loads a .vmat file and return the VMat object built from it

void generateVMatIndex (VMat source, const string &meta_data_dir, const string &filename, time_t date_of_code, const string &in, size_t idx_prefilter, size_t cidx_prefilter, size_t idx_postfilter, size_t cidx_postfilter, size_t idx_process, size_t cidx_process, size_t idx_shuffle, size_t cidx_shuffle, size_t idx_join, size_t cidx_join)
void processJoinSection (const vector< string > &code, VMat &tmpsource)
vector< vector< string > > extractSourceMatrix (const string &str, const string &filename)
void generateFilterIndexFile (VMat source, const string &code, const string &ivfname)

Protected Attributes

string code
VMat the_mat

Private Types

typedef VMatrix inherited

Private Member Functions

void build_ ()
 This does the actual building.


Detailed Description

this class is a wrapper for a .vmat VMatrix.

Definition at line 48 of file VVMatrix.h.


Member Typedef Documentation

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

Reimplemented from PLearn::VMatrix.

Definition at line 53 of file VVMatrix.h.


Constructor & Destructor Documentation

PLearn::VVMatrix::VVMatrix const string filename_  )  [inline]
 

Definition at line 110 of file VVMatrix.h.

References build_(), and the_filename.

PLearn::VVMatrix::VVMatrix  )  [inline]
 

Definition at line 111 of file VVMatrix.h.


Member Function Documentation

void PLearn::VVMatrix::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 600 of file VVMatrix.cc.

References build_().

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

This does the actual building.

Reimplemented from PLearn::VMatrix.

Definition at line 606 of file VVMatrix.cc.

References code, createPreproVMat(), PLearn::force_mkdir(), PLearn::VMatrix::getMetaDataDir(), PLearn::PP< VMatrix >::isNull(), PLearn::VMat::length(), PLearn::makeExplicitPath(), PLearn::newObject(), PLERROR, PLearn::readFileAndMacroProcess(), PLearn::removeblanks(), PLearn::TVec< VMField >::resize(), the_filename, the_mat, and PLearn::VMat::width().

Referenced by build(), and VVMatrix().

VMat PLearn::VVMatrix::buildFilteredVMatFromVPL VMat  source,
const string code,
const string ivfname,
time_t  date_of_code
[static]
 

returns the source VMat after filtering it with 'code' .

ivfname is the name of the index file and date_of_code is the code last modification date. If existant, index file is used as is, provided its date is > the latest date of all files (code + all its dependencies)

Definition at line 102 of file VVMatrix.cc.

References generateFilterIndexFile(), PLearn::getNonBlankLines(), PLearn::isfile(), and PLearn::mtime().

Referenced by generateVMatIndex().

VMat PLearn::VVMatrix::createPreproVMat const string filename  )  [static, protected]
 

loads a .vmat file and return the VMat object built from it

Definition at line 344 of file VVMatrix.cc.

References code, PLearn::endl(), PLearn::extract_directory(), extractSourceMatrix(), PLearn::force_mkdir(), PLearn::force_rmdir(), generateVMatIndex(), PLearn::getDataSet(), getDateOfVMat(), PLearn::hconcat(), PLearn::isdir(), PLearn::isfile(), PLearn::PP< VMatrix >::isNull(), PLearn::TVec< T >::length(), PLearn::mtime(), PLearn::mvforce(), NEW_SYNTAX_CHAR, PLearn::newObject(), PLearn::pathexists(), PLERROR, PLWARNING, processJoinSection(), PLearn::readFileAndMacroProcess(), PLearn::remove_trailing_slash(), PLearn::removeblanks(), PLearn::rm(), PLearn::TVec< T >::size(), slash, slash_char, PLearn::split(), PLearn::toint(), and PLearn::vconcat().

Referenced by build_().

void PLearn::VVMatrix::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 71 of file VVMatrix.cc.

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

vector< vector< string > > PLearn::VVMatrix::extractSourceMatrix const string str,
const string filename
[static, protected]
 

Definition at line 113 of file VVMatrix.cc.

References PLearn::extract_directory(), PLearn::file_exists(), PLearn::getNonBlankLines(), NEW_SYNTAX_CHAR, PLearn::removeblanks(), slash_char, and PLearn::split().

Referenced by createPreproVMat(), and getDateOfVMat().

void PLearn::VVMatrix::generateFilterIndexFile VMat  source,
const string code,
const string ivfname
[static, protected]
 

Definition at line 80 of file VVMatrix.cc.

References PLearn::IntVecFile::append(), PLearn::IntVecFile::close(), PLearn::VMatLanguage::compileString(), PLearn::VMat::fieldName(), PLearn::VMat::length(), PLearn::rm(), PLearn::VMatLanguage::run(), PLearn::Vec, and PLearn::VMat::width().

Referenced by buildFilteredVMatFromVPL().

void PLearn::VVMatrix::generateVMatIndex VMat  source,
const string meta_data_dir,
const string filename,
time_t  date_of_code,
const string in,
size_t  idx_prefilter,
size_t  cidx_prefilter,
size_t  idx_postfilter,
size_t  cidx_postfilter,
size_t  idx_process,
size_t  cidx_process,
size_t  idx_shuffle,
size_t  cidx_shuffle,
size_t  idx_join,
size_t  cidx_join
[static, protected]
 

Definition at line 219 of file VVMatrix.cc.

References PLearn::IntVecFile::append(), buildFilteredVMatFromVPL(), code, PLearn::endl(), PLearn::IntVecFile::getVec(), PLearn::isfile(), PLearn::VMat::length(), PLearn::IntVecFile::length(), PLearn::manual_seed(), PLearn::mv(), PLERROR, processJoinSection(), PLearn::removeblanks(), PLearn::rm(), PLearn::seed(), PLearn::shuffleElements(), slash, PLearn::split(), and PLearn::toint().

Referenced by createPreproVMat().

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

returns element (i,j)

Reimplemented from PLearn::VMatrix.

Definition at line 125 of file VVMatrix.h.

References get(), and the_mat.

Referenced by get().

const string& PLearn::VVMatrix::getCode  )  [inline]
 

Definition at line 94 of file VVMatrix.h.

References code.

time_t PLearn::VVMatrix::getDateOfVMat const string filename  )  [static]
 

get "real" date of .vmat according to its dependencies

Definition at line 142 of file VVMatrix.cc.

References PLearn::extract_directory(), extractSourceMatrix(), PLearn::getDataSetDate(), PLearn::getDateOfCode(), PLearn::mtime(), PLERROR, PLearn::readFileAndMacroProcess(), slash_char, PLearn::split(), and PLearn::strlen().

Referenced by createPreproVMat().

string PLearn::VVMatrix::getPrecomputedDataName  ) 
 

Definition at line 333 of file VVMatrix.cc.

References PLearn::isfile(), PLearn::pathexists(), PLearn::remove_trailing_slash(), slash, and the_filename.

Referenced by PLearn::vmatmain().

virtual void PLearn::VVMatrix::getSubRow int  i,
int  j,
Vec  v
const [inline, virtual]
 

fills v with the subrow i lying between columns j (inclusive) and j+v.length() (exclusive)

Reimplemented from PLearn::VMatrix.

Definition at line 126 of file VVMatrix.h.

References PLearn::VMat::getSubRow(), getSubRow(), and the_mat.

Referenced by getSubRow().

bool PLearn::VVMatrix::isPrecomputedAndUpToDate  ) 
 

returns true if the .vmat is precomputed *and* if that precomputed data is more recent than the .vmat file

Definition at line 321 of file VVMatrix.cc.

References PLearn::VMatrix::getMtime(), PLearn::isfile(), PLearn::mtime(), PLearn::pathexists(), PLearn::remove_trailing_slash(), slash, and the_filename.

Referenced by PLearn::vmatmain().

void PLearn::VVMatrix::makeDeepCopyFromShallowCopy map< const void *, void * > &  copies  )  [virtual]
 

Transforms a shallow copy into a deep copy.

Reimplemented from PLearn::VMatrix.

Definition at line 666 of file VVMatrix.cc.

References PLearn::deepCopyField(), and the_mat.

PLearn::VVMatrix::PLEARN_DECLARE_OBJECT VVMatrix   ) 
 

void PLearn::VVMatrix::processJoinSection const vector< string > &  code,
VMat tmpsource
[static, protected]
 

Definition at line 180 of file VVMatrix.cc.

References PLearn::JoinVMatrix::addStatField(), PLearn::getDataSet(), PLearn::isBlank(), PLERROR, PLearn::removeblanks(), and PLearn::split().

Referenced by createPreproVMat(), and generateVMatIndex().


Member Data Documentation

string PLearn::VVMatrix::code [protected]
 

Definition at line 57 of file VVMatrix.h.

Referenced by build_(), createPreproVMat(), generateVMatIndex(), and getCode().

string PLearn::VVMatrix::the_filename
 

Definition at line 86 of file VVMatrix.h.

Referenced by build_(), getPrecomputedDataName(), isPrecomputedAndUpToDate(), and VVMatrix().

VMat PLearn::VVMatrix::the_mat [protected]
 

Definition at line 58 of file VVMatrix.h.

Referenced by build_(), get(), getSubRow(), and makeDeepCopyFromShallowCopy().


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