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

Tests for IndexedVMatrix, including handling of NaN and string mappings. More...

#include <IndexedVMatrixTest.h>

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

List of all members.

Public Member Functions

 IndexedVMatrixTest ()
 Default constructor.
virtual string classname () const
virtual OptionListgetOptionList () const
virtual OptionMapgetOptionMap () const
virtual RemoteMethodMapgetRemoteMethodMap () const
virtual IndexedVMatrixTestdeepCopy (CopiesMap &copies) const
virtual void build ()
 Post-constructor.
virtual void makeDeepCopyFromShallowCopy (CopiesMap &copies)
 Transforms a shallow copy into a deep copy.
virtual void perform ()
 The method performing the test.

Static Public Member Functions

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

PPath source_matrix

Static Public Attributes

static StaticInitializer _static_initializer_

Static Protected Member Functions

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

Private Types

typedef PTest inherited

Private Member Functions

void build_ ()
 This does the actual building.

Detailed Description

Tests for IndexedVMatrix, including handling of NaN and string mappings.

Definition at line 51 of file IndexedVMatrixTest.h.


Member Typedef Documentation

Reimplemented from PLearn::PTest.

Definition at line 53 of file IndexedVMatrixTest.h.


Constructor & Destructor Documentation

PLearn::IndexedVMatrixTest::IndexedVMatrixTest ( )

Default constructor.

Definition at line 57 of file IndexedVMatrixTest.cc.

{
}

Member Function Documentation

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

Reimplemented from PLearn::PTest.

Definition at line 52 of file IndexedVMatrixTest.cc.

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

Reimplemented from PLearn::PTest.

Definition at line 52 of file IndexedVMatrixTest.cc.

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

Reimplemented from PLearn::PTest.

Definition at line 52 of file IndexedVMatrixTest.cc.

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

Reimplemented from PLearn::PTest.

Definition at line 52 of file IndexedVMatrixTest.cc.

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

Reimplemented from PLearn::PTest.

Definition at line 52 of file IndexedVMatrixTest.cc.

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

Reimplemented from PLearn::PTest.

Definition at line 52 of file IndexedVMatrixTest.cc.

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

Post-constructor.

The normal implementation should call simply inherited::build(), then this class's build_(). This method should be callable again at later times, after modifying some option fields to change the "architecture" of the object.

Reimplemented from PLearn::PTest.

Definition at line 64 of file IndexedVMatrixTest.cc.

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

This does the actual building.

Reimplemented from PLearn::PTest.

Definition at line 96 of file IndexedVMatrixTest.cc.

{
}
string PLearn::IndexedVMatrixTest::classname ( ) const [virtual]

Reimplemented from PLearn::PTest.

Definition at line 52 of file IndexedVMatrixTest.cc.

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

Declares the class options.

Reimplemented from PLearn::PTest.

Definition at line 81 of file IndexedVMatrixTest.cc.

References PLearn::OptionBase::buildoption, PLearn::declareOption(), and source_matrix.

{
    // declareOption(ol, "myoption", &IndexedVMatrixTest::myoption, OptionBase::buildoption,
    //               "Help text describing this option");
    declareOption(ol, "source_matrix", &IndexedVMatrixTest::source_matrix,
                  OptionBase::buildoption,
                  "Source matrix of the IndexedVMatrix being tested");

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

Here is the call graph for this function:

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

Reimplemented from PLearn::PTest.

Definition at line 69 of file IndexedVMatrixTest.h.

:
    //#####  Protected Options  ###############################################
IndexedVMatrixTest * PLearn::IndexedVMatrixTest::deepCopy ( CopiesMap copies) const [virtual]

Reimplemented from PLearn::PTest.

Definition at line 52 of file IndexedVMatrixTest.cc.

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

Reimplemented from PLearn::PTest.

Definition at line 52 of file IndexedVMatrixTest.cc.

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

Reimplemented from PLearn::PTest.

Definition at line 52 of file IndexedVMatrixTest.cc.

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

Reimplemented from PLearn::PTest.

Definition at line 52 of file IndexedVMatrixTest.cc.

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

Transforms a shallow copy into a deep copy.

Reimplemented from PLearn::PTest.

Definition at line 73 of file IndexedVMatrixTest.cc.

void PLearn::IndexedVMatrixTest::perform ( ) [virtual]

The method performing the test.

A typical test consists in some output (to pout and / or perr), and updates of this object's options.

Reimplemented from PLearn::PTest.

Definition at line 103 of file IndexedVMatrixTest.cc.

References PLearn::endl(), i, PLearn::VMat::length(), MAND_LOG, n, and PLERROR.

{
    // ### The test code should go here.
    if( source_matrix == "" )
        PLERROR( "In RowBufferedVMatrixTest::perform - You must provide"
                 " 'source_matrix' option" );

    VMat source_vmat = new AutoVMatrix( source_matrix );
    source_vmat->build();

    VMat indexed_vmat = new IndexedVMatrix( source_vmat, true, true );

    int n = indexed_vmat->length();

    MAND_LOG << "source_matrix = " << source_matrix.canonical() << endl;
    MAND_LOG << "Column 2 (value) of indexed_vmat as strings:" << endl;
    for( int i=0 ; i<n ; i++ )
    {
        MAND_LOG << indexed_vmat->getString(i,2) << endl;
    }
    MAND_LOG << endl;

    MAND_LOG << "Underlying (real) values:" << endl;
    for( int i=0 ; i<n ; i++ )
    {
        MAND_LOG << indexed_vmat(i,2) << endl;
    }
}

Here is the call graph for this function:


Member Data Documentation

Reimplemented from PLearn::PTest.

Definition at line 69 of file IndexedVMatrixTest.h.

Definition at line 58 of file IndexedVMatrixTest.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