|
PLearn 0.1
|
#include <SDBVMat.h>


Public Member Functions | |
| SDBVMFieldFunc1 (SDBVMSource source, Func func, real missing_values_mapping=MISSING_VALUE) | |
| virtual void | convertField (const SDBWithStats &sdb, const Row &row, const Vec &output) const |
| virtual int | fieldWidth () const |
| Width that the field occupies in the VMat. | |
Protected Attributes | |
| Func | func_ |
Private Types | |
| typedef SDBVMFieldSource1 | inherited |
Apply a one-input func to the field: call operator()(const Vec& input) of the func, with the input vector set to the single value resulting from the conversion of the SDB field to a Real. The vector output by the func is kept completely in the output; in other words, fieldWidth() is equal to the size of the vector returned by the func.
typedef SDBVMFieldSource1 PLearn::SDBVMFieldFunc1::inherited [private] |
Reimplemented from PLearn::SDBVMFieldSource1.
| PLearn::SDBVMFieldFunc1::SDBVMFieldFunc1 | ( | SDBVMSource | source, |
| Func | func, | ||
| real | missing_values_mapping = MISSING_VALUE |
||
| ) | [inline] |
Definition at line 459 of file SDBVMat.h.
: inherited(source,missing_values_mapping,VMField::Continuous), func_(func) {}
| void PLearn::SDBVMFieldFunc1::convertField | ( | const SDBWithStats & | sdb, |
| const Row & | theRow, | ||
| const Vec & | outputField | ||
| ) | const [virtual] |
Given a database row, convert the appropriate parts to a (preallocated) output vector of the correct width (given by fieldWidth). Replace MISSING_VALUEs by missing_values_mapping.
Implements PLearn::SDBVMField.
Definition at line 404 of file SDBVMat.cc.
References PLearn::SDBVMField::convertMissing(), func_, PLearn::SDBVMSource::getValue(), and PLearn::SDBVMFieldSource1::source_.
{
Vec input(1);
input[0] = source_.getValue(sdb,row);
output << func_(input);
convertMissing(output);
}

| int PLearn::SDBVMFieldFunc1::fieldWidth | ( | ) | const [virtual] |
Width that the field occupies in the VMat.
Implements PLearn::SDBVMField.
Definition at line 413 of file SDBVMat.cc.
References func_.
{
return func_->outputsize;
}
Func PLearn::SDBVMFieldFunc1::func_ [mutable, protected] |
Definition at line 469 of file SDBVMat.h.
Referenced by convertField(), and fieldWidth().
1.7.4