Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

PLearn::SDBVMFieldRemapIntervals Class Reference

#include <SDBVMat.h>

Inheritance diagram for PLearn::SDBVMFieldRemapIntervals:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 SDBVMFieldRemapIntervals (SDBVMSource source, const string &mappings, real other_values_mapping=MISSING_VALUE, real missing_values_mapping=MISSING_VALUE, SDBVMOutputCoding oc=SDBVMNumeric, VMField::FieldType ft=VMField::DiscrGeneral)
virtual real getDiscreteValue (const SDBWithStats &sdb, const Row &row) const
 Perform the actual remapping.


Static Public Member Functions

void getIntervals (const string &mappings, bool &all_int, real &max_of_map, Vec &intervals_x, Vec &intervals_y)

Protected Attributes

Vec intervals_x_
Vec intervals_y_
real other_values_mapping_

Private Types

typedef SDBVMFieldDiscrete inherited

Detailed Description

A field that remaps intervals on the reals onto discrete integer values. The format of the "mappings" argument is: "y_0 x_1 y_1 x_2 y_2 ... x_N y_N", where the "x_i" are cut-points for X, with for the value y_i obtained when x_i <= X < x_{i+1}, and y_0 obtained for X<x_1, and y_N obtained for X >= y_N. It is required that x_i < x_{i+1}.

Definition at line 815 of file SDBVMat.h.


Member Typedef Documentation

typedef SDBVMFieldDiscrete PLearn::SDBVMFieldRemapIntervals::inherited [private]
 

Reimplemented from PLearn::SDBVMFieldDiscrete.

Definition at line 817 of file SDBVMat.h.

Referenced by SDBVMFieldRemapIntervals().


Constructor & Destructor Documentation

PLearn::SDBVMFieldRemapIntervals::SDBVMFieldRemapIntervals SDBVMSource  source,
const string mappings,
real  other_values_mapping = MISSING_VALUE,
real  missing_values_mapping = MISSING_VALUE,
SDBVMOutputCoding  oc = SDBVMNumeric,
VMField::FieldType  ft = VMField::DiscrGeneral
 

Definition at line 868 of file SDBVMat.cc.

References getIntervals(), inherited, intervals_x_, and intervals_y_.


Member Function Documentation

real PLearn::SDBVMFieldRemapIntervals::getDiscreteValue const SDBWithStats sdb,
const Row row
const [virtual]
 

Perform the actual remapping.

Implements PLearn::SDBVMFieldDiscrete.

Definition at line 886 of file SDBVMat.cc.

References PLearn::binary_search(), PLearn::SDBVMSource::getValue(), intervals_x_, intervals_y_, and PLearn::FieldValue::isMissing().

void PLearn::SDBVMFieldRemapIntervals::getIntervals const string mappings,
bool all_int,
real max_of_map,
Vec intervals_x,
Vec intervals_y
[static]
 

This parses the remapping string and returns a map. Whether the target values are all non-negative integers is set in all_int. The maximum target value in the map is set into max_of_map. The intervals are returned in intervals_x and intervals_y

Definition at line 820 of file SDBVMat.cc.

References PLERROR, PLearn::TVec< T >::resize(), and PLearn::Vec.

Referenced by SDBVMFieldRemapIntervals().


Member Data Documentation

Vec PLearn::SDBVMFieldRemapIntervals::intervals_x_ [protected]
 

Definition at line 840 of file SDBVMat.h.

Referenced by getDiscreteValue(), and SDBVMFieldRemapIntervals().

Vec PLearn::SDBVMFieldRemapIntervals::intervals_y_ [protected]
 

Definition at line 841 of file SDBVMat.h.

Referenced by getDiscreteValue(), and SDBVMFieldRemapIntervals().

real PLearn::SDBVMFieldRemapIntervals::other_values_mapping_ [protected]
 

Definition at line 842 of file SDBVMat.h.


The documentation for this class was generated from the following files:
Generated on Tue Aug 17 16:22:59 2004 for PLearn by doxygen 1.3.7