YMDDatedVMatrix.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00044
#ifndef YMDDatedVMatrix_INC
00045
#define YMDDatedVMatrix_INC
00046
00047
#include "DatedVMatrix.h"
00048
#include "VMat.h"
00049
00050
namespace PLearn {
00051
using namespace std;
00052
00058 class YMDDatedVMatrix:
public DatedVMatrix
00059 {
00060 typedef DatedVMatrix inherited;
00061
00062
public:
00063 VMat data;
00064
protected:
00065 Mat years;
00066 Mat months;
00067 Mat days;
00068 Vec pos_of_ith_year;
00069 Vec pos_of_ith_month;
00070 Vec pos_of_ith_day;
00071 Vec day_of_ith_pos;
00072 Array< TMat<int> >
pos_of_date;
00073
00074
00075
public:
00076
00077
00078
00079
YMDDatedVMatrix();
00080
00083
YMDDatedVMatrix(
VMat data_,
Mat years_,
Mat months_,
Mat days_);
00084
00088
YMDDatedVMatrix(
Mat& YMD_and_data);
00089
00090
PLEARN_DECLARE_OBJECT(
YMDDatedVMatrix);
00091
static void declareOptions(
OptionList &ol);
00092
00093
virtual void build();
00094
00096 int nDateFields() {
return 3; }
00097
00102
VMat subDistrRelativeDates(
int first,
int n,
const string& units);
00103
VMat subDistrRelativeYears(
int first_relative_year,
int n_years);
00104
VMat subDistrRelativeMonths(
int first_relative_month,
int n_months);
00105
VMat subDistrRelativeDays(
int first_relative_day,
int n_days);
00106
00109
VMat subDistrAbsoluteYears(
int year,
int month,
int day,
int n_years);
00110
VMat subDistrAbsoluteMonths(
int year,
int month,
int day,
int n_months);
00111
VMat subDistrAbsoluteDays(
int year,
int month,
int day,
int n_days);
00112
VMat subDistrAbsoluteUnits(
int year,
int month,
int day,
int n_units,
const string& units);
00113
00116
int lengthInDates(
const string& units);
00117
00120
int positionOfRelativeDate(
int first,
const string& units);
00121
00124
int positionOfDate(
int year,
int month,
int day);
00125
00128
void copyDatesOfRows(
int from_row,
int n_rows,
Mat& dates);
00129
00130
00131
00132
00133
Vec copyRowDataAndDate(
int row,
int &year,
int &month,
int &day);
00134
void copyDateOfRow(
int row,
int &year,
int &month,
int &day);
00135
00136 virtual void reset_dimensions() {
PLERROR(
"YMDDatedVMatrix::reset_dimensions() not implemented"); }
00137
private:
00138
void build_();
00139 };
00140
00141
DECLARE_OBJECT_PTR(YMDDatedVMatrix);
00142
00143 }
00144
#endif
Generated on Tue Aug 17 16:11:22 2004 for PLearn by
1.3.7