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

#include <GramVMatrix.h>

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

List of all members.

Public Member Functions

 GramVMatrix ()
 Default constructor.
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 GramVMatrixdeepCopy (CopiesMap &copies) const

Static Public Member Functions

static string _classname_ ()
 MemoryVMatrix.
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

Ker kernel
int verbosity

Static Public Attributes

static StaticInitializer _static_initializer_

Static Protected Member Functions

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

Private Types

typedef MemoryVMatrix inherited

Private Member Functions

void build_ ()
 This does the actual building.

Detailed Description

Definition at line 53 of file GramVMatrix.h.


Member Typedef Documentation

Reimplemented from PLearn::MemoryVMatrix.

Definition at line 58 of file GramVMatrix.h.


Constructor & Destructor Documentation

PLearn::GramVMatrix::GramVMatrix ( )

Default constructor.

Definition at line 53 of file GramVMatrix.cc.

    : verbosity(1)
{
}

Member Function Documentation

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

MemoryVMatrix.

Reimplemented from PLearn::MemoryVMatrix.

Definition at line 62 of file GramVMatrix.cc.

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

Reimplemented from PLearn::MemoryVMatrix.

Definition at line 62 of file GramVMatrix.cc.

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

Reimplemented from PLearn::MemoryVMatrix.

Definition at line 62 of file GramVMatrix.cc.

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

Reimplemented from PLearn::MemoryVMatrix.

Definition at line 62 of file GramVMatrix.cc.

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

Reimplemented from PLearn::MemoryVMatrix.

Definition at line 62 of file GramVMatrix.cc.

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

Reimplemented from PLearn::MemoryVMatrix.

Definition at line 62 of file GramVMatrix.cc.

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

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

Reimplemented from PLearn::MemoryVMatrix.

Definition at line 100 of file GramVMatrix.cc.

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

Here is the call graph for this function:

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

This does the actual building.

Reimplemented from PLearn::MemoryVMatrix.

Definition at line 109 of file GramVMatrix.cc.

References PLearn::MemoryVMatrix::build(), PLearn::MemoryVMatrix::data, PLearn::endl(), kernel, PLearn::VMatrix::length_, n, PLearn::TMat< T >::resize(), PLearn::VMatrix::updateMtime(), verbosity, and PLearn::VMatrix::width_.

Referenced by build().

{
    if (kernel) {
        updateMtime(kernel->getData());
        updateMtime(kernel->specify_dataset);
        bool old_report_progress = kernel->report_progress != 0;
        if (verbosity < 1) {
            kernel->report_progress = false;
        }
        int n = kernel->getData()->length();
        data.resize(n, n);
        clock_t time_for_gram = clock();
        kernel->computeGramMatrix(data);
        time_for_gram = clock() - time_for_gram;
        real real_time_for_gram = real(time_for_gram) / real(CLOCKS_PER_SEC);
        if (verbosity >= 2) {
            cout << "Time to compute the Gram matrix: " << real_time_for_gram << endl;
        }
        kernel->report_progress = old_report_progress;
        length_ = width_ = n;
        inherited::build();
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reimplemented from PLearn::MemoryVMatrix.

Definition at line 62 of file GramVMatrix.cc.

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

Declares this class' options.

Reimplemented from PLearn::MemoryVMatrix.

Definition at line 67 of file GramVMatrix.cc.

References PLearn::OptionBase::buildoption, PLearn::MemoryVMatrix::data, PLearn::declareOption(), PLearn::MemoryVMatrix::declareOptions(), kernel, PLearn::OptionBase::nosave, PLearn::redeclareOption(), PLearn::MemoryVMatrix::source, and verbosity.

{
    // ### 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, "kernel", &GramVMatrix::kernel, OptionBase::buildoption,
                  "The kernel whose Gram matrix we want to compute.");

    declareOption(ol, "verbosity", &GramVMatrix::verbosity, OptionBase::buildoption,
                  "The level of verbosity.");

    //               "Help text describing this option");
    // ...

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

    // Hide the 'data' and 'source' options of a MemoryVMatrix, that are
    // not used in this subclass.
    redeclareOption(ol, "data", &GramVMatrix::data, OptionBase::nosave,
                    "Not needed here.");

    redeclareOption(ol, "source", &GramVMatrix::source, OptionBase::nosave,
                    "Not needed here.");

}

Here is the call graph for this function:

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

Reimplemented from PLearn::MemoryVMatrix.

Definition at line 111 of file GramVMatrix.h.

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

Reimplemented from PLearn::MemoryVMatrix.

Definition at line 62 of file GramVMatrix.cc.

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

Reimplemented from PLearn::MemoryVMatrix.

Definition at line 62 of file GramVMatrix.cc.

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

Reimplemented from PLearn::MemoryVMatrix.

Definition at line 62 of file GramVMatrix.cc.

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

Reimplemented from PLearn::MemoryVMatrix.

Definition at line 62 of file GramVMatrix.cc.

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

Transforms a shallow copy into a deep copy.

Reimplemented from PLearn::MemoryVMatrix.

Definition at line 136 of file GramVMatrix.cc.

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

Here is the call graph for this function:


Member Data Documentation

Reimplemented from PLearn::MemoryVMatrix.

Definition at line 111 of file GramVMatrix.h.

Definition at line 72 of file GramVMatrix.h.

Referenced by build_(), and declareOptions().

Definition at line 73 of file GramVMatrix.h.

Referenced by build_(), and declareOptions().


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