ARTS 2.5.4 (git: 31ce4f0e)
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 friend std::ostream& operator<<(std::ostream& os, const ConstTensor5View& v);
293
294 // Special constructor to make a Tensor5 view of a Tensor4.
296
297 protected:
298 // Constructors:
299 ConstTensor5View() = default;
301 const Range& s,
302 const Range& b,
303 const Range& p,
304 const Range& r,
305 const Range& c);
307 const Range& ps,
308 const Range& pb,
309 const Range& pp,
310 const Range& pr,
311 const Range& pc,
312 const Range& ns,
313 const Range& nb,
314 const Range& np,
315 const Range& nr,
316 const Range& nc);
317
318 // Data members:
319 // -------------
321 Range msr{0, 0, 1};
323 Range mbr{0, 0, 1};
325 Range mpr{0, 0, 1};
327 Range mrr{0, 0, 1};
329 Range mcr{0, 0, 1};
331 Numeric* mdata{nullptr};
332};
333
344 public:
345 // Make const methods visible from base class
348 using ConstTensor5View::operator();
350
351 constexpr Tensor5View(const Tensor5View&) = default;
352
353 // Non-const index operators:
354
356 const Range& b,
357 const Range& p,
358 const Range& r,
359 const Range& c);
360
362 const Range& s, const Range& b, const Range& p, const Range& r, Index c);
364 const Range& s, const Range& b, const Range& p, Index r, const Range& c);
366 const Range& s, const Range& b, Index p, const Range& r, const Range& c);
368 const Range& s, Index b, const Range& p, const Range& r, const Range& c);
370 Index s, const Range& b, const Range& p, const Range& r, const Range& c);
371
373 const Range& s, const Range& b, const Range& p, Index r, Index c);
375 const Range& s, const Range& b, Index p, const Range& r, Index c);
377 const Range& s, const Range& b, Index p, Index r, const Range& c);
379 const Range& s, Index b, const Range& p, Index r, const Range& c);
381 const Range& s, Index b, const Range& p, const Range& r, Index c);
383 const Range& s, Index b, Index p, const Range& r, const Range& c);
385 Index s, const Range& b, Index p, const Range& r, const Range& c);
387 Index s, const Range& b, const Range& p, Index r, const Range& c);
389 Index s, const Range& b, const Range& p, const Range& r, Index c);
391 Index s, Index b, const Range& p, const Range& r, const Range& c);
392
394 const Range& s, const Range& b, Index p, Index r, Index c);
396 const Range& s, Index b, const Range& p, Index r, Index c);
398 const Range& s, Index b, Index p, const Range& r, Index c);
400 const Range& s, Index b, Index p, Index r, const Range& c);
402 Index s, const Range& b, Index p, Index r, const Range& c);
404 Index s, const Range& b, Index p, const Range& r, Index c);
406 Index s, const Range& b, const Range& p, Index r, Index c);
408 Index s, Index b, const Range& p, const Range& r, Index c);
410 Index s, Index b, const Range& p, Index r, const Range& c);
412 Index s, Index b, Index p, const Range& r, const Range& c);
413
414 VectorView operator()(const Range& s, Index b, Index p, Index r, Index c);
415 VectorView operator()(Index s, const Range& b, Index p, Index r, Index c);
416 VectorView operator()(Index s, Index b, const Range& p, Index r, Index c);
417 VectorView operator()(Index s, Index b, Index p, const Range& r, Index c);
418 VectorView operator()(Index s, Index b, Index p, Index r, const Range& c);
419
422 Index b,
423 Index p,
424 Index r,
425 Index c) { // Check if indices are valid:
426 ARTS_ASSERT(0 <= s);
427 ARTS_ASSERT(0 <= b);
428 ARTS_ASSERT(0 <= p);
429 ARTS_ASSERT(0 <= r);
430 ARTS_ASSERT(0 <= c);
436
437 return get(s, b, p, r, c);
438 }
439
442 return *(mdata + msr.mstart + s * msr.mstride + mbr.mstart +
443 b * mbr.mstride + mpr.mstart + p * mpr.mstride + mrr.mstart +
444 r * mrr.mstride + mcr.mstart + c * mcr.mstride);
445 }
446
447 // Conversion to a plain C-array
448 [[nodiscard]] const Numeric* get_c_array() const ARTS_NOEXCEPT;
450
451 // Functions returning iterators:
453 Iterator5D end();
454
455 // Assignment operators:
456 Tensor5View& operator=(const ConstTensor5View& v);
457 Tensor5View& operator=(const Tensor5View& v);
458 Tensor5View& operator=(const Tensor5& v);
459 Tensor5View& operator=(Numeric x);
460
461 // Other operators:
462 Tensor5View& operator*=(Numeric x);
463 Tensor5View& operator/=(Numeric x);
464 Tensor5View& operator+=(Numeric x);
465 Tensor5View& operator-=(Numeric x);
466
467 Tensor5View& operator*=(const ConstTensor5View& x);
468 Tensor5View& operator/=(const ConstTensor5View& x);
469 Tensor5View& operator+=(const ConstTensor5View& x);
470 Tensor5View& operator-=(const ConstTensor5View& x);
471
473 virtual ~Tensor5View() = default;
474
475 // Friends:
476 // friend class VectorView;
477 // friend ConstTensor5View transpose(ConstTensor5View m);
478 // friend Tensor5View transpose(Tensor5View m);
479 friend class Iterator6D;
480 friend class Tensor6View;
481 friend class Tensor7View;
482
483 // Special constructor to make a Tensor5 view of a Tensor4.
484 Tensor5View(const Tensor4View& a);
485
486 protected:
487 // Constructors:
488 Tensor5View() = default;
489 Tensor5View(Numeric* data,
490 const Range& s,
491 const Range& b,
492 const Range& p,
493 const Range& r,
494 const Range& c);
495 Tensor5View(Numeric* data,
496 const Range& ps,
497 const Range& pb,
498 const Range& pp,
499 const Range& pr,
500 const Range& pc,
501 const Range& ns,
502 const Range& nb,
503 const Range& np,
504 const Range& nr,
505 const Range& nc);
506};
507
516class Tensor5 : public Tensor5View {
517 public:
518 // Constructors:
519 Tensor5() = default;
520 Tensor5(Index s, Index b, Index p, Index r, Index c);
521 Tensor5(Index s, Index b, Index p, Index r, Index c, Numeric fill);
522 Tensor5(const ConstTensor5View& v);
523 Tensor5(const Tensor5& v);
524 Tensor5(Tensor5&& v) noexcept : Tensor5View(std::forward<Tensor5View>(v)) {
525 v.mdata = nullptr;
526 }
527
541 const Range& r0,
542 const Range& r1,
543 const Range& r2,
544 const Range& r3,
545 const Range& r4) ARTS_NOEXCEPT : Tensor5View(d, r0, r1, r2, r3, r4) {
546 ARTS_ASSERT(not(r0.get_extent() < 0), "Must have size");
547 ARTS_ASSERT(not(r1.get_extent() < 0), "Must have size");
548 ARTS_ASSERT(not(r2.get_extent() < 0), "Must have size");
549 ARTS_ASSERT(not(r3.get_extent() < 0), "Must have size");
550 ARTS_ASSERT(not(r4.get_extent() < 0), "Must have size");
551 }
552
553 // Assignment operators:
554 Tensor5& operator=(const Tensor5& x);
555 Tensor5& operator=(Tensor5&& x) noexcept;
557
558 // Resize function:
559 void resize(Index s, Index b, Index p, Index r, Index c);
560
561 // Swap function:
562 friend void swap(Tensor5& t1, Tensor5& t2);
563
564 // Destructor:
565 virtual ~Tensor5();
566
568 template <std::size_t dim0>
570 static_assert(dim0 < 5, "Bad Dimension, Out-of-Bounds");
571
572 Range r0(0,
573 dim0 == 0 ? nshelves()
574 : dim0 == 1 ? nbooks()
575 : dim0 == 2 ? npages()
576 : dim0 == 3 ? nrows()
577 : ncols());
578
579 Vector out(mdata, r0);
580 ARTS_ASSERT(size() == out.size(),
581 "Can only reduce size on same size input");
582 mdata = nullptr;
583 return out;
584 }
585
587 template <std::size_t dim0, std::size_t dim1>
589 static_assert(dim1 < 5, "Bad Dimension, Out-of-Bounds");
590 static_assert(dim0 < dim1, "Bad Dimensions, dim1 must be larger than dim0");
591
592 const Range r1(0,
593 dim1 == 1 ? nbooks()
594 : dim1 == 2 ? npages()
595 : dim1 == 3 ? nrows()
596 : ncols());
597 const Range r0(0,
598 dim0 == 0 ? nshelves()
599 : dim0 == 1 ? nbooks()
600 : dim0 == 2 ? npages()
601 : nrows(),
602 r1.get_extent());
603
604 Matrix out(mdata, r0, r1);
605 ARTS_ASSERT(size() == out.size(),
606 "Can only reduce size on same size input");
607 mdata = nullptr;
608 return out;
609 }
610
612 template <std::size_t dim0, std::size_t dim1, std::size_t dim2>
614 static_assert(dim2 < 5, "Bad Dimension, Out-of-Bounds");
615 static_assert(dim0 < dim1, "Bad Dimensions, dim1 must be larger than dim0");
616 static_assert(dim1 < dim2, "Bad Dimensions, dim2 must be larger than dim1");
617
618 const Range r2(0, dim2 == 2 ? npages() : dim2 == 3 ? nrows() : ncols());
619 const Range r1(0,
620 dim1 == 1 ? nbooks()
621 : dim1 == 2 ? npages()
622 : nrows(),
623 r2.get_extent());
624 const Range r0(0,
625 dim0 == 0 ? nshelves()
626 : dim0 == 1 ? nbooks()
627 : npages(),
628 r1.get_extent() * r2.get_extent());
629
630 Tensor3 out(mdata, r0, r1, r2);
631 ARTS_ASSERT(size() == out.size(),
632 "Can only reduce size on same size input");
633 mdata = nullptr;
634 return out;
635 }
636
638 template <std::size_t dim0,
639 std::size_t dim1,
640 std::size_t dim2,
641 std::size_t dim3>
643 static_assert(dim3 < 5, "Bad Dimension, Out-of-Bounds");
644 static_assert(dim0 < dim1, "Bad Dimensions, dim1 must be larger than dim0");
645 static_assert(dim1 < dim2, "Bad Dimensions, dim2 must be larger than dim1");
646 static_assert(dim2 < dim3, "Bad Dimensions, dim3 must be larger than dim2");
647
648 const Range r3(0, dim3 == 3 ? nrows() : ncols());
649 const Range r2(0, dim2 == 2 ? npages() : nrows(), r3.get_extent());
650 const Range r1(
651 0, dim1 == 1 ? nbooks() : npages(), r2.get_extent() * r3.get_extent());
652 const Range r0(0,
653 dim0 == 0 ? nshelves() : nbooks(),
654 r1.get_extent() * r2.get_extent() * r3.get_extent());
655
656 Tensor4 out(mdata, r0, r1, r2, r3);
657 ARTS_ASSERT(size() == out.size(),
658 "Can only reduce size on same size input");
659 mdata = nullptr;
660 return out;
661 }
662
663 template <class F>
664 void transform_elementwise(F&& func) {
665 std::transform(mdata, mdata + size(), mdata, func);
666 }
667};
668
669// Function declarations:
670// ----------------------
671
672void copy(ConstIterator5D origin,
673 const ConstIterator5D& end,
674 Iterator5D target);
675
676void copy(Numeric x, Iterator5D target, const Iterator5D& end);
677
678void transform(Tensor5View y, double (&my_func)(double), ConstTensor5View x);
679
681
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
696
698
699#endif // matpackV_h
This can be used to make arrays out of anything.
Definition: array.h:48
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:1043
Index size() const noexcept
Definition: matpackI.h:1061
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:276
Range mbr
The book range of mdata that is actually used.
Definition: matpackIV.h:272
Index size() const noexcept
Definition: matpackIV.h:145
Range mcr
The column range of mdata that is actually used.
Definition: matpackIV.h:278
Numeric * mdata
Pointer to the plain C array that holds the data.
Definition: matpackIV.h:280
Range mpr
The page range of mdata that is actually used.
Definition: matpackIV.h:274
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:325
Range mcr
The column range of mdata that is actually used.
Definition: matpackV.h:329
constexpr ConstTensor5View(const ConstTensor5View &)=default
ConstTensor5View()=default
Numeric * mdata
Pointer to the plain C array that holds the data.
Definition: matpackV.h:331
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:323
Range msr
The shelf range of mdata that is actually used.
Definition: matpackV.h:321
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:327
Index nbooks() const noexcept
Definition: matpackV.h:150
Index nshelves() const noexcept
Definition: matpackV.h:149
friend std::ostream & operator<<(std::ostream &os, const ConstTensor5View &v)
Output operator.
Definition: matpackV.cc:756
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:512
Index size() const noexcept
Definition: matpackI.h:539
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:1164
The Matrix class.
Definition: matpackI.h:1261
The range class.
Definition: matpackI.h:159
Index mstart
The start index.
Definition: matpackI.h:367
constexpr Index get_extent() const noexcept
Returns the extent of the range.
Definition: matpackI.h:342
Index mstride
The stride.
Definition: matpackI.h:372
Index mextent
The number of elements.
Definition: matpackI.h:370
The Tensor3View class.
Definition: matpackIII.h:246
The Tensor3 class.
Definition: matpackIII.h:346
The Tensor4View class.
Definition: matpackIV.h:292
The Tensor4 class.
Definition: matpackIV.h:429
The Tensor5View class.
Definition: matpackV.h:343
Numeric & get(Index s, Index b, Index p, Index r, Index c)
Get element implementation without assertions.
Definition: matpackV.h:441
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:421
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:516
Matrix reduce_rank() &&ARTS_NOEXCEPT
Definition: matpackV.h:588
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:540
Tensor5(Tensor5 &&v) noexcept
Definition: matpackV.h:524
Tensor4 reduce_rank() &&ARTS_NOEXCEPT
Definition: matpackV.h:642
void transform_elementwise(F &&func)
Definition: matpackV.h:664
Vector reduce_rank() &&ARTS_NOEXCEPT
Definition: matpackV.h:569
Tensor3 reduce_rank() &&ARTS_NOEXCEPT
Definition: matpackV.h:613
The Tensor6View class.
Definition: matpackVI.h:632
The Tensor7View class.
Definition: matpackVII.h:1303
The VectorView class.
Definition: matpackI.h:663
The Vector class.
Definition: matpackI.h:899
#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
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
Helper shape class.
Definition: matpackI.h:377
#define d
#define v
#define a
#define c
#define b