#include <ConcatRowsSubVMatrix.h>
Inheritance diagram for PLearn::ConcatRowsSubVMatrix:
Public Member Functions | |
ConcatRowsSubVMatrix () | |
default constructor (for automatic deserialization) | |
ConcatRowsSubVMatrix (VMat the_distr, TVec< int > &the_start, TVec< int > &the_len) | |
The field names of the parent VMat are copied upon construction. | |
ConcatRowsSubVMatrix (VMat the_distr, int start1, int len1, int start2, int len2) | |
PLEARN_DECLARE_OBJECT (ConcatRowsSubVMatrix) | |
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 | 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). | |
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 | |
void | check () |
check ranges are compatible | |
void | getpositions (int i, int &whichvm, int &rowofvm) const |
returns the index of the correct sub-VMat in the array and the the row number in this VMat that correspond to row i in the ConcatRowsVMat | |
Protected Attributes | |
VMat | distr |
TVec< int > | start |
TVec< int > | len |
Private Types | |
typedef VMatrix | inherited |
Private Member Functions | |
void | build_ () |
This does the actual building. |
Definition at line 60 of file ConcatRowsSubVMatrix.h.
|
Reimplemented from PLearn::VMatrix. Definition at line 62 of file ConcatRowsSubVMatrix.h. Referenced by ConcatRowsSubVMatrix(). |
|
default constructor (for automatic deserialization)
Definition at line 51 of file ConcatRowsSubVMatrix.cc. |
|
The field names of the parent VMat are copied upon construction. Copy parent field names Definition at line 55 of file ConcatRowsSubVMatrix.cc. |
|
Copy parent field names Definition at line 67 of file ConcatRowsSubVMatrix.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 154 of file ConcatRowsSubVMatrix.cc. References build_(). Referenced by ConcatRowsSubVMatrix(). |
|
This does the actual building.
Reimplemented from PLearn::VMatrix. Definition at line 161 of file ConcatRowsSubVMatrix.cc. References distr, len, PLearn::VMat::length(), PLearn::TVec< int >::length(), PLERROR, and start. Referenced by build(). |
|
check ranges are compatible
|
|
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 145 of file ConcatRowsSubVMatrix.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 137 of file ConcatRowsSubVMatrix.cc. References distr, getpositions(), and start. |
|
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 128 of file ConcatRowsSubVMatrix.cc. References distr, getpositions(), and start. |
|
returns element (i,j)
Reimplemented from PLearn::VMatrix. Definition at line 114 of file ConcatRowsSubVMatrix.cc. References distr, getpositions(), and start. |
|
returns the index of the correct sub-VMat in the array and the the row number in this VMat that correspond to row i in the ConcatRowsVMat
Definition at line 95 of file ConcatRowsSubVMatrix.cc. References k, len, PLearn::VMatrix::length(), and PLERROR. Referenced by dot(), get(), and getSubRow(). |
|
fills v with the subrow i lying between columns j (inclusive) and j+v.length() (exclusive)
Reimplemented from PLearn::VMatrix. Definition at line 121 of file ConcatRowsSubVMatrix.cc. References distr, getpositions(), PLearn::VMat::getSubRow(), start, and PLearn::Vec. |
|
|
|
in case the dimensions of an underlying vmat has changed, recompute it
Reimplemented from PLearn::VMatrix. Definition at line 92 of file ConcatRowsSubVMatrix.h. References distr, len, PLearn::TVec< int >::length(), and PLearn::VMat::width(). |
|
Definition at line 65 of file ConcatRowsSubVMatrix.h. Referenced by build_(), dot(), get(), getSubRow(), and reset_dimensions(). |
|
Definition at line 67 of file ConcatRowsSubVMatrix.h. Referenced by build_(), ConcatRowsSubVMatrix(), getpositions(), and reset_dimensions(). |
|
Definition at line 66 of file ConcatRowsSubVMatrix.h. Referenced by build_(), ConcatRowsSubVMatrix(), dot(), get(), and getSubRow(). |