148 [[nodiscard]]
bool empty() const noexcept {
return size() == 0; }
222 return get(
b, p, r,
c);
295 using ConstTensor4View::operator();
350 return get(
b, p, r,
c);
456 ARTS_ASSERT(not(r1.get_extent() < 0),
"Must have size");
457 ARTS_ASSERT(not(r2.get_extent() < 0),
"Must have size");
458 ARTS_ASSERT(not(r3.get_extent() < 0),
"Must have size");
476 template <std::
size_t dim0>
478 static_assert(dim0 < 4,
"Bad Dimension, Out-of-Bounds");
483 : dim0 == 2 ?
nrows()
488 "Can only reduce size on same size input");
494 template <std::
size_t dim0, std::
size_t dim1>
496 static_assert(dim1 < 4,
"Bad Dimension, Out-of-Bounds");
497 static_assert(dim0 < dim1,
"Bad Dimensions, dim1 must be larger than dim0");
508 "Can only reduce size on same size input");
514 template <std::
size_t dim0, std::
size_t dim1, std::
size_t dim2>
516 static_assert(dim2 < 4,
"Bad Dimension, Out-of-Bounds");
517 static_assert(dim0 < dim1,
"Bad Dimensions, dim1 must be larger than dim0");
518 static_assert(dim1 < dim2,
"Bad Dimensions, dim2 must be larger than dim1");
527 "Can only reduce size on same size input");
Const version of Iterator4D.
ConstIterator4D & operator++()
Prefix increment operator.
const ConstTensor3View & operator*() const
Dereferencing.
const ConstTensor3View * operator->() const
The -> operator is needed, so that we can write i->begin() to get the 3D iterators.
ConstTensor3View msv
Current position.
ConstIterator4D()=default
Default constructor.
ConstIterator4D(const ConstTensor3View &x, Index stride)
Explicit constructor.
bool operator!=(const ConstIterator4D &other) const
Not equal operator, needed for algorithms like copy.
Const version of Iterator5D.
A constant view of a Matrix.
Index size() const noexcept
A constant view of a Tensor3.
Numeric * mdata
Pointer to the plain C array that holds the data.
Range mrr
The row range of mdata that is actually used.
Range mcr
The column range of mdata that is actually used.
Index size() const noexcept
Range mpr
The page range of mdata that is actually used.
A constant view of a Tensor4.
Index ncols() const noexcept
Range mrr
The row range of mdata that is actually used.
ConstTensor4View()=default
ConstTensor4View & operator=(const ConstTensor4View &)=default
Range mbr
The book range of mdata that is actually used.
ConstTensor4View operator()(const Range &b, const Range &p, const Range &r, const Range &c) const
Const index operator for subrange.
virtual ~ConstTensor4View()=default
Destructor.
Index size() const noexcept
bool empty() const noexcept
constexpr ConstTensor4View(const ConstTensor4View &)=default
Range mcr
The column range of mdata that is actually used.
Numeric * mdata
Pointer to the plain C array that holds the data.
constexpr ConstTensor4View(ConstTensor4View &&)=default
Range mpr
The page range of mdata that is actually used.
ConstTensor4View & operator=(ConstTensor4View &&)=default
Numeric get(Index b, Index p, Index r, Index c) const
Get element implementation without assertions.
ConstIterator4D end() const
Return const iterator behind last book.
ConstIterator4D begin() const
Return const iterator to first book.
Index nrows() const noexcept
Index nbooks() const noexcept
Numeric operator()(Index b, Index p, Index r, Index c) const
Plain const index operator.
Index npages() const noexcept
A constant view of a Tensor5.
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 4.
Iterator4D & operator++()
Prefix increment operator.
Tensor3View * operator->()
The -> operator is needed, so that we can write i->begin() to get the 3D iterators.
Iterator4D()=default
Default constructor.
bool operator!=(const Iterator4D &other) const
Not equal operator, needed for algorithms like copy.
Tensor3View & operator*()
Dereferencing.
Tensor3View msv
Current position.
Iterator4D(const Tensor3View &x, Index stride)
Explicit constructor.
Implementation of Tensors of Rank 5.
Index mstart
The start index.
constexpr Index get_extent() const noexcept
Returns the extent of the range.
Index mextent
The number of elements.
constexpr Tensor4View(const Tensor4View &)=default
Iterator4D begin()
Return iterator to first book.
const Numeric * get_c_array() const ARTS_NOEXCEPT
Conversion to plain C-array.
Numeric & get(Index b, Index p, Index r, Index c)
Get element implementation without assertions.
Tensor4View operator()(const Range &b, const Range &p, const Range &r, const Range &c)
Index operator for subrange.
Tensor4View & operator=(const ConstTensor4View &v)
Assignment operator.
Iterator4D end()
Return iterator behind last book.
Numeric & operator()(Index b, Index p, Index r, Index c)
Plain non-const index operator.
Matrix reduce_rank() &&ARTS_NOEXCEPT
Tensor4(Tensor4 &&v) noexcept
Tensor4(Numeric *d, const Range &r0, const Range &r1, const Range &r2, const Range &r3) ARTS_NOEXCEPT
Tensor3 reduce_rank() &&ARTS_NOEXCEPT
void transform_elementwise(F &&func)
Vector reduce_rank() &&ARTS_NOEXCEPT
#define ARTS_ASSERT(condition,...)
void copy(ConstIterator4D origin, const ConstIterator4D &end, Iterator4D target)
Copy data between begin and end to target.
Numeric debug_tensor4view_get_elem(Tensor4View &tv, Index b, Index p, Index r, Index c)
Helper function to access tensor elements.
Numeric max(const ConstTensor4View &x)
Max function, tensor version.
Numeric min(const ConstTensor4View &x)
Min function, tensor version.
std::ostream & operator<<(std::ostream &os, const ConstTensor4View &v)
Output operator.
void transform(Tensor4View y, double(&my_func)(double), ConstTensor4View x)
A generic transform function for tensors, which can be used to implement mathematical functions opera...
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.