PLearn 0.1
|
#include <PairsVMatrix.h>
Public Member Functions | |
PairsVMatrix () | |
default constructor (for automatic deserialization) | |
PairsVMatrix (Mat the_data1, Mat the_data2) | |
virtual string | classname () const |
virtual OptionList & | getOptionList () const |
virtual OptionMap & | getOptionMap () const |
virtual RemoteMethodMap & | getRemoteMethodMap () const |
virtual PairsVMatrix * | deepCopy (CopiesMap &copies) const |
virtual void | build () |
Simply calls inherited::build() then build_(). | |
virtual void | reset_dimensions () |
In case the dimensions of an underlying VMat has changed, recompute it. | |
Static Public Member Functions | |
static string | _classname_ () |
PairsVMatrix. | |
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 Public Attributes | |
static StaticInitializer | _static_initializer_ |
Protected Member Functions | |
virtual void | getNewRow (int ij, const Vec &samplevec) const |
This is the only method requiring implementation in subclasses. | |
Static Protected Member Functions | |
static void | declareOptions (OptionList &ol) |
Declare this class' options. | |
Protected Attributes | |
Mat | data1 |
Mat | data2 |
Private Types | |
typedef RowBufferedVMatrix | inherited |
Private Member Functions | |
void | build_ () |
This does the actual building. |
like PairVMatrix but samples from all the pairs in order (traversing all the nxn pairs), outputs a Vec that is the concatenation of the i-th row of data1 and j-th row of data2. The j-index moves faster than the i-index.
Definition at line 60 of file PairsVMatrix.h.
typedef RowBufferedVMatrix PLearn::PairsVMatrix::inherited [private] |
Reimplemented from PLearn::RowBufferedVMatrix.
Definition at line 62 of file PairsVMatrix.h.
PLearn::PairsVMatrix::PairsVMatrix | ( | ) |
default constructor (for automatic deserialization)
Definition at line 51 of file PairsVMatrix.cc.
{ }
string PLearn::PairsVMatrix::_classname_ | ( | ) | [static] |
Reimplemented from PLearn::RowBufferedVMatrix.
Definition at line 49 of file PairsVMatrix.cc.
OptionList & PLearn::PairsVMatrix::_getOptionList_ | ( | ) | [static] |
Reimplemented from PLearn::RowBufferedVMatrix.
Definition at line 49 of file PairsVMatrix.cc.
RemoteMethodMap & PLearn::PairsVMatrix::_getRemoteMethodMap_ | ( | ) | [static] |
Reimplemented from PLearn::RowBufferedVMatrix.
Definition at line 49 of file PairsVMatrix.cc.
Reimplemented from PLearn::RowBufferedVMatrix.
Definition at line 49 of file PairsVMatrix.cc.
Object * PLearn::PairsVMatrix::_new_instance_for_typemap_ | ( | ) | [static] |
Reimplemented from PLearn::Object.
Definition at line 49 of file PairsVMatrix.cc.
StaticInitializer PairsVMatrix::_static_initializer_ & PLearn::PairsVMatrix::_static_initialize_ | ( | ) | [static] |
Reimplemented from PLearn::RowBufferedVMatrix.
Definition at line 49 of file PairsVMatrix.cc.
void PLearn::PairsVMatrix::build | ( | ) | [virtual] |
Simply calls inherited::build() then build_().
Reimplemented from PLearn::VMatrix.
Definition at line 62 of file PairsVMatrix.cc.
References PLearn::VMatrix::build(), and build_().
{ inherited::build(); build_(); }
void PLearn::PairsVMatrix::build_ | ( | ) | [private] |
This does the actual building.
Reimplemented from PLearn::VMatrix.
Definition at line 69 of file PairsVMatrix.cc.
Referenced by build().
{ }
string PLearn::PairsVMatrix::classname | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 49 of file PairsVMatrix.cc.
void PLearn::PairsVMatrix::declareOptions | ( | OptionList & | ol | ) | [static, protected] |
Declare this class' options.
Reimplemented from PLearn::VMatrix.
Definition at line 74 of file PairsVMatrix.cc.
References PLearn::OptionBase::buildoption, data1, data2, PLearn::declareOption(), and PLearn::VMatrix::declareOptions().
{ declareOption(ol, "data1", &PairsVMatrix::data1, OptionBase::buildoption, ""); declareOption(ol, "data2", &PairsVMatrix::data2, OptionBase::buildoption, ""); inherited::declareOptions(ol); }
static const PPath& PLearn::PairsVMatrix::declaringFile | ( | ) | [inline, static] |
PairsVMatrix * PLearn::PairsVMatrix::deepCopy | ( | CopiesMap & | copies | ) | const [virtual] |
Reimplemented from PLearn::RowBufferedVMatrix.
Definition at line 49 of file PairsVMatrix.cc.
This is the only method requiring implementation in subclasses.
Implements PLearn::RowBufferedVMatrix.
Definition at line 81 of file PairsVMatrix.cc.
References PLearn::TVec< T >::data(), data1, data2, PLearn::TMat< T >::length(), PLearn::VMatrix::length_, and PLearn::TMat< T >::width().
{ //ij = ij%length_; ij %= length_; real* data = samplevec.data(); real* data_i = data1[ij/data2.length()]; real* data_j = data2[ij%data2.length()]; int kk=0; for (int k=0;k<data1.width();k++) data[kk++] = data_i[k]; for (int k=0;k<data2.width();k++) data[kk++] = data_j[k]; }
OptionList & PLearn::PairsVMatrix::getOptionList | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 49 of file PairsVMatrix.cc.
OptionMap & PLearn::PairsVMatrix::getOptionMap | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 49 of file PairsVMatrix.cc.
RemoteMethodMap & PLearn::PairsVMatrix::getRemoteMethodMap | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 49 of file PairsVMatrix.cc.
virtual void PLearn::PairsVMatrix::reset_dimensions | ( | ) | [inline, virtual] |
In case the dimensions of an underlying VMat has changed, recompute it.
Reimplemented from PLearn::VMatrix.
Definition at line 87 of file PairsVMatrix.h.
References PLERROR.
{ PLERROR("PairsVMatrix::reset_dimensions() not implemented"); }
Reimplemented from PLearn::RowBufferedVMatrix.
Definition at line 76 of file PairsVMatrix.h.
Mat PLearn::PairsVMatrix::data1 [protected] |
Definition at line 65 of file PairsVMatrix.h.
Referenced by declareOptions(), and getNewRow().
Mat PLearn::PairsVMatrix::data2 [protected] |
Definition at line 66 of file PairsVMatrix.h.
Referenced by declareOptions(), and getNewRow().