PLearn 0.1
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | Private Types | Private Member Functions
PLearn::YMDDatedVMatrix Class Reference

#include <YMDDatedVMatrix.h>

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

List of all members.

Public Member Functions

 YMDDatedVMatrix ()
 position of the absolute (year,month,day) date
 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.
virtual string classname () const
virtual OptionListgetOptionList () const
virtual OptionMapgetOptionMap () const
virtual RemoteMethodMapgetRemoteMethodMap () const
virtual YMDDatedVMatrixdeepCopy (CopiesMap &copies) const
virtual void build ()
 Simply calls inherited::build() then 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

static string _classname_ ()
 DatedVMatrix.
static OptionList_getOptionList_ ()
static RemoteMethodMap_getRemoteMethodMap_ ()
static Object_new_instance_for_typemap_ ()
static bool _isa_ (const Object *o)
static void _static_initialize_ ()
static const PPathdeclaringFile ()
static void declareOptions (OptionList &ol)
 Declare this class' options.

Public Attributes

VMat data

Static Public Attributes

static StaticInitializer _static_initializer_

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.

Detailed Description

A DatedVMatrix that knows about years, months, and days, and for which the relative differences between two dates (e.g. days) depends on the number of different values of that unit (e.g. the number of days which actually occur).

Definition at line 58 of file YMDDatedVMatrix.h.


Member Typedef Documentation

Reimplemented from PLearn::DatedVMatrix.

Definition at line 60 of file YMDDatedVMatrix.h.


Constructor & Destructor Documentation

PLearn::YMDDatedVMatrix::YMDDatedVMatrix ( )

position of the absolute (year,month,day) date

default constructor (for automatic deserialization)

Definition at line 48 of file YMDDatedVMatrix.cc.

{
}
PLearn::YMDDatedVMatrix::YMDDatedVMatrix ( VMat  data_,
Mat  years_,
Mat  months_,
Mat  days_ 
)

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(data_->length(),data_->width()),data(data_), years(years_), 
      months(months_), days(days_), day_of_ith_pos(days_.length())
{
    build();
}

Here is the call graph for this function:

PLearn::YMDDatedVMatrix::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.

Warning: VMFields are NOT YET handled by this constructor

Definition at line 59 of file YMDDatedVMatrix.cc.

References build().

    : inherited(YMD_and_data.length(),YMD_and_data.width()-3),
      data(YMD_and_data.subMatColumns(3,YMD_and_data.width()-3)), 
      years(YMD_and_data.subMatColumns(0,1)),
      months(YMD_and_data.subMatColumns(1,1)),
      days(YMD_and_data.subMatColumns(2,1)), day_of_ith_pos(YMD_and_data.length())
{
    build();
}

Here is the call graph for this function:


Member Function Documentation

string PLearn::YMDDatedVMatrix::_classname_ ( ) [static]

DatedVMatrix.

Reimplemented from PLearn::DatedVMatrix.

Definition at line 46 of file YMDDatedVMatrix.cc.

OptionList & PLearn::YMDDatedVMatrix::_getOptionList_ ( ) [static]

Reimplemented from PLearn::DatedVMatrix.

Definition at line 46 of file YMDDatedVMatrix.cc.

RemoteMethodMap & PLearn::YMDDatedVMatrix::_getRemoteMethodMap_ ( ) [static]

Reimplemented from PLearn::DatedVMatrix.

Definition at line 46 of file YMDDatedVMatrix.cc.

bool PLearn::YMDDatedVMatrix::_isa_ ( const Object o) [static]

Reimplemented from PLearn::DatedVMatrix.

Definition at line 46 of file YMDDatedVMatrix.cc.

Object * PLearn::YMDDatedVMatrix::_new_instance_for_typemap_ ( ) [static]

Reimplemented from PLearn::Object.

Definition at line 46 of file YMDDatedVMatrix.cc.

StaticInitializer YMDDatedVMatrix::_static_initializer_ & PLearn::YMDDatedVMatrix::_static_initialize_ ( ) [static]

Reimplemented from PLearn::DatedVMatrix.

