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 j, Index stride=1)
 Constructor with joker extent.
 Range (Joker j, 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.
Index get_start () const
 Returns the start index of the range.
Index get_extent () const
 Returns the extent of the range.
Index get_stride () const
 Returns the stride of the 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 Iterator4D
class Iterator5D
class Iterator6D
class Iterator7D
class ConstIterator2D
class ConstIterator3D
class ConstIterator4D
class ConstIterator5D
class ConstIterator6D
class ConstIterator7D
class ConstTensor3View
class Tensor3View
class Tensor3
class ConstTensor4View
class Tensor4View
class Tensor4
class ConstTensor5View
class Tensor5View
class Tensor5
class ConstTensor6View
class Tensor6View
class Tensor6
class ConstTensor7View
class Tensor7View
class Tensor7
class Sparse
void mult (VectorView, const ConstMatrixView &, const ConstVectorView &)
 Matrix Vector multiplication.


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 145 of file matpackI.h.


Constructor & Destructor Documentation

Range::Range ( Index  start,
Index  extent,
Index  stride = 1 
)

Definition at line 42 of file matpackI.cc.

References mextent, and mstart.

Range::Range ( Index  start,
Joker  j,
Index  stride = 1 
)

Constructor with joker extent.

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

Definition at line 58 of file matpackI.cc.

References mstart.

Range::Range ( Joker  j,
Index  stride = 1 
)

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 68 of file matpackI.cc.

Range::Range ( Index  max_size,
const Range r 
)

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 79 of file matpackI.cc.

References mextent, mstart, and mstride.

Range::Range ( const Range p,
const Range n 
)

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 116 of file matpackI.cc.

References mextent, mstart, and mstride.


Member Function Documentation

Index Range::get_start (  )  const [inline]

Returns the start index of the range.

Definition at line 193 of file matpackI.h.

References mstart.

Index Range::get_extent (  )  const [inline]

Returns the extent of the range.

Definition at line 195 of file matpackI.h.

References mextent.

Index Range::get_stride (  )  const [inline]

Returns the stride of the range.

Definition at line 197 of file matpackI.h.

References mstride.


Friends And Related Function Documentation

friend class ConstVectorView [friend]

Definition at line 155 of file matpackI.h.

friend class VectorView [friend]

Definition at line 156 of file matpackI.h.

friend class Vector [friend]

Definition at line 157 of file matpackI.h.

friend class ConstMatrixView [friend]

Definition at line 158 of file matpackI.h.

friend class MatrixView [friend]

Definition at line 159 of file matpackI.h.

friend class Matrix [friend]

Definition at line 160 of file matpackI.h.

friend class Iterator2D [friend]

Definition at line 161 of file matpackI.h.

friend class Iterator3D [friend]

Definition at line 162 of file matpackI.h.

friend class Iterator4D [friend]

Definition at line 163 of file matpackI.h.

friend class Iterator5D [friend]

Definition at line 164 of file matpackI.h.

friend class Iterator6D [friend]

Definition at line 165 of file matpackI.h.

friend class Iterator7D [friend]

Definition at line 166 of file matpackI.h.

friend class ConstIterator2D [friend]

Definition at line 167 of file matpackI.h.

friend class ConstIterator3D [friend]

Definition at line 168 of file matpackI.h.

friend class ConstIterator4D [friend]

Definition at line 169 of file matpackI.h.

friend class ConstIterator5D [friend]

Definition at line 170 of file matpackI.h.

friend class ConstIterator6D [friend]

Definition at line 171 of file matpackI.h.

friend class ConstIterator7D [friend]

Definition at line 172 of file matpackI.h.

friend class ConstTensor3View [friend]

Definition at line 173 of file matpackI.h.

friend class Tensor3View [friend]

Definition at line 174 of file matpackI.h.

friend class Tensor3 [friend]

Definition at line 175 of file matpackI.h.

friend class ConstTensor4View [friend]

Definition at line 176 of file matpackI.h.

friend class Tensor4View [friend]

Definition at line 177 of file matpackI.h.

friend class Tensor4 [friend]

Definition at line 178 of file matpackI.h.

friend class ConstTensor5View [friend]

Definition at line 179 of file matpackI.h.

friend class Tensor5View [friend]

Definition at line 180 of file matpackI.h.

friend class Tensor5 [friend]

Definition at line 181 of file matpackI.h.

friend class ConstTensor6View [friend]

Definition at line 182 of file matpackI.h.

friend class Tensor6View [friend]

Definition at line 183 of file matpackI.h.

friend class Tensor6 [friend]

Definition at line 184 of file matpackI.h.

friend class ConstTensor7View [friend]

Definition at line 185 of file matpackI.h.

friend class Tensor7View [friend]

Definition at line 186 of file matpackI.h.

friend class Tensor7 [friend]

Definition at line 187 of file matpackI.h.

friend class Sparse [friend]

Definition at line 188 of file matpackI.h.

void mult ( VectorView  ,
const ConstMatrixView ,
const ConstVectorView  
) [friend]

Matrix Vector multiplication.

y = M*x. Note that the order is different from MTL, output comes first! Dimensions of y, M, and x must match. No memory reallocation takes place, only the data is copied. Using this function on overlapping MatrixViews belonging to the same Matrix will lead to unpredictable results. In particular, this means that A and B must not be the same matrix! The implementation here is different from the other multiplication routines. It does not use iterators but a more drastic approach to gain maximum performance.

Definition at line 1598 of file matpackI.cc.


Member Data Documentation

Index Range::mstart [private]

The start index.

Definition at line 201 of file matpackI.h.

Referenced by Tensor7View::begin(), ConstTensor7View::begin(), Tensor6View::begin(), ConstTensor6View::begin(), Tensor5View::begin(), ConstTensor5View::begin(), Tensor4View::begin(), ConstTensor4View::begin(), Tensor3View::begin(), ConstTensor3View::begin(), MatrixView::begin(), ConstMatrixView::begin(), VectorView::begin(), ConstVectorView::begin(), Tensor7View::end(), ConstTensor7View::end(), Tensor6View::end(), ConstTensor6View::end(), Tensor5View::end(), ConstTensor5View::end(), Tensor4View::end(), ConstTensor4View::end(), Tensor3View::end(), ConstTensor3View::end(), MatrixView::end(), ConstMatrixView::end(), VectorView::end(), ConstVectorView::end(), Tensor4View::get_c_array(), Tensor3View::get_c_array(), MatrixView::get_c_array(), VectorView::get_c_array(), get_start(), mult(), ConstVectorView::operator ConstMatrixView(), VectorView::operator MatrixView(), ConstIterator7D::operator!=(), Iterator7D::operator!=(), ConstIterator6D::operator!=(), Iterator6D::operator!=(), ConstIterator5D::operator!=(), Iterator5D::operator!=(), ConstIterator4D::operator!=(), Iterator4D::operator!=(), ConstIterator3D::operator!=(), Iterator3D::operator!=(), ConstIterator2D::operator!=(), Iterator2D::operator!=(), Tensor5View::operator()(), ConstTensor5View::operator()(), Tensor4View::operator()(), ConstTensor4View::operator()(), Tensor3View::operator()(), ConstTensor3View::operator()(), MatrixView::operator()(), ConstMatrixView::operator()(), VectorView::operator[](), ConstVectorView::operator[](), Range(), Tensor7::resize(), Tensor6::resize(), Tensor5::resize(), Tensor4::resize(), Tensor3::resize(), Matrix::resize(), and Vector::resize().

Index Range::mextent [private]

The number of elements.

-1 means extent to the end of the vector.

Definition at line 204 of file matpackI.h.

Referenced by Tensor7View::end(), ConstTensor7View::end(), Tensor6View::end(), ConstTensor6View::end(), Tensor5View::end(), ConstTensor5View::end(), Tensor4View::end(), ConstTensor4View::end(), Tensor3View::end(), ConstTensor3View::end(), MatrixView::end(), ConstMatrixView::end(), VectorView::end(), ConstVectorView::end(), Tensor4View::get_c_array(), Tensor3View::get_c_array(), MatrixView::get_c_array(), get_extent(), mult(), ConstTensor7View::nbooks(), ConstTensor6View::nbooks(), ConstTensor5View::nbooks(), ConstTensor4View::nbooks(), ConstTensor7View::ncols(), ConstTensor6View::ncols(), ConstTensor5View::ncols(), ConstTensor4View::ncols(), ConstTensor3View::ncols(), ConstMatrixView::ncols(), ConstVectorView::nelem(), ConstTensor7View::nlibraries(), ConstTensor7View::npages(), ConstTensor6View::npages(), ConstTensor5View::npages(), ConstTensor4View::npages(), ConstTensor3View::npages(), ConstTensor7View::nrows(), ConstTensor6View::nrows(), ConstTensor5View::nrows(), ConstTensor4View::nrows(), ConstTensor3View::nrows(), ConstMatrixView::nrows(), ConstTensor7View::nshelves(), ConstTensor6View::nshelves(), ConstTensor5View::nshelves(), ConstTensor7View::nvitrines(), ConstTensor6View::nvitrines(), Tensor5View::operator()(), ConstTensor5View::operator()(), Tensor4View::operator()(), ConstTensor4View::operator()(), Tensor3View::operator()(), ConstTensor3View::operator()(), MatrixView::operator()(), ConstMatrixView::operator()(), Tensor7::operator=(), Tensor7View::operator=(), Tensor6::operator=(), Tensor6View::operator=(), Tensor5::operator=(), Tensor5View::operator=(), Tensor4::operator=(), Tensor4View::operator=(), Tensor3::operator=(), Tensor3View::operator=(), Matrix::operator=(), MatrixView::operator=(), VectorView::operator=(), VectorView::operator[](), ConstVectorView::operator[](), Range(), Tensor7::resize(), Tensor6::resize(), Tensor5::resize(), Tensor4::resize(), Tensor3::resize(), Matrix::resize(), and Vector::resize().

Index Range::mstride [private]


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

Generated on Mon Mar 23 14:07:02 2009 for ARTS by  doxygen 1.5.6