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);
1125 for (; xi != xe; ++xi, ++yi) {
1141 for (; xi != xe; ++xi) {
1145 if (maxi > themax) themax = maxi;
1160 for (; xi != xe; ++xi) {
1164 if (mini < themin) themin = mini;
1191 return tv(
b, p, r,
c);
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.
virtual ~Tensor4()
Destructor for Tensor4.
void resize(Index b, Index p, Index r, Index c)
Resize function.
Tensor4 & operator=(const Tensor4 &x)
Assignment operator from another tensor.
#define ARTS_ASSERT(condition,...)
The declarations of all the exception classes.
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...
void swap(Tensor4 &t1, Tensor4 &t2)
Swaps two objects.
NUMERIC Numeric
The type to use for all floating point numbers.
INDEX Index
The type to use for all integer numbers and indices.
constexpr Rational end(Rational Ju, Rational Jl, Polarization type) noexcept
Gives the largest M for a polarization type of this transition.