ARTS 2.5.4 (git: 4c0d3b4d)
matpackV.h
Go to the documentation of this file.
1/* Copyright (C) 2002-2012
2 Stefan Buehler <sbuehler@ltu.se>
3 Wolfram-Andre Haas <wolhaas@hermes.fho-emden.de>
4
5 This program is free software; you can redistribute it and/or modify it
6 under the terms of the GNU General Public License as published by the
7 Free Software Foundation; either version 2, or (at your option) any
8 later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
18 USA. */
19
31#ifndef matpackV_h
32#define matpackV_h
33
34#include "matpackIV.h"
35
39 public:
40 // Constructors:
41 // Functions for Iterator5D
42 // ------------------------
43
45 Iterator5D() = default;
46
48 Iterator5D(const Tensor4View& x, Index stride)
49 : msv(x), mstride(stride) { /* Nothing to do here. */
50 }
51
52 // Operators:
55 msv.mdata += mstride;
56 return *this;
57 }
58
60 bool operator!=(const Iterator5D& other) const {
62 msv.mcr.mstart !=
63 other.msv.mdata + other.msv.mbr.mstart + other.msv.mpr.mstart +
64 other.msv.mrr.mstart + other.msv.mcr.mstart)
65 return true;
66 return false;
67 }
68
71 Tensor4View* operator->() { return &msv; }
72
74 Tensor4View& operator*() { return msv; }
75
76 private:
81};
82
85 public:
86 // Constructors:
88 ConstIterator5D() = default;
89
92 : msv(x), mstride(stride) { /* Nothing to do here. */
93 }
94
95 // Operators:
98 msv.mdata += mstride;
99 return *this;
100 }
101
103 bool operator!=(const ConstIterator5D& other) const {
105 msv.mcr.mstart !=
106 other.msv.mdata + other.msv.mbr.mstart + other.msv.mpr.mstart +
107 other.msv.mrr.mstart + other.msv.mcr.mstart)
108 return true;
109 return false;
110 }
111
114 const ConstTensor4View* operator->() const { return &msv; }
115
117 const ConstTensor4View& operator*() const { return msv; }
118
119 private:
124};
125
126// Declare class Tensor5:
127class Tensor5;
128
142 public:
143 constexpr ConstTensor5View(const ConstTensor5View&) = default;
144 constexpr ConstTensor5View(ConstTensor5View&&) = default;
147
148 // Member functions:
149 [[nodiscard]] Index nshelves() const noexcept { return msr.mextent; }
150 [[nodiscard]] Index nbooks() const noexcept { return mbr.mextent; }
151 [[nodiscard]] Index npages() const noexcept { return mpr.mextent; }
152 [[nodiscard]] Index nrows() const noexcept { return mrr.mextent; }
153 [[nodiscard]] Index ncols() const noexcept { return mcr.mextent; }
154
155 // Total size
156 [[nodiscard]] Index size() const noexcept {
157 return nshelves() * nbooks() * npages() * nrows() * ncols();
158 }
159 [[nodiscard]] bool empty() const noexcept { return size() == 0; }
160
162 [[nodiscard]] Shape<5> shape() const {
163 return {nshelves(), nbooks(), npages(), nrows(), ncols()};
164 }
165
166 // Const index operators:
168 const Range& b,
169 const Range& p,
170 const Range& r,
171 const Range& c) const;
172
174 const Range& b,
175 const Range& p,
176 const Range& r,
177 Index c) const;
179 const Range& b,
180 const Range& p,
181 Index r,
182 const Range& c) const;
184 const Range& b,
185 Index p,
186 const Range& r,
187 const Range& c) const;
189 Index b,
190 const Range& p,
191 const Range& r,
192 const Range& c) const;
194 const Range& b,
195 const Range& p,
196 const Range& r,
197 const Range& c) const;
198
200 const Range& s, const Range& b, const Range& p, Index r, Index c) const;
202 const Range& s, const Range& b, Index p, const Range& r, Index c) const;
204 const Range& s, const Range& b, Index p, Index r, const Range& c) const;
206 const Range& s, Index b, const Range& p, Index r, const Range& c) const;
208 const Range& s, Index b, const Range& p, const Range& r, Index c) const;
210 const Range& s, Index b, Index p, const Range& r, const Range& c) const;
212 Index s, const Range& b, Index p, const Range& r, const Range& c) const;
214 Index s, const Range& b, const Range& p, Index r, const Range& c) const;
216 Index s, const Range& b, const Range& p, const Range& r, Index c) const;
218 Index s, Index b, const Range& p, const Range& r, const Range& c) const;
219
221 const Range& s, const Range& b, Index p, Index r, Index c) const;
223 const Range& s, Index b, const Range& p, Index r, Index c) const;
225 const Range& s, Index b, Index p, const Range& r, Index c) const;
227 const Range& s, Index b, Index p, Index r, const Range& c) const;
229 Index s, const Range& b, Index p, Index r, const Range& c) const;
231 Index s, const Range& b, Index p, const Range& r, Index c) const;
233 Index s, const Range& b, const Range& p, Index r, Index c) const;
235 Index s, Index b, const Range& p, const Range& r, Index c) const;
237 Index s, Index b, const Range& p, Index r, const Range& c) const;
239 Index s, Index b, Index p, const Range& r, const Range& c) const;
240
242 const Range& s, Index b, Index p, Index r, Index c) const;
244 Index s, const Range& b, Index p, Index r, Index c) const;
246 Index s, Index b, const Range& p, Index r, Index c) const;
248 Index s, Index b, Index p, const Range& r, Index c) const;
250 Index s, Index b, Index p, Index r, const Range& c) const;
251
254 Index b,
255 Index p,
256 Index r,
257 Index c) const { // Check if indices are valid:
258 ARTS_ASSERT(0 <= s);
259 ARTS_ASSERT(0 <= b);
260 ARTS_ASSERT(0 <= p);
261 ARTS_ASSERT(0 <= r);
262 ARTS_ASSERT(0 <= c);
268
269 return get(s, b, p, r, c);
270 }
271
273 [[nodiscard]] Numeric get(Index s, Index b, Index p, Index r, Index c) const {
274 return *(mdata + msr.mstart + s * msr.mstride + mbr.mstart +
275 b * mbr.mstride + mpr.mstart + p * mpr.mstride + mrr.mstart +
276 r * mrr.mstride + mcr.mstart + c * mcr.mstride);
277 }
278
279 // Functions returning iterators:
280 [[nodiscard]] ConstIterator5D begin() const;
281 [[nodiscard]] ConstIterator5D end() const;
282
284 virtual ~ConstTensor5View() = default;
285
286 // Friends:
287 friend class Tensor5View;
288 friend class ConstIterator6D;
289 friend class ConstTensor6View;
290 friend class ConstTensor7View;
291
292 // Special constructor to make a Tensor5 view of a Tensor4.
294
295 protected:
296 // Constructors:
297 ConstTensor5View() = default;
299 const Range& s,
300 const Range& b,
301 const Range& p,
302 const Range& r,
303 const Range& c);
305 const Range& ps,
306 const Range& pb,
307 const Range& pp,
308 const Range& pr,
309 const Range& pc,
310 const Range& ns,
311 const Range& nb,
312 const Range& np,
313 const Range& nr,
314 const Range& nc);
315
316 // Data members:
317 // -------------
319 Range msr{0, 0, 1};
321 Range mbr{0, 0, 1};
323 Range mpr{0, 0, 1};
325 Range mrr{0, 0, 1};
327 Range mcr{0, 0, 1};
329 Numeric* mdata{nullptr};
330};
331
342 public:
343 // Make const methods visible from base class
346 using ConstTensor5View::operator();
348
349 constexpr Tensor5View(const Tensor5View&) = default;
350
351 // Non-const index operators:
352
354 const Range& b,
355 const Range& p,
356 const Range& r,
357 const Range& c);
358
360 const Range& s, const Range& b, const Range& p, const Range& r, Index c);
362 const Range& s, const Range& b, const Range& p, Index r, const Range& c);
364 const Range& s, const Range& b, Index p, const Range& r, const Range& c);
366 const Range& s, Index b, const Range& p, const Range& r, const Range& c);
368 Index s, const Range& b, const Range& p, const Range& r, const Range& c);
369
371 const Range& s, const Range& b, const Range& p, Index r, Index c);
373 const Range& s, const Range& b, Index p, const Range& r, Index c);
375 const Range& s, const Range& b, Index p, Index r, const Range& c);
377 const Range& s, Index b, const Range& p, Index r, const Range& c);
379 const Range& s, Index b, const Range& p, const Range& r, Index c);
381 const Range& s, Index b, Index p, const Range& r, const Range& c);
383 Index s, const Range& b, Index p, const Range& r, const Range& c);
385 Index s, const Range& b, const Range& p, Index r, const Range& c);
387 Index s, const Range& b, const Range& p, const Range& r, Index c);
389 Index s, Index b, const Range& p, const Range& r, const Range& c);
390
392 const Range& s, const Range& b, Index p, Index r, Index c);
394 const Range& s, Index b, const Range& p, Index r, Index c);
396 const Range& s, Index b, Index p, const Range& r, Index c);
398 const Range& s, Index b, Index p, Index r, const Range& c);
400 Index s, const Range& b, Index p, Index r, const Range& c);
402 Index s, const Range& b, Index p, const Range& r, Index c);
404 Index s, const Range& b, const Range& p, Index r, Index c);
406 Index s, Index b, const Range& p, const Range& r, Index c);
408 Index s, Index b, const Range& p, Index r, const Range& c);
410 Index s, Index b, Index p, const Range& r, const Range& c);
411
412 VectorView operator()(const Range& s, Index b, Index p, Index r, Index c);
413 VectorView operator()(Index s, const Range& b, Index p, Index r, Index c);
414 VectorView operator()(Index s, Index b, const Range& p, Index r, Index c);
415 VectorView operator()(Index s, Index b, Index p, const Range& r, Index c);
416 VectorView operator()(Index s, Index b, Index p, Index r, const Range& c);
417
420 Index b,
421 Index p,
422 Index r,
423 Index c) { // Check if indices are valid:
424 ARTS_ASSERT(0 <= s);
425 ARTS_ASSERT(0 <= b);
426 ARTS_ASSERT(0 <= p);
427 ARTS_ASSERT(0 <= r);
428 ARTS_ASSERT(0 <= c);
434
435 return get(s, b, p, r, c);
436 }
437
440 return *(mdata + msr.mstart + s * msr.mstride + mbr.mstart +
441 b * mbr.mstride + mpr.mstart + p * mpr.mstride + mrr.mstart +
442 r * mrr.mstride + mcr.mstart + c * mcr.mstride);
443 }
444
445 // Conversion to a plain C-array
446 [[nodiscard]] const Numeric* get_c_array() const ARTS_NOEXCEPT;
448
449 // Functions returning iterators:
451 Iterator5D end();
452
453 // Assignment operators:
454 Tensor5View& operator=(const ConstTensor5View& v);
455 Tensor5View& operator=(const Tensor5View& v);
456 Tensor5View& operator=(const Tensor5& v);
457 Tensor5View& operator=(Numeric x);
458
459 // Other operators:
460 Tensor5View& operator*=(Numeric x);
461 Tensor5View& operator/=(Numeric x);
462 Tensor5View& operator+=(Numeric x);
463 Tensor5View& operator-=(Numeric x);
464
465 Tensor5View& operator*=(const ConstTensor5View& x);
466 Tensor5View& operator/=(const ConstTensor5View& x);
467 Tensor5View& operator+=(const ConstTensor5View& x);
468 Tensor5View& operator-=(const ConstTensor5View& x);
469
471 virtual ~Tensor5View() = default;
472
473 // Friends:
474 // friend class VectorView;
475 // friend ConstTensor5View transpose(ConstTensor5View m);
476 // friend Tensor5View transpose(Tensor5View m);
477 friend class Iterator6D;
478 friend class Tensor6View;
479 friend class Tensor7View;
480
481 // Special constructor to make a Tensor5 view of a Tensor4.
482 Tensor5View(const Tensor4View& a);
483
484 protected:
485 // Constructors:
486 Tensor5View() = default;
487 Tensor5View(Numeric* data,
488 const Range& s,
489 const Range& b,
490 const Range& p,
491 const Range& r,
492 const Range& c);
493 Tensor5View(Numeric* data,
494 const Range& ps,
495 const Range& pb,
496 const Range& pp,
497 const Range& pr,
498 const Range& pc,
499 const Range& ns,
500 const Range& nb,
501 const Range& np,
502 const Range& nr,
503 const Range& nc);
504};
505
514class Tensor5 : public Tensor5View {
515 public:
516 // Constructors:
517 Tensor5() = default;
518 Tensor5(Index s, Index b, Index p, Index r, Index c);
519 Tensor5(Index s, Index b, Index p, Index r, Index c, Numeric fill);
520 Tensor5(const ConstTensor5View& v);
521 Tensor5(const Tensor5& v);
522 Tensor5(Tensor5&& v) noexcept : Tensor5View(std::forward<Tensor5View>(v)) {
523 v.mdata = nullptr;
524 }
525
539 const Range& r0,
540 const Range& r1,
541 const Range& r2,
542 const Range& r3,
543 const Range& r4) ARTS_NOEXCEPT : Tensor5View(d, r0, r1, r2, r3, r4) {
544 ARTS_ASSERT(not(r0.get_extent() < 0), "Must have size");
545 ARTS_ASSERT(not(r1.get_extent() < 0), "Must have size");
546 ARTS_ASSERT(not(r2.get_extent() < 0), "Must have size");
547 ARTS_ASSERT(not(r3.get_extent() < 0), "Must have size");
548 ARTS_ASSERT(not(r4.get_extent() < 0), "Must have size");
549 }
550
551 // Assignment operators:
552 Tensor5& operator=(const Tensor5& x);
553 Tensor5& operator=(Tensor5&& x) noexcept;
555
556 // Resize function:
557 void resize(Index s, Index b, Index p, Index r, Index c);
558
559 // Swap function:
560 friend void swap(Tensor5& t1, Tensor5& t2);
561
562 // Destructor:
563 virtual ~Tensor5();
564
566 template <std::size_t dim0>
568 static_assert(dim0 < 5, "Bad Dimension, Out-of-Bounds");
569
570 Range r0(0,
571 dim0 == 0 ? nshelves()
572 : dim0 == 1 ? nbooks()
573 : dim0 == 2 ? npages()
574 : dim0 == 3 ? nrows()
575 : ncols());
576
577 Vector out(mdata, r0);
578 ARTS_ASSERT(size() == out.size(),
579 "Can only reduce size on same size input");
580 mdata = nullptr;
581 return out;
582 }
583
585 template <std::size_t dim0, std::size_t dim1>
587 static_assert(dim1 < 5, "Bad Dimension, Out-of-Bounds");
588 static_assert(dim0 < dim1, "Bad Dimensions, dim1 must be larger than dim0");
589
590 const Range r1(0,
591 dim1 == 1 ? nbooks()
592 : dim1 == 2 ? npages()
593 : dim1 == 3 ? nrows()
594 : ncols());
595 const Range r0(0,
596 dim0 == 0 ? nshelves()
597 : dim0 == 1 ? nbooks()
598 : dim0 == 2 ? npages()
599 : nrows(),
600 r1.get_extent());
601
602 Matrix out(mdata, r0, r1);
603 ARTS_ASSERT(size() == out.size(),
604 "Can only reduce size on same size input");
605 mdata = nullptr;
606 return out;
607 }
608
610 template <std::size_t dim0, std::size_t dim1, std::size_t dim2>
612 static_assert(dim2 < 5, "Bad Dimension, Out-of-Bounds");
613 static_assert(dim0 < dim1, "Bad Dimensions, dim1 must be larger than dim0");
614 static_assert(dim1 < dim2, "Bad Dimensions, dim2 must be larger than dim1");
615
616 const Range r2(0, dim2 == 2 ? npages() : dim2 == 3 ? nrows() : ncols());
617 const Range r1(0,
618 dim1 == 1 ? nbooks()
619 : dim1 == 2 ? npages()
620 : nrows(),
621 r2.get_extent());
622 const Range r0(0,
623 dim0 == 0 ? nshelves()
624 : dim0 == 1 ? nbooks()
625 : npages(),
626 r1.get_extent() * r2.get_extent());
627
628 Tensor3 out(mdata, r0, r1, r2);
629 ARTS_ASSERT(size() == out.size(),
630 "Can only reduce size on same size input");
631 mdata = nullptr;
632 return out;
633 }
634
636 template <std::size_t dim0,
637 std::size_t dim1,
638 std::size_t dim2,
639 std::size_t dim3>
641 static_assert(dim3 < 5, "Bad Dimension, Out-of-Bounds");
642 static_assert(dim0 < dim1, "Bad Dimensions, dim1 must be larger than dim0");
643 static_assert(dim1 < dim2, "Bad Dimensions, dim2 must be larger than dim1");
644 static_assert(dim2 < dim3, "Bad Dimensions, dim3 must be larger than dim2");
645
646 const Range r3(0, dim3 == 3 ? nrows() : ncols());
647 const Range r2(0, dim2 == 2 ? npages() : nrows(), r3.get_extent());
648 const Range r1(
649 0, dim1 == 1 ? nbooks() : npages(), r2.get_extent() * r3.get_extent());
650 const Range r0(0,
651 dim0 == 0 ? nshelves() : nbooks(),
652 r1.get_extent() * r2.get_extent() * r3.get_extent());
653
654 Tensor4 out(mdata, r0, r1, r2, r3);
655 ARTS_ASSERT(size() == out.size(),
656 "Can only reduce size on same size input");
657 mdata = nullptr;
658 return out;
659 }
660
661 template <class F>
662 void transform_elementwise(F&& func) {
663 std::transform(mdata, mdata + size(), mdata, func);
664 }
665};
666
667// Function declarations:
668// ----------------------
669
670void copy(ConstIterator5D origin,
671 const ConstIterator5D& end,
672 Iterator5D target);
673
674void copy(Numeric x, Iterator5D target, const Iterator5D& end);
675
676void transform(Tensor5View y, double (&my_func)(double), ConstTensor5View x);
677
679
681
682std::ostream& operator<<(std::ostream& os, const ConstTensor5View& v);
683
685// Helper function for debugging
686#ifndef NDEBUG
687
689 Tensor5View& tv, Index s, Index b, Index p, Index r, Index c);
690
691#endif
693
694#endif // matpackV_h
Const version of Iterator5D.
Definition: matpackV.h:84
bool operator!=(const ConstIterator5D &other) const
Not equal operator, needed for algorithms like copy.
Definition: matpackV.h:103
ConstIterator5D & operator++()
Prefix increment operator.
Definition: matpackV.h:97
Index mstride
Stride.
Definition: matpackV.h:123
ConstIterator5D(const ConstTensor4View &x, Index stride)
Explicit constructor.
Definition: matpackV.h:91
const ConstTensor4View * operator->() const
The -> operator is needed, so that we can write i->begin() to get the 4D iterators.
Definition: matpackV.h:114
const ConstTensor4View & operator*() const
Dereferencing.
Definition: matpackV.h:117
ConstTensor4View msv
Current position.
Definition: matpackV.h:121
ConstIterator5D()=default
Default constructor.
Const version of Iterator6D.
Definition: matpackVI.h:86
A constant view of a Matrix.
Definition: matpackI.h:1050
Index size() const noexcept
Definition: matpackI.h:1065
A constant view of a Tensor3.
Definition: matpackIII.h:130
Index size() const noexcept
Definition: matpackIII.h:149
A constant view of a Tensor4.
Definition: matpackIV.h:131
Range mrr
The row range of mdata that is actually used.
Definition: matpackIV.h:274
Range mbr
The book range of mdata that is actually used.
Definition: matpackIV.h:270
Index size() const noexcept
Definition: matpackIV.h:145
Range mcr
The column range of mdata that is actually used.
Definition: matpackIV.h:276
Numeric * mdata
Pointer to the plain C array that holds the data.
Definition: matpackIV.h:278
Range mpr
The page range of mdata that is actually used.
Definition: matpackIV.h:272
A constant view of a Tensor5.
Definition: matpackV.h:141
virtual ~ConstTensor5View()=default
Destructor.
constexpr ConstTensor5View(ConstTensor5View &&)=default
Numeric get(Index s, Index b, Index p, Index r, Index c) const
Get element implementation without assertions.
Definition: matpackV.h:273
Index nrows() const noexcept
Definition: matpackV.h:152
ConstTensor5View operator()(const Range &s, const Range &b, const Range &p, const Range &r, const Range &c) const
Const index operator for subrange.
Definition: matpackV.cc:37
Index ncols() const noexcept
Definition: matpackV.h:153
Range mpr
The page range of mdata that is actually used.
Definition: matpackV.h:323
Range mcr
The column range of mdata that is actually used.
Definition: matpackV.h:327
constexpr ConstTensor5View(const ConstTensor5View &)=default
ConstTensor5View()=default
Numeric * mdata
Pointer to the plain C array that holds the data.
Definition: matpackV.h:329
Index npages() const noexcept
Definition: matpackV.h:151
ConstTensor5View & operator=(ConstTensor5View &&)=default
ConstIterator5D end() const
Return const iterator behind last shelf.
Definition: matpackV.cc:694
ConstTensor5View & operator=(const ConstTensor5View &)=default
Index size() const noexcept
Definition: matpackV.h:156
Shape< 5 > shape() const
Definition: matpackV.h:162
Range mbr
The book range of mdata that is actually used.
Definition: matpackV.h:321
Range msr
The shelf range of mdata that is actually used.
Definition: matpackV.h:319
Numeric operator()(Index s, Index b, Index p, Index r, Index c) const
Plain const index operator.
Definition: matpackV.h:253
Range mrr
The row range of mdata that is actually used.
Definition: matpackV.h:325
Index nbooks() const noexcept
Definition: matpackV.h:150
Index nshelves() const noexcept
Definition: matpackV.h:149
bool empty() const noexcept
Definition: matpackV.h:159
ConstIterator5D begin() const
Return const iterator to first shelf.
Definition: matpackV.cc:688
A constant view of a Tensor6.
Definition: matpackVI.h:147
A constant view of a Tensor7.
Definition: matpackVII.h:145
A constant view of a Vector.
Definition: matpackI.h:517
Index size() const noexcept
Definition: matpackI.h:544
Implementation of Tensors of Rank 5.
Definition: matpackV.h:38
Tensor4View & operator*()
Dereferencing.
Definition: matpackV.h:74
Iterator5D()=default
Default constructor.
bool operator!=(const Iterator5D &other) const
Not equal operator, needed for algorithms like copy.
Definition: matpackV.h:60
Tensor4View msv
Current position.
Definition: matpackV.h:78
Tensor4View * operator->()
The -> operator is needed, so that we can write i->begin() to get the 4D iterators.
Definition: matpackV.h:71
Index mstride
Stride.
Definition: matpackV.h:80
Iterator5D & operator++()
Prefix increment operator.
Definition: matpackV.h:54
Iterator5D(const Tensor4View &x, Index stride)
Explicit constructor.
Definition: matpackV.h:48
The outermost iterator class for rank 6 tensors.
Definition: matpackVI.h:40
The MatrixView class.
Definition: matpackI.h:1169
The Matrix class.
Definition: matpackI.h:1270
The range class.
Definition: matpackI.h:166
Index mstart
The start index.
Definition: matpackI.h:368
constexpr Index get_extent() const noexcept
Returns the extent of the range.
Definition: matpackI.h:349
Index mstride
The stride.
Definition: matpackI.h:377
Index mextent
The number of elements.
Definition: matpackI.h:375
The Tensor3View class.
Definition: matpackIII.h:244
The Tensor3 class.
Definition: matpackIII.h:344
The Tensor4View class.
Definition: matpackIV.h:290
The Tensor4 class.
Definition: matpackIV.h:427
The Tensor5View class.
Definition: matpackV.h:341
Numeric & get(Index s, Index b, Index p, Index r, Index c)
Get element implementation without assertions.
Definition: matpackV.h:439
const Numeric * get_c_array() const ARTS_NOEXCEPT
Conversion to plain C-array.
Definition: matpackV.cc:662
Iterator5D end()
Return iterator behind last shelf.
Definition: matpackV.cc:1360
Numeric & operator()(Index s, Index b, Index p, Index r, Index c)
Plain const index operator.
Definition: matpackV.h:419
Tensor5View operator()(const Range &s, const Range &b, const Range &p, const Range &r, const Range &c)
Index operator for subrange.
Definition: matpackV.cc:780
Iterator5D begin()
Return iterator to first shelf.
Definition: matpackV.cc:1354
Tensor5View()=default
Tensor5View & operator=(const ConstTensor5View &v)
Assignment operator.
Definition: matpackV.cc:1371
constexpr Tensor5View(const Tensor5View &)=default
The Tensor5 class.
Definition: matpackV.h:514
Matrix reduce_rank() &&ARTS_NOEXCEPT
Definition: matpackV.h:586
Tensor5()=default
Tensor5(Numeric *d, const Range &r0, const Range &r1, const Range &r2, const Range &r3, const Range &r4) ARTS_NOEXCEPT
Definition: matpackV.h:538
Tensor5(Tensor5 &&v) noexcept
Definition: matpackV.h:522
Tensor4 reduce_rank() &&ARTS_NOEXCEPT
Definition: matpackV.h:640
void transform_elementwise(F &&func)
Definition: matpackV.h:662
Vector reduce_rank() &&ARTS_NOEXCEPT
Definition: matpackV.h:567
Tensor3 reduce_rank() &&ARTS_NOEXCEPT
Definition: matpackV.h:611
The Tensor6View class.
Definition: matpackVI.h:630
The Tensor7View class.
Definition: matpackVII.h:1301
The VectorView class.
Definition: matpackI.h:658
The Vector class.
Definition: matpackI.h:908
#define ARTS_NOEXCEPT
Definition: debug.h:80
#define ARTS_ASSERT(condition,...)
Definition: debug.h:83
#define ns
Numeric max(const ConstTensor5View &x)
Max function, tensor version.
Definition: matpackV.cc:1827
void copy(ConstIterator5D origin, const ConstIterator5D &end, Iterator5D target)
Copy data between begin and end to target.
Definition: matpackV.cc:1591
void transform(Tensor5View y, double(&my_func)(double), ConstTensor5View x)
A generic transform function for tensors, which can be used to implement mathematical functions opera...
Definition: matpackV.cc:1808
Numeric debug_tensor5view_get_elem(Tensor5View &tv, Index s, Index b, Index p, Index r, Index c)
Helper function to access tensor elements.
Definition: matpackV.cc:1884
Numeric min(const ConstTensor5View &x)
Min function, tensor version.
Definition: matpackV.cc:1846
std::ostream & operator<<(std::ostream &os, const ConstTensor5View &v)
Output operator.
Definition: matpackV.cc:756
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
void swap(ComplexVector &v1, ComplexVector &v2)
Swaps two objects.
constexpr Numeric r0
The reference radius in IGRF13.
Definition: igrf13.cc:203
#define d
#define v
#define a
#define c
#define b
Helper shape class.
Definition: matpackI.h:382