#include <SubVMatrix.h>
Inheritance diagram for PLearn::SubVMatrix:
Public Member Functions | |
SubVMatrix () | |
The appropriate VMFields of the parent VMat are copied upon construction. | |
SubVMatrix (VMat the_parent, int the_istart, int the_jstart, int the_length, int the_width) | |
SubVMatrix (VMat the_parent, real the_fistart, int the_jstart, real the_flength, int the_width) | |
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 | getMat (int i, int j, Mat m) const |
copies the submatrix starting at i,j into m (which must have appropriate length and width) | |
virtual void | put (int i, int j, real value) |
sets element (i,j) to value | |
virtual void | putSubRow (int i, int j, Vec v) |
virtual void | putMat (int i, int j, Mat m) |
copies matrix m at position i,j of this VMat | |
virtual VMat | subMat (int i, int j, int l, int w) |
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 | |
virtual void | makeDeepCopyFromShallowCopy (map< const void *, void * > &copies) |
Transforms a shallow copy into a deep copy. | |
PLEARN_DECLARE_OBJECT (SubVMatrix) | |
virtual void | build () |
Should call simply inherited::build(), then this class's build_(). | |
Public Attributes | |
VMat | parent |
Build options. | |
int | istart |
int | jstart |
real | fistart |
real | flength |
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) | |
Private Types | |
typedef VMatrix | inherited |
Private Member Functions | |
void | build_ () |
This does the actual building. |
|
Reimplemented from PLearn::VMatrix. Definition at line 57 of file SubVMatrix.h. |
|
The appropriate VMFields of the parent VMat are copied upon construction.
Definition at line 54 of file SubVMatrix.cc. |
|
Definition at line 61 of file SubVMatrix.cc. References build_(). |
|
Definition at line 68 of file SubVMatrix.cc. References build_(). |
|
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 91 of file SubVMatrix.cc. References build_(). |
|
This does the actual building.
Reimplemented from PLearn::VMatrix. Definition at line 97 of file SubVMatrix.cc. References fistart, flength, istart, jstart, PLearn::VMatrix::length(), PLearn::VMat::length(), parent, PLERROR, PLearn::TVec< map< string, real > >::resize(), PLearn::TVec< map< real, string > >::resize(), PLearn::TVec< VMField >::resize(), PLearn::VMatrix::width(), and PLearn::VMat::width(). Referenced by build(), and SubVMatrix(). |
|
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 79 of file SubVMatrix.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 222 of file SubVMatrix.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 214 of file SubVMatrix.cc. |
|
returns element (i,j)
Reimplemented from PLearn::VMatrix. Definition at line 154 of file SubVMatrix.cc. References istart, jstart, PLearn::VMatrix::length(), parent, PLERROR, and PLearn::VMatrix::width(). |
|
copies the submatrix starting at i,j into m (which must have appropriate length and width)
Reimplemented from PLearn::VMatrix. Definition at line 171 of file SubVMatrix.cc. References istart, jstart, PLearn::VMatrix::length(), PLearn::TMat< T >::length(), PLearn::Mat, parent, PLERROR, PLearn::VMatrix::width(), and PLearn::TMat< T >::width(). |
|
fills v with the subrow i lying between columns j (inclusive) and j+v.length() (exclusive)
Reimplemented from PLearn::VMatrix. Definition at line 162 of file SubVMatrix.cc. References PLearn::VMat::getSubRow(), istart, jstart, PLearn::TVec< T >::length(), PLearn::VMatrix::length(), parent, PLERROR, PLearn::Vec, and PLearn::VMatrix::width(). |
|
Transforms a shallow copy into a deep copy.
Reimplemented from PLearn::VMatrix. Definition at line 233 of file SubVMatrix.cc. References PLearn::deepCopyField(), and parent. |
|
|
|
sets element (i,j) to value
Reimplemented from PLearn::VMatrix. Definition at line 180 of file SubVMatrix.cc. References istart, jstart, PLearn::VMatrix::length(), parent, PLERROR, and PLearn::VMatrix::width(). |
|
copies matrix m at position i,j of this VMat
Reimplemented from PLearn::VMatrix. Definition at line 197 of file SubVMatrix.cc. References istart, jstart, PLearn::VMatrix::length(), PLearn::TMat< T >::length(), parent, PLERROR, PLearn::VMatrix::width(), and PLearn::TMat< T >::width(). |
|
It is suggested that this method be implemented in subclasses of writable matrices to speed up accesses (default version repeatedly calls put(i,j,value) which may have a significant overhead) Reimplemented from PLearn::VMatrix. Definition at line 188 of file SubVMatrix.cc. References istart, jstart, PLearn::VMatrix::length(), parent, PLERROR, and PLearn::VMatrix::width(). |
|
in case the dimensions of an underlying vmat has changed, recompute it
Reimplemented from PLearn::VMatrix. Definition at line 145 of file SubVMatrix.cc. References PLearn::VMat::length(), parent, and PLearn::VMat::width(). |
|
default version returns a SubVMatrix referencing the current VMatrix however this can be overridden to provide more efficient shortcuts (see MemoryVMatrix::subMat and SubVMatrix::subMat for examples) Reimplemented from PLearn::VMatrix. Definition at line 206 of file SubVMatrix.cc. References istart, jstart, parent, and PLearn::VMat::subMat(). |
|
Definition at line 65 of file SubVMatrix.h. Referenced by build_(). |
|
Definition at line 66 of file SubVMatrix.h. Referenced by build_(). |
|
Definition at line 63 of file SubVMatrix.h. Referenced by build_(), dot(), get(), getMat(), getSubRow(), put(), putMat(), putSubRow(), and subMat(). |
|
Definition at line 64 of file SubVMatrix.h. Referenced by build_(), dot(), get(), getMat(), getSubRow(), put(), putMat(), putSubRow(), and subMat(). |
|
Build options.
Definition at line 62 of file SubVMatrix.h. Referenced by build_(), dot(), get(), getMat(), getSubRow(), makeDeepCopyFromShallowCopy(), put(), putMat(), putSubRow(), reset_dimensions(), and subMat(). |