PLearn 0.1
|
A SDBVMSource represents a source for a value that can be either directly a field from a SDB or an already processed SDBVMField. More...
#include <SDBVMat.h>
Public Member Functions | |
SDBVMSource (FieldPtr the_sdbfieldptr) | |
SDBVMSource (PSDBVMField the_sdbvmfieldptr) | |
FieldValue | getValue (const SDBWithStats &sdb, const Row &row) const |
to get the value of this source | |
const FieldStat & | getFieldStat (const SDBWithStats &sdb, const Row &row) const |
to get the statistics for this source (works only if the source is a FieldPtr, produces an error if it's a PSDBVMField) | |
Protected Attributes | |
FieldPtr | sdbfieldptr |
PSDBVMField | sdbvmfieldptr |
Vec | output |
A SDBVMSource represents a source for a value that can be either directly a field from a SDB or an already processed SDBVMField.
PLearn::SDBVMSource::SDBVMSource | ( | FieldPtr | the_sdbfieldptr | ) | [inline] |
Definition at line 210 of file SDBVMat.h.
:sdbfieldptr(the_sdbfieldptr) {}
PLearn::SDBVMSource::SDBVMSource | ( | PSDBVMField | the_sdbvmfieldptr | ) | [inline] |
Definition at line 213 of file SDBVMat.h.
References PLERROR.
:sdbvmfieldptr(the_sdbvmfieldptr), output(1) { if(sdbvmfieldptr->fieldWidth()!=1) PLERROR("Can't make a SDBVMSource from a SDBVMField whose width is other than 1"); }
const FieldStat& PLearn::SDBVMSource::getFieldStat | ( | const SDBWithStats & | sdb, |
const Row & | row | ||
) | const [inline] |
to get the statistics for this source (works only if the source is a FieldPtr, produces an error if it's a PSDBVMField)
Definition at line 235 of file SDBVMat.h.
References PLearn::SDBWithStats::getStat(), and PLERROR.
Referenced by PLearn::SDBVMFieldDivSigma::convertField(), and PLearn::SDBVMFieldNormalize::convertField().
{ if(!sdbfieldptr) PLERROR("works only if the source is a FieldPtr"); return sdb.getStat(sdbfieldptr.field_index()); }
FieldValue PLearn::SDBVMSource::getValue | ( | const SDBWithStats & | sdb, |
const Row & | row | ||
) | const [inline] |
to get the value of this source
Definition at line 222 of file SDBVMat.h.
References PLearn::Row::bind().
Referenced by PLearn::SDBVMFieldFunc1::convertField(), PLearn::SDBVMFieldDivSigma::convertField(), PLearn::SDBVMFieldFunc2::convertField(), PLearn::SDBVMFieldMonths::convertField(), PLearn::SDBVMFieldICBCClassification::convertField(), PLearn::SDBVMFieldSignedPower::convertField(), PLearn::SDBVMFieldAsIs::convertField(), PLearn::SDBVMFieldDay::convertField(), PLearn::SDBVMFieldICBCTargets::convertField(), PLearn::SDBVMFieldDateDiff::convertField(), PLearn::SDBVMFieldDate::convertField(), PLearn::SDBVMFieldAffine::convertField(), PLearn::SDBVMFieldPosAffine::convertField(), PLearn::SDBVMFieldDateGreater::convertField(), PLearn::SDBVMFieldNormalize::convertField(), PLearn::SDBVMFieldCodeAsIs::getDiscreteValue(), PLearn::SDBVMFieldRemapStrings::getDiscreteValue(), PLearn::SDBVMFieldDateGreater::getDiscreteValue(), PLearn::SDBVMFieldRemapReals::getDiscreteValue(), and PLearn::SDBVMFieldRemapIntervals::getDiscreteValue().
{ if(sdbfieldptr) return *row.bind(sdbfieldptr); else { sdbvmfieldptr->convertField(sdb,row,output); return FieldValue(output[0]); } }
Vec PLearn::SDBVMSource::output [protected] |
FieldPtr PLearn::SDBVMSource::sdbfieldptr [protected] |
PSDBVMField PLearn::SDBVMSource::sdbvmfieldptr [protected] |