#include <SelectRowsFileIndexVMatrix.h>
Inheritance diagram for PLearn::SelectRowsFileIndexVMatrix:
Public Member Functions | |
SelectRowsFileIndexVMatrix () | |
default constructor (for automatic deserialization) | |
SelectRowsFileIndexVMatrix (VMat the_distr, const string &indexfile) | |
Copy the original fieldinfos upon construction. | |
PLEARN_DECLARE_OBJECT (SelectRowsFileIndexVMatrix) | |
virtual void | build () |
Should call simply inherited::build(), then this class's build_(). | |
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 | getRow (int i, Vec v) const |
copies row i into v (which must have appropriate length equal to the VMat's width) | |
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 | 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 const map< string, real > & | getStringToRealMapping (int col) const |
returns the string->value mapping for field 'fld' | |
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). | |
virtual void | reset_dimensions () |
in case the dimensions of an underlying vmat has changed, recompute it | |
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 Attributes | |
VMat | distr |
IntVecFile | indices |
string | index_file |
Private Types | |
typedef VMatrix | inherited |
Private Member Functions | |
void | build_ () |
This does the actual building. |
Definition at line 57 of file SelectRowsFileIndexVMatrix.h.
|
Reimplemented from PLearn::VMatrix. Definition at line 59 of file SelectRowsFileIndexVMatrix.h. Referenced by SelectRowsFileIndexVMatrix(). |
|
default constructor (for automatic deserialization)
Definition at line 50 of file SelectRowsFileIndexVMatrix.cc. |
|
Copy the original fieldinfos upon construction.
Definition at line 54 of file SelectRowsFileIndexVMatrix.cc. |
|
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 61 of file SelectRowsFileIndexVMatrix.cc. References build_(). Referenced by SelectRowsFileIndexVMatrix(). |
|
This does the actual building.
Reimplemented from PLearn::VMatrix. Definition at line 68 of file SelectRowsFileIndexVMatrix.cc. References distr, index_file, indices, PLearn::IntVecFile::length(), and PLearn::IntVecFile::open(). Referenced by build(). |
|
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 82 of file SelectRowsFileIndexVMatrix.cc. References PLearn::declareOption(), and PLearn::OptionList. |
|
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 SelectRowsFileIndexVMatrix.cc. |
|
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 SelectRowsFileIndexVMatrix.cc. |
|
returns element (i,j)
Reimplemented from PLearn::VMatrix. Definition at line 89 of file SelectRowsFileIndexVMatrix.cc. |
|
copies row i into v (which must have appropriate length equal to the VMat's width)
Reimplemented from PLearn::VMatrix. Definition at line 95 of file SelectRowsFileIndexVMatrix.cc. |
|
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 110 of file SelectRowsFileIndexVMatrix.cc. |
|
returns the string->value mapping for field 'fld'
Reimplemented from PLearn::VMatrix. Definition at line 113 of file SelectRowsFileIndexVMatrix.cc. References distr. |
|
returns value associated with a string (or MISSING_VALUE if there's no association for this string)
Reimplemented from PLearn::VMatrix. Definition at line 104 of file SelectRowsFileIndexVMatrix.cc. References distr. |
|
fills v with the subrow i lying between columns j (inclusive) and j+v.length() (exclusive)
Reimplemented from PLearn::VMatrix. Definition at line 92 of file SelectRowsFileIndexVMatrix.cc. References distr, PLearn::VMat::getSubRow(), indices, and PLearn::Vec. |
|
returns the string associated with value val for field# col. Or returns "" if no string is associated. Reimplemented from PLearn::VMatrix. Definition at line 107 of file SelectRowsFileIndexVMatrix.cc. |
|
|
|
in case the dimensions of an underlying vmat has changed, recompute it
Reimplemented from PLearn::VMatrix. Definition at line 89 of file SelectRowsFileIndexVMatrix.h. References distr, and PLearn::VMat::width(). |
|
Definition at line 62 of file SelectRowsFileIndexVMatrix.h. Referenced by build_(), dot(), get(), getRow(), getString(), getStringToRealMapping(), getStringVal(), getSubRow(), getValString(), and reset_dimensions(). |
|
Definition at line 64 of file SelectRowsFileIndexVMatrix.h. Referenced by build_(). |
|
Definition at line 63 of file SelectRowsFileIndexVMatrix.h. Referenced by build_(), dot(), get(), getRow(), getString(), and getSubRow(). |