PLearn 0.1
Public Member Functions | Public Attributes
PLearn::Range Class Reference

#include <Range.h>

Collaboration diagram for PLearn::Range:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Range (int the_start=0, int the_length=0)
bool isEmpty ()
bool operator== (Range r) const
bool operator< (Range r) const
 operator void * ()
 to allow if(range) statements (safer than operator bool, according to Nicolas.)

Public Attributes

int start
 index of first element
int length
 number of elements

Detailed Description

Definition at line 56 of file Range.h.


Constructor & Destructor Documentation

PLearn::Range::Range ( int  the_start = 0,
int  the_length = 0 
) [inline]

Definition at line 62 of file Range.h.

        :start(the_start), length(the_length) {}

Member Function Documentation

bool PLearn::Range::isEmpty ( ) [inline]

Definition at line 65 of file Range.h.

{ return length<=0; }
PLearn::Range::operator void * ( ) [inline]

to allow if(range) statements (safer than operator bool, according to Nicolas.)

Definition at line 74 of file Range.h.

{ return (length>0 ? this : 0); }
bool PLearn::Range::operator< ( Range  r) const [inline]

Definition at line 70 of file Range.h.

References length, and start.

    { return start<r.start || (start==r.start && length<r.length); }
bool PLearn::Range::operator== ( Range  r) const [inline]

Definition at line 67 of file Range.h.

References length, and start.

    { return start==r.start && length==r.length; }

Member Data Documentation

number of elements

Definition at line 60 of file Range.h.

Referenced by operator<(), PLearn::operator<<(), operator==(), and PLearn::TVec< PP< RegressionTreeNode > >::subVec().

index of first element

Definition at line 59 of file Range.h.

Referenced by operator<(), PLearn::operator<<(), operator==(), and PLearn::TVec< PP< RegressionTreeNode > >::subVec().


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