ARTS
2.3.1285(git:92a29ea9-dirty)
|
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.
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.
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.
|
inline |
Returns the extent of the range.
Definition at line 329 of file matpackI.h.
Referenced by covmat_seAddBlock(), diagonalize(), get_covariance_matrix_block(), CovarianceMatrix::is_consistent(), mult(), Block::ncols(), Block::nrows(), operator<<(), and partial_derivatives_lineshape_dependency().
|
inline |
Returns the start index of the range.
Definition at line 327 of file matpackI.h.
Referenced by get_covariance_matrix_block(), CovarianceMatrix::is_consistent(), jacobianCalcPointingZaInterp(), jacobianCalcPointingZaRecalc(), jacobianCalcPolyfit(), MapToEigen(), MapToEigen4x4(), MapToEigenCol(), mult(), operator<<(), transpose_mult(), yCalc(), and yCalc_mblock_loop_body().
|
inline |
Returns the stride of the range.
Definition at line 331 of file matpackI.h.
References ConstComplexIterator2D::mstride.
Referenced by lubacksub(), MapToEigen(), MapToEigen4x4(), MapToEigenCol(), mult(), operator<<(), and transpose_mult().
Range of range.
Definition at line 334 of file matpackI.h.
References mextent, mstart, mstride, and ConstComplexIterator2D::mstride.
Definition at line 346 of file matpackI.h.
References ConstComplexIterator2D::mstride.
|
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 274 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(), ConstTensor3View::end(), ConstTensor5View::end(), Tensor3View::end(), ConstComplexVectorView::end(), Tensor4View::end(), ComplexVectorView::end(), Tensor5View::end(), ConstVectorView::end(), ConstTensor6View::end(), VectorView::end(), ComplexMatrixView::end(), Tensor6View::end(), MatrixView::end(), ConstTensor7View::end(), Tensor7View::end(), Tensor3View::get_c_array(), Tensor5View::get_c_array(), ComplexMatrixView::get_c_array(), Tensor6View::get_c_array(), MatrixView::get_c_array(), Tensor7View::get_c_array(), mult_general(), ConstTensor5View::nbooks(), ConstTensor7View::nbooks(), ConstTensor6View::nbooks(), ConstTensor5View::ncols(), ConstTensor7View::ncols(), ConstTensor6View::ncols(), ConstVectorView::nelem(), ConstTensor7View::nlibraries(), ConstTensor5View::npages(), ConstTensor7View::npages(), ConstTensor6View::npages(), ConstTensor5View::nrows(), ConstTensor7View::nrows(), ConstTensor6View::nrows(), ConstTensor5View::nshelves(), ConstTensor7View::nshelves(), ConstTensor6View::nshelves(), ConstTensor7View::nvitrines(), ConstTensor6View::nvitrines(), operator()(), Tensor3View::operator=(), Tensor4View::operator=(), ComplexVectorView::operator=(), Tensor5View::operator=(), VectorView::operator=(), ComplexMatrixView::operator=(), Tensor6View::operator=(), MatrixView::operator=(), Tensor7View::operator=(), Range(), ComplexVector::resize(), and Vector::resize().
|
private |
The start index.
Definition at line 346 of file matpackI.h.
Referenced by ConstTensor3View::begin(), ConstTensor5View::begin(), Tensor3View::begin(), ConstComplexVectorView::begin(), Tensor4View::begin(), ComplexVectorView::begin(), Tensor5View::begin(), ConstVectorView::begin(), ConstTensor6View::begin(), VectorView::begin(), ComplexMatrixView::begin(), Tensor6View::begin(), MatrixView::begin(), ConstTensor7View::begin(), Tensor7View::begin(), ComplexMatrixView::diagonal(), ConstTensor3View::end(), ConstTensor5View::end(), Tensor3View::end(), ConstComplexVectorView::end(), Tensor4View::end(), ComplexVectorView::end(), Tensor5View::end(), ConstVectorView::end(), ConstTensor6View::end(), VectorView::end(), ComplexMatrixView::end(), Tensor6View::end(), MatrixView::end(), ConstTensor7View::end(), Tensor7View::end(), Tensor3View::get_c_array(), Tensor5View::get_c_array(), ComplexVectorView::get_c_array(), VectorView::get_c_array(), ComplexMatrixView::get_c_array(), Tensor6View::get_c_array(), MatrixView::get_c_array(), Tensor7View::get_c_array(), mult_general(), Iterator3D::operator!=(), Iterator4D::operator!=(), Iterator7D::operator!=(), Iterator5D::operator!=(), Iterator6D::operator!=(), ConstIterator3D::operator!=(), ConstIterator4D::operator!=(), ConstIterator5D::operator!=(), ConstIterator7D::operator!=(), ConstIterator6D::operator!=(), ComplexIterator2D::operator!=(), ConstComplexIterator2D::operator!=(), Iterator2D::operator!=(), ConstIterator2D::operator!=(), operator()(), Range(), ComplexVector::resize(), and Vector::resize().
|
private |
The stride.
Can be positive or negative.
Definition at line 355 of file matpackI.h.
Referenced by ConstTensor3View::begin(), ConstTensor5View::begin(), Tensor3View::begin(), ConstComplexVectorView::begin(), Tensor4View::begin(), ComplexVectorView::begin(), Tensor5View::begin(), ConstVectorView::begin(), ConstTensor6View::begin(), VectorView::begin(), ComplexMatrixView::begin(), Tensor6View::begin(), MatrixView::begin(), ConstTensor7View::begin(), Tensor7View::begin(), ComplexMatrixView::diagonal(), ConstTensor3View::end(), ConstTensor5View::end(), Tensor3View::end(), ConstComplexVectorView::end(), Tensor4View::end(), ComplexVectorView::end(), Tensor5View::end(), ConstVectorView::end(), ConstTensor6View::end(), VectorView::end(), ComplexMatrixView::end(), Tensor6View::end(), MatrixView::end(), ConstTensor7View::end(), Tensor7View::end(), Tensor3View::get_c_array(), Tensor5View::get_c_array(), ComplexVectorView::get_c_array(), VectorView::get_c_array(), ComplexMatrixView::get_c_array(), Tensor6View::get_c_array(), MatrixView::get_c_array(), Tensor7View::get_c_array(), mult_general(), operator()(), Range(), ComplexVector::resize(), and Vector::resize().