Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

PLearn::RowBufferedVMatrix Class Reference

#include <RowBufferedVMatrix.h>

Inheritance diagram for PLearn::RowBufferedVMatrix:

Inheritance graph
[legend]
Collaboration diagram for PLearn::RowBufferedVMatrix:

Collaboration graph
[legend]
List of all members.

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

Member Typedef Documentation

typedef VMatrix PLearn::RowBufferedVMatrix::inherited [private]
 

Reimplemented from PLearn::VMatrix.

Reimplemented in PLearn::SDBVMatrix, PLearn::AsciiVMatrix, PLearn::BootstrapVMatrix, PLearn::CenteredVMatrix, PLearn::CompactVMatrix, PLearn::CompressedVMatrix, PLearn::ConcatColumnsVMatrix, PLearn::CumVMatrix, PLearn::DatedJoinVMatrix, PLearn::DiskVMatrix, PLearn::ExtendedVMatrix, PLearn::FileVMatrix, PLearn::FilteredVMatrix, PLearn::FinancePreprocVMatrix, PLearn::GeneralizedOneHotVMatrix, PLearn::GetInputVMatrix, PLearn::JoinVMatrix, PLearn::JulianizeVMatrix, PLearn::KNNVMatrix, PLearn::LearnerProcessedVMatrix, PLearn::LocalNeighborsDifferencesVMatrix, PLearn::MovingAverageVMatrix, PLearn::MultiInstanceVMatrix, PLearn::OneHotVMatrix, PLearn::PairsVMatrix, PLearn::PLearnerOutputVMatrix, PLearn::PrecomputedVMatrix, PLearn::ProcessingVMatrix, PLearn::RegularGridVMatrix, PLearn::RemapLastColumnVMatrix, PLearn::RemoveDuplicateVMatrix, PLearn::RowsSubVMatrix, PLearn::SelectColumnsVMatrix, PLearn::SelectRowsVMatrix, PLearn::SortRowsVMatrix, PLearn::SourceVMatrix, PLearn::SparseVMatrix, PLearn::SubInputVMatrix, PLearn::ThresholdVMatrix, PLearn::TransposeVMatrix, PLearn::UniformizeVMatrix, PLearn::UpsideDownVMatrix, PLearn::VecExtendedVMatrix, PLearn::PreprocessingVMatrix, and PLearn::TextSenseSequenceVMatrix.

Definition at line 60 of file RowBufferedVMatrix.h.


Constructor & Destructor Documentation

PLearn::RowBufferedVMatrix::RowBufferedVMatrix  ) 
 

Definition at line 59 of file RowBufferedVMatrix.cc.

References current_row_index, and other_row_index.

PLearn::RowBufferedVMatrix::RowBufferedVMatrix int  the_length,
int  the_width
 

Definition at line 53 of file RowBufferedVMatrix.cc.

References current_row_index, and other_row_index.


Member Function Documentation

real PLearn::RowBufferedVMatrix::dot int  i,
const Vec v
const [virtual]
 

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().

real PLearn::RowBufferedVMatrix::dot int  i1,
int  i2,
int  inputsize
const [virtual]
 

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().

real PLearn::RowBufferedVMatrix::get int  i,
int  j
const [virtual]
 

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().

virtual void PLearn::RowBufferedVMatrix::getNewRow int  i,
const Vec v
const [protected, pure virtual]
 

This is the only method requiring implementation in subclasses.