Definition at line 46 of file YMDDatedVMatrix.cc.

void PLearn::YMDDatedVMatrix::build ( ) [virtual]

Simply calls inherited::build() then build_().

Reimplemented from PLearn::DatedVMatrix.

Definition at line 70 of file YMDDatedVMatrix.cc.

References PLearn::DatedVMatrix::build(), and build_().

Referenced by YMDDatedVMatrix().

Here is the call graph for this function:

Here is the caller graph for this function:

void PLearn::YMDDatedVMatrix::build_ ( ) [private]

This does the actual building.

Reimplemented from PLearn::DatedVMatrix.

Definition at line 76 of file YMDDatedVMatrix.cc.

References d, data, day_of_ith_pos, days, i, PLearn::TVec< T >::isEmpty(), PLearn::TMat< T >::isNotEmpty(), PLearn::PP< T >::isNotNull(), PLearn::VMat::length(), PLearn::TMat< T >::length(), m, months, PLERROR, pos_of_date, pos_of_ith_day, pos_of_ith_month, pos_of_ith_year, PLearn::TVec< T >::resize(), and years.

Referenced by build().

{
    if ( data.isNotNull() && years.isNotEmpty() && months.isNotEmpty() && days.isNotEmpty() && !day_of_ith_pos.isEmpty()) {
        // check that the dates are in increasing chronological order and
        // compute the pos_of_ith_{year,month,day} vectors
        if (years.length()!=data->length() ||
            months.length()!=data->length() ||
            days.length()!=data->length())
            PLERROR("YMDDatedVMatrix: arguments should all have the same length");

        // build pos_of_date
        int first_year = (int)years(0,0);
        int last_year = (int)years(data->length()-1,0);
        int ny=last_year-first_year+1;
        pos_of_date.resize(ny);
        for (int y=0;y<ny;y++)
        {
            pos_of_date[y].resize(12,31);
            for (int m=0;m<12;m++)
                for (int d=0;d<31;d++)
                    pos_of_date[y](m,d)= -1; // -1 will mean unseen date
        }

        int n_different_years=1;
        int n_different_months=1;
        int n_different_days=1;
        for (int i=1;i<years.length();i++)
        {
            if (years(i,0)>years(i-1,0)) 
            {
                n_different_years++;
                n_different_months++;
                n_different_days++;
                pos_of_date[int(years(i,0)-first_year)](int(months(i,0)-1), int(days(i,0)-1)) = i;
            }
            else
            {
                if (years(i,0)<years(i-1,0)) 
                    PLERROR("YMDDatedVMatrix: %d-th year = %d < %d-th year= %d",
                            i,(int)years(i,0),i-1,(int)years(i-1,0));
                if (months(i,0)>months(i-1,0)) 
                {
                    n_different_months++;
                    n_different_days++;
                    pos_of_date[int(years(i,0)-first_year)](int(months(i,0)-1),int(days(i,0)-1)) = i;
                }
                else
                {
                    if (months(i,0)<months(i-1,0)) 
                        PLERROR("YMDDatedVMatrix: %d-th month = %d < %d-th month= %d",
                                i,(int)months(i,0),i-1,(int)months(i-1,0));
                    if (days(i,0)>days(i-1,0)) 
                    {
                        n_different_days++;
                        pos_of_date[int(years(i,0)-first_year)](int(months(i,0)-1),int(days(i,0)-1)) = i;
                    }
                    else  if (days(i,0)<days(i-1,0)) 
                        PLERROR("YMDDatedVMatrix: %d-th day = %d < %d-th day= %d",
                                i,(int)days(i,0),i-1,(int)days(i-1,0));
                }
            }
        }
        pos_of_ith_year.resize(n_different_years+1);
        pos_of_ith_month.resize(n_different_months+1);
        pos_of_ith_day.resize(n_different_days+1);
        int y=1;
        int m=1;
        int d=1;
        day_of_ith_pos[0]=0;
        for (int i=1;i<years.length();i++)
        {
            if (years(i,0)>years(i-1,0)) 
            {
                pos_of_ith_year[y++]=i;
                pos_of_ith_month[m++]=i;
                pos_of_ith_day[d++]=i;
            }
            else
            {
                if (years(i,0)<years(i-1,0)) 
                    PLERROR("YMDDatedVMatrix: %d-th year = %d < %d-th year= %d",
                            i,(int)years(i,0),i-1,(int)years(i-1,0));
                if (months(i,0)>months(i-1,0)) 
                {
                    pos_of_ith_month[m++]=i;
                    pos_of_ith_day[d++]=i;
                }
                else
                {
                    if (months(i,0)<months(i-1,0)) 
                        PLERROR("YMDDatedVMatrix: %d-th month = %d < %d-th month= %d",
                                i,(int)months(i,0),i-1,(int)months(i-1,0));
                    if (days(i,0)>days(i-1,0)) 
                        pos_of_ith_day[d++]=i;
                    else  if (days(i,0)<days(i-1,0)) 
                        PLERROR("YMDDatedVMatrix: %d-th day = %d < %d-th day= %d",
                                i,(int)days(i,0),i-1,(int)days(i-1,0));
                }
            }
            day_of_ith_pos[i]=d-1;
        }
        pos_of_ith_year[y]=data->length();
        pos_of_ith_month[m]=data->length();
        pos_of_ith_day[d]=data->length();
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

string PLearn::YMDDatedVMatrix::classname ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 46 of file YMDDatedVMatrix.cc.

void PLearn::YMDDatedVMatrix::copyDateOfRow ( int  row,
int year,
int month,
int day 
) [virtual]

Implements PLearn::DatedVMatrix.

Definition at line 342 of file YMDDatedVMatrix.cc.

References days, months, and years.

{
    year = (int)years(row,0);
    month = (int)months(row,0);
    day = (int)days(row,0);
}
void PLearn::YMDDatedVMatrix::copyDatesOfRows ( int  from_row,
int  n_rows,
Mat dates 
) [virtual]

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, i, months, PLearn::TMat< T >::resize(), and years.

{
    dates.resize(n_rows,3);
    for (int i=from_row;i<from_row+n_rows;i++)
    {
        dates(i-from_row,0)=years(i,0);
        dates(i-from_row,1)=months(i,0);
        dates(i-from_row,2)=days(i,0);
    }
}

Here is the call graph for this function:

Vec PLearn::YMDDatedVMatrix::copyRowDataAndDate ( int  row,
int year,
int month,
int day 
) [virtual]

Implements PLearn::DatedVMatrix.

Definition at line 335 of file YMDDatedVMatrix.cc.

References data, days, months, and years.

{
    year = (int)years(row,0);
    month = (int)months(row,0);
    day = (int)days(row,0);
    return data(row);
}
void PLearn::YMDDatedVMatrix::declareOptions ( OptionList ol) [static]
static const PPath& PLearn::YMDDatedVMatrix::declaringFile ( ) [inline, static]

Reimplemented from PLearn::DatedVMatrix.

Definition at line 90 of file YMDDatedVMatrix.h.

{ return 3; }
YMDDatedVMatrix * PLearn::YMDDatedVMatrix::deepCopy ( CopiesMap copies) const [virtual]

Reimplemented from PLearn::DatedVMatrix.

Definition at line 46 of file YMDDatedVMatrix.cc.

OptionList & PLearn::YMDDatedVMatrix::getOptionList ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 46 of file YMDDatedVMatrix.cc.

OptionMap & PLearn::YMDDatedVMatrix::getOptionMap ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 46 of file YMDDatedVMatrix.cc.

RemoteMethodMap & PLearn::YMDDatedVMatrix::getRemoteMethodMap ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 46 of file YMDDatedVMatrix.cc.

int PLearn::YMDDatedVMatrix::lengthInDates ( const string &  units) [virtual]

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.

{
    if (units[0]=='y' || units[0]=='Y')
        return pos_of_ith_year.length()-1;
    if (units[0]=='m' || units[0]=='M')
        return pos_of_ith_month.length()-1;
    if (units[0]=='d' || units[0]=='D')
        return pos_of_ith_day.length()-1;
    else
        PLERROR("YMDDatedVMatrix::lengthInDates(%s), unknown units, expected years,months or days!",
                units.c_str());
    return 0;
}

Here is the call graph for this function:

int PLearn::YMDDatedVMatrix::nDateFields ( ) [inline, virtual]

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 3; }
int PLearn::YMDDatedVMatrix::positionOfDate ( int  year,
int  month,
int  day 
)

return row position associated with first sample whose date is given

Definition at line 227 of file YMDDatedVMatrix.cc.

References PLearn::TMat< T >::length(), PLERROR, pos_of_date, and years.

Referenced by subDistrAbsoluteDays(), subDistrAbsoluteMonths(), and subDistrAbsoluteYears().

{
    if (year<years(0,0))
        PLERROR("YMDDatedVMatrix::positionOfDate(%d,%d,%d): year %d < first year %d",
                year,month,day,year,(int)years(0,0));
    if (year>years(years.length()-1,0))
        return years.length();
    if (month<1 || month>12)
        PLERROR("YMDDatedVMatrix::positionOfDate(%d,%d,%d): month %d should be in [1,12]",
                year,month,day,month);
    if (day<1 || day>31)
        PLERROR("YMDDatedVMatrix::positionOfDate(%d,%d,%d): day %d should be in [1,31]",
                year,month,day,day);
    return int(pos_of_date[year-int(years(0,0))](month-1,day-1));
}

Here is the call graph for this function:

Here is the caller graph for this function:

int PLearn::YMDDatedVMatrix::positionOfRelativeDate ( int  first,
const string &  units 
) [virtual]

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.

{
    if (units[0]=='y' || units[0]=='Y')
        return (int)pos_of_ith_year[first];
    if (units[0]=='m' || units[0]=='M')
        return (int)pos_of_ith_month[first];
    if (units[0]=='d' || units[0]=='D')
        return (int)pos_of_ith_day[first];
    else
        PLERROR("YMDDatedVMatrix::positionOfRelativeDate(%s), unknown units, expected years,months or days!",
                units.c_str());
    return 0;
}
virtual void PLearn::YMDDatedVMatrix::reset_dimensions ( ) [inline, virtual]

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.

{ PLERROR("YMDDatedVMatrix::reset_dimensions() not implemented"); }
VMat PLearn::YMDDatedVMatrix::subDistrAbsoluteDays ( int  year,
int  month,
int  day,
int  n_days 
)

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().

{
    int first_pos = positionOfDate(year,month,day);
    int nthday = (int)day_of_ith_pos[first_pos];
    int last_pos = (int)pos_of_ith_day[nthday+n_days];
    return data.subMatRows(first_pos,last_pos-first_pos);
}

Here is the call graph for this function:

Here is the caller graph for this function:

VMat PLearn::YMDDatedVMatrix::subDistrAbsoluteMonths ( int  year,
int  month,
int  day,
int  n_months 
)

Definition at line 250 of file YMDDatedVMatrix.cc.

References data, positionOfDate(), and PLearn::VMat::subMatRows().

Referenced by subDistrAbsoluteUnits().

{
    int first_pos = positionOfDate(year,month,day);
    int extra_years = (month + n_months) / 12;
    int new_month = (month + n_months) - extra_years*12;
    int last_pos = positionOfDate(year+extra_years,new_month,day);
    return data.subMatRows(first_pos,last_pos-first_pos);
}

Here is the call graph for this function:

Here is the caller graph for this function:

VMat PLearn::YMDDatedVMatrix::subDistrAbsoluteUnits ( int  year,
int  month,
int  day,
int  n_units,
const string &  units 
) [virtual]

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 m, PLERROR, subDistrAbsoluteDays(), subDistrAbsoluteMonths(), subDistrAbsoluteYears(), and PLearn::VMatrix::VMat.

{
    if (units[0]=='y' || units[0]=='Y')
        return subDistrAbsoluteYears(year,month,day,n_units);
    if (units[0]=='m' || units[0]=='M')
        return subDistrAbsoluteMonths(year,month,day,n_units);
    if (units[0]=='d' || units[0]=='D')
        return subDistrAbsoluteDays(year,month,day,n_units);
    else
        PLERROR("YMDDatedVMatrix::subDistrAbsoluteUnits, unknown units, expected years,months or days!",
                units.c_str());
    Mat m;
    return VMat(m);
}

Here is the call graph for this function:

VMat PLearn::YMDDatedVMatrix::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

Definition at line 243 of file YMDDatedVMatrix.cc.

References data, positionOfDate(), and PLearn::VMat::subMatRows().

Referenced by subDistrAbsoluteUnits().

{
    int first_pos = positionOfDate(year,month,day);
    int last_pos = positionOfDate(year+n_years,month,day);
    return data.subMatRows(first_pos,last_pos-first_pos);
}

Here is the call graph for this function:

Here is the caller graph for this function:

VMat PLearn::YMDDatedVMatrix::subDistrRelativeDates ( int  first,
int  n,
const string &  units 
) [virtual]

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 PLERROR, subDistrRelativeDays(), subDistrRelativeMonths(), subDistrRelativeYears(), and PLearn::VMatrix::VMat.

{
    if (units[0]=='y' || units[0]=='Y')
        return subDistrRelativeYears(first,n);
    if (units[0]=='m' || units[0]=='M')
        return subDistrRelativeMonths(first,n);
    if (units[0]=='d' || units[0]=='D')
        return subDistrRelativeDays(first,n);
    else
        PLERROR("YMDDatedVMatrix::subDistrRelativeDates(%d,%d,%s), unknown units, expected years,months or days!",
                first,n,units.c_str());
    return VMat(Mat());
}

Here is the call graph for this function:

VMat PLearn::YMDDatedVMatrix::subDistrRelativeDays ( int  first_relative_day,
int  n_days 
)

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().

{
    if (first_relative_day<0 || n_days<0 ||
        first_relative_day+n_days >=pos_of_ith_day.length())
        PLERROR("YMDDatedVMatrix::subDistrRelativeDays(%d,%d) : incorrect arguments",
                first_relative_day, n_days);
    return data.subMatRows(int(pos_of_ith_day[first_relative_day]),
                           int(pos_of_ith_day[first_relative_day+n_days]-
                               pos_of_ith_day[first_relative_day]));
} 

Here is the call graph for this function:

Here is the caller graph for this function:

VMat PLearn::YMDDatedVMatrix::subDistrRelativeMonths ( int  first_relative_month,
int  n_months 
)

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().

{
    if (first_relative_month<0 || n_months<0 ||
        first_relative_month+n_months >=pos_of_ith_month.length())
        PLERROR("YMDDatedVMatrix::subDistrRelativeMonths(%d,%d) : incorrect arguments",
                first_relative_month, n_months);
    return data.subMatRows(int(pos_of_ith_month[first_relative_month]),
                           int(pos_of_ith_month[first_relative_month+n_months]-
                               pos_of_ith_month[first_relative_month]));
}

Here is the call graph for this function:

Here is the caller graph for this function:

VMat PLearn::YMDDatedVMatrix::subDistrRelativeYears ( int  first_relative_year,
int  n_years 
)

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().

{
    if (first_relative_year<0 || n_years<0 ||
        first_relative_year+n_years >=pos_of_ith_year.length())
        PLERROR("YMDDatedVMatrix::subDistrRelativeYears(%d,%d) : incorrect arguments",
                first_relative_year, n_years);
    return data.subMatRows(int(pos_of_ith_year[first_relative_year]),
                           int(pos_of_ith_year[first_relative_year+n_years]-
                               pos_of_ith_year[first_relative_year]));
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Reimplemented from PLearn::DatedVMatrix.

Definition at line 90 of file YMDDatedVMatrix.h.

inverse map of pos_of_ith_day

Definition at line 71 of file YMDDatedVMatrix.h.

Referenced by build_(), declareOptions(), 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(), copyRowDataAndDate(), and declareOptions().

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(), copyRowDataAndDate(), and declareOptions().

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(), declareOptions(), and positionOfDate().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines