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

The first sentence should be a BRIEF DESCRIPTION of what the class does. More...

#include <PutSubVMatrix.h>

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

List of all members.

Public Member Functions

 PutSubVMatrix ()
 Default constructor.
virtual string classname () const
virtual OptionListgetOptionList () const
virtual OptionMapgetOptionMap () const
virtual RemoteMethodMapgetRemoteMethodMap () const
virtual PutSubVMatrixdeepCopy (CopiesMap &copies) const
virtual void build ()
 Simply calls inherited::build() then build_().
virtual void makeDeepCopyFromShallowCopy (CopiesMap &copies)
 Transforms a shallow copy into a deep copy.

Static Public Member Functions

static string _classname_ ()
 Declares name and deepCopy methods.
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 ()

Public Attributes

int istart
int jstart
VMat submat

Static Public Attributes

static StaticInitializer _static_initializer_

Protected Member Functions

virtual void getNewRow (int i, const Vec &v) const
 Fill the vector 'v' with the content of the i-th row.

Static Protected Member Functions

static void declareOptions (OptionList &ol)
 Declares the class options.

Protected Attributes

Vec subrow

Private Types

typedef SourceVMatrix inherited

Private Member Functions

void build_ ()
 This does the actual building.

Detailed Description

The first sentence should be a BRIEF DESCRIPTION of what the class does.

Place the rest of the class programmer documentation here. Doxygen supports Javadoc-style comments. See http://www.doxygen.org/manual.html

Todo:
Write class to-do's here if there are any.
Deprecated:
Write deprecated stuff here if there is any. Indicate what else should be used instead.

Definition at line 57 of file PutSubVMatrix.h.


Member Typedef Documentation

Reimplemented from PLearn::SourceVMatrix.

Definition at line 59 of file PutSubVMatrix.h.


Constructor & Destructor Documentation

PLearn::PutSubVMatrix::PutSubVMatrix ( )

Default constructor.

Definition at line 55 of file PutSubVMatrix.cc.

                            :
    istart(0),
    jstart(0)
{}

Member Function Documentation

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

Declares name and deepCopy methods.

Reimplemented from PLearn::SourceVMatrix.

Definition at line 50 of file PutSubVMatrix.cc.

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 50 of file PutSubVMatrix.cc.

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 50 of file PutSubVMatrix.cc.

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 50 of file PutSubVMatrix.cc.

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 50 of file PutSubVMatrix.cc.

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 50 of file PutSubVMatrix.cc.

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

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 84 of file PutSubVMatrix.cc.

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

Here is the call graph for this function:

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

This does the actual building.

Reimplemented from PLearn::SourceVMatrix.

Definition at line 93 of file PutSubVMatrix.cc.

References istart, jstart, PLearn::VMat::length(), PLCHECK, PLearn::TVec< T >::resize(), PLearn::SourceVMatrix::setMetaInfoFromSource(), PLearn::SourceVMatrix::source, submat, subrow, PLearn::VMatrix::updateMtime(), and PLearn::VMat::width().

Referenced by build().

{
    if (!source)
        return;

    if (submat) {
        updateMtime(submat);
        PLCHECK( istart + submat.length() <= source->length() );
        PLCHECK( jstart + submat.width() <= source->width() );
        subrow.resize(submat->width());
    }

    setMetaInfoFromSource();
}

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 50 of file PutSubVMatrix.cc.

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

Declares the class options.

Reimplemented from PLearn::SourceVMatrix.

Definition at line 63 of file PutSubVMatrix.cc.

References PLearn::OptionBase::buildoption, PLearn::declareOption(), PLearn::SourceVMatrix::declareOptions(), istart, jstart, and submat.

{
    declareOption(ol, "submat", &PutSubVMatrix::submat,
                  OptionBase::buildoption,
        "The data matrix to put in the source.");

    declareOption(ol, "istart", &PutSubVMatrix::istart,
                  OptionBase::buildoption,
        "Row index where 'submat' will be put.");

    declareOption(ol, "jstart", &PutSubVMatrix::jstart,
                  OptionBase::buildoption,
        "Column index where 'submat' will be put.");

    // Now call the parent class' declareOptions
    inherited::declareOptions(ol);
}

Here is the call graph for this function:

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 82 of file PutSubVMatrix.h.

:

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 50 of file PutSubVMatrix.cc.

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

Fill the vector 'v' with the content of the i-th row.

v is assumed to be the right size. ### This function must be overridden in your class

Reimplemented from PLearn::SourceVMatrix.

Definition at line 111 of file PutSubVMatrix.cc.

References istart, j, jstart, PLearn::VMatrix::length(), PLearn::TVec< T >::length(), PLearn::VMat::length(), PLearn::SourceVMatrix::source, submat, and subrow.

{
    source->getRow(i, v);
    if (submat && submat->length() > 0 && subrow.length() > 0) {
        if (i >= istart && i < istart + submat->length()) {
            submat->getRow(i - istart, subrow);
            for (int j = 0; j < subrow.length(); j++)
                v[jstart + j] = subrow[j];
        }
    }
}

Here is the call graph for this function:

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 50 of file PutSubVMatrix.cc.

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 50 of file PutSubVMatrix.cc.

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 50 of file PutSubVMatrix.cc.

void PLearn::PutSubVMatrix::makeDeepCopyFromShallowCopy ( CopiesMap copies) [virtual]

Transforms a shallow copy into a deep copy.

Reimplemented from PLearn::SourceVMatrix.

Definition at line 126 of file PutSubVMatrix.cc.

References PLearn::SourceVMatrix::makeDeepCopyFromShallowCopy(), and PLERROR.

{
    inherited::makeDeepCopyFromShallowCopy(copies);

    // ### Call deepCopyField on all "pointer-like" fields
    // ### that you wish to be deepCopied rather than
    // ### shallow-copied.
    // ### ex:
    // deepCopyField(trainvec, copies);

    // ### Remove this line when you have fully implemented this method.
    PLERROR("PutSubVMatrix::makeDeepCopyFromShallowCopy not fully (correctly) implemented yet!");
}

Here is the call graph for this function:


Member Data Documentation

Reimplemented from PLearn::SourceVMatrix.

Definition at line 82 of file PutSubVMatrix.h.

Definition at line 64 of file PutSubVMatrix.h.

Referenced by build_(), declareOptions(), and getNewRow().

Definition at line 65 of file PutSubVMatrix.h.

Referenced by build_(), declareOptions(), and getNewRow().

Definition at line 66 of file PutSubVMatrix.h.

Referenced by build_(), declareOptions(), and getNewRow().

Definition at line 93 of file PutSubVMatrix.h.

Referenced by build_(), and getNewRow().


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