PLearn 0.1
Public Types | Public Member Functions | Public Attributes
PLearn::TestSnippet Class Reference

The first sentence should be a BRIEF DESCRIPTION of what the class does. More...

#include <InstanceSnippetTest.h>

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

List of all members.

Public Types

typedef PythonCodeSnippet inherited

Public Member Functions

 TestSnippet (const string &xtra="")
virtual void build ()
 Post-constructor.
void build_ ()
 This does the actual building.
PythonObjectWrapper getLearner (const TVec< PythonObjectWrapper > &args)
PythonObjectWrapper recTest (const TVec< PythonObjectWrapper > &args)
PythonObjectWrapper recTest2 (const TVec< PythonObjectWrapper > &args)
PythonObjectWrapper recTestCrash (const TVec< PythonObjectWrapper > &args)

Public Attributes

PP< PLearnerll

Detailed Description

The first sentence should be a BRIEF DESCRIPTION of what the class does.

Place the rest of the class programmer documentation here. Doxygen supports Javadoc-style comments. See http://www.doxygen.org/manual.html

Todo:
Write class to-do's here if there are any.
Deprecated:
Write deprecated stuff here if there is any. Indicate what else should be used instead.

Definition at line 62 of file InstanceSnippetTest.h.


Member Typedef Documentation

Reimplemented from PLearn::PythonCodeSnippet.

Definition at line 65 of file InstanceSnippetTest.h.


Constructor & Destructor Documentation

PLearn::TestSnippet::TestSnippet ( const string &  xtra = "") [inline]

Definition at line 69 of file InstanceSnippetTest.h.

        :PythonCodeSnippet(string("from plearn.pybridge.test_embedded_code_snippet import *\n")
                           + xtra,
                           true),
         ll(new LinearRegressor())
    {}

Member Function Documentation

virtual void PLearn::TestSnippet::build ( ) [inline, 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::PythonCodeSnippet.

Definition at line 76 of file InstanceSnippetTest.h.

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

Referenced by PLearn::InstanceSnippetTest::perform().

Here is the call graph for this function:

Here is the caller graph for this function:

void PLearn::TestSnippet::build_ ( ) [inline]

This does the actual building.

This is where the Python code is in fact compiled

Reimplemented from PLearn::PythonCodeSnippet.

Definition at line 82 of file InstanceSnippetTest.h.

References getLearner(), PLearn::PythonCodeSnippet::inject(), recTest(), recTest2(), and recTestCrash().

Referenced by build().

    {
        inject("getLearner", this, &TestSnippet::getLearner);
        inject("recTest", this, &TestSnippet::recTest);
        inject("recTest2", this, &TestSnippet::recTest2);
        inject("recTestCrash", this, &TestSnippet::recTestCrash);
    }

Here is the call graph for this function:

Here is the caller graph for this function:

PythonObjectWrapper PLearn::TestSnippet::getLearner ( const TVec< PythonObjectWrapper > &  args) [inline]

Definition at line 90 of file InstanceSnippetTest.h.

References ll.

Referenced by build_().

    {
        Object* p= ll;
        return PythonObjectWrapper(p);
    }

Here is the caller graph for this function:

PythonObjectWrapper PLearn::TestSnippet::recTest ( const TVec< PythonObjectWrapper > &  args) [inline]

Definition at line 96 of file InstanceSnippetTest.h.

References PLearn::endl(), PLearn::PythonCodeSnippet::invoke(), n, and PLearn::pout.

Referenced by build_().

    {
        int n= args[0];
        if(n%100 == 0)
            pout << "recTest\t" << n << endl;
        invoke("testRec", args);
        return PythonObjectWrapper(n);
    }

Here is the call graph for this function:

Here is the caller graph for this function:

PythonObjectWrapper PLearn::TestSnippet::recTest2 ( const TVec< PythonObjectWrapper > &  args) [inline]

Definition at line 105 of file InstanceSnippetTest.h.

References PLearn::endl(), PLearn::PythonCodeSnippet::invoke(), and PLearn::pout.

Referenced by build_().

    {
        PP<PLearner> l= args[0];
        --l->nstages;
        if(l->nstages%100 == 0)
            pout << "recTest2\t" << l->nstages << "\tnrefs=" << l->usage() << endl;
        invoke("testRec2", args);
        return args[0];
    }

Here is the call graph for this function:

Here is the caller graph for this function:

PythonObjectWrapper PLearn::TestSnippet::recTestCrash ( const TVec< PythonObjectWrapper > &  args) [inline]

Definition at line 115 of file InstanceSnippetTest.h.

References PLearn::endl(), PLearn::PythonCodeSnippet::invoke(), n, and PLearn::pout.

Referenced by build_().

    {
        int n= args[0];
        pout << "recTestCrash\t" << n << endl;
        invoke("testRecCrash", n-1);
        return PythonObjectWrapper();
    }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 67 of file InstanceSnippetTest.h.

Referenced by getLearner(), and PLearn::InstanceSnippetTest::perform().


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