ARTS 2.5.10 (git: 2f1c442c)
|
#include <matpackV.h>
Public Member Functions | |
Tensor5 ()=default | |
Tensor5 (Index s, Index b, Index p, Index r, Index c) | |
Constructor setting size. | |
Tensor5 (Index s, Index b, Index p, Index r, Index c, Numeric fill) | |
Constructor setting size and filling with constant value. | |
Tensor5 (const ConstTensor5View &v) | |
Copy constructor from Tensor5View. | |
Tensor5 (const Tensor5 &v) | |
Copy constructor from Tensor5. | |
Tensor5 (Tensor5 &&v) noexcept | |
Tensor5 (const matpack::tensor5_like_not_tensor5 auto &init) | |
Initialization from a tensor type. | |
Tensor5 & | operator= (const matpack::tensor5_like_not_tensor5 auto &init) |
Set from a tensor type. | |
Tensor5 (Numeric *d, const Range &r0, const Range &r1, const Range &r2, const Range &r3, const Range &r4) ARTS_NOEXCEPT | |
Tensor5 & | operator= (const Tensor5 &x) |
Assignment operator from another tensor. | |
Tensor5 & | operator= (Tensor5 &&x) ARTS_NOEXCEPT |
Move assignment operator from another tensor. | |
Tensor5 & | operator= (Numeric x) |
Assignment operator from scalar. | |
void | resize (Index s, Index b, Index p, Index r, Index c) |
Resize function. | |
~Tensor5 () noexcept override | |
Destructor for Tensor5. | |
template<std::size_t dim0> | |
Vector | reduce_rank () &&ARTS_NOEXCEPT |
template<std::size_t dim0, std::size_t dim1> | |
Matrix | reduce_rank () &&ARTS_NOEXCEPT |
template<std::size_t dim0, std::size_t dim1, std::size_t dim2> | |
Tensor3 | reduce_rank () &&ARTS_NOEXCEPT |
template<std::size_t dim0, std::size_t dim1, std::size_t dim2, std::size_t dim3> | |
Tensor4 | reduce_rank () &&ARTS_NOEXCEPT |
template<class F > | |
void | transform_elementwise (F &&func) |
![]() | |
constexpr | Tensor5View (const Tensor5View &)=default |
Tensor5View | operator() (const Range &s, const Range &b, const Range &p, const Range &r, const Range &c) |
Index operator for subrange. | |
Tensor4View | operator() (const Range &s, const Range &b, const Range &p, const Range &r, Index c) |
Index operator returning an object of type Tensor4View. | |
Tensor4View | operator() (const Range &s, const Range &b, const Range &p, Index r, const Range &c) |
Index operator returning an object of type Tensor4View. | |
Tensor4View | operator() (const Range &s, const Range &b, Index p, const Range &r, const Range &c) |
Index operator returning an object of type Tensor4View. | |
Tensor4View | operator() (const Range &s, Index b, const Range &p, const Range &r, const Range &c) |
Index operator returning an object of type Tensor4View. | |
Tensor4View | operator() (Index s, const Range &b, const Range &p, const Range &r, const Range &c) |
Index operator returning an object of type Tensor4View. | |
Tensor3View | operator() (const Range &s, const Range &b, const Range &p, Index r, Index c) |
Index operator returning an object of type Tensor3View. | |
Tensor3View | operator() (const Range &s, const Range &b, Index p, const Range &r, Index c) |
Index operator returning an object of type Tensor3View. | |
Tensor3View | operator() (const Range &s, const Range &b, Index p, Index r, const Range &c) |
Index operator returning an object of type Tensor3View. | |
Tensor3View | operator() (const Range &s, Index b, const Range &p, Index r, const Range &c) |
Index operator returning an object of type Tensor3View. | |
Tensor3View | operator() (const Range &s, Index b, const Range &p, const Range &r, Index c) |
Index operator returning an object of type Tensor3View. | |
Tensor3View | operator() (const Range &s, Index b, Index p, const Range &r, const Range &c) |
Index operator returning an object of type Tensor3View. | |
Tensor3View | operator() (Index s, const Range &b, Index p, const Range &r, const Range &c) |
Index operator returning an object of type Tensor3View. | |
Tensor3View | operator() (Index s, const Range &b, const Range &p, Index r, const Range &c) |
Index operator returning an object of type Tensor3View. | |
Tensor3View | operator() (Index s, const Range &b, const Range &p, const Range &r, Index c) |
Index operator returning an object of type Tensor3View. | |
Tensor3View | operator() (Index s, Index b, const Range &p, const Range &r, const Range &c) |
Index operator returning an object of type Tensor3View. | |
MatrixView | operator() (const Range &s, const Range &b, Index p, Index r, Index c) |
Index operator returning an object of type MatrixView. | |
MatrixView | operator() (const Range &s, Index b, const Range &p, Index r, Index c) |
Index operator returning an object of type MatrixView. | |
MatrixView | operator() (const Range &s, Index b, Index p, const Range &r, Index c) |
Index operator returning an object of type MatrixView. | |
MatrixView | operator() (const Range &s, Index b, Index p, Index r, const Range &c) |
Index operator returning an object of type MatrixView. | |
MatrixView | operator() (Index s, const Range &b, Index p, Index r, const Range &c) |
Index operator returning an object of type MatrixView. | |
MatrixView | operator() (Index s, const Range &b, Index p, const Range &r, Index c) |
Index operator returning an object of type MatrixView. | |
MatrixView | operator() (Index s, const Range &b, const Range &p, Index r, Index c) |
Index operator returning an object of type MatrixView. | |
MatrixView | operator() (Index s, Index b, const Range &p, const Range &r, Index c) |
Index operator returning an object of type MatrixView. | |
MatrixView | operator() (Index s, Index b, const Range &p, Index r, const Range &c) |
Index operator returning an object of type MatrixView. | |
MatrixView | operator() (Index s, Index b, Index p, const Range &r, const Range &c) |
Index operator returning an object of type MatrixView. | |
VectorView | operator() (const Range &s, Index b, Index p, Index r, Index c) |
Index operator returning an object of type VectorView. | |
VectorView | operator() (Index s, const Range &b, Index p, Index r, Index c) |
Index operator returning an object of type VectorView. | |
VectorView | operator() (Index s, Index b, const Range &p, Index r, Index c) |
Index operator returning an object of type VectorView. | |
VectorView | operator() (Index s, Index b, Index p, const Range &r, Index c) |
Index operator returning an object of type VectorView. | |
VectorView | operator() (Index s, Index b, Index p, Index r, const Range &c) |
Const index operator returning an object of type ConstVectorView. | |
Numeric & | operator() (Index s, Index b, Index p, Index r, Index c) |
Plain const index operator. | |
Numeric & | get (Index s, Index b, Index p, Index r, Index c) |
Get element implementation without assertions. | |
const Numeric * | get_c_array () const ARTS_NOEXCEPT |
Conversion to plain C-array. | |
Numeric * | get_c_array () ARTS_NOEXCEPT |
Conversion to plain C-array. | |
Iterator5D | begin () |
Return iterator to first shelf. | |
Iterator5D | end () |
Return iterator behind last shelf. | |
Tensor5View & | operator= (const ConstTensor5View &v) |
Assignment operator. | |
Tensor5View & | operator= (const Tensor5View &v) |
Assignment from Tensor5View to Tensor5View. | |
Tensor5View & | operator= (const Tensor5 &v) |
Assignment from a Tensor5. | |
Tensor5View & | operator= (Numeric x) |
Assigning a scalar to a Tensor5View will set all elements to this value. | |
Tensor5View & | operator*= (Numeric x) |
Multiplication by scalar. | |
Tensor5View & | operator/= (Numeric x) |
Division by scalar. | |
Tensor5View & | operator+= (Numeric x) |
Addition of scalar. | |
Tensor5View & | operator-= (Numeric x) |
Subtraction of scalar. | |
Tensor5View & | operator*= (const ConstTensor5View &x) |
Element-vise multiplication by another Tensor5. | |
Tensor5View & | operator/= (const ConstTensor5View &x) |
Element-vise division by another Tensor5. | |
Tensor5View & | operator+= (const ConstTensor5View &x) |
Element-vise addition of another Tensor5. | |
Tensor5View & | operator-= (const ConstTensor5View &x) |
Element-vise subtraction of another Tensor5. | |
~Tensor5View () override=default | |
Destructor. | |
Tensor5View (const Tensor4View &a) | |
Special constructor to make a Tensor5 view of a Tensor4. | |
ConstIterator5D | begin () const |
Return const iterator to first shelf. | |
ConstIterator5D | end () const |
Return const iterator behind last shelf. | |
Numeric | get (Index s, Index b, Index p, Index r, Index c) const |
Get element implementation without assertions. | |
![]() | |
constexpr | ConstTensor5View (const ConstTensor5View &)=default |
constexpr | ConstTensor5View (ConstTensor5View &&)=default |
ConstTensor5View & | operator= (const ConstTensor5View &)=default |
ConstTensor5View & | operator= (ConstTensor5View &&)=default |
Index | nshelves () const noexcept |
Index | nbooks () const noexcept |
Index | npages () const noexcept |
Index | nrows () const noexcept |
Index | ncols () const noexcept |
Index | size () const noexcept |
bool | empty () const noexcept |
Shape< 5 > | shape () const |
ConstTensor5View | operator() (const Range &s, const Range &b, const Range &p, const Range &r, const Range &c) const |
Const index operator for subrange. | |
ConstTensor4View | operator() (const Range &s, const Range &b, const Range &p, const Range &r, Index c) const |
Const index operator returning an object of type ConstTensor4View. | |
ConstTensor4View | operator() (const Range &s, const Range &b, const Range &p, Index r, const Range &c) const |
Const index operator returning an object of type ConstTensor4View. | |
ConstTensor4View | operator() (const Range &s, const Range &b, Index p, const Range &r, const Range &c) const |
Const index operator returning an object of type ConstTensor4View. | |
ConstTensor4View | operator() (const Range &s, Index b, const Range &p, const Range &r, const Range &c) const |
Const index operator returning an object of type ConstTensor4View. | |
ConstTensor4View | operator() (Index s, const Range &b, const Range &p, const Range &r, const Range &c) const |
Const index operator returning an object of type ConstTensor4View. | |
ConstTensor3View | operator() (const Range &s, const Range &b, const Range &p, Index r, Index c) const |
Const index operator returning an object of type ConstTensor3View. | |
ConstTensor3View | operator() (const Range &s, const Range &b, Index p, const Range &r, Index c) const |
Const index operator returning an object of type ConstTensor3View. | |
ConstTensor3View | operator() (const Range &s, const Range &b, Index p, Index r, const Range &c) const |
Const index operator returning an object of type ConstTensor3View. | |
ConstTensor3View | operator() (const Range &s, Index b, const Range &p, Index r, const Range &c) const |
Const index operator returning an object of type ConstTensor3View. | |
ConstTensor3View | operator() (const Range &s, Index b, const Range &p, const Range &r, Index c) const |
Const index operator returning an object of type ConstTensor3View. | |
ConstTensor3View | operator() (const Range &s, Index b, Index p, const Range &r, const Range &c) const |
Const index operator returning an object of type ConstTensor3View. | |
ConstTensor3View | operator() (Index s, const Range &b, Index p, const Range &r, const Range &c) const |
Const index operator returning an object of type ConstTensor3View. | |
ConstTensor3View | operator() (Index s, const Range &b, const Range &p, Index r, const Range &c) const |
Const index operator returning an object of type ConstTensor3View. | |
ConstTensor3View | operator() (Index s, const Range &b, const Range &p, const Range &r, Index c) const |
Const index operator returning an object of type ConstTensor3View. | |
ConstTensor3View | operator() (Index s, Index b, const Range &p, const Range &r, const Range &c) const |
Const index operator returning an object of type ConstTensor3View. | |
ConstMatrixView | operator() (const Range &s, const Range &b, Index p, Index r, Index c) const |
Const index operator returning an object of type ConstMatrixView. | |
ConstMatrixView | operator() (const Range &s, Index b, const Range &p, Index r, Index c) const |
Const index operator returning an object of type ConstMatrixView. | |
ConstMatrixView | operator() (const Range &s, Index b, Index p, const Range &r, Index c) const |
Const index operator returning an object of type ConstMatrixView. | |
ConstMatrixView | operator() (const Range &s, Index b, Index p, Index r, const Range &c) const |
Const index operator returning an object of type ConstMatrixView. | |
ConstMatrixView | operator() (Index s, const Range &b, Index p, Index r, const Range &c) const |
Const index operator returning an object of type ConstMatrixView. | |
ConstMatrixView | operator() (Index s, const Range &b, Index p, const Range &r, Index c) const |
Const index operator returning an object of type ConstMatrixView. | |
ConstMatrixView | operator() (Index s, const Range &b, const Range &p, Index r, Index c) const |
Const index operator returning an object of type ConstMatrixView. | |
ConstMatrixView | operator() (Index s, Index b, const Range &p, const Range &r, Index c) const |
Const index operator returning an object of type ConstMatrixView. | |
ConstMatrixView | operator() (Index s, Index b, const Range &p, Index r, const Range &c) const |
Const index operator returning an object of type ConstMatrixView. | |
ConstMatrixView | operator() (Index s, Index b, Index p, const Range &r, const Range &c) const |
Const index operator returning an object of type ConstMatrixView. | |
ConstVectorView | operator() (const Range &s, Index b, Index p, Index r, Index c) const |
Const index operator returning an object of type ConstVectorView. | |
ConstVectorView | operator() (Index s, const Range &b, Index p, Index r, Index c) const |
Const index operator returning an object of type ConstVectorView. | |
ConstVectorView | operator() (Index s, Index b, const Range &p, Index r, Index c) const |
Const index operator returning an object of type ConstVectorView. | |
ConstVectorView | operator() (Index s, Index b, Index p, const Range &r, Index c) const |
Const index operator returning an object of type ConstVectorView. | |
ConstVectorView | operator() (Index s, Index b, Index p, Index r, const Range &c) const |
Const index operator returning an object of type ConstVectorView. | |
Numeric | operator() (Index s, Index b, Index p, Index r, Index c) const |
Plain const index operator. | |
Numeric | get (Index s, Index b, Index p, Index r, Index c) const |
Get element implementation without assertions. | |
ConstIterator5D | begin () const |
Return const iterator to first shelf. | |
ConstIterator5D | end () const |
Return const iterator behind last shelf. | |
virtual | ~ConstTensor5View ()=default |
Destructor. | |
ConstTensor5View (const ConstTensor4View &a) | |
Special constructor to make a Tensor5 view of a Tensor4. | |
Friends | |
void | swap (Tensor5 &t1, Tensor5 &t2) noexcept |
Swaps two objects. | |
Additional Inherited Members | |
![]() | |
static constexpr bool | matpack_type {true} |
![]() | |
Tensor5View ()=default | |
Tensor5View (Numeric *data, const Range &s, const Range &b, const Range &p, const Range &r, const Range &c) | |
Explicit constructor. | |
Tensor5View (Numeric *data, const Range &ps, const Range &pb, const Range &pp, const Range &pr, const Range &pc, const Range &ns, const Range &nb, const Range &np, const Range &nr, const Range &nc) | |
Recursive constructor. | |
![]() | |
ConstTensor5View ()=default | |
ConstTensor5View (Numeric *data, const Range &s, const Range &b, const Range &p, const Range &r, const Range &c) | |
Explicit constructor. | |
ConstTensor5View (Numeric *data, const Range &ps, const Range &pb, const Range &pp, const Range &pr, const Range &pc, const Range &ns, const Range &nb, const Range &np, const Range &nr, const Range &nc) | |
Recursive constructor. | |
![]() | |
Range | msr {0, 0, 1} |
The shelf range of mdata that is actually used. | |
Range | mbr {0, 0, 1} |
The book range of mdata that is actually used. | |
Range | mpr {0, 0, 1} |
The page range of mdata that is actually used. | |
Range | mrr {0, 0, 1} |
The row range of mdata that is actually used. | |
Range | mcr {0, 0, 1} |
The column range of mdata that is actually used. | |
Numeric * | mdata {nullptr} |
Pointer to the plain C array that holds the data. | |
The Tensor5 class.
This is a Tensor5View that also allocates storage automatically, and deallocates it when it is destroyed. We take all the functionality from Tensor5View. Additionally defined here are:
Definition at line 524 of file matpackV.h.
|
default |
Constructor setting size.
This constructor has to set the strides in the shelf, book, page and row ranges correctly!
Definition at line 1615 of file matpackV.cc.
Constructor setting size and filling with constant value.
Definition at line 1626 of file matpackV.cc.
References b, c, and ConstTensor5View::mdata.
Tensor5::Tensor5 | ( | const ConstTensor5View & | m | ) |
Copy constructor from Tensor5View.
This automatically sets the size and copies the data.
Definition at line 1640 of file matpackV.cc.
References Tensor5View::begin(), ConstTensor5View::begin(), copy(), and ConstTensor5View::end().
Tensor5::Tensor5 | ( | const Tensor5 & | m | ) |
Copy constructor from Tensor5.
This automatically sets the size and copies the data.
Definition at line 1655 of file matpackV.cc.
References ConstTensor5View::mdata, ConstTensor5View::nbooks(), ConstTensor5View::ncols(), ConstTensor5View::npages(), ConstTensor5View::nrows(), and ConstTensor5View::nshelves().
|
inlinenoexcept |
Definition at line 532 of file matpackV.h.
References v.
|
inlineexplicit |
Initialization from a tensor type.
Definition at line 537 of file matpackV.h.
|
inline |
Construct from known data
Note that this will call delete on the pointer if it is still valid at the end of the lifetime of this variable
[in] | d | - A pointer to some raw data |
[in] | r0 | - The Range along the first dimension |
[in] | r1 | - The Range along the second dimension |
[in] | r2 | - The Range along the third dimension |
[in] | r3 | - The Range along the fourth dimension |
[in] | r4 | - The Range along the fifth dimension |
Definition at line 572 of file matpackV.h.
References ARTS_ASSERT.
|
overridenoexcept |
Destructor for Tensor5.
This is important, since Tensor5 uses new to allocate storage.
Definition at line 1788 of file matpackV.cc.
References ConstTensor5View::mdata.
|
inline |
Set from a tensor type.
Definition at line 545 of file matpackV.h.
References M, and ConstTensor5View::shape().
Assignment operator from another tensor.
While dimensions of views can not be adjusted, dimensions of tensors can be adjusted. Hence, the behavior of the assignment operator is different.
In this case the size of the target is automatically adjusted. This is important, so that structures containing tensors are copied correctly.
This is a deviation from the old ARTS paradigm that sizes must match exactly before copying!
Note: It is sufficient to have only this one version of the assignment (Tensor = Tensor). It implicitly covers the cases Tensor=TensorView, etc, because there is a default constructor for Tensor from TensorView. (See C++ Primer Plus, page 571ff.)
m | The other tensor to assign to this one. |
Definition at line 1700 of file matpackV.cc.
References ConstTensor5View::mdata, ConstTensor5View::nbooks(), ConstTensor5View::ncols(), ConstTensor5View::npages(), ConstTensor5View::nrows(), ConstTensor5View::nshelves(), and resize().
Assignment operator from scalar.
Assignment operators are not inherited.
Definition at line 1733 of file matpackV.cc.
References ConstTensor5View::mdata, ConstTensor5View::nbooks(), ConstTensor5View::ncols(), ConstTensor5View::npages(), ConstTensor5View::nrows(), and ConstTensor5View::nshelves().
Move assignment operator from another tensor.
Definition at line 1712 of file matpackV.cc.
|
inline |
Reduce a Tensor5 to a Vector and leave this in an empty state
Definition at line 601 of file matpackV.h.
References ARTS_ASSERT, ConstTensor5View::mdata, ConstTensor5View::nbooks(), ConstTensor5View::ncols(), ConstTensor5View::npages(), ConstTensor5View::nrows(), ConstTensor5View::nshelves(), ConstVectorView::size(), and ConstTensor5View::size().
Referenced by test48().
|
inline |
Reduce a Tensor5 to a Matrix and leave this in an empty state
Definition at line 620 of file matpackV.h.
References ARTS_ASSERT, Range::get_extent(), ConstTensor5View::mdata, ConstTensor5View::nbooks(), ConstTensor5View::ncols(), ConstTensor5View::npages(), ConstTensor5View::nrows(), ConstTensor5View::nshelves(), ConstMatrixView::size(), and ConstTensor5View::size().
|
inline |
Reduce a Tensor5 to a Tensor3 and leave this in an empty state
Definition at line 645 of file matpackV.h.
References ARTS_ASSERT, Range::get_extent(), ConstTensor5View::mdata, ConstTensor5View::nbooks(), ConstTensor5View::ncols(), ConstTensor5View::npages(), ConstTensor5View::nrows(), ConstTensor5View::nshelves(), ConstTensor3View::size(), and ConstTensor5View::size().
|
inline |
Reduce a Tensor5 to a Tensor4 and leave this in an empty state
Definition at line 674 of file matpackV.h.
References ARTS_ASSERT, Range::get_extent(), ConstTensor5View::mdata, ConstTensor5View::nbooks(), ConstTensor5View::ncols(), ConstTensor5View::npages(), ConstTensor5View::nrows(), ConstTensor5View::nshelves(), ConstTensor4View::size(), and ConstTensor5View::size().
Resize function.
If the size is already correct this function does nothing. All data is lost after resizing! The new tensor is not initialized, so it will contain random values.
Definition at line 1741 of file matpackV.cc.
References ARTS_ASSERT, b, c, ConstTensor5View::mbr, ConstTensor5View::mcr, ConstTensor5View::mdata, Range::mextent, ConstTensor5View::mpr, ConstTensor5View::mrr, ConstTensor5View::msr, Range::mstart, and Range::mstride.
Referenced by calcSingleScatteringDataProperties(), ConvertAzimuthallyRandomSingleScatteringData(), DisortCalcIrradiance(), GasAbsLookup::Extract(), nca_read_from_file(), operator=(), pha_mat_sptFromData(), pha_mat_sptFromScat_data(), RadiationFieldSpectralIntegrate(), Reduce(), GriddedField5::resize(), ScatSpeciesExtendTemperature(), ScatSpeciesMerge(), spectral_irradiance_fieldFromSpectralRadianceField(), Tensor5Multiply(), Tensor5SetConstant(), and xml_read_from_stream().
|
inline |
Definition at line 696 of file matpackV.h.
References ConstTensor5View::mdata, and ConstTensor5View::size().
Swaps two objects.
Definition at line 1776 of file matpackV.cc.