#include <JulianizeVMatrix.h>
Inheritance diagram for PLearn::JulianizeVMatrix:
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. |
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.
|
Reimplemented from PLearn::RowBufferedVMatrix. Definition at line 70 of file JulianizeVMatrix.h. Referenced by JulianizeVMatrix(). |
|
This specifies the how the dates are coded in the underlying VMatrix; for now only two formats are allowed.
Definition at line 75 of file JulianizeVMatrix.h. |
|
Default constructor, the implementation in the .cc initializes all fields to reasonable default values.
Definition at line 58 of file JulianizeVMatrix.cc. References inherited. |
|
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(). |
|
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_(). |
|
This does the actual building.
Reimplemented from PLearn::VMatrix. Definition at line 134 of file JulianizeVMatrix.cc. Referenced by build(). |
|
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(). |
|
Declares this class' options. No options are currently supported.
Reimplemented from PLearn::VMatrix. Definition at line 117 of file JulianizeVMatrix.cc. References PLearn::OptionList. |
|
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. |
|
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_. |
|
Definition at line 147 of file JulianizeVMatrix.h. References newWidth(), and PLearn::VMat::width(). Referenced by newWidth(). |
|
Declares name and deepCopy methods.
|
|
Definition at line 154 of file JulianizeVMatrix.cc. References cols_codes_, Date, dateCodeWidth(), DateTime, PLearn::TVec< T >::size(), and underlying_. Referenced by JulianizeVMatrix(). |
|
all columns/date codes
Definition at line 92 of file JulianizeVMatrix.h. Referenced by getNewRow(), JulianizeVMatrix(), and setVMFields(). |
|
buffer for underlying row
Definition at line 93 of file JulianizeVMatrix.h. Referenced by getNewRow(), and makeDeepCopyFromShallowCopy(). |
|
underlying vmat
Definition at line 91 of file JulianizeVMatrix.h. Referenced by getNewRow(), makeDeepCopyFromShallowCopy(), and setVMFields(). |