PLearn 0.1
|
sees an underlying VMat with the specified rows excluded More...
#include <RemoveRowsVMatrix.h>
Public Member Functions | |
virtual void | reset_dimensions () |
In case the dimensions of an underlying VMat has changed, recompute it. | |
RemoveRowsVMatrix () | |
RemoveRowsVMatrix (VMat the_distr, Vec the_indices=Vec()) | |
default constructor (for automatic deserialization) | |
virtual string | classname () const |
virtual OptionList & | getOptionList () const |
virtual OptionMap & | getOptionMap () const |
virtual RemoteMethodMap & | getRemoteMethodMap () const |
virtual RemoveRowsVMatrix * | deepCopy (CopiesMap &copies) const |
virtual void | build () |
Simply calls inherited::build() then build_(). | |
void | remove (int rownum) |
the given rownum of the underlying distr will also be excluded | |
void | unremove (int rownum) |
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). | |
virtual real | dot (int i1, int i2, int inputsize) const |
Returns the dot product between row i1 and row i2 (considering only the inputsize first elements). | |
virtual real | dot (int i, const Vec &v) const |
Returns the result of the dot product between row i and the given vec (only v.length() first elements of row i are considered). | |
Static Public Member Functions | |
static string | _classname_ () |
RemoveRowsVMatrix. | |
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 Member Functions | |
int | getrownum (int i) const |
returns the row number in distr corresponding to i in this VMat | |
Protected Attributes | |
VMat | distr |
Vec | indices |
Private Types | |
typedef VMatrix | inherited |
Private Member Functions | |
void | build_ () |
This does the actual building. |
sees an underlying VMat with the specified rows excluded
Definition at line 53 of file RemoveRowsVMatrix.h.
typedef VMatrix PLearn::RemoveRowsVMatrix::inherited [private] |
Reimplemented from PLearn::VMatrix.
Definition at line 55 of file RemoveRowsVMatrix.h.
PLearn::RemoveRowsVMatrix::RemoveRowsVMatrix | ( | ) | [inline] |
Definition at line 70 of file RemoveRowsVMatrix.h.
{};
default constructor (for automatic deserialization)
Copy the original fieldinfos upon construction
Definition at line 50 of file RemoveRowsVMatrix.cc.
References build().
: inherited(the_distr->length()-the_indices.length(), the_distr->width()), distr(the_distr), indices(the_indices.copy()) { build(); }
string PLearn::RemoveRowsVMatrix::_classname_ | ( | ) | [static] |
Reimplemented from PLearn::VMatrix.
Definition at line 48 of file RemoveRowsVMatrix.cc.
OptionList & PLearn::RemoveRowsVMatrix::_getOptionList_ | ( | ) | [static] |
Reimplemented from PLearn::VMatrix.
Definition at line 48 of file RemoveRowsVMatrix.cc.
RemoteMethodMap & PLearn::RemoveRowsVMatrix::_getRemoteMethodMap_ | ( | ) | [static] |
Reimplemented from PLearn::VMatrix.
Definition at line 48 of file RemoveRowsVMatrix.cc.
Reimplemented from PLearn::VMatrix.
Definition at line 48 of file RemoveRowsVMatrix.cc.
Object * PLearn::RemoveRowsVMatrix::_new_instance_for_typemap_ | ( | ) | [static] |
Reimplemented from PLearn::Object.
Definition at line 48 of file RemoveRowsVMatrix.cc.
StaticInitializer RemoveRowsVMatrix::_static_initializer_ & PLearn::RemoveRowsVMatrix::_static_initialize_ | ( | ) | [static] |
Reimplemented from PLearn::VMatrix.
Definition at line 48 of file RemoveRowsVMatrix.cc.
void PLearn::RemoveRowsVMatrix::build | ( | ) | [virtual] |
Simply calls inherited::build() then build_().
Reimplemented from PLearn::VMatrix.
Definition at line 58 of file RemoveRowsVMatrix.cc.
References PLearn::VMatrix::build(), and build_().
Referenced by RemoveRowsVMatrix().
{ inherited::build(); build_(); }
void PLearn::RemoveRowsVMatrix::build_ | ( | ) | [private] |
This does the actual building.
Reimplemented from PLearn::VMatrix.
Definition at line 65 of file RemoveRowsVMatrix.cc.
References distr, PLearn::VMatrix::fieldinfos, indices, and PLearn::sortElements().
Referenced by build().
{ if (distr) fieldinfos = distr->fieldinfos; if (indices) sortElements(indices); }
string PLearn::RemoveRowsVMatrix::classname | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 48 of file RemoveRowsVMatrix.cc.
void PLearn::RemoveRowsVMatrix::declareOptions | ( | OptionList & | ol | ) | [static] |
Declare this class' options.
Reimplemented from PLearn::VMatrix.
Definition at line 74 of file RemoveRowsVMatrix.cc.
References PLearn::OptionBase::buildoption, PLearn::declareOption(), PLearn::VMatrix::declareOptions(), distr, and indices.
{ declareOption(ol, "distr", &RemoveRowsVMatrix::distr, OptionBase::buildoption, ""); declareOption(ol, "indices", &RemoveRowsVMatrix::indices, OptionBase::buildoption, ""); inherited::declareOptions(ol); }
static const PPath& PLearn::RemoveRowsVMatrix::declaringFile | ( | ) | [inline, static] |
RemoveRowsVMatrix * PLearn::RemoveRowsVMatrix::deepCopy | ( | CopiesMap & | copies | ) | const [virtual] |
Reimplemented from PLearn::VMatrix.
Definition at line 48 of file RemoveRowsVMatrix.cc.
Returns the dot product between row i1 and row i2 (considering only the inputsize first elements).
The default version in VMatrix is somewhat inefficient, as it repeatedly calls get(i,j) The default version in RowBufferedVMatrix is a little better as it buffers the 2 Vecs between calls in case one of them is needed again. But the real strength of this method is for specialised and efficient versions in subbclasses. This method is typically used by SmartKernels so that they can compute kernel values between input samples efficiently.
Reimplemented from PLearn::VMatrix.
Definition at line 98 of file RemoveRowsVMatrix.cc.
References distr, and getrownum().
Returns the result of the dot product between row i and the given vec (only v.length() first elements of row i are considered).
Reimplemented from PLearn::VMatrix.
Definition at line 101 of file RemoveRowsVMatrix.cc.
References distr, and getrownum().
This method must be implemented in all subclasses.
Returns element (i,j).
Implements PLearn::VMatrix.
Definition at line 92 of file RemoveRowsVMatrix.cc.
References distr, and getrownum().
OptionList & PLearn::RemoveRowsVMatrix::getOptionList | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 48 of file RemoveRowsVMatrix.cc.
OptionMap & PLearn::RemoveRowsVMatrix::getOptionMap | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 48 of file RemoveRowsVMatrix.cc.
RemoteMethodMap & PLearn::RemoveRowsVMatrix::getRemoteMethodMap | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 48 of file RemoveRowsVMatrix.cc.
returns the row number in distr corresponding to i in this VMat
Definition at line 81 of file RemoveRowsVMatrix.cc.
References i, indices, and PLearn::TVec< T >::length().
Referenced by dot(), get(), and getSubRow().
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 95 of file RemoveRowsVMatrix.cc.
References distr, getrownum(), and PLearn::VMat::getSubRow().
void PLearn::RemoveRowsVMatrix::remove | ( | int | rownum | ) | [inline] |
the given rownum of the underlying distr will also be excluded
Definition at line 81 of file RemoveRowsVMatrix.h.
virtual void PLearn::RemoveRowsVMatrix::reset_dimensions | ( | ) | [inline, virtual] |
In case the dimensions of an underlying VMat has changed, recompute it.
Reimplemented from PLearn::VMatrix.
Definition at line 65 of file RemoveRowsVMatrix.h.
void PLearn::RemoveRowsVMatrix::unremove | ( | int | rownum | ) | [inline] |
Definition at line 87 of file RemoveRowsVMatrix.h.
Reimplemented from PLearn::VMatrix.
Definition at line 75 of file RemoveRowsVMatrix.h.
VMat PLearn::RemoveRowsVMatrix::distr [protected] |
Definition at line 58 of file RemoveRowsVMatrix.h.
Referenced by build_(), declareOptions(), dot(), get(), and getSubRow().
Vec PLearn::RemoveRowsVMatrix::indices [protected] |
Definition at line 59 of file RemoveRowsVMatrix.h.
Referenced by build_(), declareOptions(), and getrownum().