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::VecExtendedVMatrix Class Reference

#include <VecExtendedVMatrix.h>

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

List of all members.

Public Member Functions

 VecExtendedVMatrix (bool call_build_=false)
 default constructor (for automatic deserialization)
 VecExtendedVMatrix (VMat the_source, Vec extend_data, bool call_build_=true)
 The fieldinfos of the source are copied, the extension fieldinfos are left empty (fill them yourself)
virtual string classname () const
virtual OptionListgetOptionList () const
virtual OptionMapgetOptionMap () const
virtual RemoteMethodMapgetRemoteMethodMap () const
virtual VecExtendedVMatrixdeepCopy (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_ ()
 VecExtendedVMatrix.
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 i, const Vec &v) const
 Must be implemented in subclasses: default version returns an error.

Static Protected Member Functions

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

Protected Attributes

Vec extend_data_

Private Types

typedef SourceVMatrix inherited

Private Member Functions

void build_ ()
 This does the actual building.

Detailed Description

A VecExtendedVMatrix is similar to an ExtendedVMatrix: it extends the source VMat by appending COLUMNS to its right. The appended columns are filled with a constant vector passed upon construction. For example, if the vector [1,2,3] is passed at construction, then every row of the source VMat will be extended by 3 columns, containing [1,2,3] (constant).

Definition at line 62 of file VecExtendedVMatrix.h.


Member Typedef Documentation

Reimplemented from PLearn::SourceVMatrix.

Definition at line 64 of file VecExtendedVMatrix.h.


Constructor & Destructor Documentation

PLearn::VecExtendedVMatrix::VecExtendedVMatrix ( bool  call_build_ = false)

default constructor (for automatic deserialization)

Definition at line 65 of file VecExtendedVMatrix.cc.

    : inherited(call_build_)
{
    // build_() won't do anything
}
PLearn::VecExtendedVMatrix::VecExtendedVMatrix ( VMat  the_source,
Vec  extend_data,
bool  call_build_ = true 
)

The fieldinfos of the source are copied, the extension fieldinfos are left empty (fill them yourself)

Definition at line 71 of file VecExtendedVMatrix.cc.

References build_().

    : inherited(the_source,
                the_source->length(),
                the_source->width() + extend_data.length(),
                call_build_),
      extend_data_(extend_data)
{
    if( call_build_ )
        build_();
}

Here is the call graph for this function:


Member Function Documentation

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

VecExtendedVMatrix.

Reimplemented from PLearn::SourceVMatrix.

Definition at line 63 of file VecExtendedVMatrix.cc.

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 63 of file VecExtendedVMatrix.cc.

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 63 of file VecExtendedVMatrix.cc.

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 63 of file VecExtendedVMatrix.cc.

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 63 of file VecExtendedVMatrix.cc.

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 63 of file VecExtendedVMatrix.cc.

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

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 83 of file VecExtendedVMatrix.cc.

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

Here is the call graph for this function:

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

This does the actual building.

Reimplemented from PLearn::SourceVMatrix.

Definition at line 89 of file VecExtendedVMatrix.cc.

References PLearn::VMatrix::fieldinfos, PLearn::SourceVMatrix::source, and PLearn::VMatrix::updateMtime().

Referenced by build(), and VecExtendedVMatrix().

{
    if (source)
        fieldinfos = source->getFieldInfos();
    updateMtime(source);
}

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 63 of file VecExtendedVMatrix.cc.

void PLearn::VecExtendedVMatrix::declareOptions ( OptionList ol) [static, protected]
static const PPath& PLearn::VecExtendedVMatrix::declaringFile ( ) [inline, static]

Reimplemented from PLearn::SourceVMatrix.

Definition at line 79 of file VecExtendedVMatrix.h.

:

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 63 of file VecExtendedVMatrix.cc.

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

Must be implemented in subclasses: default version returns an error.

Reimplemented from PLearn::SourceVMatrix.

Definition at line 108 of file VecExtendedVMatrix.cc.

References PLearn::TVec< T >::begin(), std::copy(), PLearn::TVec< T >::end(), extend_data_, PLearn::VMatrix::length(), PLearn::TVec< T >::length(), PLERROR, PLearn::SourceVMatrix::source, PLearn::TVec< T >::subVec(), PLearn::VMat::width(), and PLearn::VMatrix::width().

{
#ifdef BOUNDCHECK
    if(i<0 || i>=length())
        PLERROR("In VecExtendedVMatrix::getNewRow OUT OF BOUNDS");
    if(v.length() != width())
        PLERROR("In VecExtendedVMatrix::getNewRow v.length() must be equal to the VMat's width");
#endif

    Vec subv = v.subVec(0, source->width());
    source->getRow(i,subv);
    copy(extend_data_.begin(), extend_data_.end(),
         v.begin() + source->width());
}

Here is the call graph for this function:

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 63 of file VecExtendedVMatrix.cc.

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 63 of file VecExtendedVMatrix.cc.

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 63 of file VecExtendedVMatrix.cc.

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

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

Reimplemented from PLearn::VMatrix.

Definition at line 90 of file VecExtendedVMatrix.h.

                                    {
        source->reset_dimensions();
        width_ = source.width() + extend_data_.length();
        length_ = source.length();
    }

Member Data Documentation

Reimplemented from PLearn::SourceVMatrix.

Definition at line 79 of file VecExtendedVMatrix.h.

Definition at line 100 of file VecExtendedVMatrix.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