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

#include <UniformVMatrix.h>

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

List of all members.

Public Member Functions

 UniformVMatrix ()
 default constructor (for automatic deserialization)
 UniformVMatrix (real the_minval, real the_maxval, int the_width)
virtual string classname () const
virtual OptionListgetOptionList () const
virtual OptionMapgetOptionMap () const
virtual RemoteMethodMapgetRemoteMethodMap () const
virtual UniformVMatrixdeepCopy (CopiesMap &copies) const
virtual void build ()
 Simply calls inherited::build() then build_().
virtual real get (int i, int j) const
 This method must be implemented in all subclasses.
virtual void getSubRow (int i, int j, Vec v) const
 It is suggested that this method be implemented in subclasses to speed up accesses (default version repeatedly calls get(i,j) which may have a significant overhead).

Static Public Member Functions

static string _classname_ ()
 Uniform VMatrix.
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 void declareOptions (OptionList &ol)
 Declare this class' options.

Static Public Attributes

static StaticInitializer _static_initializer_

Protected Attributes

real minval
real maxval

Private Types

typedef VMatrix inherited

Private Member Functions

void build_ ()
 This does the actual building.

Detailed Description

Definition at line 53 of file UniformVMatrix.h.


Member Typedef Documentation

Reimplemented from PLearn::VMatrix.

Definition at line 55 of file UniformVMatrix.h.


Constructor & Destructor Documentation

PLearn::UniformVMatrix::UniformVMatrix ( )

default constructor (for automatic deserialization)

Definition at line 52 of file UniformVMatrix.cc.

    : minval(0), maxval(1)
{
}
PLearn::UniformVMatrix::UniformVMatrix ( real  the_minval,
real  the_maxval,
int  the_width 
)

Definition at line 57 of file UniformVMatrix.cc.

    : inherited(-1,the_width),minval(the_minval), maxval(the_maxval)
{}

Member Function Documentation

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

Uniform VMatrix.

Reimplemented from PLearn::VMatrix.

Definition at line 50 of file UniformVMatrix.cc.

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

Reimplemented from PLearn::VMatrix.

Definition at line 50 of file UniformVMatrix.cc.

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

Reimplemented from PLearn::VMatrix.

Definition at line 50 of file UniformVMatrix.cc.

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

Reimplemented from PLearn::VMatrix.

Definition at line 50 of file UniformVMatrix.cc.

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

Reimplemented from PLearn::Object.

Definition at line 50 of file UniformVMatrix.cc.

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

Reimplemented from PLearn::VMatrix.

Definition at line 50 of file UniformVMatrix.cc.

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

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

Reimplemented from PLearn::VMatrix.

Definition at line 62 of file UniformVMatrix.cc.

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

Here is the call graph for this function:

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

This does the actual building.

Reimplemented from PLearn::VMatrix.

Definition at line 69 of file UniformVMatrix.cc.

Referenced by build().

{
}

Here is the caller graph for this function:

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

Reimplemented from PLearn::Object.

Definition at line 50 of file UniformVMatrix.cc.

void PLearn::UniformVMatrix::declareOptions ( OptionList ol) [static]

Declare this class' options.

Reimplemented from PLearn::VMatrix.

Definition at line 74 of file UniformVMatrix.cc.

References PLearn::OptionBase::buildoption, PLearn::declareOption(), PLearn::VMatrix::declareOptions(), maxval, and minval.

Here is the call graph for this function:

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

Reimplemented from PLearn::VMatrix.

Definition at line 69 of file UniformVMatrix.h.

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

Reimplemented from PLearn::VMatrix.

Definition at line 50 of file UniformVMatrix.cc.

real PLearn::UniformVMatrix::get ( int  i,
int  j 
) const [virtual]

This method must be implemented in all subclasses.

Returns element (i,j).

Implements PLearn::VMatrix.

Definition at line 81 of file UniformVMatrix.cc.

References maxval, minval, and PLearn::uniform_sample().

{
    double scale = maxval-minval;
    return uniform_sample()*scale+minval;
}

Here is the call graph for this function:

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

Reimplemented from PLearn::Object.

Definition at line 50 of file UniformVMatrix.cc.

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

Reimplemented from PLearn::Object.

Definition at line 50 of file UniformVMatrix.cc.

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

Reimplemented from PLearn::Object.

Definition at line 50 of file UniformVMatrix.cc.

void PLearn::UniformVMatrix::getSubRow ( int  i,
int  j,
Vec  v 
) const [virtual]

It is suggested that this method be implemented in subclasses to speed up accesses (default version repeatedly calls get(i,j) which may have a significant overhead).

Fills v with the subrow i lying between columns j (inclusive) and j+v.length() (exclusive).

Reimplemented from PLearn::VMatrix.

Definition at line 87 of file UniformVMatrix.cc.

References PLearn::TVec< T >::length(), maxval, minval, and PLearn::uniform_sample().

{
    double scale = maxval-minval;
    for(int k=0; k<v.length(); k++)
        v[k] = uniform_sample()*scale+minval;
}

Here is the call graph for this function:


Member Data Documentation

Reimplemented from PLearn::VMatrix.

Definition at line 69 of file UniformVMatrix.h.

Definition at line 59 of file UniformVMatrix.h.

Referenced by declareOptions(), get(), and getSubRow().

Definition at line 58 of file UniformVMatrix.h.

Referenced by declareOptions(), get(), and getSubRow().


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