PLearn 0.1
|
#include <UniformVMatrix.h>
Public Member Functions | |
UniformVMatrix () | |
default constructor (for automatic deserialization) | |
UniformVMatrix (real the_minval, real the_maxval, int the_width) | |
virtual string | classname () const |
virtual OptionList & | getOptionList () const |
virtual OptionMap & | getOptionMap () const |
virtual RemoteMethodMap & | getRemoteMethodMap () const |
virtual UniformVMatrix * | deepCopy (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 PPath & | declaringFile () |
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. |
Definition at line 53 of file UniformVMatrix.h.
typedef VMatrix PLearn::UniformVMatrix::inherited [private] |
Reimplemented from PLearn::VMatrix.
Definition at line 55 of file UniformVMatrix.h.
PLearn::UniformVMatrix::UniformVMatrix | ( | ) |
default constructor (for automatic deserialization)
Definition at line 52 of file UniformVMatrix.cc.
Definition at line 57 of file UniformVMatrix.cc.
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.
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_().
{ inherited::build(); build_(); }
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().
{ }
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.
{ declareOption(ol, "minval", &UniformVMatrix::minval, OptionBase::buildoption, ""); declareOption(ol, "maxval", &UniformVMatrix::maxval, OptionBase::buildoption, ""); inherited::declareOptions(ol); }
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.
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; }
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.
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; }
Reimplemented from PLearn::VMatrix.
Definition at line 69 of file UniformVMatrix.h.
real PLearn::UniformVMatrix::maxval [protected] |
Definition at line 59 of file UniformVMatrix.h.
Referenced by declareOptions(), get(), and getSubRow().
real PLearn::UniformVMatrix::minval [protected] |
Definition at line 58 of file UniformVMatrix.h.
Referenced by declareOptions(), get(), and getSubRow().