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

#include <RealFunctionsProcessedVMatrix.h>

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

List of all members.

Public Member Functions

 RealFunctionsProcessedVMatrix (VMat source_=0, const TVec< RealFunc > &functions_=TVec< RealFunc >(), bool put_raw_input_=false, bool put_non_input_=false, bool call_build_=false)
virtual void build ()
 Simply calls inherited::build() then build_().
virtual void makeDeepCopyFromShallowCopy (CopiesMap &copies)
 Transforms a shallow copy into a deep copy.
virtual string classname () const
virtual OptionListgetOptionList () const
virtual OptionMapgetOptionMap () const
virtual RemoteMethodMapgetRemoteMethodMap () const
virtual
RealFunctionsProcessedVMatrix
deepCopy (CopiesMap &copies) const

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

TVec< RealFuncfunctions
bool put_raw_input
bool put_non_input

Static Public Attributes

static StaticInitializer _static_initializer_

Protected Member Functions

virtual void getNewRow (int i, const Vec &v) const
 This is the only method requiring implementation.

Static Protected Member Functions

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

Protected Attributes

Vec input
Vec targ
real weight

Private Types

typedef SourceVMatrix inherited

Private Member Functions

void build_ ()
 This does the actual building.

Detailed Description

Definition at line 49 of file RealFunctionsProcessedVMatrix.h.


Member Typedef Documentation

Reimplemented from PLearn::SourceVMatrix.

Definition at line 51 of file RealFunctionsProcessedVMatrix.h.


Constructor & Destructor Documentation

PLearn::RealFunctionsProcessedVMatrix::RealFunctionsProcessedVMatrix ( VMat  source_ = 0,
const TVec< RealFunc > &  functions_ = TVec<RealFunc>(),
bool  put_raw_input_ = false,
bool  put_non_input_ = false,
bool  call_build_ = false 
)

Definition at line 46 of file RealFunctionsProcessedVMatrix.cc.

References build_().

    :inherited(source_, call_build_),
     functions(functions_),
     put_raw_input(put_raw_input_),
     put_non_input(put_non_input_)
{
    if( call_build_ )
        build_();
}

Here is the call graph for this function:


Member Function Documentation

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

Declares name and deepCopy methods.

Reimplemented from PLearn::SourceVMatrix.

Definition at line 62 of file RealFunctionsProcessedVMatrix.cc.

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 62 of file RealFunctionsProcessedVMatrix.cc.

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 62 of file RealFunctionsProcessedVMatrix.cc.

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 62 of file RealFunctionsProcessedVMatrix.cc.

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 62 of file RealFunctionsProcessedVMatrix.cc.

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 62 of file RealFunctionsProcessedVMatrix.cc.

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

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 117 of file RealFunctionsProcessedVMatrix.cc.

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

Here is the call graph for this function:

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

This does the actual building.

Reimplemented from PLearn::SourceVMatrix.

Definition at line 97 of file RealFunctionsProcessedVMatrix.cc.

References functions, PLearn::TVec< T >::length(), PLearn::VMat::length(), PLearn::VMatrix::length_, put_non_input, put_raw_input, PLearn::SourceVMatrix::source, PLearn::VMatrix::updateMtime(), and PLearn::VMatrix::width_.

Referenced by build(), and RealFunctionsProcessedVMatrix().

{
    if(source)
    {
        updateMtime(source);
        length_= source->length();
        if(functions)
        {
            width_= functions->length();
            if(put_raw_input)
                width_+= source->inputsize();
            if(put_non_input)
                width_+= source->targetsize() + source->weightsize();
        }
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 62 of file RealFunctionsProcessedVMatrix.cc.

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

Declares this class' options.

Reimplemented from PLearn::SourceVMatrix.

Definition at line 66 of file RealFunctionsProcessedVMatrix.cc.

References PLearn::OptionBase::buildoption, PLearn::declareOption(), PLearn::SourceVMatrix::declareOptions(), functions, put_non_input, and put_raw_input.

{
    // ### Declare all of this object's options here
    // ### For the "flags" of each option, you should typically specify
    // ### one of OptionBase::buildoption, OptionBase::learntoption or
    // ### OptionBase::tuningoption. Another possible flag to be combined with
    // ### is OptionBase::nosave

    declareOption(ol, "functions",
                  &RealFunctionsProcessedVMatrix::functions,
                  OptionBase::buildoption,
                  "The functions used to process the inputs from the source VMat.");

    declareOption(ol, "put_raw_input", &RealFunctionsProcessedVMatrix::put_raw_input,
                  OptionBase::buildoption,
                  "Whether to include in the input part of this VMatrix the"
                  " raw input part\n"
                  "of 'source'.\n");

    declareOption(ol, "put_non_input", &RealFunctionsProcessedVMatrix::put_non_input,
                  OptionBase::buildoption,
                  "Whether to include in this VMatrix the original target and"
                  " weights.");

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

Here is the call graph for this function:

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 109 of file RealFunctionsProcessedVMatrix.h.

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 62 of file RealFunctionsProcessedVMatrix.cc.

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

This is the only method requiring implementation.

Reimplemented from PLearn::SourceVMatrix.

Definition at line 135 of file RealFunctionsProcessedVMatrix.cc.

References PLearn::evaluate_functions(), functions, PLearn::VMat::getExample(), input, PLearn::TVec< T >::length(), put_non_input, put_raw_input, PLearn::SourceVMatrix::source, PLearn::TVec< T >::subVec(), targ, weight, and PLearn::VMatrix::weightsize_.

{
    source->getExample(i, input, targ, weight);
    Vec v2;
    evaluate_functions(functions, input, v2);
    int l0= 0, l1= v2.length();
    v.subVec(l0, l1) << v2;
    l0+= l1;
    if(put_raw_input)
    {
        l1= input.length();
        v.subVec(l0, l1) << input;
        l0+= l1;
    }
    if(put_non_input)
    {
        l1= targ.length();
        v.subVec(l0, l1) << targ;
        if(0 < weightsize_)
            v[l0+l1]= weight;
    }
}

Here is the call graph for this function:

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 62 of file RealFunctionsProcessedVMatrix.cc.

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 62 of file RealFunctionsProcessedVMatrix.cc.

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 62 of file RealFunctionsProcessedVMatrix.cc.

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

Transforms a shallow copy into a deep copy.

Reimplemented from PLearn::SourceVMatrix.

Definition at line 123 of file RealFunctionsProcessedVMatrix.cc.

References PLearn::deepCopyField(), functions, input, PLearn::SourceVMatrix::makeDeepCopyFromShallowCopy(), and targ.

Here is the call graph for this function:


Member Data Documentation

Reimplemented from PLearn::SourceVMatrix.

Definition at line 109 of file RealFunctionsProcessedVMatrix.h.

Definition at line 60 of file RealFunctionsProcessedVMatrix.h.

Referenced by getNewRow(), and makeDeepCopyFromShallowCopy().

Definition at line 72 of file RealFunctionsProcessedVMatrix.h.

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

Definition at line 71 of file RealFunctionsProcessedVMatrix.h.

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

Definition at line 61 of file RealFunctionsProcessedVMatrix.h.

Referenced by getNewRow(), and makeDeepCopyFromShallowCopy().

Definition at line 62 of file RealFunctionsProcessedVMatrix.h.

Referenced by getNewRow().


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