#include <VMatLanguage.h>
Inheritance diagram for PLearn::VMatLanguage:
Public Member Functions | |
VMatLanguage () | |
VMatLanguage (VMat vmsrc) | |
PLEARN_DECLARE_OBJECT (VMatLanguage) | |
virtual void | build () |
Should call simply inherited::build(), then this class's build_(). | |
void | run (const Vec &srcvec, const Vec &result, int rowindex=-1) const |
Executes the program on the srcvec, copy resulting stack to result rowindex is only there for instruction 'rowindex' that pushes it on the stack. | |
void | run (int rowindex, const Vec &result) const |
Gets the row with the given rowindex from the vmsource VMat and applies program to it. | |
void | setSource (VMat the_source) |
void | compileStream (istream &in, vector< string > &fieldnames) |
takes a string, filename, or istream and generate the bytecode from it On exit, fieldnames will contain fieldnames of the resulting matrix The source vmat must be set before compiling a VPL program. | |
void | compileString (const string &code, vector< string > &fieldnames) |
void | compileFile (const string &filename, vector< string > &fieldnames) |
int | pstackSize () const |
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) | |
Static Public Attributes | |
bool | output_preproc = false |
Private Types | |
typedef Object | inherited |
Private Member Functions | |
void | generateCode (const string &processed_sourcecode) |
void | generateCode (istream &processed_sourcecode) |
void | preprocess (istream &in, map< string, string > &defines, string &processed_sourcecode, vector< string > &fieldnames) |
void | build_ () |
Static Private Member Functions | |
void | build_opcodes_map () |
builds the map if it does not already exist | |
Private Attributes | |
VMat | vmsource |
TVec< int > | program |
TVec< RealMapping > | mappings |
Vec | pstack |
Vec | myvec |
Vec | mem |
Static Private Attributes | |
map< string, int > | opcodes |
|
Reimplemented from PLearn::Object. Definition at line 61 of file VMatLanguage.h. |
|
Definition at line 86 of file VMatLanguage.h. References build_(), PLearn::Mat, and vmsource. |
|
Definition at line 87 of file VMatLanguage.h. |
|
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::Object. Definition at line 84 of file VMatLanguage.cc. References build_(). |
|
This method should be redefined in subclasses and do the actual building of the object according to previously set option fields. Constructors can just set option fields, and then call build_. This method is NOT virtual, and will typically be called only from three places: a constructor, the public virtual build() method, and possibly the public virtual read method (which calls its parent's read). build_() can assume that it's parent's build_ has already been called. Reimplemented from PLearn::Object. Definition at line 91 of file VMatLanguage.cc. References build_opcodes_map(). Referenced by build(), and VMatLanguage(). |
|
builds the map if it does not already exist
Definition at line 416 of file VMatLanguage.cc. References opcodes. Referenced by build_(). |
|
Definition at line 379 of file VMatLanguage.cc. References compileStream(), and PLERROR. |
|
takes a string, filename, or istream and generate the bytecode from it On exit, fieldnames will contain fieldnames of the resulting matrix The source vmat must be set before compiling a VPL program.
Definition at line 387 of file VMatLanguage.cc. References PLearn::endl(), PLearn::VMat::fieldName(), generateCode(), mappings, output_preproc, PLERROR, preprocess(), program, PLearn::TVec< RealMapping >::resize(), PLearn::TVec< int >::resize(), PLearn::tostring(), vmsource, and PLearn::VMat::width(). Referenced by compileFile(), and compileString(). |
|
Definition at line 373 of file VMatLanguage.cc. References compileStream(). Referenced by PLearn::ProcessingVMatrix::build_(), PLearn::FilteredVMatrix::build_(), PLearn::VVMatrix::generateFilterIndexFile(), PLearn::PreprocessingVMatrix::PreprocessingVMatrix(), and PLearn::vmatmain(). |
|
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::Object. Definition at line 97 of file VMatLanguage.cc. References PLearn::declareOption(), and PLearn::OptionList. |
|
Definition at line 309 of file VMatLanguage.cc. References PLearn::TVec< int >::append(), mappings, opcodes, PLearn::peekAfterSkipBlanks(), PLearn::pl_isnumber(), PLERROR, program, PLearn::TVec< RealMapping >::read(), PLearn::TVec< RealMapping >::resize(), PLearn::TVec< RealMapping >::size(), PLearn::split(), PLearn::tofloat(), PLearn::toint(), and val. |
|
Definition at line 365 of file VMatLanguage.cc. References generateCode(). Referenced by compileStream(), and generateCode(). |
|
|
|
Definition at line 105 of file VMatLanguage.cc. References c_str(), PLearn::VMat::fieldName(), PLearn::getDataSetDate(), PLearn::is_missing(), PLearn::isBlank(), PLearn::join(), PLearn::mtime(), PLearn::pl_isnumber(), PLERROR, PLWARNING, preprocess(), PLearn::removeblanks(), PLearn::skipRestOfLine(), PLearn::split(), PLearn::toint(), PLearn::tostring(), vmsource, and PLearn::VMat::width(). Referenced by compileStream(), and preprocess(). |
|
Definition at line 119 of file VMatLanguage.h. References pstack, and PLearn::TVec< T >::size(). |
|
Gets the row with the given rowindex from the vmsource VMat and applies program to it.
Definition at line 798 of file VMatLanguage.cc. References myvec, PLearn::TVec< T >::resize(), PLearn::Object::run(), vmsource, and PLearn::VMat::width(). |
|
|
Definition at line 102 of file VMatLanguage.h. References program, PLearn::TVec< int >::resize(), setSource(), and vmsource. Referenced by PLearn::ProcessingVMatrix::build_(), PLearn::FilteredVMatrix::build_(), and setSource(). |
|
Definition at line 65 of file VMatLanguage.h. Referenced by compileStream(), generateCode(), and run(). |
|
Definition at line 68 of file VMatLanguage.h. Referenced by run(). |
|
Definition at line 67 of file VMatLanguage.h. Referenced by run(). |
|
Definition at line 79 of file VMatLanguage.cc. Referenced by build_opcodes_map(), and generateCode(). |
|
Definition at line 52 of file VMatLanguage.cc. Referenced by compileStream(). |
|
Definition at line 64 of file VMatLanguage.h. Referenced by compileStream(), generateCode(), run(), and setSource(). |
|
Definition at line 66 of file VMatLanguage.h. Referenced by pstackSize(), and run(). |
|
Definition at line 63 of file VMatLanguage.h. Referenced by compileStream(), preprocess(), run(), setSource(), and VMatLanguage(). |