#include <SDBVMat.h>
Inheritance diagram for PLearn::SDBVMFieldDateDiff:
Public Member Functions | |
SDBVMFieldDateDiff (SDBVMSource source1, SDBVMSource source2, char the_unit= 'D', FieldValue date1_threshold=FieldValue(), FieldValue date2_threshold=FieldValue()) | |
unit can be 'D' for days, 'M' for months or 'Y' for years (result is always an integer number of days, months, or years) | |
SDBVMFieldDateDiff (SDBVMSource source1, PDate the_refdate, char the_unit= 'D') | |
This will compute difference between date in source1 and a fixed refdate. | |
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 | |
PDate | refdate |
FieldValue | date1_threshold_ |
FieldValue | date2_threshold_ |
char | unit |
unit can be 'D' for days, 'M' for months or 'Y' for years |
Definition at line 555 of file SDBVMat.h.
|
unit can be 'D' for days, 'M' for months or 'Y' for years (result is always an integer number of days, months, or years) This will compute difference between dates in source1 and source2 The sources must both be dates. Optionally, two thresholds can be specified, such that if a date is below or equal to its respective threshold, then the date is considered MISSING_VALUE. This is useful to filter out some obvious outliers. (TO BE IMPLEMENTED: or one can be a date and the other an integer numerical type; in this latter case, the integer is understood as beeing expressed in the given unit...) Definition at line 577 of file SDBVMat.h. References MISSING_VALUE. |
|
This will compute difference between date in source1 and a fixed refdate.
Definition at line 586 of file SDBVMat.h. References MISSING_VALUE. |
|
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 507 of file SDBVMat.cc. References date1_threshold_, date2_threshold_, PLearn::SDBVMSource::getValue(), PLearn::FieldValue::isDate(), PLearn::FieldValue::isIntegral(), PLearn::PDate::isMissing(), PLearn::FieldValue::isMissing(), MISSING_VALUE, PLearn::PDate::month, PLERROR, refdate, PLearn::PDate::setMissing(), PLearn::FieldValue::setMissing(), PLearn::FieldValue::toDate(), PLearn::PDate::toJulianDay(), unit, PLearn::Vec, and PLearn::PDate::year. |
|
Width that the field occupies in the VMat.
Implements PLearn::SDBVMField. Definition at line 580 of file SDBVMat.cc. |
|
Definition at line 559 of file SDBVMat.h. Referenced by convertField(). |
|
Definition at line 560 of file SDBVMat.h. Referenced by convertField(). |
|
Definition at line 558 of file SDBVMat.h. Referenced by convertField(). |
|
unit can be 'D' for days, 'M' for months or 'Y' for years
Definition at line 561 of file SDBVMat.h. Referenced by convertField(). |