PLearn 0.1
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Types | Private Member Functions
PLearn::PairsVMatrix Class Reference

#include <PairsVMatrix.h>

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

List of all members.

Public Member Functions

 PairsVMatrix ()
 default constructor (for automatic deserialization)
 PairsVMatrix (Mat the_data1, Mat the_data2)
virtual string classname () const
virtual OptionListgetOptionList () const
virtual OptionMapgetOptionMap () const
virtual RemoteMethodMapgetRemoteMethodMap () const
virtual PairsVMatrixdeepCopy (CopiesMap &copies) const
virtual void build ()
 Simply calls inherited::build() then build_().
virtual void reset_dimensions ()
 In case the dimensions of an underlying VMat has changed, recompute it.

Static Public Member Functions

static string _classname_ ()
 PairsVMatrix.
static OptionList_getOptionList_ ()
static RemoteMethodMap_getRemoteMethodMap_ ()
static Object_new_instance_for_typemap_ ()
static bool _isa_ (const Object *o)
static void _static_initialize_ ()
static const PPathdeclaringFile ()

Static Public Attributes

static StaticInitializer _static_initializer_

Protected Member Functions

virtual void getNewRow (int ij, const Vec &samplevec) const
 This is the only method requiring implementation in subclasses.

Static Protected Member Functions

static void declareOptions (OptionList &ol)
 Declare this class' options.

Protected Attributes

Mat data1
Mat data2

Private Types

typedef RowBufferedVMatrix inherited

Private Member Functions

void build_ ()
 This does the actual building.

Detailed Description

like PairVMatrix but samples from all the pairs in order (traversing all the nxn pairs), outputs a Vec that is the concatenation of the i-th row of data1 and j-th row of data2. The j-index moves faster than the i-index.

Definition at line 60 of file PairsVMatrix.h.


Member Typedef Documentation

Reimplemented from PLearn::RowBufferedVMatrix.

Definition at line 62 of file PairsVMatrix.h.


Constructor & Destructor Documentation

PLearn::PairsVMatrix::PairsVMatrix ( )

default constructor (for automatic deserialization)

Definition at line 51 of file PairsVMatrix.cc.

{
}
PLearn::PairsVMatrix::PairsVMatrix ( Mat  the_data1,
Mat  the_data2 
)

Definition at line 55 of file PairsVMatrix.cc.

    : inherited(data1.width()+data2.width(), data1.length()*data2.length()),
      data1(the_data1), data2(the_data2)
{
}

Member Function Documentation

string PLearn::PairsVMatrix::_classname_ ( ) [static]

PairsVMatrix.

Reimplemented from PLearn::RowBufferedVMatrix.

Definition at line 49 of file PairsVMatrix.cc.

OptionList & PLearn::PairsVMatrix::_getOptionList_ ( ) [static]

Reimplemented from PLearn::RowBufferedVMatrix.

Definition at line 49 of file PairsVMatrix.cc.

RemoteMethodMap & PLearn::PairsVMatrix::_getRemoteMethodMap_ ( ) [static]

Reimplemented from PLearn::RowBufferedVMatrix.

Definition at line 49 of file PairsVMatrix.cc.

bool PLearn::PairsVMatrix::_isa_ ( const Object o) [static]

Reimplemented from PLearn::RowBufferedVMatrix.

Definition at line 49 of file PairsVMatrix.cc.

Object * PLearn::PairsVMatrix::_new_instance_for_typemap_ ( ) [static]

Reimplemented from PLearn::Object.

Definition at line 49 of file PairsVMatrix.cc.

StaticInitializer PairsVMatrix::_static_initializer_ & PLearn::PairsVMatrix::_static_initialize_ ( ) [static]

Reimplemented from PLearn::RowBufferedVMatrix.

Definition at line 49 of file PairsVMatrix.cc.

void PLearn::PairsVMatrix::build ( ) [virtual]

Simply calls inherited::build() then build_().

Reimplemented from PLearn::VMatrix.

Definition at line 62 of file PairsVMatrix.cc.

References PLearn::VMatrix::build(), and build_().

Here is the call graph for this function:

void PLearn::PairsVMatrix::build_ ( ) [private]

This does the actual building.

Reimplemented from PLearn::VMatrix.

Definition at line 69 of file PairsVMatrix.cc.

Referenced by build().

{
}

Here is the caller graph for this function:

string PLearn::PairsVMatrix::classname ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 49 of file PairsVMatrix.cc.

void PLearn::PairsVMatrix::declareOptions ( OptionList ol) [static, protected]

Declare this class' options.

Reimplemented from PLearn::VMatrix.

Definition at line 74 of file PairsVMatrix.cc.

References PLearn::OptionBase::buildoption, data1, data2, PLearn::declareOption(), and PLearn::VMatrix::declareOptions().

Here is the call graph for this function:

static const PPath& PLearn::PairsVMatrix::declaringFile ( ) [inline, static]

Reimplemented from PLearn::RowBufferedVMatrix.

Definition at line 76 of file PairsVMatrix.h.

:

PairsVMatrix * PLearn::PairsVMatrix::deepCopy ( CopiesMap copies) const [virtual]

Reimplemented from PLearn::RowBufferedVMatrix.

Definition at line 49 of file PairsVMatrix.cc.

void PLearn::PairsVMatrix::getNewRow ( int  i,
const Vec v 
) const [protected, virtual]

This is the only method requiring implementation in subclasses.

Implements PLearn::RowBufferedVMatrix.

Definition at line 81 of file PairsVMatrix.cc.

References PLearn::TVec< T >::data(), data1, data2, PLearn::TMat< T >::length(), PLearn::VMatrix::length_, and PLearn::TMat< T >::width().

{
    //ij = ij%length_;
    ij %= length_;
    real* data = samplevec.data();
    real* data_i = data1[ij/data2.length()];
    real* data_j = data2[ij%data2.length()];
    int kk=0;
    for (int k=0;k<data1.width();k++)
        data[kk++] = data_i[k];
    for (int k=0;k<data2.width();k++)
        data[kk++] = data_j[k];
}

Here is the call graph for this function:

OptionList & PLearn::PairsVMatrix::getOptionList ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 49 of file PairsVMatrix.cc.

OptionMap & PLearn::PairsVMatrix::getOptionMap ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 49 of file PairsVMatrix.cc.

RemoteMethodMap & PLearn::PairsVMatrix::getRemoteMethodMap ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 49 of file PairsVMatrix.cc.

virtual void PLearn::PairsVMatrix::reset_dimensions ( ) [inline, virtual]

In case the dimensions of an underlying VMat has changed, recompute it.

Reimplemented from PLearn::VMatrix.

Definition at line 87 of file PairsVMatrix.h.

References PLERROR.

{ PLERROR("PairsVMatrix::reset_dimensions() not implemented"); }

Member Data Documentation

Reimplemented from PLearn::RowBufferedVMatrix.

Definition at line 76 of file PairsVMatrix.h.

Definition at line 65 of file PairsVMatrix.h.

Referenced by declareOptions(), and getNewRow().

Definition at line 66 of file PairsVMatrix.h.

Referenced by declareOptions(), and getNewRow().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines