Range Class Reference

The range class. More...

#include <matpackI.h>

List of all members.

Public Member Functions

 Range (Index start, Index extent, Index stride=1)
 Range (Index start, Joker joker, Index stride=1)
 Constructor with joker extent.
 Range (Joker joker, Index stride=1)
 Constructor with just a joker.
 Range (Index max_size, const Range &r)
 Constructor which converts a range with joker to an explicit range.
 Range (const Range &p, const Range &n)
 Constructor of a new range relative to an old range.

Private Attributes

Index mstart
 The start index.
Index mextent
 The number of elements.
Index mstride
 The stride.

Friends

class ConstVectorView
class VectorView
class Vector
class ConstMatrixView
class MatrixView
class Matrix
class Iterator2D
class Iterator3D
class ConstIterator2D
class ConstIterator3D
class SparseMatrixView
class ConstTensor3View
class Tensor3View
class Tensor3
std::ostream & operator<< (std::ostream &os, const SparseMatrixView &v)


Detailed Description

The range class.

This is used to specifiy a range of a vector. In general, a range is given by a start index, an extent, and a stride. The entire vector would be: start = 0, range = # elements, stride = 1

Stride specifies the stepsize of the vector. A stride of 2 means only every second element. This is particularly important in connection with matrices.

There are a number of special constructors for this class, of particular interest should be those using jokers, which provide a Matlab-like functionality.

Definition at line 139 of file matpackI.h.


Constructor & Destructor Documentation

Range::Range ( Index  start,
Index  extent,
Index  stride = 1 
) [inline]

Definition at line 611 of file matpackI.h.

Range::Range ( Index  start,
Joker  joker,
Index  stride = 1 
) [inline]

Constructor with joker extent.

Depending on the sign of stride, this means "to the end", or "to the beginning".

Definition at line 627 of file matpackI.h.

Range::Range ( Joker  joker,
Index  stride = 1 
) [inline]

Constructor with just a joker.

This means, take everything. You can still optionally give a stride, though. This constructor is just shorter notation for Range(0,joker)

Definition at line 637 of file matpackI.h.

Range::Range ( Index  max_size,
const Range r 
) [inline]

Constructor which converts a range with joker to an explicit range.

Parameters:
max_size The maximum allowed size of the vector.
r The new range, with joker.

Definition at line 648 of file matpackI.h.

Range::Range ( const Range p,
const Range n 
) [inline]

Constructor of a new range relative to an old range.

The new range may contain -1 for the stride, which acts as a joker.

Parameters:
p Previous range.
n New range.

Definition at line 685 of file matpackI.h.


Friends And Related Function Documentation

friend class ConstVectorView [friend]

Definition at line 149 of file matpackI.h.

friend class VectorView [friend]

Definition at line 150 of file matpackI.h.

friend class Vector [friend]

Definition at line 151 of file matpackI.h.

friend class ConstMatrixView [friend]

Definition at line 152 of file matpackI.h.

friend class MatrixView [friend]

Definition at line 153 of file matpackI.h.

friend class Matrix [friend]

Definition at line 154 of file matpackI.h.

friend class Iterator2D [friend]

Definition at line 155 of file matpackI.h.

friend class Iterator3D [friend]

Definition at line 156 of file matpackI.h.

friend class ConstIterator2D [friend]

Definition at line 157 of file matpackI.h.

friend class ConstIterator3D [friend]

Definition at line 158 of file matpackI.h.

friend class SparseMatrixView [friend]

Definition at line 159 of file matpackI.h.

friend class ConstTensor3View [friend]

Definition at line 160 of file matpackI.h.

friend class Tensor3View [friend]

Definition at line 161 of file matpackI.h.

friend class Tensor3 [friend]

Definition at line 162 of file matpackI.h.

std::ostream& operator<< ( std::ostream &  os,
const SparseMatrixView &  v 
) [friend]


Member Data Documentation

Index Range::mstart [private]

The start index.

Definition at line 168 of file matpackI.h.

Index Range::mextent [private]

The number of elements.

-1 means extent to the end of the vector.

Definition at line 171 of file matpackI.h.

Index Range::mstride [private]

The stride.

Can be positive or negative.

Definition at line 173 of file matpackI.h.


The documentation for this class was generated from the following file:

Generated on Wed Feb 4 08:17:34 2009 for ARTS by  doxygen 1.5.6