376 : mbr(0, 1,
a.mpr.mextent *
a.mrr.mextent *
a.mcr.mextent),
393 : mbr(br), mpr(pr), mrr(rr), mcr(cr), mdata(data) {
413 : mbr(pb, nb), mpr(pp, np), mrr(pr, nr), mcr(pc, nc), mdata(data) {
425 if (ib != end_book) {
430 for (; ib != end_book; ++ib) {
809 for (;
b != eb; ++
b, ++xb) {
824 for (;
b != eb; ++
b, ++xb) {
839 for (;
b != eb; ++
b, ++xb) {
854 for (;
b != eb; ++
b, ++xb) {
864 Range(0, 1,
a.mpr.mextent *
a.mrr.mextent *
a.mcr.mextent),
921 for (; origin != end; ++origin, ++target) {
930 for (; target != end; ++target) {
960 std::fill_n(
mdata,
b * p * r *
c, fill);
967 Range(0, m.nbooks(), m.npages() * m.nrows() * m.ncols()),
968 Range(0, m.npages(), m.nrows() * m.ncols()),
969 Range(0, m.nrows(), m.ncols()),
970 Range(0, m.ncols())) {
978 Range(0, m.nbooks(), m.npages() * m.nrows() * m.ncols()),
979 Range(0, m.npages(), m.nrows() * m.ncols()),
980 Range(0, m.nrows(), m.ncols()),
981 Range(0, m.ncols())) {
1035 x.mbr =
Range(0, 0);
1036 x.mpr =
Range(0, 0);
1037 x.mrr =
Range(0, 0);
1038 x.mcr =
Range(0, 0);
1086 swap(t1.mbr, t2.mbr);
1087 swap(t1.mpr, t2.mpr);
1088 swap(t1.mrr, t2.mrr);
1089 swap(t1.mcr, t2.mcr);
1090 swap(t1.mdata, t2.mdata);
1126 for (; xi != xe; ++xi, ++yi) {
1142 for (; xi != xe; ++xi) {
1146 if (maxi > themax) themax = maxi;
1161 for (; xi != xe; ++xi) {
1165 if (mini < themin) themin = mini;
1192 return tv(
b, p, r,
c);
base max(const Array< base > &x)
Max function.
base min(const Array< base > &x)
Min function.
Const version of Iterator4D.
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.
A constant view of a Matrix.
A constant view of a Tensor3.
ConstIterator3D begin() const
Return const iterator to first page.
ConstIterator3D end() const
Return const iterator behind last page.
A constant view of a Tensor4.
Index ncols() const noexcept
Range mrr
The row range of mdata that is actually used.
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.
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.
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
Index npages() const noexcept
A constant view of a Vector.
Implementation of Tensors of Rank 4.
Tensor3View * operator->()
The -> operator is needed, so that we can write i->begin() to get the 3D iterators.
Tensor3View & operator*()
Dereferencing.
Tensor3View msv
Current position.
Index mstart
The start index.
Index mextent
The number of elements.
Iterator3D begin()
Return iterator to first page.
Iterator3D end()
Return iterator behind last page.
Iterator4D begin()
Return iterator to first book.
const Numeric * get_c_array() const ARTS_NOEXCEPT
Conversion to plain C-array.
Tensor4View & operator+=(Numeric x)
Addition of scalar.
Tensor4View operator()(const Range &b, const Range &p, const Range &r, const Range &c)
Index operator for subrange.
Tensor4View & operator-=(Numeric x)
Subtraction of scalar.
Tensor4View & operator=(const ConstTensor4View &v)
Assignment operator.
Iterator4D end()
Return iterator behind last book.
Tensor4View & operator/=(Numeric x)
Division by scalar.
Tensor4View & operator*=(Numeric x)
Multiplication by scalar.
Tensor4 & operator=(const matpack::tensor4_like_not_tensor4 auto &init)
Set from a tensor type.
Vector flatten() &&ARTS_NOEXCEPT
void resize(Index b, Index p, Index r, Index c)
Resize function.
~Tensor4() noexcept override
Destructor for Tensor4.
#define ARTS_ASSERT(condition,...)
The declarations of all the exception classes.
void swap(Tensor4 &t1, Tensor4 &t2) noexcept
Swaps two objects.
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.
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...
void copy(ConstIterator4D origin, const ConstIterator4D &end, Iterator4D target)
Copy data between begin and end to target.
NUMERIC Numeric
The type to use for all floating point numbers.
INDEX Index
The type to use for all integer numbers and indices.