159 [[nodiscard]]
bool empty() const noexcept {
return size() == 0; }
269 return get(s,
b, p, r,
c);
346 using ConstTensor5View::operator();
435 return get(s,
b, p, r,
c);
545 ARTS_ASSERT(not(r1.get_extent() < 0),
"Must have size");
546 ARTS_ASSERT(not(r2.get_extent() < 0),
"Must have size");
547 ARTS_ASSERT(not(r3.get_extent() < 0),
"Must have size");
548 ARTS_ASSERT(not(r4.get_extent() < 0),
"Must have size");
566 template <std::
size_t dim0>
568 static_assert(dim0 < 5,
"Bad Dimension, Out-of-Bounds");
574 : dim0 == 3 ?
nrows()
579 "Can only reduce size on same size input");
585 template <std::
size_t dim0, std::
size_t dim1>
587 static_assert(dim1 < 5,
"Bad Dimension, Out-of-Bounds");
588 static_assert(dim0 < dim1,
"Bad Dimensions, dim1 must be larger than dim0");
593 : dim1 == 3 ?
nrows()
604 "Can only reduce size on same size input");
610 template <std::
size_t dim0, std::
size_t dim1, std::
size_t dim2>
612 static_assert(dim2 < 5,
"Bad Dimension, Out-of-Bounds");
613 static_assert(dim0 < dim1,
"Bad Dimensions, dim1 must be larger than dim0");
614 static_assert(dim1 < dim2,
"Bad Dimensions, dim2 must be larger than dim1");
630 "Can only reduce size on same size input");
636 template <std::size_t dim0,
641 static_assert(dim3 < 5,
"Bad Dimension, Out-of-Bounds");
642 static_assert(dim0 < dim1,
"Bad Dimensions, dim1 must be larger than dim0");
643 static_assert(dim1 < dim2,
"Bad Dimensions, dim2 must be larger than dim1");
644 static_assert(dim2 < dim3,
"Bad Dimensions, dim3 must be larger than dim2");
656 "Can only reduce size on same size input");
Const version of Iterator5D.
bool operator!=(const ConstIterator5D &other) const
Not equal operator, needed for algorithms like copy.
ConstIterator5D & operator++()
Prefix increment operator.
ConstIterator5D(const ConstTensor4View &x, Index stride)
Explicit constructor.
const ConstTensor4View * operator->() const
The -> operator is needed, so that we can write i->begin() to get the 4D iterators.
const ConstTensor4View & operator*() const
Dereferencing.
ConstTensor4View msv
Current position.
ConstIterator5D()=default
Default constructor.
Const version of Iterator6D.
A constant view of a Matrix.
Index size() const noexcept
A constant view of a Tensor3.
Index size() const noexcept
A constant view of a Tensor4.
Range mrr
The row range of mdata that is actually used.
Range mbr
The book range of mdata that is actually used.
Index size() const noexcept
Range mcr
The column range of mdata that is actually used.
Numeric * mdata
Pointer to the plain C array that holds the data.
Range mpr
The page range of mdata that is actually used.
A constant view of a Tensor5.
virtual ~ConstTensor5View()=default
Destructor.
constexpr ConstTensor5View(ConstTensor5View &&)=default
Numeric get(Index s, Index b, Index p, Index r, Index c) const
Get element implementation without assertions.
Index nrows() const noexcept
ConstTensor5View operator()(const Range &s, const Range &b, const Range &p, const Range &r, const Range &c) const
Const index operator for subrange.
Index ncols() const noexcept
Range mpr
The page range of mdata that is actually used.
Range mcr
The column range of mdata that is actually used.
constexpr ConstTensor5View(const ConstTensor5View &)=default
ConstTensor5View()=default
Numeric * mdata
Pointer to the plain C array that holds the data.
Index npages() const noexcept
ConstTensor5View & operator=(ConstTensor5View &&)=default
ConstIterator5D end() const
Return const iterator behind last shelf.
ConstTensor5View & operator=(const ConstTensor5View &)=default
Index size() const noexcept
Range mbr
The book range of mdata that is actually used.
Range msr
The shelf range of mdata that is actually used.
Numeric operator()(Index s, Index b, Index p, Index r, Index c) const
Plain const index operator.
Range mrr
The row range of mdata that is actually used.
Index nbooks() const noexcept
Index nshelves() const noexcept
bool empty() const noexcept
ConstIterator5D begin() const
Return const iterator to first shelf.
A constant view of a Tensor6.
A constant view of a Tensor7.
A constant view of a Vector.
Index size() const noexcept
Implementation of Tensors of Rank 5.
Tensor4View & operator*()
Dereferencing.
Iterator5D()=default
Default constructor.
bool operator!=(const Iterator5D &other) const
Not equal operator, needed for algorithms like copy.
Tensor4View msv
Current position.
Tensor4View * operator->()
The -> operator is needed, so that we can write i->begin() to get the 4D iterators.
Iterator5D & operator++()
Prefix increment operator.
Iterator5D(const Tensor4View &x, Index stride)
Explicit constructor.
The outermost iterator class for rank 6 tensors.
Index mstart
The start index.
constexpr Index get_extent() const noexcept
Returns the extent of the range.
Index mextent
The number of elements.
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.
Iterator5D end()
Return iterator behind last shelf.
Numeric & operator()(Index s, Index b, Index p, Index r, Index c)
Plain const index operator.
Tensor5View operator()(const Range &s, const Range &b, const Range &p, const Range &r, const Range &c)
Index operator for subrange.
Iterator5D begin()
Return iterator to first shelf.
Tensor5View & operator=(const ConstTensor5View &v)
Assignment operator.
constexpr Tensor5View(const Tensor5View &)=default
Matrix reduce_rank() &&ARTS_NOEXCEPT
Tensor5(Numeric *d, const Range &r0, const Range &r1, const Range &r2, const Range &r3, const Range &r4) ARTS_NOEXCEPT
Tensor5(Tensor5 &&v) noexcept
Tensor4 reduce_rank() &&ARTS_NOEXCEPT
void transform_elementwise(F &&func)
Vector reduce_rank() &&ARTS_NOEXCEPT
Tensor3 reduce_rank() &&ARTS_NOEXCEPT
#define ARTS_ASSERT(condition,...)
Numeric max(const ConstTensor5View &x)
Max function, tensor version.
void copy(ConstIterator5D origin, const ConstIterator5D &end, Iterator5D target)
Copy data between begin and end to target.
void transform(Tensor5View y, double(&my_func)(double), ConstTensor5View x)
A generic transform function for tensors, which can be used to implement mathematical functions opera...
Numeric debug_tensor5view_get_elem(Tensor5View &tv, Index s, Index b, Index p, Index r, Index c)
Helper function to access tensor elements.
Numeric min(const ConstTensor5View &x)
Min function, tensor version.
std::ostream & operator<<(std::ostream &os, const ConstTensor5View &v)
Output operator.
NUMERIC Numeric
The type to use for all floating point numbers.
INDEX Index
The type to use for all integer numbers and indices.
void swap(ComplexVector &v1, ComplexVector &v2)
Swaps two objects.
constexpr Numeric r0
The reference radius in IGRF13.