ARTS 2.5.10 (git: 2f1c442c)
|
The range class. More...
#include <matpackI.h>
Public Member Functions | |
constexpr | Range (Index start, Index extent, Index stride=1) ARTS_NOEXCEPT |
Explicit constructor. | |
constexpr | Range (Index start, Joker, Index stride=1) ARTS_NOEXCEPT |
Constructor with joker extent. | |
constexpr | Range (Joker, Index stride=1) noexcept |
Constructor with just a joker. | |
constexpr | Range (Index max_size, const Range &r) ARTS_NOEXCEPT |
Constructor which converts a range with joker to an explicit range. | |
constexpr | Range (const Range &p, const Range &n) ARTS_NOEXCEPT |
Constructor of a new range relative to an old range. | |
constexpr Index | get_start () const noexcept |
Returns the start index of the range. | |
constexpr Index | get_extent () const noexcept |
Returns the extent of the range. | |
constexpr Index | get_stride () const noexcept |
Returns the stride of the range. | |
constexpr Range | operator() (const Range r) const ARTS_NOEXCEPT |
Range of range. | |
constexpr Index | operator() (const Index i) const ARTS_NOEXCEPT |
constexpr void | swap (Range &other) noexcept |
Private Attributes | |
Index | mstart |
The start index. | |
Index | mextent |
The number of elements. | |
Index | mstride |
The stride. | |
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 174 of file matpackI.h.
References ARTS_ASSERT, mextent, and mstart.
Constructor with joker extent.
Depending on the sign of stride, this means "to the end", or "to the beginning".
Definition at line 191 of file matpackI.h.
References ARTS_ASSERT, and 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 202 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 214 of file matpackI.h.
References ARTS_ASSERT, mextent, mstart, and mstride.
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 247 of file matpackI.h.
References ARTS_ASSERT, mextent, mstart, and mstride.
|
inlineconstexprnoexcept |
Returns the extent of the range.
Definition at line 343 of file matpackI.h.
References mextent.
Referenced by covmat_seAddBlock(), CovarianceMatrix::is_consistent(), Block::ncols(), Block::nrows(), Tensor3::reduce_rank(), Tensor4::reduce_rank(), Tensor5::reduce_rank(), Tensor6::reduce_rank(), and Tensor7::reduce_rank().
|
inlineconstexprnoexcept |
Returns the start index of the range.
Definition at line 341 of file matpackI.h.
References mstart.
Referenced by calcBaselineFit(), CovarianceMatrix::is_consistent(), jacobianCalcPointingZaInterp(), jacobianCalcPointingZaRecalc(), jacobianCalcPolyfit(), jacobianCalcSinefit(), yCalc(), and yCalc_mblock_loop_body().
|
inlineconstexprnoexcept |
Definition at line 360 of file matpackI.h.
|
inlineconstexprnoexcept |
|
friend |
Definition at line 331 of file matpackI.h.
|
friend |
Definition at line 330 of file matpackI.h.
|
friend |
Definition at line 329 of file matpackI.h.
|
friend |
Definition at line 327 of file matpackI.h.
|
friend |
Definition at line 326 of file matpackI.h.
|
friend |
Definition at line 332 of file matpackI.h.
|
friend |
Definition at line 328 of file matpackI.h.
|
friend |
Definition at line 325 of file matpackI.h.
|
friend |
Definition at line 303 of file matpackI.h.
|
friend |
Definition at line 304 of file matpackI.h.
|
friend |
Definition at line 305 of file matpackI.h.
|
friend |
Definition at line 306 of file matpackI.h.
|
friend |
Definition at line 307 of file matpackI.h.
|
friend |
Definition at line 308 of file matpackI.h.
|
friend |
Definition at line 294 of file matpackI.h.
|
friend |
Definition at line 309 of file matpackI.h.
|
friend |
Definition at line 312 of file matpackI.h.
|
friend |
Definition at line 315 of file matpackI.h.
|
friend |
Definition at line 318 of file matpackI.h.
|
friend |
Definition at line 321 of file matpackI.h.
|
friend |
Definition at line 291 of file matpackI.h.
|
friend |
Definition at line 297 of file matpackI.h.
|
friend |
Definition at line 298 of file matpackI.h.
|
friend |
Definition at line 299 of file matpackI.h.
|
friend |
Definition at line 300 of file matpackI.h.
|
friend |
Definition at line 301 of file matpackI.h.
|
friend |
Definition at line 302 of file matpackI.h.
|
friend |
invlib wrapper type for ARTS matrices.
Definition at line 296 of file matpackI.h.
|
friend |
Definition at line 295 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 1138 of file matpackI.cc.
|
friend |
Definition at line 39 of file matpackI.cc.
|
friend |
Definition at line 324 of file matpackI.h.
Definition at line 373 of file matpackI.h.
Referenced by swap().
|
friend |
Definition at line 311 of file matpackI.h.
|
friend |
Definition at line 310 of file matpackI.h.
|
friend |
Definition at line 314 of file matpackI.h.
|
friend |
Definition at line 313 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 320 of file matpackI.h.
|
friend |
Definition at line 319 of file matpackI.h.
|
friend |
Definition at line 323 of file matpackI.h.
|
friend |
Definition at line 322 of file matpackI.h.
|
friend |
invlib wrapper type for ARTS vectors.
Definition at line 293 of file matpackI.h.
|
friend |
Definition at line 292 of file matpackI.h.
|
private |
The number of elements.
-1 means extent to the end of the vector.
Definition at line 380 of file matpackI.h.
Referenced by ComplexMatrixView::diagonal(), ConstComplexMatrixView::diagonal(), ConstMatrixView::diagonal(), ConstVectorView::empty(), ComplexVectorView::end(), ComplexMatrixView::end(), Tensor3View::end(), Tensor4View::end(), Tensor5View::end(), Tensor6View::end(), Tensor7View::end(), VectorView::end(), MatrixView::end(), ConstComplexVectorView::end(), ConstComplexMatrixView::end(), ConstTensor3View::end(), ConstTensor4View::end(), ConstTensor5View::end(), ConstTensor6View::end(), ConstTensor7View::end(), ConstVectorView::end(), ConstMatrixView::end(), Tensor3View::get_c_array(), Tensor4View::get_c_array(), Tensor5View::get_c_array(), Tensor6View::get_c_array(), Tensor7View::get_c_array(), get_extent(), ComplexVectorView::imag(), ComplexMatrixView::imag(), ConstComplexVectorView::imag(), ConstComplexMatrixView::imag(), ConstTensor4View::nbooks(), ConstTensor5View::nbooks(), ConstTensor6View::nbooks(), ConstTensor7View::nbooks(), 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(), 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()(), ComplexMatrixView::operator()(), ConstComplexMatrixView::operator()(), Tensor5View::operator()(), ConstTensor5View::operator()(), 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(), ConstComplexVectorView::real(), ConstComplexMatrixView::real(), Tensor4::resize(), Tensor7::resize(), Vector::resize(), Tensor3::resize(), ComplexMatrix::resize(), Matrix::resize(), Tensor5::resize(), Tensor6::resize(), ConstComplexVectorView::size(), ConstVectorView::size(), and swap().
|
private |
The start index.
Definition at line 377 of file matpackI.h.
Referenced by ComplexVectorView::begin(), ComplexMatrixView::begin(), Tensor3View::begin(), Tensor4View::begin(), Tensor5View::begin(), Tensor6View::begin(), Tensor7View::begin(), VectorView::begin(), MatrixView::begin(), ConstComplexVectorView::begin(), ConstComplexMatrixView::begin(), ConstTensor3View::begin(), ConstTensor4View::begin(), ConstTensor5View::begin(), ConstTensor6View::begin(), ConstTensor7View::begin(), ConstVectorView::begin(), ConstMatrixView::begin(), ComplexMatrixView::diagonal(), ConstComplexMatrixView::diagonal(), ConstMatrixView::diagonal(), ComplexVectorView::end(), ComplexMatrixView::end(), Tensor3View::end(), Tensor4View::end(), Tensor5View::end(), Tensor6View::end(), Tensor7View::end(), VectorView::end(), MatrixView::end(), ConstComplexVectorView::end(), ConstComplexMatrixView::end(), ConstTensor3View::end(), ConstTensor4View::end(), ConstTensor5View::end(), ConstTensor6View::end(), ConstTensor7View::end(), ConstVectorView::end(), ConstMatrixView::end(), ConstTensor4View::get(), ComplexVectorView::get(), ConstComplexVectorView::get(), ConstVectorView::get(), ConstTensor3View::get(), ConstTensor5View::get(), Tensor3View::get_c_array(), Tensor4View::get_c_array(), Tensor5View::get_c_array(), Tensor6View::get_c_array(), Tensor7View::get_c_array(), get_start(), ComplexVectorView::imag(), ComplexMatrixView::imag(), ConstComplexVectorView::imag(), ConstComplexMatrixView::imag(), ComplexIterator2D::operator!=(), ConstComplexIterator2D::operator!=(), ConstIterator3D::operator!=(), ConstIterator4D::operator!=(), ConstIterator5D::operator!=(), ConstIterator6D::operator!=(), ConstIterator7D::operator!=(), Iterator3D::operator!=(), Iterator4D::operator!=(), Iterator5D::operator!=(), Iterator6D::operator!=(), Iterator7D::operator!=(), Tensor4View::operator()(), ConstTensor4View::operator()(), Tensor3View::operator()(), ConstTensor3View::operator()(), ComplexMatrixView::operator()(), ConstComplexMatrixView::operator()(), Tensor5View::operator()(), ConstTensor5View::operator()(), operator()(), Range(), ComplexVectorView::real(), ComplexMatrixView::real(), ConstComplexVectorView::real(), ConstComplexMatrixView::real(), Tensor4::resize(), Tensor7::resize(), Vector::resize(), Tensor3::resize(), ComplexMatrix::resize(), Matrix::resize(), Tensor5::resize(), Tensor6::resize(), ConstComplexVectorView::selem(), ConstVectorView::selem(), and swap().
|
private |
The stride.
Can be positive or negative.
Definition at line 382 of file matpackI.h.
Referenced by ComplexVectorView::begin(), ComplexMatrixView::begin(), Tensor3View::begin(), Tensor4View::begin(), Tensor5View::begin(), Tensor6View::begin(), Tensor7View::begin(), VectorView::begin(), MatrixView::begin(), ConstComplexVectorView::begin(), ConstComplexMatrixView::begin(), ConstTensor3View::begin(), ConstTensor4View::begin(), ConstTensor5View::begin(), ConstTensor6View::begin(), ConstTensor7View::begin(), ConstVectorView::begin(), ConstMatrixView::begin(), ConstComplexVectorView::delem(), ConstVectorView::delem(), ComplexMatrixView::diagonal(), ConstComplexMatrixView::diagonal(), ConstMatrixView::diagonal(), ComplexVectorView::end(), ComplexMatrixView::end(), Tensor3View::end(), Tensor4View::end(), Tensor5View::end(), Tensor6View::end(), Tensor7View::end(), VectorView::end(), MatrixView::end(), ConstComplexVectorView::end(), ConstComplexMatrixView::end(), ConstTensor3View::end(), ConstTensor4View::end(), ConstTensor5View::end(), ConstTensor6View::end(), ConstTensor7View::end(), ConstVectorView::end(), ConstMatrixView::end(), ConstTensor4View::get(), ComplexVectorView::get(), ConstComplexVectorView::get(), ConstVectorView::get(), ConstTensor3View::get(), ConstTensor5View::get(), Tensor3View::get_c_array(), Tensor4View::get_c_array(), Tensor5View::get_c_array(), Tensor6View::get_c_array(), Tensor7View::get_c_array(), get_stride(), ComplexVectorView::imag(), ComplexMatrixView::imag(), ConstComplexVectorView::imag(), ConstComplexMatrixView::imag(), Tensor4View::operator()(), ConstTensor4View::operator()(), Tensor3View::operator()(), ConstTensor3View::operator()(), ComplexMatrixView::operator()(), ConstComplexMatrixView::operator()(), Tensor5View::operator()(), ConstTensor5View::operator()(), operator()(), Range(), ComplexVectorView::real(), ComplexMatrixView::real(), ConstComplexVectorView::real(), ConstComplexMatrixView::real(), Tensor4::resize(), Tensor7::resize(), Vector::resize(), Tensor3::resize(), ComplexMatrix::resize(), Matrix::resize(), Tensor5::resize(), Tensor6::resize(), and swap().