#include <RowBufferedVMatrix.h>
Inheritance diagram for PLearn::RowBufferedVMatrix:
Public Member Functions | |
RowBufferedVMatrix () | |
RowBufferedVMatrix (int the_length, int the_width) | |
virtual real | get (int i, int j) const |
returns element (i,j) | |
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 void | getSubRow (int i, int j, Vec v) const |
fills v with the subrow i laying between columns j (inclusive) and j+v.length() (exclusive) | |
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 | makeDeepCopyFromShallowCopy (map< const void *, void * > &copies) |
Transforms a shallow copy into a deep copy. | |
PLEARN_DECLARE_ABSTRACT_OBJECT (RowBufferedVMatrix) | |
Protected Member Functions | |
virtual void | getNewRow (int i, const Vec &v) const =0 |
This is the only method requiring implementation in subclasses. | |
Protected Attributes | |
int | current_row_index |
Vec | current_row |
int | other_row_index |
used by dot | |
Vec | other_row |
Private Types | |
typedef VMatrix | inherited |
|
|
Definition at line 59 of file RowBufferedVMatrix.cc. References current_row_index, and other_row_index. |
|
Definition at line 53 of file RowBufferedVMatrix.cc. References current_row_index, and other_row_index. |
|
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. Reimplemented in PLearn::CompactVMatrix, PLearn::ConcatColumnsVMatrix, PLearn::OneHotVMatrix, PLearn::SelectRowsVMatrix, and PLearn::SparseVMatrix. Definition at line 158 of file RowBufferedVMatrix.cc. References current_row, current_row_index, PLearn::dot(), getNewRow(), PLearn::TVec< T >::length(), PLearn::TVec< T >::resize(), and PLearn::TVec< T >::subVec(). |
|
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. Reimplemented in PLearn::CompactVMatrix, PLearn::ConcatColumnsVMatrix, PLearn::OneHotVMatrix, PLearn::SelectRowsVMatrix, and PLearn::SparseVMatrix. Definition at line 106 of file RowBufferedVMatrix.cc. References current_row, current_row_index, PLearn::dot(), getNewRow(), other_row, other_row_index, PLearn::pownorm(), PLearn::TVec< T >::resize(), and PLearn::TVec< T >::subVec(). |
|
returns element (i,j)
Reimplemented from PLearn::VMatrix. Reimplemented in PLearn::SelectColumnsVMatrix, and PLearn::SelectRowsVMatrix. Definition at line 66 of file RowBufferedVMatrix.cc. References current_row, current_row_index, getNewRow(), and PLearn::TVec< T >::resize(). |
|
|
copies row i into v (which must have appropriate length equal to the VMat's width)
Reimplemented from PLearn::VMatrix. Reimplemented in PLearn::SDBVMatrix, and PLearn::IntStreamVMatrix. Definition at line 80 of file RowBufferedVMatrix.cc. References PLearn::TVec< T >::copyFrom(), current_row, current_row_index, PLearn::TVec< T >::data(), getNewRow(), and PLearn::TVec< T >::resize(). Referenced by PLearn::CompactVMatrix::append(). |
|
fills v with the subrow i laying between columns j (inclusive) and j+v.length() (exclusive)
Reimplemented from PLearn::VMatrix. Reimplemented in PLearn::SelectColumnsVMatrix, and PLearn::SelectRowsVMatrix. Definition at line 92 of file RowBufferedVMatrix.cc. References PLearn::TVec< T >::copyFrom(), current_row, current_row_index, PLearn::TVec< T >::data(), getNewRow(), PLearn::TVec< T >::length(), and PLearn::TVec< T >::resize(). |
|
|
|
|
Definition at line 65 of file RowBufferedVMatrix.h. Referenced by dot(), get(), getRow(), getSubRow(), and makeDeepCopyFromShallowCopy(). |
|
Definition at line 64 of file RowBufferedVMatrix.h. Referenced by dot(), get(), getRow(), and getSubRow(). |
|
Definition at line 67 of file RowBufferedVMatrix.h. Referenced by dot(), and makeDeepCopyFromShallowCopy(). |
|
used by dot
Definition at line 66 of file RowBufferedVMatrix.h. Referenced by dot(). |