PLearn 0.1
Public Member Functions | Protected Attributes | Private Types
PLearn::SDBVMFieldDateGreater Class Reference

verifies if the date within the row is greater than a threshold date More...

#include <SDBVMat.h>

Inheritance diagram for PLearn::SDBVMFieldDateGreater:
Inheritance graph
[legend]
Collaboration diagram for PLearn::SDBVMFieldDateGreater:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 SDBVMFieldDateGreater (SDBVMSource source, PDate the_ref)
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.
virtual real getDiscreteValue (const SDBWithStats &sdb, const Row &row) const

Protected Attributes

PDate ref

Private Types

typedef SDBVMFieldDiscrete inherited

Detailed Description

verifies if the date within the row is greater than a threshold date

Definition at line 664 of file SDBVMat.h.


Member Typedef Documentation

Reimplemented from PLearn::SDBVMFieldDiscrete.

Definition at line 666 of file SDBVMat.h.


Constructor & Destructor Documentation

PLearn::SDBVMFieldDateGreater::SDBVMFieldDateGreater ( SDBVMSource  source,
PDate  the_ref 
) [inline]

< true or false

Definition at line 672 of file SDBVMat.h.

        : inherited(source),ref(the_ref)
    {
        setNumClasses(2);                    
    }

Member Function Documentation

void PLearn::SDBVMFieldDateGreater::convertField ( const SDBWithStats sdb,
const Row row,
const Vec output 
) const [virtual]

This function is implemented as a call to a virtual function getDiscreteValue(), followed by a call to setOutput of the OutputCoder.

Reimplemented from PLearn::SDBVMFieldDiscrete.

Definition at line 631 of file SDBVMat.cc.

References d, PLearn::SDBVMSource::getValue(), PLearn::PPointable::ref(), and PLearn::SDBVMFieldSource1::source_.

{
    PDate d = source_.getValue(sdb,row);

    if (d>ref)
        output[0]=1;
    else 
        output[0]=0;
}

Here is the call graph for this function:

int PLearn::SDBVMFieldDateGreater::fieldWidth ( ) const [virtual]

Width that the field occupies in the VMat.

Reimplemented from PLearn::SDBVMFieldDiscrete.

Definition at line 642 of file SDBVMat.cc.

{
    return 1;
}
real PLearn::SDBVMFieldDateGreater::getDiscreteValue ( const SDBWithStats sdb,
const Row row 
) const [virtual]

This function must be overridden in derived classes to get the correctly-mapped discrete value obtained from the SDB. The semantics prescribe missing values to be remapped to missing_values_mapping_.

Implements PLearn::SDBVMFieldDiscrete.

Definition at line 647 of file SDBVMat.cc.

References PLearn::SDBVMSource::getValue(), PLearn::FieldValue::isMissing(), PLearn::SDBVMField::missing_values_mapping_, PLearn::PPointable::ref(), PLearn::SDBVMFieldSource1::source_, and PLearn::FieldValue::toDate().

{
    // WARNING: IS THIS CORRECT (Pascal?)
    FieldValue v = source_.getValue(sdb,row);
    if(v.isMissing())
        return missing_values_mapping_;
    return v.toDate()>ref ?1 :0;
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 669 of file SDBVMat.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines