ARTS  2.2.66
Range Class Reference

The range class. More...

#include <matpackI.h>

Public Member Functions

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

Private Attributes

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

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. More...
 

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

Constructor & Destructor Documentation

◆ Range() [1/5]

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

Definition at line 52 of file matpackI.cc.

References mextent, and mstart.

◆ Range() [2/5]

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

References mstart.

◆ Range() [3/5]

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

◆ Range() [4/5]

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

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

Parameters
max_sizeThe maximum allowed size of the vector.
rThe new range, with joker.

Definition at line 89 of file matpackI.cc.

References mextent, mstart, and mstride.

◆ Range() [5/5]

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
pPrevious range.
nNew range.

Definition at line 126 of file matpackI.cc.

References mextent, mstart, and mstride.

Member Function Documentation

◆ get_extent()

Index Range::get_extent ( ) const
inline

Returns the extent of the range.

Definition at line 198 of file matpackI.h.

References mextent.

◆ get_start()

Index Range::get_start ( ) const
inline

◆ get_stride()

Index Range::get_stride ( ) const
inline

Returns the stride of the range.

Definition at line 200 of file matpackI.h.

References mstride.

Friends And Related Function Documentation

◆ ConstIterator2D

friend class ConstIterator2D
friend

Definition at line 170 of file matpackI.h.

◆ ConstIterator3D

friend class ConstIterator3D
friend

Definition at line 171 of file matpackI.h.

◆ ConstIterator4D

friend class ConstIterator4D
friend

Definition at line 172 of file matpackI.h.

◆ ConstIterator5D

friend class ConstIterator5D
friend

Definition at line 173 of file matpackI.h.

◆ ConstIterator6D

friend class ConstIterator6D
friend

Definition at line 174 of file matpackI.h.

◆ ConstIterator7D

friend class ConstIterator7D
friend

Definition at line 175 of file matpackI.h.

◆ ConstMatrixView

friend class ConstMatrixView
friend

Definition at line 161 of file matpackI.h.

◆ ConstTensor3View

friend class ConstTensor3View
friend

Definition at line 176 of file matpackI.h.

◆ ConstTensor4View

friend class ConstTensor4View
friend

Definition at line 179 of file matpackI.h.

◆ ConstTensor5View

friend class ConstTensor5View
friend

Definition at line 182 of file matpackI.h.

◆ ConstTensor6View

friend class ConstTensor6View
friend

Definition at line 185 of file matpackI.h.

◆ ConstTensor7View

friend class ConstTensor7View
friend

Definition at line 188 of file matpackI.h.

◆ ConstVectorView

friend class ConstVectorView
friend

Definition at line 158 of file matpackI.h.

◆ Iterator2D

friend class Iterator2D
friend

Definition at line 164 of file matpackI.h.

◆ Iterator3D

friend class Iterator3D
friend

Definition at line 165 of file matpackI.h.

◆ Iterator4D

friend class Iterator4D
friend

Definition at line 166 of file matpackI.h.

◆ Iterator5D

friend class Iterator5D
friend

Definition at line 167 of file matpackI.h.

◆ Iterator6D

friend class Iterator6D
friend

Definition at line 168 of file matpackI.h.

◆ Iterator7D

friend class Iterator7D
friend

Definition at line 169 of file matpackI.h.

◆ Matrix

friend class Matrix
friend

Definition at line 163 of file matpackI.h.

◆ MatrixView

friend class MatrixView
friend

Definition at line 162 of file matpackI.h.

◆ mult

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

◆ Sparse

friend class Sparse
friend

Definition at line 191 of file matpackI.h.

◆ Tensor3

friend class Tensor3
friend

Definition at line 178 of file matpackI.h.

◆ Tensor3View

friend class Tensor3View
friend

Definition at line 177 of file matpackI.h.

◆ Tensor4

friend class Tensor4
friend

Definition at line 181 of file matpackI.h.

◆ Tensor4View

friend class Tensor4View
friend

Definition at line 180 of file matpackI.h.

◆ Tensor5

friend class Tensor5
friend

Definition at line 184 of file matpackI.h.

◆ Tensor5View

friend class Tensor5View
friend

Definition at line 183 of file matpackI.h.

◆ Tensor6

friend class Tensor6
friend

Definition at line 187 of file matpackI.h.

◆ Tensor6View

friend class Tensor6View
friend

Definition at line 186 of file matpackI.h.

◆ Tensor7

friend class Tensor7
friend

Definition at line 190 of file matpackI.h.

◆ Tensor7View

friend class Tensor7View
friend

Definition at line 189 of file matpackI.h.

◆ Vector

friend class Vector
friend

Definition at line 160 of file matpackI.h.

◆ VectorView

friend class VectorView
friend

Definition at line 159 of file matpackI.h.

Member Data Documentation

◆ mextent

Index Range::mextent
private

The number of elements.

-1 means extent to the end of the vector.

Definition at line 207 of file matpackI.h.

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

◆ mstart

Index Range::mstart
private

The start index.

Definition at line 204 of file matpackI.h.

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

◆ mstride

Index Range::mstride
private

The stride.

Can be positive or negative.

Definition at line 209 of file matpackI.h.

Referenced by VectorView::begin(), MatrixView::begin(), Tensor3View::begin(), Tensor4View::begin(), Tensor5View::begin(), Tensor6View::begin(), Tensor7View::begin(), ConstVectorView::begin(), ConstMatrixView::begin(), ConstTensor3View::begin(), ConstTensor4View::begin(), ConstTensor5View::begin(), ConstTensor6View::begin(), ConstTensor7View::begin(), VectorView::end(), MatrixView::end(), Tensor3View::end(), Tensor4View::end(), Tensor5View::end(), Tensor6View::end(), Tensor7View::end(), ConstVectorView::end(), ConstMatrixView::end(), ConstTensor3View::end(), ConstTensor4View::end(), ConstTensor5View::end(), ConstTensor6View::end(), ConstTensor7View::end(), Tensor4View::get(), ConstTensor4View::get(), VectorView::get(), ConstVectorView::get(), Tensor3View::get(), ConstTensor3View::get(), MatrixView::get(), ConstMatrixView::get(), Tensor5View::get(), ConstTensor5View::get(), Tensor3View::get_c_array(), Tensor4View::get_c_array(), Tensor5View::get_c_array(), Tensor6View::get_c_array(), Tensor7View::get_c_array(), VectorView::get_c_array(), MatrixView::get_c_array(), get_stride(), mult(), Tensor4View::operator()(), ConstTensor4View::operator()(), Tensor3View::operator()(), ConstTensor3View::operator()(), MatrixView::operator()(), ConstMatrixView::operator()(), Tensor5View::operator()(), ConstTensor5View::operator()(), Range(), Tensor4::resize(), Tensor7::resize(), Vector::resize(), Tensor3::resize(), Matrix::resize(), Tensor5::resize(), and Tensor6::resize().


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