#include <YMDDatedVMatrix.h>
Inheritance diagram for PLearn::YMDDatedVMatrix:
Public Member Functions | |
YMDDatedVMatrix () | |
default constructor (for automatic deserialization) | |
YMDDatedVMatrix (VMat data_, Mat years_, Mat months_, Mat days_) | |
THE DATES MUST BE IN INCREASING CHRONOLOGICAL ORDER. | |
YMDDatedVMatrix (Mat &YMD_and_data) | |
alternatively, the given matrix has (year, month, day) in the first 3 columns and the rest of the data in the remaining columns. | |
PLEARN_DECLARE_OBJECT (YMDDatedVMatrix) | |
virtual void | build () |
Should call simply inherited::build(), then this class's build_(). | |
int | nDateFields () |
return the number of real fields required to specify a date: here 3 for YMD | |
VMat | subDistrRelativeDates (int first, int n, const string &units) |
VMat | subDistrRelativeYears (int first_relative_year, int n_years) |
VMat | subDistrRelativeMonths (int first_relative_month, int n_months) |
VMat | subDistrRelativeDays (int first_relative_day, int n_days) |
VMat | subDistrAbsoluteYears (int year, int month, int day, int n_years) |
sub-distribution starting at the given date, for the given number of occured years, months or days | |
VMat | subDistrAbsoluteMonths (int year, int month, int day, int n_months) |
VMat | subDistrAbsoluteDays (int year, int month, int day, int n_days) |
VMat | subDistrAbsoluteUnits (int year, int month, int day, int n_units, const string &units) |
int | lengthInDates (const string &units) |
return "size" in the given units (e.g. | |
int | positionOfRelativeDate (int first, const string &units) |
return row position of example whose relative date is the first with the given (relative) value, in the given time units | |
int | positionOfDate (int year, int month, int day) |
return row position associated with first sample whose date is given | |
void | copyDatesOfRows (int from_row, int n_rows, Mat &dates) |
copy the date fields for the relative positions starting at the given row position for the given number of rows, into the given matrix | |
Vec | copyRowDataAndDate (int row, int &year, int &month, int &day) |
void | copyDateOfRow (int row, int &year, int &month, int &day) |
virtual void | reset_dimensions () |
in case the dimensions of an underlying vmat has changed, recompute it | |
Static Public Member Functions | |
void | declareOptions (OptionList &ol) |
redefine this in subclasses: call declareOption(...) for each option, and then call inherited::declareOptions(options) ( see the declareOption function further down) | |
Public Attributes | |
VMat | data |
Protected Attributes | |
Mat | years |
single column of years (e.g. 1987), one year per data row | |
Mat | months |
single column of months (between 1 and 12), one month per data row | |
Mat | days |
single column of days (between 1 and 31), one day per data row | |
Vec | pos_of_ith_year |
row index of first row of i-th year in the data | |
Vec | pos_of_ith_month |
row index of first row of i-th month in the data | |
Vec | pos_of_ith_day |
row index of first row of i-th month in the data | |
Vec | day_of_ith_pos |
inverse map of pos_of_ith_day | |
Array< TMat< int > > | pos_of_date |
dates[year-years(0,0)][month-1][day-1] is the | |
Private Types | |
typedef DatedVMatrix | inherited |
Private Member Functions | |
void | build_ () |
This does the actual building. |
Definition at line 58 of file YMDDatedVMatrix.h.
|
Reimplemented from PLearn::DatedVMatrix. Definition at line 60 of file YMDDatedVMatrix.h. Referenced by YMDDatedVMatrix(). |
|
default constructor (for automatic deserialization)
Definition at line 48 of file YMDDatedVMatrix.cc. |
|
THE DATES MUST BE IN INCREASING CHRONOLOGICAL ORDER. Warning: VMFields are NOT YET handled by this constructor Definition at line 52 of file YMDDatedVMatrix.cc. References build(), inherited, and PLearn::Mat. |
|
alternatively, the given matrix has (year, month, day) in the first 3 columns and the rest of the data in the remaining columns. Warning: VMFields are NOT YET handled by this constructor Definition at line 59 of file YMDDatedVMatrix.cc. References build(). |
|
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::DatedVMatrix. Definition at line 70 of file YMDDatedVMatrix.cc. References build_(). Referenced by YMDDatedVMatrix(). |
|
This does the actual building.
Reimplemented from PLearn::DatedVMatrix. Definition at line 76 of file YMDDatedVMatrix.cc. References data, day_of_ith_pos, days, PLearn::TVec< T >::isEmpty(), PLearn::TMat< T >::isNotEmpty(), PLearn::PP< VMatrix >::isNotNull(), PLearn::VMat::length(), PLearn::TMat< T >::length(), months, PLERROR, pos_of_date, pos_of_ith_day, pos_of_ith_month, pos_of_ith_year, PLearn::TVec< T >::resize(), PLearn::TVec< TMat< int > >::resize(), and years. Referenced by build(). |
|
Implements PLearn::DatedVMatrix. Definition at line 342 of file YMDDatedVMatrix.cc. |
|
copy the date fields for the relative positions starting at the given row position for the given number of rows, into the given matrix
Implements PLearn::DatedVMatrix. Definition at line 324 of file YMDDatedVMatrix.cc. References days, months, PLearn::TMat< T >::resize(), and years. |
|
Implements PLearn::DatedVMatrix. Definition at line 335 of file YMDDatedVMatrix.cc. |
|
redefine this in subclasses: call declareOption(...) for each option, and then call inherited::declareOptions(options) ( see the declareOption function further down) ex: static void declareOptions(OptionList& ol) { declareOption(ol, "inputsize", &MyObject::inputsize_, OptionBase::buildoption, "the size of the input\n it must be provided"); declareOption(ol, "weights", &MyObject::weights, OptionBase::learntoption, "the learnt model weights"); inherited::declareOptions(ol); } Reimplemented from PLearn::DatedVMatrix. Definition at line 184 of file YMDDatedVMatrix.cc. References PLearn::declareOption(), and PLearn::OptionList. |
|
return "size" in the given units (e.g. interval in years, months, etc...) here e.g. the number of different years (if units=="years"). Implements PLearn::DatedVMatrix. Definition at line 296 of file YMDDatedVMatrix.cc. References PLearn::TVec< T >::length(), PLERROR, pos_of_ith_day, pos_of_ith_month, and pos_of_ith_year. |
|
return the number of real fields required to specify a date: here 3 for YMD
Implements PLearn::DatedVMatrix. Definition at line 96 of file YMDDatedVMatrix.h. |
|
|
|
return row position associated with first sample whose date is given
Definition at line 227 of file YMDDatedVMatrix.cc. References PLERROR, pos_of_date, and years. Referenced by subDistrAbsoluteDays(), subDistrAbsoluteMonths(), and subDistrAbsoluteYears(). |
|
return row position of example whose relative date is the first with the given (relative) value, in the given time units
Implements PLearn::DatedVMatrix. Definition at line 310 of file YMDDatedVMatrix.cc. References PLERROR, pos_of_ith_day, pos_of_ith_month, and pos_of_ith_year. |
|
in case the dimensions of an underlying vmat has changed, recompute it
Reimplemented from PLearn::VMatrix. Definition at line 136 of file YMDDatedVMatrix.h. References PLERROR. |
|
Definition at line 259 of file YMDDatedVMatrix.cc. References data, day_of_ith_pos, pos_of_ith_day, positionOfDate(), and PLearn::VMat::subMatRows(). Referenced by subDistrAbsoluteUnits(). |
|
Definition at line 250 of file YMDDatedVMatrix.cc. References data, positionOfDate(), and PLearn::VMat::subMatRows(). Referenced by subDistrAbsoluteUnits(). |
|
this one calls one of subDistrRelative{Years,Months,Days} according to wether units=="years", "months", or "days" (or if the first letter matches, irrespective of upper/lower case distinctions) Implements PLearn::DatedVMatrix. Definition at line 267 of file YMDDatedVMatrix.cc. References PLERROR, subDistrAbsoluteDays(), subDistrAbsoluteMonths(), and subDistrAbsoluteYears(). |
|
sub-distribution starting at the given date, for the given number of occured years, months or days
Definition at line 243 of file YMDDatedVMatrix.cc. References data, positionOfDate(), and PLearn::VMat::subMatRows(). Referenced by subDistrAbsoluteUnits(). |
|
this one calls one of subDistrRelative{Years,Months,Days} according to wether units=="years", "months", or "days" (or if the first letter matches, irrespective of upper/lower case distinctions) Implements PLearn::DatedVMatrix. Definition at line 282 of file YMDDatedVMatrix.cc. References PLearn::Mat, PLERROR, subDistrRelativeDays(), subDistrRelativeMonths(), and subDistrRelativeYears(). |
|
Definition at line 216 of file YMDDatedVMatrix.cc. References data, PLearn::TVec< T >::length(), PLERROR, pos_of_ith_day, and PLearn::VMat::subMatRows(). Referenced by subDistrRelativeDates(). |
|
Definition at line 205 of file YMDDatedVMatrix.cc. References data, PLearn::TVec< T >::length(), PLERROR, pos_of_ith_month, and PLearn::VMat::subMatRows(). Referenced by subDistrRelativeDates(). |
|
Definition at line 194 of file YMDDatedVMatrix.cc. References data, PLearn::TVec< T >::length(), PLERROR, pos_of_ith_year, and PLearn::VMat::subMatRows(). Referenced by subDistrRelativeDates(). |
|
Definition at line 63 of file YMDDatedVMatrix.h. Referenced by build_(), copyRowDataAndDate(), subDistrAbsoluteDays(), subDistrAbsoluteMonths(), subDistrAbsoluteYears(), subDistrRelativeDays(), subDistrRelativeMonths(), and subDistrRelativeYears(). |
|
inverse map of pos_of_ith_day
Definition at line 71 of file YMDDatedVMatrix.h. Referenced by build_(), and subDistrAbsoluteDays(). |
|
single column of days (between 1 and 31), one day per data row
Definition at line 67 of file YMDDatedVMatrix.h. Referenced by build_(), copyDateOfRow(), copyDatesOfRows(), and copyRowDataAndDate(). |
|
single column of months (between 1 and 12), one month per data row
Definition at line 66 of file YMDDatedVMatrix.h. Referenced by build_(), copyDateOfRow(), copyDatesOfRows(), and copyRowDataAndDate(). |
|
dates[year-years(0,0)][month-1][day-1] is the
Definition at line 72 of file YMDDatedVMatrix.h. Referenced by build_(), and positionOfDate(). |
|
row index of first row of i-th month in the data
Definition at line 70 of file YMDDatedVMatrix.h. Referenced by build_(), lengthInDates(), positionOfRelativeDate(), subDistrAbsoluteDays(), and subDistrRelativeDays(). |
|
row index of first row of i-th month in the data
Definition at line 69 of file YMDDatedVMatrix.h. Referenced by build_(), lengthInDates(), positionOfRelativeDate(), and subDistrRelativeMonths(). |
|
row index of first row of i-th year in the data
Definition at line 68 of file YMDDatedVMatrix.h. Referenced by build_(), lengthInDates(), positionOfRelativeDate(), and subDistrRelativeYears(). |
|
single column of years (e.g. 1987), one year per data row
Definition at line 65 of file YMDDatedVMatrix.h. Referenced by build_(), copyDateOfRow(), copyDatesOfRows(), copyRowDataAndDate(), and positionOfDate(). |