ARTS
2.4.0(git:4fb77825)
|
The range class. More...
#include <matpackI.h>
Public Member Functions | |
constexpr | Range (Index start, Index extent, Index stride=1) |
Explicit constructor. More... | |
constexpr | Range (Index start, Joker, Index stride=1) |
Constructor with joker extent. More... | |
constexpr | Range (Joker, Index stride=1) |
Constructor with just a joker. More... | |
constexpr | Range (Index max_size, const Range &r) |
Constructor which converts a range with joker to an explicit range. More... | |
constexpr | Range (const Range &p, const Range &n) |
Constructor of a new range relative to an old range. More... | |
constexpr Index | get_start () const |
Returns the start index of the range. More... | |
constexpr Index | get_extent () const |
Returns the extent of the range. More... | |
constexpr Index | get_stride () const |
Returns the stride of the range. More... | |
constexpr Range | operator() (const Range r) const |
Range of range. More... | |
constexpr Index | operator() (const Index i) const |
Private Attributes | |
Index | mstart |
The start index. More... | |
Index | mextent |
The number of elements. More... | |
Index | mstride |
The stride. More... | |
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 160 of file matpackI.h.
Explicit constructor.
[in] | start | Start must be >= 0. |
[in] | extent | Extent also. Although internally negative extent means "to the end", this can not be created this way, only with the joker. Zero extent is allowed, though, which corresponds to an empty range. |
[in] | stride | Stride can be anything. It can be omitted, in which case the default value is 1. |
Definition at line 175 of file matpackI.h.
References mextent, and mstart.
Referenced by operator()().
Constructor with joker extent.
Depending on the sign of stride, this means "to the end", or "to the beginning".
Definition at line 190 of file matpackI.h.
References mstart.
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 199 of file matpackI.h.
Constructor which converts a range with joker to an explicit range.
[in] | max_size | The maximum allowed size of the vector. |
[in] | r | The new range, with joker. |
Definition at line 208 of file matpackI.h.
Constructor of a new range relative to an old range.
The new range may contain -1 for the stride, which acts as a joker.
[in] | p | Previous range. |
[in] | n | New range. |
Definition at line 239 of file matpackI.h.
|
inlineconstexpr |
Returns the extent of the range.
Definition at line 329 of file matpackI.h.
References mextent.
Referenced by covmat_seAddBlock(), diagonalize(), ConstComplexMatrixView::get_column_extent(), get_covariance_matrix_block(), CovarianceMatrix::is_consistent(), Block::ncols(), Block::nrows(), and operator<<().
|
inlineconstexpr |
Returns the start index of the range.
Definition at line 327 of file matpackI.h.
References mstart.
Referenced by get_covariance_matrix_block(), CovarianceMatrix::is_consistent(), jacobianCalcPointingZaInterp(), jacobianCalcPointingZaRecalc(), jacobianCalcPolyfit(), MapToEigen(), MapToEigen4x4(), MapToEigenCol(), mult(), operator<<(), yCalc(), and yCalc_mblock_loop_body().
|
inlineconstexpr |
Returns the stride of the range.
Definition at line 331 of file matpackI.h.
References mstride.
Referenced by lubacksub(), MapToEigen(), MapToEigen4x4(), MapToEigenCol(), mult(), and operator<<().
Definition at line 346 of file matpackI.h.
|
friend |
Definition at line 317 of file matpackI.h.
|
friend |
Definition at line 316 of file matpackI.h.
|
friend |
Definition at line 315 of file matpackI.h.
|
friend |
Definition at line 313 of file matpackI.h.
|
friend |
Definition at line 312 of file matpackI.h.
|
friend |
Definition at line 318 of file matpackI.h.
|
friend |
Definition at line 314 of file matpackI.h.
|
friend |
Definition at line 311 of file matpackI.h.
|
friend |
Definition at line 289 of file matpackI.h.
|
friend |
Definition at line 290 of file matpackI.h.
|
friend |
Definition at line 291 of file matpackI.h.
|
friend |
Definition at line 292 of file matpackI.h.
|
friend |
Definition at line 293 of file matpackI.h.
|
friend |
Definition at line 294 of file matpackI.h.
|
friend |
Definition at line 280 of file matpackI.h.
|
friend |
Definition at line 295 of file matpackI.h.
|
friend |
Definition at line 298 of file matpackI.h.
|
friend |
Definition at line 301 of file matpackI.h.
|
friend |
Definition at line 304 of file matpackI.h.
|
friend |
Definition at line 307 of file matpackI.h.
|
friend |
Definition at line 277 of file matpackI.h.
|
friend |
Definition at line 283 of file matpackI.h.
|
friend |
Definition at line 284 of file matpackI.h.
|
friend |
Definition at line 285 of file matpackI.h.
|
friend |
Definition at line 286 of file matpackI.h.
|
friend |
Definition at line 287 of file matpackI.h.
|
friend |
Definition at line 288 of file matpackI.h.
|
friend |
invlib wrapper type for ARTS matrices.
Definition at line 282 of file matpackI.h.
|
friend |
Definition at line 281 of file matpackI.h.
|
friend |
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 Matrix and VectorViews belonging to the same Matrix will lead to unpredictable results.
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 1181 of file matpackI.cc.
|
friend |
Definition at line 310 of file matpackI.h.
|
friend |
Definition at line 297 of file matpackI.h.
|
friend |
Definition at line 296 of file matpackI.h.
|
friend |
Definition at line 300 of file matpackI.h.
|
friend |
Definition at line 299 of file matpackI.h.
|
friend |
Definition at line 303 of file matpackI.h.
|
friend |
Definition at line 302 of file matpackI.h.
|
friend |
Definition at line 306 of file matpackI.h.
|
friend |
Definition at line 305 of file matpackI.h.
|
friend |
Definition at line 309 of file matpackI.h.
|
friend |
Definition at line 308 of file matpackI.h.
|
friend |
invlib wrapper type for ARTS vectors.
Definition at line 279 of file matpackI.h.
|
friend |
Definition at line 278 of file matpackI.h.
|
private |
The number of elements.
-1 means extent to the end of the vector.
Definition at line 353 of file matpackI.h.
Referenced by ComplexMatrixView::diagonal(), ConstComplexMatrixView::diagonal(), ConstMatrixView::diagonal(), ComplexVectorView::end(), ComplexMatrixView::end(), VectorView::end(), MatrixView::end(), Tensor3View::end(), Tensor4View::end(), Tensor5View::end(), Tensor6View::end(), Tensor7View::end(), ConstComplexVectorView::end(), ConstComplexMatrixView::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(), ComplexMatrixView::get_c_array(), MatrixView::get_c_array(), get_extent(), ComplexVectorView::imag(), ComplexMatrixView::imag(), ConstTensor4View::nbooks(), ConstTensor5View::nbooks(), ConstTensor6View::nbooks(), ConstTensor7View::nbooks(), ConstComplexMatrixView::ncols(), ConstMatrixView::ncols(), ConstTensor3View::ncols(), ConstTensor4View::ncols(), ConstTensor5View::ncols(), ConstTensor6View::ncols(), ConstTensor7View::ncols(), ConstComplexVectorView::nelem(), ConstVectorView::nelem(), ConstTensor7View::nlibraries(), ConstTensor3View::npages(), ConstTensor4View::npages(), ConstTensor5View::npages(), ConstTensor6View::npages(), ConstTensor7View::npages(), ConstComplexMatrixView::nrows(), ConstMatrixView::nrows(), ConstTensor3View::nrows(), ConstTensor4View::nrows(), ConstTensor5View::nrows(), ConstTensor6View::nrows(), ConstTensor7View::nrows(), ConstTensor5View::nshelves(), ConstTensor6View::nshelves(), ConstTensor7View::nshelves(), ConstTensor6View::nvitrines(), ConstTensor7View::nvitrines(), operator()(), ComplexMatrixView::operator=(), ComplexVectorView::operator=(), MatrixView::operator=(), Tensor3View::operator=(), Tensor4View::operator=(), Tensor5View::operator=(), Tensor6View::operator=(), Tensor7View::operator=(), VectorView::operator=(), ComplexVectorView::operator[](), VectorView::operator[](), ConstComplexVectorView::operator[](), ConstVectorView::operator[](), Range(), ComplexVectorView::real(), ComplexMatrixView::real(), ComplexVector::resize(), and Vector::resize().
|
private |
The start index.
Definition at line 350 of file matpackI.h.
Referenced by ComplexVectorView::begin(), ComplexMatrixView::begin(), VectorView::begin(), MatrixView::begin(), Tensor3View::begin(), Tensor4View::begin(), Tensor5View::begin(), Tensor6View::begin(), Tensor7View::begin(), ConstComplexVectorView::begin(), ConstComplexMatrixView::begin(), ConstVectorView::begin(), ConstMatrixView::begin(), ConstTensor3View::begin(), ConstTensor4View::begin(), ConstTensor5View::begin(), ConstTensor6View::begin(), ConstTensor7View::begin(), ComplexMatrixView::diagonal(), ConstComplexMatrixView::diagonal(), ConstMatrixView::diagonal(), ComplexVectorView::end(), ComplexMatrixView::end(), VectorView::end(), MatrixView::end(), Tensor3View::end(), Tensor4View::end(), Tensor5View::end(), Tensor6View::end(), Tensor7View::end(), ConstComplexVectorView::end(), ConstComplexMatrixView::end(), ConstVectorView::end(), ConstMatrixView::end(), ConstTensor3View::end(), ConstTensor4View::end(), ConstTensor5View::end(), ConstTensor6View::end(), ConstTensor7View::end(), ComplexVectorView::get(), VectorView::get(), Tensor3View::get_c_array(), Tensor4View::get_c_array(), Tensor5View::get_c_array(), Tensor6View::get_c_array(), Tensor7View::get_c_array(), ComplexVectorView::get_c_array(), ComplexMatrixView::get_c_array(), VectorView::get_c_array(), MatrixView::get_c_array(), get_start(), ComplexVectorView::imag(), ComplexMatrixView::imag(), ComplexIterator2D::operator!=(), ConstComplexIterator2D::operator!=(), ConstIterator2D::operator!=(), ConstIterator3D::operator!=(), ConstIterator4D::operator!=(), ConstIterator5D::operator!=(), ConstIterator6D::operator!=(), ConstIterator7D::operator!=(), Iterator2D::operator!=(), Iterator3D::operator!=(), Iterator4D::operator!=(), Iterator5D::operator!=(), Iterator6D::operator!=(), Iterator7D::operator!=(), operator()(), Range(), ComplexVectorView::real(), ComplexMatrixView::real(), and ComplexVector::resize().
|
private |
The stride.
Can be positive or negative.
Definition at line 355 of file matpackI.h.
Referenced by ComplexVectorView::begin(), ComplexMatrixView::begin(), VectorView::begin(), MatrixView::begin(), Tensor3View::begin(), Tensor4View::begin(), Tensor5View::begin(), Tensor6View::begin(), Tensor7View::begin(), ConstComplexVectorView::begin(), ConstComplexMatrixView::begin(), ConstVectorView::begin(), ConstMatrixView::begin(), ConstTensor3View::begin(), ConstTensor4View::begin(), ConstTensor5View::begin(), ConstTensor6View::begin(), ConstTensor7View::begin(), ComplexMatrixView::diagonal(), ConstComplexMatrixView::diagonal(), ConstMatrixView::diagonal(), ComplexVectorView::end(), ComplexMatrixView::end(), VectorView::end(), MatrixView::end(), Tensor3View::end(), Tensor4View::end(), Tensor5View::end(), Tensor6View::end(), Tensor7View::end(), ConstComplexVectorView::end(), ConstComplexMatrixView::end(), ConstVectorView::end(), ConstMatrixView::end(), ConstTensor3View::end(), ConstTensor4View::end(), ConstTensor5View::end(), ConstTensor6View::end(), ConstTensor7View::end(), ComplexVectorView::get(), VectorView::get(), Tensor3View::get_c_array(), Tensor4View::get_c_array(), Tensor5View::get_c_array(), Tensor6View::get_c_array(), Tensor7View::get_c_array(), ComplexVectorView::get_c_array(), ComplexMatrixView::get_c_array(), VectorView::get_c_array(), MatrixView::get_c_array(), get_stride(), ComplexVectorView::imag(), ComplexMatrixView::imag(), operator()(), Range(), ComplexVectorView::real(), ComplexMatrixView::real(), and ComplexVector::resize().