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

#include <CenteredVMatrix.h>

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

List of all members.

Public Member Functions

 CenteredVMatrix ()
 Default constructor.
 CenteredVMatrix (VMat the_source)
 Constructed from an existing source matrix.
Vec getMu () const
 Return the mean sample mu.
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 CenteredVMatrixdeepCopy (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 ()

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 mu
 The sample mean.

Private Types

typedef SourceVMatrix inherited

Private Member Functions

void build_ ()
 This does the actual building.

Detailed Description

Definition at line 52 of file CenteredVMatrix.h.


Member Typedef Documentation

Reimplemented from PLearn::SourceVMatrix.

Definition at line 57 of file CenteredVMatrix.h.


Constructor & Destructor Documentation

PLearn::CenteredVMatrix::CenteredVMatrix ( )

Default constructor.

Definition at line 54 of file CenteredVMatrix.cc.

{
}
PLearn::CenteredVMatrix::CenteredVMatrix ( VMat  the_source)

Constructed from an existing source matrix.

Definition at line 58 of file CenteredVMatrix.cc.

                                                {
    this->source = the_source;
    build();
}

Member Function Documentation

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

Declares name and deepCopy methods.

Reimplemented from PLearn::SourceVMatrix.

Definition at line 66 of file CenteredVMatrix.cc.

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 66 of file CenteredVMatrix.cc.

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 66 of file CenteredVMatrix.cc.

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 66 of file CenteredVMatrix.cc.

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 66 of file CenteredVMatrix.cc.

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 66 of file CenteredVMatrix.cc.

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

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 90 of file CenteredVMatrix.cc.

{
    // ### Nothing to add here, simply calls build_
    inherited::build();
    build_();
}
void PLearn::CenteredVMatrix::build_ ( ) [private]

This does the actual building.

Reimplemented from PLearn::SourceVMatrix.

Definition at line 100 of file CenteredVMatrix.cc.

References PLearn::computeMean().

{
    // ### This method should do the real building of the object,
    // ### according to set 'options', in *any* situation.
    // ### Typical situations include:
    // ###  - Initial building of an object from a few user-specified options
    // ###  - Building of a "reloaded" object: i.e. from the complete set of all serialised options.
    // ###  - Updating or "re-building" of an object after a few "tuning" options have been modified.
    // ### You should assume that the parent class' build_() has already been called.

    if (source) {
        // Compute the mean.
        computeMean(source, mu);
        setMetaInfoFromSource();
    }
}

Here is the call graph for this function:

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 66 of file CenteredVMatrix.cc.

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

Declares this class' options.

Reimplemented from PLearn::SourceVMatrix.

Definition at line 71 of file CenteredVMatrix.cc.

References PLearn::declareOption(), mu, and PLearn::OptionBase::nosave.

{
    // ### 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

    // There is no need to save 'mu' since it is recomputed at build time.
    declareOption(ol, "mu", &CenteredVMatrix::mu, OptionBase::nosave,
                  "The sample mean");

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

Here is the call graph for this function:

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 116 of file CenteredVMatrix.h.

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 66 of file CenteredVMatrix.cc.

Vec PLearn::CenteredVMatrix::getMu ( ) const

Return the mean sample mu.

Definition at line 120 of file CenteredVMatrix.cc.

Referenced by PLearn::PCA::em_algo(), and PLearn::PCA::em_orth_algo().

                                 {
    return mu;
}

Here is the caller graph for this function:

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

This is the only method requiring implementation.

Reimplemented from PLearn::SourceVMatrix.

Definition at line 127 of file CenteredVMatrix.cc.

{
    source->getRow(i, v);
    v -= mu;
}
OptionList & PLearn::CenteredVMatrix::getOptionList ( ) const [virtual]

Reimplemented from PLearn::SourceVMatrix.

Definition at line 66 of file CenteredVMatrix.cc.

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 66 of file CenteredVMatrix.cc.

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 66 of file CenteredVMatrix.cc.

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

Transforms a shallow copy into a deep copy.

Reimplemented from PLearn::SourceVMatrix.

Definition at line 136 of file CenteredVMatrix.cc.

References 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("CenteredVMatrix::makeDeepCopyFromShallowCopy not fully (correctly) implemented yet!");
}

Member Data Documentation

Reimplemented from PLearn::SourceVMatrix.

Definition at line 116 of file CenteredVMatrix.h.

The sample mean.

Definition at line 68 of file CenteredVMatrix.h.

Referenced by declareOptions().


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