Implemented in PLearn::AutoSDBVMatrix, PLearn::AsciiVMatrix, PLearn::CenteredVMatrix, PLearn::CompactVMatrix, PLearn::CompressedVMatrix, PLearn::ConcatColumnsVMatrix, PLearn::CumVMatrix, PLearn::DatedJoinVMatrix, PLearn::DiskVMatrix, PLearn::ExtendedVMatrix, PLearn::FileVMatrix, PLearn::FilteredVMatrix, PLearn::FinancePreprocVMatrix, PLearn::GeneralizedOneHotVMatrix, PLearn::JoinVMatrix, PLearn::JulianizeVMatrix, PLearn::KNNVMatrix, PLearn::LearnerProcessedVMatrix, PLearn::LocalNeighborsDifferencesVMatrix, PLearn::MultiInstanceVMatrix, PLearn::OneHotVMatrix, PLearn::PairsVMatrix, PLearn::PLearnerOutputVMatrix, PLearn::PrecomputedVMatrix, PLearn::ProcessingVMatrix, PLearn::RegularGridVMatrix, PLearn::RemapLastColumnVMatrix, PLearn::SelectColumnsVMatrix, PLearn::SelectRowsVMatrix, PLearn::SourceVMatrix, PLearn::SparseVMatrix, PLearn::SubInputVMatrix, PLearn::ThresholdVMatrix, PLearn::TransposeVMatrix, PLearn::UniformizeVMatrix, PLearn::VecExtendedVMatrix, PLearn::PreprocessingVMatrix, and PLearn::TextSenseSequenceVMatrix.

Referenced by dot(), get(), getRow(), and getSubRow().

void PLearn::RowBufferedVMatrix::getRow int  i,
Vec  v
const [virtual]
 

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().

void PLearn::RowBufferedVMatrix::getSubRow int  i,
int  j,
Vec  v
const [virtual]
 

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().

void PLearn::RowBufferedVMatrix::makeDeepCopyFromShallowCopy map< const void *, void * > &  copies  )  [virtual]
 

Transforms a shallow copy into a deep copy.

Reimplemented from PLearn::VMatrix.

Reimplemented in PLearn::CenteredVMatrix, PLearn::CompactVMatrix, PLearn::CumVMatrix, PLearn::DatedJoinVMatrix, PLearn::FileVMatrix, PLearn::FilteredVMatrix, PLearn::FinancePreprocVMatrix, PLearn::GetInputVMatrix, PLearn::JulianizeVMatrix, PLearn::KNNVMatrix, PLearn::LearnerProcessedVMatrix, PLearn::LocalNeighborsDifferencesVMatrix, PLearn::MovingAverageVMatrix, PLearn::MultiInstanceVMatrix, PLearn::PLearnerOutputVMatrix, PLearn::PrecomputedVMatrix, PLearn::ProcessingVMatrix, PLearn::RegularGridVMatrix, PLearn::RemoveDuplicateVMatrix, PLearn::RowsSubVMatrix, PLearn::SelectColumnsVMatrix, PLearn::SelectRowsVMatrix, PLearn::SortRowsVMatrix, PLearn::SourceVMatrix, PLearn::SubInputVMatrix, PLearn::TransposeVMatrix, PLearn::UpsideDownVMatrix, and PLearn::TextSenseSequenceVMatrix.

Definition at line 172 of file RowBufferedVMatrix.cc.

References current_row, PLearn::deepCopyField(), and other_row.

PLearn::RowBufferedVMatrix::PLEARN_DECLARE_ABSTRACT_OBJECT RowBufferedVMatrix   ) 
 


Member Data Documentation

Vec PLearn::RowBufferedVMatrix::current_row [mutable, protected]
 

Definition at line 65 of file RowBufferedVMatrix.h.

Referenced by dot(), get(), getRow(), getSubRow(), and makeDeepCopyFromShallowCopy().

int PLearn::RowBufferedVMatrix::current_row_index [mutable, protected]
 

Definition at line 64 of file RowBufferedVMatrix.h.

Referenced by dot(), get(), getRow(), and getSubRow().

Vec PLearn::RowBufferedVMatrix::other_row [mutable, protected]
 

Definition at line 67 of file RowBufferedVMatrix.h.

Referenced by dot(), and makeDeepCopyFromShallowCopy().

int PLearn::RowBufferedVMatrix::other_row_index [mutable, protected]
 

used by dot

Definition at line 66 of file RowBufferedVMatrix.h.

Referenced by dot().


The documentation for this class was generated from the following files:
Generated on Tue Aug 17 16:26:38 2004 for PLearn by doxygen 1.3.7