PLearn 0.1
|
The first sentence should be a BRIEF DESCRIPTION of what the class does. More...
#include <ValueSelectRowsVMatrix.h>
Public Member Functions | |
ValueSelectRowsVMatrix () | |
Default constructor. | |
virtual string | classname () const |
virtual OptionList & | getOptionList () const |
virtual OptionMap & | getOptionMap () const |
virtual RemoteMethodMap & | getRemoteMethodMap () const |
virtual ValueSelectRowsVMatrix * | deepCopy (CopiesMap &copies) const |
virtual void | build () |
Simply calls inherited::build() then build_(). | |
virtual void | makeDeepCopyFromShallowCopy (CopiesMap &copies) |
Transforms a shallow copy into a deep copy. | |
Static Public Member Functions | |
static string | _classname_ () |
SelectRowsVMatrix. | |
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 () |
Public Attributes | |
string | col_name |
### declare public option fields (such as build options) here Start your comments with Doxygen-compatible comments such as //! | |
string | col_name_sec |
VMat | second |
Static Public Attributes | |
static StaticInitializer | _static_initializer_ |
Static Protected Member Functions | |
static void | declareOptions (OptionList &ol) |
Declares the class options. | |
Private Types | |
typedef SelectRowsVMatrix | inherited |
Private Member Functions | |
void | build_ () |
This does the actual building. |
The first sentence should be a BRIEF DESCRIPTION of what the class does.
Place the rest of the class programmer documentation here. Doxygen supports Javadoc-style comments. See http://www.doxygen.org/manual.html
Definition at line 57 of file ValueSelectRowsVMatrix.h.
typedef SelectRowsVMatrix PLearn::ValueSelectRowsVMatrix::inherited [private] |
Reimplemented from PLearn::SelectRowsVMatrix.
Definition at line 59 of file ValueSelectRowsVMatrix.h.
PLearn::ValueSelectRowsVMatrix::ValueSelectRowsVMatrix | ( | ) |
string PLearn::ValueSelectRowsVMatrix::_classname_ | ( | ) | [static] |
Reimplemented from PLearn::SelectRowsVMatrix.
Definition at line 49 of file ValueSelectRowsVMatrix.cc.
OptionList & PLearn::ValueSelectRowsVMatrix::_getOptionList_ | ( | ) | [static] |
Reimplemented from PLearn::SelectRowsVMatrix.
Definition at line 49 of file ValueSelectRowsVMatrix.cc.
RemoteMethodMap & PLearn::ValueSelectRowsVMatrix::_getRemoteMethodMap_ | ( | ) | [static] |
Reimplemented from PLearn::SelectRowsVMatrix.
Definition at line 49 of file ValueSelectRowsVMatrix.cc.
Reimplemented from PLearn::SelectRowsVMatrix.
Definition at line 49 of file ValueSelectRowsVMatrix.cc.
Object * PLearn::ValueSelectRowsVMatrix::_new_instance_for_typemap_ | ( | ) | [static] |
Reimplemented from PLearn::SelectRowsVMatrix.
Definition at line 49 of file ValueSelectRowsVMatrix.cc.
StaticInitializer ValueSelectRowsVMatrix::_static_initializer_ & PLearn::ValueSelectRowsVMatrix::_static_initialize_ | ( | ) | [static] |
Reimplemented from PLearn::SelectRowsVMatrix.
Definition at line 49 of file ValueSelectRowsVMatrix.cc.
void PLearn::ValueSelectRowsVMatrix::build | ( | ) | [virtual] |
Simply calls inherited::build() then build_().
Reimplemented from PLearn::SelectRowsVMatrix.
Definition at line 90 of file ValueSelectRowsVMatrix.cc.
{ // ### Nothing to add here, simply calls build_ // inherited::build(); build_(); inherited::build();//must recall as we changed selected_indices }
void PLearn::ValueSelectRowsVMatrix::build_ | ( | ) | [private] |
This does the actual building.
Reimplemented from PLearn::SelectRowsVMatrix.
Definition at line 101 of file ValueSelectRowsVMatrix.cc.
References i, PLERROR, PLWARNING, and PLearn::sortElements().
{ // ### This method should do the real building of the object, // ### according to set 'options', in *any* situation. // ### Typical situations include: // ### - Initial building of an object from a few user-specified options // ### - Building of a "reloaded" object: i.e. from the complete set of // ### all serialised options. // ### - Updating or "re-building" of an object after a few "tuning" // ### options have been modified. // ### You should assume that the parent class' build_() has already been // ### called. // ### In a SourceVMatrix, you will typically end build_() with: // setMetaInfoFromSource(); // ### You should keep the line 'updateMtime(0);' if you do not implement // ### the update of the mtime. Otherwise you can have an mtime != 0 that // ### is not valid. // ### Note that setMetaInfoFromSource() updates the mtime to the same as // ### the source, but this value will be erased with 'updateMtime(0)'. if(col_name_sec.empty()) col_name_sec=col_name; Vec values_src(source->length()), values_sec(second->length()); int idx = source->getFieldIndex(col_name,false); if(idx<0) PLERROR("In ValueSelectRowsVMatrix::build_ - the matrix source don't have the column %s", col_name.c_str()); source->getColumn(idx,values_src); idx=second->getFieldIndex(col_name_sec); if(idx<0) PLERROR("In ValueSelectRowsVMatrix::build_ - the matrix second don't have the column %s", col_name.c_str()); second->getColumn(idx,values_sec); //sort values_sec as it is shorter. sortElements(values_sec); for(int i=0;i<values_src.size();i++){ real val = values_src[i]; int idx=values_sec.findSorted(val); if(values_sec[idx]==val){ indices.append(i); } } if(indices.size()!=values_sec.size()) PLWARNING("In ValueSelectRowsVMatrix::build_() - we selected less rows" " (%d) than asked(%d). Maybe some disappeared.", indices.size(), values_sec.size()); updateMtime(source); updateMtime(second); }
string PLearn::ValueSelectRowsVMatrix::classname | ( | ) | const [virtual] |
Reimplemented from PLearn::SelectRowsVMatrix.
Definition at line 49 of file ValueSelectRowsVMatrix.cc.
void PLearn::ValueSelectRowsVMatrix::declareOptions | ( | OptionList & | ol | ) | [static, protected] |
Declares the class options.
Reimplemented from PLearn::SelectRowsVMatrix.
Definition at line 61 of file ValueSelectRowsVMatrix.cc.
References PLearn::OptionBase::buildoption, col_name, PLearn::declareOption(), and second.
{ // ### Declare all of this object's options here. // ### For the "flags" of each option, you should typically specify // ### one of OptionBase::buildoption, OptionBase::learntoption or // ### OptionBase::tuningoption. If you don't provide one of these three, // ### this option will be ignored when loading values from a script. // ### You can also combine flags, for example with OptionBase::nosave: // ### (OptionBase::buildoption | OptionBase::nosave) declareOption(ol, "col_name", &ValueSelectRowsVMatrix::col_name, OptionBase::buildoption, "The name of the column to compare values."); declareOption(ol, "col_name_sec", &ValueSelectRowsVMatrix::col_name, OptionBase::buildoption, "The name of the column to compare values for the second matrix." " If not provided, will use col_name."); declareOption(ol, "second", &ValueSelectRowsVMatrix::second, OptionBase::buildoption, "The matrix that have the value that we keep the columns."); inherited::declareOptions(ol); }
static const PPath& PLearn::ValueSelectRowsVMatrix::declaringFile | ( | ) | [inline, static] |
Reimplemented from PLearn::SelectRowsVMatrix.
Definition at line 81 of file ValueSelectRowsVMatrix.h.
:
//##### Protected Options ###############################################
ValueSelectRowsVMatrix * PLearn::ValueSelectRowsVMatrix::deepCopy | ( | CopiesMap & | copies | ) | const [virtual] |
Reimplemented from PLearn::SelectRowsVMatrix.
Definition at line 49 of file ValueSelectRowsVMatrix.cc.
OptionList & PLearn::ValueSelectRowsVMatrix::getOptionList | ( | ) | const [virtual] |
Reimplemented from PLearn::SelectRowsVMatrix.
Definition at line 49 of file ValueSelectRowsVMatrix.cc.
OptionMap & PLearn::ValueSelectRowsVMatrix::getOptionMap | ( | ) | const [virtual] |
Reimplemented from PLearn::SelectRowsVMatrix.
Definition at line 49 of file ValueSelectRowsVMatrix.cc.
RemoteMethodMap & PLearn::ValueSelectRowsVMatrix::getRemoteMethodMap | ( | ) | const [virtual] |
Reimplemented from PLearn::SelectRowsVMatrix.
Definition at line 49 of file ValueSelectRowsVMatrix.cc.
void PLearn::ValueSelectRowsVMatrix::makeDeepCopyFromShallowCopy | ( | CopiesMap & | copies | ) | [virtual] |
Transforms a shallow copy into a deep copy.
Reimplemented from PLearn::SelectRowsVMatrix.
Definition at line 156 of file ValueSelectRowsVMatrix.cc.
References PLearn::deepCopyField().
{ inherited::makeDeepCopyFromShallowCopy(copies); deepCopyField(second, copies); }
Reimplemented from PLearn::SelectRowsVMatrix.
Definition at line 81 of file ValueSelectRowsVMatrix.h.
### declare public option fields (such as build options) here Start your comments with Doxygen-compatible comments such as //!
Definition at line 67 of file ValueSelectRowsVMatrix.h.
Referenced by declareOptions().
Definition at line 68 of file ValueSelectRowsVMatrix.h.
Definition at line 69 of file ValueSelectRowsVMatrix.h.
Referenced by declareOptions().