171 [[nodiscard]]
bool empty() const noexcept {
return size() == 0; }
1227 return get(l,
v, s,
b, p, r,
c);
1313 using ConstTensor7View::operator();
2315#define GETFUN(l, v, s, b, p, r, c) \
2316 *(mdata + OFFSET(l) + OFFSET(v) + OFFSET(s) + OFFSET(b) + OFFSET(p) + \
2317 OFFSET(r) + OFFSET(c))
2437 if (
const auto s = matpack::shape<Index, 7>(init);
shape().data not_eq s)
2438 resize(s[0], s[1], s[2], s[3], s[4], s[5], s[6]);
2440 auto [I, J, K, L,
M,
N, O] =
shape().data;
2441 for (
Index i = 0; i < I; i++)
2442 for (
Index j = 0; j < J; j++)
2443 for (
Index k = 0; k < K; k++)
2444 for (
Index x = 0; x < L; x++)
2445 for (
Index m = 0; m <
M; m++)
2446 for (
Index n = 0; n <
N; n++)
2447 for (
Index o = 0; o < O; o++)
2448 operator()(i, j, k, x, m, n, o) = init(i, j, k, x, m, n, o);
2468 template <std::
size_t dim0>
2470 static_assert(dim0 < 7,
"Bad Dimension, Out-of-Bounds");
2478 : dim0 == 5 ?
nrows()
2483 "Can only reduce size on same size input");
2489 template <std::
size_t dim0, std::
size_t dim1>
2491 static_assert(dim1 < 7,
"Bad Dimension, Out-of-Bounds");
2492 static_assert(dim0 < dim1,
"Bad Dimensions, dim1 must be larger than dim0");
2499 : dim1 == 5 ?
nrows()
2512 "Can only reduce size on same size input");
2518 template <std::
size_t dim0, std::
size_t dim1, std::
size_t dim2>
2520 static_assert(dim2 < 7,
"Bad Dimension, Out-of-Bounds");
2521 static_assert(dim0 < dim1,
"Bad Dimensions, dim1 must be larger than dim0");
2522 static_assert(dim1 < dim2,
"Bad Dimensions, dim2 must be larger than dim1");
2528 : dim2 == 5 ?
nrows()
2547 "Can only reduce size on same size input");
2553 template <std::size_t dim0,
2558 static_assert(dim3 < 7,
"Bad Dimension, Out-of-Bounds");
2559 static_assert(dim0 < dim1,
"Bad Dimensions, dim1 must be larger than dim0");
2560 static_assert(dim1 < dim2,
"Bad Dimensions, dim2 must be larger than dim1");
2561 static_assert(dim2 < dim3,
"Bad Dimensions, dim3 must be larger than dim2");
2566 : dim3 == 5 ?
nrows()
2589 "Can only reduce size on same size input");
2595 template <std::size_t dim0,
2601 static_assert(dim4 < 7,
"Bad Dimension, Out-of-Bounds");
2602 static_assert(dim0 < dim1,
"Bad Dimensions, dim1 must be larger than dim0");
2603 static_assert(dim1 < dim2,
"Bad Dimensions, dim2 must be larger than dim1");
2604 static_assert(dim2 < dim3,
"Bad Dimensions, dim3 must be larger than dim2");
2605 static_assert(dim3 < dim4,
"Bad Dimensions, dim4 must be larger than dim3");
2632 "Can only reduce size on same size input");
2638 template <std::size_t dim0,
2645 static_assert(dim5 < 7,
"Bad Dimension, Out-of-Bounds");
2646 static_assert(dim0 < dim1,
"Bad Dimensions, dim1 must be larger than dim0");
2647 static_assert(dim1 < dim2,
"Bad Dimensions, dim2 must be larger than dim1");
2648 static_assert(dim2 < dim3,
"Bad Dimensions, dim3 must be larger than dim2");
2649 static_assert(dim3 < dim4,
"Bad Dimensions, dim4 must be larger than dim3");
2650 static_assert(dim4 < dim5,
"Bad Dimensions, dim5 must be larger than dim4");
2670 "Can only reduce size on same size input");
base max(const Array< base > &x)
Max function.
base min(const Array< base > &x)
Min function.
This can be used to make arrays out of anything.
Const version of Iterator7D.
ConstIterator7D(ConstTensor6View x, Index stride)
Explicit constructor.
const ConstTensor6View * operator->() const
The -> operator is needed, so that we can write i->begin() to get the 1D iterators.
ConstTensor6View msv
Current position.
ConstIterator7D & operator++()
Prefix increment operator.
ConstIterator7D()=default
Default constructor.
const ConstTensor6View & operator*() const
Dereferencing.
bool operator!=(const ConstIterator7D &other) const
Not equal operator, needed for algorithms like copy.
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.
Index size() const noexcept
A constant view of a Tensor6.
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
Range mpr
The page range of mdata that is actually used.
Range msr
The shelf range of mdata that is actually used.
A constant view of a Tensor7.
Index ncols() const noexcept
Range mrr
The row range of mdata that is actually used.
Range mcr
The column range of mdata that is actually used.
Index npages() const noexcept
ConstTensor7View & operator=(const ConstTensor7View &)=default
ConstIterator7D end() const
Return const iterator behind last sub-tensor.
Numeric operator()(Index l, Index v, Index s, Index b, Index p, Index r, Index c) const
Range mbr
The book range of mdata that is actually used.
Range mvr
The vitrine range of mdata that is actually used.
Index nrows() const noexcept
ConstIterator7D begin() const
Return const iterator to first sub-tensor.
Range mpr
The page range of mdata that is actually used.
Index nlibraries() const noexcept
ConstTensor7View()=default
Index nvitrines() const noexcept
Range mlr
The library range of mdata that is actually used.
constexpr ConstTensor7View(ConstTensor7View &&)=default
constexpr ConstTensor7View(const ConstTensor7View &)=default
Index nshelves() const noexcept
Index size() const noexcept
Numeric * mdata
Pointer to the plain C array that holds the data.
ConstTensor7View & operator=(ConstTensor7View &&)=default
friend std::ostream & operator<<(std::ostream &os, const ConstTensor7View &v)
Output operator.
bool empty() const noexcept
ConstTensor7View operator()(const Range &l, const Range &v, const Range &s, const Range &b, const Range &p, const Range &r, const Range &c) const
virtual ~ConstTensor7View()=default
Destructor.
Range msr
The shelf range of mdata that is actually used.
Index nbooks() const noexcept
static constexpr bool matpack_type
Numeric get(Index l, Index v, Index s, Index b, Index p, Index r, Index c) const
Get element implementation without assertions.
A constant view of a Vector.
Index size() const noexcept
Implementation of Tensors of Rank 7.
Iterator7D()=default
Default constructor.
Tensor6View & operator*()
Dereferencing.
Iterator7D & operator++()
Prefix increment operator.
bool operator!=(const Iterator7D &other) const
Not equal operator, needed for algorithms like copy.
Tensor6View msv
Current position.
Tensor6View * operator->()
The -> operator is needed, so that we can write i->begin() to get the 1D iterators.
Iterator7D(const Tensor6View &x, Index stride)
Explicit constructor.
Index mstart
The start index.
constexpr Index get_extent() const noexcept
Returns the extent of the range.
Index mextent
The number of elements.
const Numeric * get_c_array() const ARTS_NOEXCEPT
Conversion to plain C-array.
Tensor7View operator()(const Range &l, const Range &v, const Range &s, const Range &b, const Range &p, const Range &r, const Range &c)
Iterator7D end()
Return iterator behind last sub-tensor.
Numeric & get(Index l, Index v, Index s, Index b, Index p, Index r, Index c)
Get element implementation without assertions.
Tensor7View & operator=(const ConstTensor7View &v)
Assignment operator.
Numeric & operator()(Index l, Index v, Index s, Index b, Index p, Index r, Index c)
Iterator7D begin()
Return iterator to first sub-tensor.
constexpr Tensor7View(const Tensor7View &)=default
Tensor3 reduce_rank() &&ARTS_NOEXCEPT
Tensor4 reduce_rank() &&ARTS_NOEXCEPT
Matrix reduce_rank() &&ARTS_NOEXCEPT
Tensor6 reduce_rank() &&ARTS_NOEXCEPT
Tensor7 & operator=(const matpack::tensor7_like_not_tensor7 auto &init)
Set from a tensor type.
void transform_elementwise(F &&func)
Tensor7(Tensor7 &&v) noexcept
Tensor7(const matpack::tensor7_like_not_tensor7 auto &init)
Initialization from a tensor type.
Tensor5 reduce_rank() &&ARTS_NOEXCEPT
A concept precluding Arts types but allowing the tensor-like object.
#define ARTS_ASSERT(condition,...)
void copy(ConstIterator7D origin, const ConstIterator7D &end, Iterator7D target)
Copy data between begin and end to target.
Numeric debug_tensor7view_get_elem(Tensor7View &tv, Index l, Index v, Index s, Index b, Index p, Index r, Index c)
Helper function to access tensor elements.
void transform(Tensor7View y, double(&my_func)(double), ConstTensor7View x)
A generic transform function for tensors, which can be used to implement mathematical functions opera...
#define GETFUN(l, v, s, b, p, r, c)
#define CHECK(x)
Implementation of Tensors of Rank 6.
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) noexcept
Swaps two objects.