34 ARTS_ASSERT(0 <= x); \
35 ARTS_ASSERT(x < m##x##r.mextent)
36#define OFFSET(x) m##x##r.mstart + x* m##x##r.mstride
166 [[nodiscard]]
bool empty() const noexcept {
return size() == 0; }
554 return get(
v, s,
b, p, r,
c);
635 using ConstTensor6View::operator();
1020 return get(
v, s,
b, p, r,
c);
1131 ARTS_ASSERT(not(r1.get_extent() < 0),
"Must have size");
1132 ARTS_ASSERT(not(r2.get_extent() < 0),
"Must have size");
1133 ARTS_ASSERT(not(r3.get_extent() < 0),
"Must have size");
1134 ARTS_ASSERT(not(r4.get_extent() < 0),
"Must have size");
1135 ARTS_ASSERT(not(r5.get_extent() < 0),
"Must have size");
1153 template <std::
size_t dim0>
1155 static_assert(dim0 < 6,
"Bad Dimension, Out-of-Bounds");
1162 : dim0 == 4 ?
nrows()
1167 "Can only reduce size on same size input");
1173 template <std::
size_t dim0, std::
size_t dim1>
1175 static_assert(dim1 < 6,
"Bad Dimension, Out-of-Bounds");
1176 static_assert(dim0 < dim1,
"Bad Dimensions, dim1 must be larger than dim0");
1182 : dim1 == 4 ?
nrows()
1194 "Can only reduce size on same size input");
1200 template <std::
size_t dim0, std::
size_t dim1, std::
size_t dim2>
1202 static_assert(dim2 < 6,
"Bad Dimension, Out-of-Bounds");
1203 static_assert(dim0 < dim1,
"Bad Dimensions, dim1 must be larger than dim0");
1204 static_assert(dim1 < dim2,
"Bad Dimensions, dim2 must be larger than dim1");
1209 : dim2 == 4 ?
nrows()
1226 "Can only reduce size on same size input");
1232 template <std::size_t dim0,
1237 static_assert(dim3 < 6,
"Bad Dimension, Out-of-Bounds");
1238 static_assert(dim0 < dim1,
"Bad Dimensions, dim1 must be larger than dim0");
1239 static_assert(dim1 < dim2,
"Bad Dimensions, dim2 must be larger than dim1");
1240 static_assert(dim2 < dim3,
"Bad Dimensions, dim3 must be larger than dim2");
1261 "Can only reduce size on same size input");
1267 template <std::size_t dim0,
1273 static_assert(dim4 < 6,
"Bad Dimension, Out-of-Bounds");
1274 static_assert(dim0 < dim1,
"Bad Dimensions, dim1 must be larger than dim0");
1275 static_assert(dim1 < dim2,
"Bad Dimensions, dim2 must be larger than dim1");
1276 static_assert(dim2 < dim3,
"Bad Dimensions, dim3 must be larger than dim2");
1277 static_assert(dim3 < dim4,
"Bad Dimensions, dim4 must be larger than dim3");
1293 "Can only reduce size on same size input");
Const version of Iterator6D.
ConstTensor5View msv
Current position.
const ConstTensor5View * operator->() const
The -> operator is needed, so that we can write i->begin() to get the 1D iterators.
ConstIterator6D(const ConstTensor5View &x, Index stride)
Explicit constructor.
ConstIterator6D()=default
Default constructor.
ConstIterator6D & operator++()
Prefix increment operator.
const ConstTensor5View & operator*() const
Dereferencing.
bool operator!=(const ConstIterator6D &other) const
Not equal operator, needed for algorithms like copy.
Const version of Iterator7D.
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.
Index size() const noexcept
A constant view of a Tensor5.
Range mpr
The page range of mdata that is actually used.
Range mcr
The column range of mdata that is actually used.
Numeric * mdata
Pointer to the plain C array that holds the data.
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.
Range mrr
The row range of mdata that is actually used.
A constant view of a Tensor6.
constexpr ConstTensor6View(ConstTensor6View &&)=default
ConstIterator6D begin() const
Return const iterator to first sub-tensor.
ConstTensor6View & operator=(ConstTensor6View &&)=default
ConstIterator6D end() const
Return const iterator behind last sub-tensor.
virtual ~ConstTensor6View()=default
Range mvr
The vitrine range of mdata that is actually used.
Range mcr
The column range of mdata that is actually used.
Range mbr
The book range of mdata that is actually used.
Numeric * mdata
Pointer to the plain C array that holds the data.
Range mrr
The row range of mdata that is actually used.
Index size() const noexcept
Index nbooks() const noexcept
Index nvitrines() const noexcept
Numeric get(Index v, Index s, Index b, Index p, Index r, Index c) const
Get element implementation without assertions.
bool empty() const noexcept
ConstTensor6View operator()(const Range &v, const Range &s, const Range &b, const Range &p, const Range &r, const Range &c) const
Index ncols() const noexcept
constexpr ConstTensor6View(const ConstTensor6View &)=default
Numeric operator()(Index v, Index s, Index b, Index p, Index r, Index c) const
Index npages() const noexcept
Index nshelves() const noexcept
ConstTensor6View & operator=(const ConstTensor6View &)=default
Range mpr
The page range of mdata that is actually used.
Index nrows() const noexcept
Range msr
The shelf range of mdata that is actually used.
ConstTensor6View()=default
A constant view of a Tensor7.
A constant view of a Vector.
Index size() const noexcept
The outermost iterator class for rank 6 tensors.
Iterator6D & operator++()
Prefix increment operator.
Iterator6D(const Tensor5View &x, Index stride)
Explicit constructor.
bool operator!=(const Iterator6D &other) const
Not equal operator, needed for algorithms like copy.
Tensor5View & operator*()
Dereferencing.
Tensor5View msv
Current position.
Tensor5View * operator->()
The -> operator is needed, so that we can write i->begin() to get the 1D iterators.
Iterator6D()=default
Default constructor.
Implementation of Tensors of Rank 7.
Index mstart
The start index.
constexpr Index get_extent() const noexcept
Returns the extent of the range.
Index mextent
The number of elements.
Iterator6D end()
Return iterator behind last sub-tensor.
Numeric & operator()(Index v, Index s, Index b, Index p, Index r, Index c)
Iterator6D begin()
Return iterator to first sub-tensor.
Numeric & get(Index v, Index s, Index b, Index p, Index r, Index c)
Get element implementation without assertions.
Tensor6View & operator=(const ConstTensor6View &v)
Assignment operator.
const Numeric * get_c_array() const ARTS_NOEXCEPT
Conversion to plain C-array.
constexpr Tensor6View(const Tensor6View &)=default
Tensor6View operator()(const Range &v, const Range &s, const Range &b, const Range &p, const Range &r, const Range &c)
Tensor5 reduce_rank() &&ARTS_NOEXCEPT
Tensor6(Numeric *d, const Range &r0, const Range &r1, const Range &r2, const Range &r3, const Range &r4, const Range &r5) ARTS_NOEXCEPT
void transform_elementwise(F &&func)
Tensor3 reduce_rank() &&ARTS_NOEXCEPT
Vector reduce_rank() &&ARTS_NOEXCEPT
Tensor4 reduce_rank() &&ARTS_NOEXCEPT
Tensor6(Tensor6 &&v) noexcept
Matrix reduce_rank() &&ARTS_NOEXCEPT
#define ARTS_ASSERT(condition,...)
Numeric max(const ConstTensor6View &x)
Max function, tensor version.
void copy(ConstIterator6D origin, const ConstIterator6D &end, Iterator6D target)
Copy data between begin and end to target.
#define CHECK(x)
Implementation of Tensors of Rank 6.
Numeric min(const ConstTensor6View &x)
Min function, tensor version.
std::ostream & operator<<(std::ostream &os, const ConstTensor6View &v)
Output operator.
void transform(Tensor6View y, double(&my_func)(double), ConstTensor6View x)
A generic transform function for tensors, which can be used to implement mathematical functions opera...
Numeric debug_tensor6view_get_elem(Tensor6View &tv, Index v, Index s, Index b, Index p, Index r, Index c)
Helper function to access tensor elements.
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.