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

PLearn::JulianizeVMatrix Class Reference

#include <JulianizeVMatrix.h>

Inheritance diagram for PLearn::JulianizeVMatrix:

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

Collaboration graph
[legend]
List of all members.

Public Types

enum  DateCode { Date = 0, DateTime = 1 }
 This specifies the how the dates are coded in the underlying VMatrix; for now only two formats are allowed. More...


Public Member Functions

 JulianizeVMatrix ()
 Default constructor, the implementation in the .cc initializes all fields to reasonable default values.

 JulianizeVMatrix (VMat underlying, DateCode date_code=Date, int starting_column=0)
 Simple constructor: takes as input only the date code and the starting column for a single date.

virtual void build ()
 Should call simply inherited::build(), then this class's build_().

virtual void makeDeepCopyFromShallowCopy (map< const void *, void * > &copies)
 Transforms a shallow copy into a deep copy.

 PLEARN_DECLARE_OBJECT (JulianizeVMatrix)
 Declares name and deepCopy methods.


Static Public Member Functions

int dateCodeWidth (DateCode dc)
 Return the number of columns taken by each date code.


Protected Member Functions

virtual void getNewRow (int i, const Vec &v) const
 Implement the base class abstract member function.

void setVMFields ()

Static Protected Member Functions

void declareOptions (OptionList &ol)
 Declares this class' options. No options are currently supported.

int newWidth (VMat und, DateCode dc)

Protected Attributes

VMat underlying_
 underlying vmat

vector< pair< int, DateCode > > cols_codes_
 all columns/date codes

Vec und_row_
 buffer for underlying row


Private Types

typedef RowBufferedVMatrix inherited

Private Member Functions

void build_ ()
 This does the actual building.


Detailed Description

JulianizeVMatrix

The purpose of a JulianizeVMatrix is to convert some columns of an underlying VMatrix into a JulianDayNumber (represented as a double). This VMatrix can convert any triplet of (YYYY,MM,DD) or sextuplet (YYY,MM,DD,HH,MM,SS) into a single double, whose integer part is the JDN and the fractional part codes the HH:MM:SS as a day fraction. Columns anywhere in the VMat can thereby be sepcified.

A class invariant here is that the member variable cols_codes_ (which stores pairs of the starting columns for dates to convert along with the date code for carrying out the conversion) is kept SORTED in order of increasing column.

Definition at line 68 of file JulianizeVMatrix.h.


Member Typedef Documentation

typedef RowBufferedVMatrix PLearn::JulianizeVMatrix::inherited [private]
 

Reimplemented from PLearn::RowBufferedVMatrix.

Definition at line 70 of file JulianizeVMatrix.h.

Referenced by JulianizeVMatrix().


Member Enumeration Documentation

enum PLearn::JulianizeVMatrix::DateCode
 

This specifies the how the dates are coded in the underlying VMatrix; for now only two formats are allowed.

Enumeration values:
Date  (YYYY, MM, DD)
DateTime  (YYYY, MM, DD, HH, MM, SS)

Definition at line 75 of file JulianizeVMatrix.h.


Constructor & Destructor Documentation

PLearn::JulianizeVMatrix::JulianizeVMatrix  ) 
 

Default constructor, the implementation in the .cc initializes all fields to reasonable default values.

Definition at line 58 of file JulianizeVMatrix.cc.

References inherited.

PLearn::JulianizeVMatrix::JulianizeVMatrix VMat  underlying,
DateCode  date_code = Date,
int  starting_column = 0
 

Simple constructor: takes as input only the date code and the starting column for a single date.

Starting columns are zero-based.

Definition at line 63 of file JulianizeVMatrix.cc.

References cols_codes_, and setVMFields().


Member Function Documentation

void PLearn::JulianizeVMatrix::build  )  [virtual]
 

Should call simply inherited::build(), then this class's build_().

This method should be callable again at later times, after modifying some option fields to change the "architecture" of the object.

Reimplemented from PLearn::VMatrix.

Definition at line 140 of file JulianizeVMatrix.cc.

References build_().

void PLearn::JulianizeVMatrix::build_  )  [private]
 

This does the actual building.

Reimplemented from PLearn::VMatrix.

Definition at line 134 of file JulianizeVMatrix.cc.

Referenced by build().

int PLearn::JulianizeVMatrix::dateCodeWidth DateCode  dc  )  [inline, static]
 

Return the number of columns taken by each date code.

Definition at line 81 of file JulianizeVMatrix.h.

References Date, dateCodeWidth(), DateTime, and PLERROR.

Referenced by dateCodeWidth(), and setVMFields().

void PLearn::JulianizeVMatrix::declareOptions OptionList ol  )  [static, protected]
 

Declares this class' options. No options are currently supported.

Reimplemented from PLearn::VMatrix.

Definition at line 117 of file JulianizeVMatrix.cc.

References PLearn::OptionList.

void PLearn::JulianizeVMatrix::getNewRow int  i,
const Vec v
const [protected, virtual]
 

Implement the base class abstract member function.

Implements PLearn::RowBufferedVMatrix.

Definition at line 75 of file JulianizeVMatrix.cc.

References PLearn::TVec< T >::begin(), cols_codes_, std::copy(), Date, DateTime, PLearn::TVec< T >::end(), und_row_, underlying_, and PLearn::Vec.

void PLearn::JulianizeVMatrix::makeDeepCopyFromShallowCopy map< const void *, void * > &  copies  )  [virtual]
 

Transforms a shallow copy into a deep copy.

Reimplemented from PLearn::RowBufferedVMatrix.

Definition at line 146 of file JulianizeVMatrix.cc.

References PLearn::deepCopyField(), und_row_, and underlying_.

int PLearn::JulianizeVMatrix::newWidth VMat  und,
DateCode  dc
[inline, static, protected]
 

Definition at line 147 of file JulianizeVMatrix.h.

References newWidth(), and PLearn::VMat::width().

Referenced by newWidth().

PLearn::JulianizeVMatrix::PLEARN_DECLARE_OBJECT JulianizeVMatrix   ) 
 

Declares name and deepCopy methods.

void PLearn::JulianizeVMatrix::setVMFields  )  [protected]
 

Definition at line 154 of file JulianizeVMatrix.cc.

References cols_codes_, Date, dateCodeWidth(), DateTime, PLearn::TVec< T >::size(), and underlying_.

Referenced by JulianizeVMatrix().


Member Data Documentation

vector< pair<int,DateCode> > PLearn::JulianizeVMatrix::cols_codes_ [protected]
 

all columns/date codes

Definition at line 92 of file JulianizeVMatrix.h.

Referenced by getNewRow(), JulianizeVMatrix(), and setVMFields().

Vec PLearn::JulianizeVMatrix::und_row_ [mutable, protected]
 

buffer for underlying row

Definition at line 93 of file JulianizeVMatrix.h.

Referenced by getNewRow(), and makeDeepCopyFromShallowCopy().

VMat PLearn::JulianizeVMatrix::underlying_ [protected]
 

underlying vmat

Definition at line 91 of file JulianizeVMatrix.h.

Referenced by getNewRow(), makeDeepCopyFromShallowCopy(), and setVMFields().


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