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

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ More...

#include <IsLargerVariable.h>

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

List of all members.

Public Member Functions

 IsLargerVariable ()
 Default constructor for persistence.
 IsLargerVariable (Variable *input1, Variable *input2)
virtual string classname () const
virtual OptionListgetOptionList () const
virtual OptionMapgetOptionMap () const
virtual RemoteMethodMapgetRemoteMethodMap () const
virtual IsLargerVariabledeepCopy (CopiesMap &copies) const
virtual void build ()
 Post-constructor.
virtual void recomputeSize (int &l, int &w) const
 Recomputes the length l and width w that this variable should have, according to its parent variables.
virtual void fprop ()
 compute output given input
virtual void bprop ()
virtual void symbolicBprop ()
 compute a piece of new Var graph that represents the symbolic derivative of this Var

Static Public Member Functions

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

void build_ ()
 This does the actual building.

Private Types

typedef BinaryVariable inherited

Detailed Description

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Definition at line 53 of file IsLargerVariable.h.


Member Typedef Documentation

Reimplemented from PLearn::BinaryVariable.

Definition at line 55 of file IsLargerVariable.h.


Constructor & Destructor Documentation

PLearn::IsLargerVariable::IsLargerVariable ( ) [inline]

Default constructor for persistence.

Definition at line 59 of file IsLargerVariable.h.

{}
PLearn::IsLargerVariable::IsLargerVariable ( Variable input1,
Variable input2 
)

Definition at line 55 of file IsLargerVariable.cc.

References build_().

    : inherited(input1, input2, input1->length(), input1->width())
{
    build_();
}

Here is the call graph for this function:


Member Function Documentation

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

IsLargerVariable.

Reimplemented from PLearn::BinaryVariable.

Definition at line 53 of file IsLargerVariable.cc.

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

Reimplemented from PLearn::BinaryVariable.

Definition at line 53 of file IsLargerVariable.cc.

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

Reimplemented from PLearn::BinaryVariable.

Definition at line 53 of file IsLargerVariable.cc.

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

Reimplemented from PLearn::BinaryVariable.

Definition at line 53 of file IsLargerVariable.cc.

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

Reimplemented from PLearn::Object.

Definition at line 53 of file IsLargerVariable.cc.

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

Reimplemented from PLearn::BinaryVariable.

Definition at line 53 of file IsLargerVariable.cc.

void PLearn::IsLargerVariable::bprop ( ) [virtual]

Implements PLearn::Variable.

Definition at line 94 of file IsLargerVariable.cc.

{}
void PLearn::IsLargerVariable::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::BinaryVariable.

Definition at line 62 of file IsLargerVariable.cc.

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

Here is the call graph for this function:

void PLearn::IsLargerVariable::build_ ( ) [protected]

This does the actual building.

Reimplemented from PLearn::BinaryVariable.

Definition at line 69 of file IsLargerVariable.cc.

References PLearn::BinaryVariable::input1, PLearn::BinaryVariable::input2, PLearn::Var::length(), PLERROR, and PLearn::Var::width().

Referenced by build(), and IsLargerVariable().

{
    if (input1 && input2) {
        if(input1->length() != input2->length() || input1->width() != input2->width())
            PLERROR("EqualVariable IsLargerVariable(Variable* input1, Variable* input2), the size of input1 and input2 are inconsistent");
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reimplemented from PLearn::Object.

Definition at line 53 of file IsLargerVariable.cc.

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

Reimplemented from PLearn::BinaryVariable.

Definition at line 62 of file IsLargerVariable.h.

:
    void build_();
IsLargerVariable * PLearn::IsLargerVariable::deepCopy ( CopiesMap copies) const [virtual]

Reimplemented from PLearn::BinaryVariable.

Definition at line 53 of file IsLargerVariable.cc.

void PLearn::IsLargerVariable::fprop ( ) [virtual]

compute output given input

Implements PLearn::Variable.

Definition at line 86 of file IsLargerVariable.cc.

References i, PLearn::BinaryVariable::input1, PLearn::BinaryVariable::input2, PLearn::Variable::nelems(), and PLearn::Variable::valuedata.

{
    for(int i = 0; i <nelems(); i++)
        valuedata[i] = input1->valuedata[i] > input2->valuedata[i];
}

Here is the call graph for this function:

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

Reimplemented from PLearn::Object.

Definition at line 53 of file IsLargerVariable.cc.

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

Reimplemented from PLearn::Object.

Definition at line 53 of file IsLargerVariable.cc.

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

Reimplemented from PLearn::Object.

Definition at line 53 of file IsLargerVariable.cc.

void PLearn::IsLargerVariable::recomputeSize ( int l,
int w 
) const [virtual]

Recomputes the length l and width w that this variable should have, according to its parent variables.

This is used for ex. by sizeprop() The default version stupidly returns the current dimensions, so make sure to overload it in subclasses if this is not appropriate.

Reimplemented from PLearn::Variable.

Definition at line 77 of file IsLargerVariable.cc.

References PLearn::BinaryVariable::input1, PLearn::Var::length(), and PLearn::Var::width().

{
    if (input1) {
        l = input1->length();
        w = input1->width();
    } else
        l = w = 0;
}

Here is the call graph for this function:

void PLearn::IsLargerVariable::symbolicBprop ( ) [virtual]

compute a piece of new Var graph that represents the symbolic derivative of this Var

Reimplemented from PLearn::Variable.

Definition at line 96 of file IsLargerVariable.cc.

{}

Member Data Documentation

Reimplemented from PLearn::BinaryVariable.

Definition at line 62 of file IsLargerVariable.h.


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