|
PLearn 0.1
|
Tests for IndexedVMatrix, including handling of NaN and string mappings. More...
#include <IndexedVMatrixTest.h>


Public Member Functions | |
| IndexedVMatrixTest () | |
| Default constructor. | |
| virtual string | classname () const |
| virtual OptionList & | getOptionList () const |
| virtual OptionMap & | getOptionMap () const |
| virtual RemoteMethodMap & | getRemoteMethodMap () const |
| virtual IndexedVMatrixTest * | deepCopy (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 PPath & | declaringFile () |
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. | |
Tests for IndexedVMatrix, including handling of NaN and string mappings.
Definition at line 51 of file IndexedVMatrixTest.h.
typedef PTest PLearn::IndexedVMatrixTest::inherited [private] |
Reimplemented from PLearn::PTest.
Definition at line 53 of file IndexedVMatrixTest.h.
| PLearn::IndexedVMatrixTest::IndexedVMatrixTest | ( | ) |
| 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.
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.
{
inherited::build();
build_();
}
| 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);
}

| 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.
{
inherited::makeDeepCopyFromShallowCopy(copies);
}
| 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;
}
}

Reimplemented from PLearn::PTest.
Definition at line 69 of file IndexedVMatrixTest.h.
Definition at line 58 of file IndexedVMatrixTest.h.
Referenced by declareOptions().
1.7.4