ARTS 2.5.4 (git: 4c0d3b4d)
matpackV.cc
Go to the documentation of this file.
1/* Copyright (C) 2002-2012 Stefan Buehler <sbuehler@ltu.se>
2
3 This program is free software; you can redistribute it and/or modify it
4 under the terms of the GNU General Public License as published by the
5 Free Software Foundation; either version 2, or (at your option) any
6 later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
16 USA. */
17
25#include "matpackV.h"
26
27#include "exceptions.h"
28
29using std::runtime_error;
30
31// Functions for ConstTensor5View:
32// ------------------------------
33
38 const Range& b,
39 const Range& p,
40 const Range& r,
41 const Range& c) const {
42 return ConstTensor5View(mdata, msr, mbr, mpr, mrr, mcr, s, b, p, r, c);
43}
44
48 const Range& b,
49 const Range& p,
50 const Range& r,
51 Index c) const {
52 // Check that c is valid:
53 ARTS_ASSERT(0 <= c);
55
56 return ConstTensor4View(
57 mdata + mcr.mstart + c * mcr.mstride, msr, mbr, mpr, mrr, s, b, p, r);
58}
59
63 const Range& b,
64 const Range& p,
65 Index r,
66 const Range& c) const {
67 // Check that r is valid:
68 ARTS_ASSERT(0 <= r);
70
71 return ConstTensor4View(
72 mdata + mrr.mstart + r * mrr.mstride, msr, mbr, mpr, mcr, s, b, p, c);
73}
74
78 const Range& b,
79 Index p,
80 const Range& r,
81 const Range& c) const {
82 // Check that p is valid:
83 ARTS_ASSERT(0 <= p);
85
86 return ConstTensor4View(
87 mdata + mpr.mstart + p * mpr.mstride, msr, mbr, mrr, mcr, s, b, r, c);
88}
89
93 Index b,
94 const Range& p,
95 const Range& r,
96 const Range& c) const {
97 // Check that b is valid:
98 ARTS_ASSERT(0 <= b);
100
101 return ConstTensor4View(
102 mdata + mbr.mstart + b * mbr.mstride, msr, mpr, mrr, mcr, s, p, r, c);
103}
104
108 const Range& b,
109 const Range& p,
110 const Range& r,
111 const Range& c) const {
112 // Check that s is valid:
113 ARTS_ASSERT(0 <= s);
115
116 return ConstTensor4View(
117 mdata + msr.mstart + s * msr.mstride, mbr, mpr, mrr, mcr, b, p, r, c);
118}
119
123 const Range& s, const Range& b, const Range& p, Index r, Index c) const {
124 // Check that r and c is valid:
125 ARTS_ASSERT(0 <= r);
126 ARTS_ASSERT(0 <= c);
129
130 return ConstTensor3View(
132 msr,
133 mbr,
134 mpr,
135 s,
136 b,
137 p);
138}
139
143 const Range& s, const Range& b, Index p, const Range& r, Index c) const {
144 // Check that p and c are valid:
145 ARTS_ASSERT(0 <= p);
146 ARTS_ASSERT(0 <= c);
149
150 return ConstTensor3View(
152 msr,
153 mbr,
154 mrr,
155 s,
156 b,
157 r);
158}
159
163 const Range& s, const Range& b, Index p, Index r, const Range& c) const {
164 // Check that p and r are valid:
165 ARTS_ASSERT(0 <= p);
166 ARTS_ASSERT(0 <= r);
169
170 return ConstTensor3View(
171 mdata + mpr.mstart + p * mpr.mstride + mrr.mstart + r * mrr.mstride,
172 msr,
173 mbr,
174 mcr,
175 s,
176 b,
177 c);
178}
179
183 const Range& s, Index b, const Range& p, Index r, const Range& c) const {
184 // Check that b and r are valid:
185 ARTS_ASSERT(0 <= b);
186 ARTS_ASSERT(0 <= r);
189
190 return ConstTensor3View(
192 msr,
193 mpr,
194 mcr,
195 s,
196 p,
197 c);
198}
199
203 const Range& s, Index b, const Range& p, const Range& r, Index c) const {
204 // Check that b and c are valid:
205 ARTS_ASSERT(0 <= b);
206 ARTS_ASSERT(0 <= c);
209
210 return ConstTensor3View(
212 msr,
213 mpr,
214 mrr,
215 s,
216 p,
217 r);
218}
219
223 const Range& s, Index b, Index p, const Range& r, const Range& c) const {
224 // Check that b and p are valid:
225 ARTS_ASSERT(0 <= b);
226 ARTS_ASSERT(0 <= p);
229
230 return ConstTensor3View(
232 msr,
233 mrr,
234 mcr,
235 s,
236 r,
237 c);
238}
239
243 Index s, const Range& b, Index p, const Range& r, const Range& c) const {
244 // Check that s and p are valid:
245 ARTS_ASSERT(0 <= s);
246 ARTS_ASSERT(0 <= p);
249
250 return ConstTensor3View(
251 mdata + msr.mstart + s * msr.mstride + mpr.mstart + p * mpr.mstride,
252 mbr,
253 mrr,
254 mcr,
255 b,
256 r,
257 c);
258}
259
263 Index s, const Range& b, const Range& p, Index r, const Range& c) const {
264 // Check that s and r are valid:
265 ARTS_ASSERT(0 <= s);
266 ARTS_ASSERT(0 <= r);
269
270 return ConstTensor3View(
271 mdata + msr.mstart + s * msr.mstride + mrr.mstart + r * mrr.mstride,
272 mbr,
273 mpr,
274 mcr,
275 b,
276 p,
277 c);
278}
279
283 Index s, const Range& b, const Range& p, const Range& r, Index c) const {
284 // Check that s and c are valid:
285 ARTS_ASSERT(0 <= s);
286 ARTS_ASSERT(0 <= c);
289
290 return ConstTensor3View(
292 mbr,
293 mpr,
294 mrr,
295 b,
296 p,
297 r);
298}
299
303 Index s, Index b, const Range& p, const Range& r, const Range& c) const {
304 // Check that s and b are valid:
305 ARTS_ASSERT(0 <= s);
306 ARTS_ASSERT(0 <= b);
309
310 return ConstTensor3View(
312 mpr,
313 mrr,
314 mcr,
315 p,
316 r,
317 c);
318}
319
323 const Range& s, const Range& b, Index p, Index r, Index c) const {
324 // Check that p, r and c are valid:
325 ARTS_ASSERT(0 <= p);
326 ARTS_ASSERT(0 <= r);
327 ARTS_ASSERT(0 <= c);
331
333 r * mrr.mstride + mcr.mstart + c * mcr.mstride,
334 msr,
335 mbr,
336 s,
337 b);
338}
339
343 const Range& s, Index b, const Range& p, Index r, Index c) const {
344 // Check that b, r and c are valid:
345 ARTS_ASSERT(0 <= b);
346 ARTS_ASSERT(0 <= r);
347 ARTS_ASSERT(0 <= c);
351
353 r * mpr.mstride + mcr.mstart + c * mcr.mstride,
354 msr,
355 mpr,
356 s,
357 p);
358}
359
363 const Range& s, Index b, Index p, const Range& r, Index c) const {
364 // Check that b, p and c are valid:
365 ARTS_ASSERT(0 <= b);
366 ARTS_ASSERT(0 <= p);
367 ARTS_ASSERT(0 <= c);
371
373 p * mpr.mstride + mcr.mstart + c * mcr.mstride,
374 msr,
375 mrr,
376 s,
377 r);
378}
379
383 const Range& s, Index b, Index p, Index r, const Range& c) const {
384 // Check that b, p and r are valid:
385 ARTS_ASSERT(0 <= b);
386 ARTS_ASSERT(0 <= p);
387 ARTS_ASSERT(0 <= r);
391
393 p * mpr.mstride + mrr.mstart + r * mrr.mstride,
394 msr,
395 mcr,
396 s,
397 c);
398}
399
403 Index s, const Range& b, Index p, Index r, const Range& c) const {
404 // Check that s, p and r are valid:
405 ARTS_ASSERT(0 <= s);
406 ARTS_ASSERT(0 <= p);
407 ARTS_ASSERT(0 <= r);
411
413 p * mpr.mstride + mrr.mstart + r * mrr.mstride,
414 mbr,
415 mcr,
416 b,
417 c);
418}
419
423 Index s, const Range& b, Index p, const Range& r, Index c) const {
424 // Check that s, p and c are valid:
425 ARTS_ASSERT(0 <= s);
426 ARTS_ASSERT(0 <= p);
427 ARTS_ASSERT(0 <= c);
431
433 p * mpr.mstride + mcr.mstart + c * mcr.mstride,
434 mbr,
435 mrr,
436 b,
437 r);
438}
439
443 Index s, const Range& b, const Range& p, Index r, Index c) const {
444 // Check that s, r and c are valid:
445 ARTS_ASSERT(0 <= s);
446 ARTS_ASSERT(0 <= r);
447 ARTS_ASSERT(0 <= c);
451
453 r * mrr.mstride + mcr.mstart + c * mcr.mstride,
454 mbr,
455 mpr,
456 b,
457 p);
458}
459
463 Index s, Index b, const Range& p, const Range& r, Index c) const {
464 // Check that s, b and c are valid:
465 ARTS_ASSERT(0 <= s);
466 ARTS_ASSERT(0 <= b);
467 ARTS_ASSERT(0 <= c);
471
473 b * mbr.mstride + mcr.mstart + c * mcr.mstride,
474 mpr,
475 mrr,
476 p,
477 r);
478}
479
483 Index s, Index b, const Range& p, Index r, const Range& c) const {
484 // Check that s, b and r are valid:
485 ARTS_ASSERT(0 <= s);
486 ARTS_ASSERT(0 <= b);
487 ARTS_ASSERT(0 <= r);
491
493 b * mbr.mstride + mrr.mstart + r * mrr.mstride,
494 mpr,
495 mcr,
496 p,
497 c);
498}
499
503 Index s, Index b, Index p, const Range& r, const Range& c) const {
504 // Check that s, b and p are valid:
505 ARTS_ASSERT(0 <= s);
506 ARTS_ASSERT(0 <= b);
507 ARTS_ASSERT(0 <= p);
511
513 b * mbr.mstride + mpr.mstart + p * mpr.mstride,
514 mrr,
515 mcr,
516 r,
517 c);
518}
519
523 const Range& s, Index b, Index p, Index r, Index c) const {
524 // Check that b, p, r and c are valid:
525 ARTS_ASSERT(0 <= b);
526 ARTS_ASSERT(0 <= p);
527 ARTS_ASSERT(0 <= r);
528 ARTS_ASSERT(0 <= c);
533
535 p * mpr.mstride + mrr.mstart + r * mrr.mstride +
536 mcr.mstart + c * mcr.mstride,
537 msr,
538 s);
539}
540
544 Index s, const Range& b, Index p, Index r, Index c) const {
545 // Check that s, p, r and c are valid:
546 ARTS_ASSERT(0 <= s);
547 ARTS_ASSERT(0 <= p);
548 ARTS_ASSERT(0 <= r);
549 ARTS_ASSERT(0 <= c);
554
556 p * mpr.mstride + mrr.mstart + r * mrr.mstride +
557 mcr.mstart + c * mcr.mstride,
558 mbr,
559 b);
560}
561
565 Index s, Index b, const Range& p, Index r, Index c) const {
566 // Check that s, b, r and c are valid:
567 ARTS_ASSERT(0 <= s);
568 ARTS_ASSERT(0 <= b);
569 ARTS_ASSERT(0 <= r);
570 ARTS_ASSERT(0 <= c);
575
577 b * mbr.mstride + mrr.mstart + r * mrr.mstride +
578 mcr.mstart + c * mcr.mstride,
579 mpr,
580 p);
581}
582
586 Index s, Index b, Index p, const Range& r, Index c) const {
587 // Check that s, b, p and c are valid:
588 ARTS_ASSERT(0 <= s);
589 ARTS_ASSERT(0 <= b);
590 ARTS_ASSERT(0 <= p);
591 ARTS_ASSERT(0 <= c);
596
598 b * mbr.mstride + mpr.mstart + p * mpr.mstride +
599 mcr.mstart + c * mcr.mstride,
600 mrr,
601 r);
602}
603
607 Index s, Index b, Index p, Index r, const Range& c) const {
608 // Check that s, b, p and r are valid:
609 ARTS_ASSERT(0 <= s);
610 ARTS_ASSERT(0 <= b);
611 ARTS_ASSERT(0 <= p);
612 ARTS_ASSERT(0 <= r);
617
619 b * mbr.mstride + mpr.mstart + p * mpr.mstride +
620 mrr.mstart + r * mrr.mstride,
621 mcr,
622 c);
623}
624
632 ARTS_ASSERT(msr.mstart == 0 and
633 (msr.mstride ==
635 size() == 0),
636 "Shelve ",
637 msr)
638 ARTS_ASSERT(mbr.mstart == 0 and
640 size() == 0),
641 "Book ",
642 mbr)
643 ARTS_ASSERT(mpr.mstart == 0 and
644 (mpr.mstride == mcr.mextent * mrr.mextent or size() == 0),
645 "Page ",
646 mpr)
647 ARTS_ASSERT(mrr.mstart == 0 and (mrr.mstride == mcr.mextent or size() == 0),
648 "Row ",
649 mrr)
651 mcr.mstart == 0 and (mcr.mstride == 1 or size() == 0), "Column ", mcr)
652
653 return mdata;
654}
655
663 ARTS_ASSERT(msr.mstart == 0 and
664 (msr.mstride ==
666 size() == 0),
667 "Shelve ",
668 msr)
669 ARTS_ASSERT(mbr.mstart == 0 and
671 size() == 0),
672 "Book ",
673 mbr)
674 ARTS_ASSERT(mpr.mstart == 0 and
675 (mpr.mstride == mcr.mextent * mrr.mextent or size() == 0),
676 "Page ",
677 mpr)
678 ARTS_ASSERT(mrr.mstart == 0 and (mrr.mstride == mcr.mextent or size() == 0),
679 "Row ",
680 mrr)
682 mcr.mstart == 0 and (mcr.mstride == 1 or size() == 0), "Column ", mcr)
683
684 return mdata;
685}
686
689 return ConstIterator5D(
691}
692
695 return ConstIterator5D(
698 msr.mstride);
699}
700
703 : msr(0, 1, a.mbr.mextent * a.mpr.mextent * a.mrr.mextent * a.mcr.mextent),
704 mbr(a.mbr),
705 mpr(a.mpr),
706 mrr(a.mrr),
707 mcr(a.mcr),
708 mdata(a.mdata) {
709 // Nothing to do here.
710}
711
717 const Range& sr,
718 const Range& br,
719 const Range& pr,
720 const Range& rr,
721 const Range& cr)
722 : msr(sr), mbr(br), mpr(pr), mrr(rr), mcr(cr), mdata(data) {
723 // Nothing to do here.
724}
725
734 const Range& ps,
735 const Range& pb,
736 const Range& pp,
737 const Range& pr,
738 const Range& pc,
739 const Range& ns,
740 const Range& nb,
741 const Range& np,
742 const Range& nr,
743 const Range& nc)
744 : msr(ps, ns),
745 mbr(pb, nb),
746 mpr(pp, np),
747 mrr(pr, nr),
748 mcr(pc, nc),
749 mdata(data) {
750 // Nothing to do here.
751}
752
756std::ostream& operator<<(std::ostream& os, const ConstTensor5View& v) {
757 // Page iterators:
758 ConstIterator5D is = v.begin();
759 const ConstIterator5D end_shelf = v.end();
760
761 if (is != end_shelf) {
762 os << *is;
763 ++is;
764 }
765
766 for (; is != end_shelf; ++is) {
767 os << "\n\n";
768 os << *is;
769 }
770
771 return os;
772}
773
774// Functions for Tensor5View:
775// -------------------------
776
781 const Range& b,
782 const Range& p,
783 const Range& r,
784 const Range& c) {
785 return Tensor5View(mdata, msr, mbr, mpr, mrr, mcr, s, b, p, r, c);
786}
787
791 const Range& s, const Range& b, const Range& p, const Range& r, Index c) {
792 // Check that c is valid:
793 ARTS_ASSERT(0 <= c);
795
796 return Tensor4View(
797 mdata + mcr.mstart + c * mcr.mstride, msr, mbr, mpr, mrr, s, b, p, r);
798}
799
803 const Range& s, const Range& b, const Range& p, Index r, const Range& c) {
804 // Check that r is valid:
805 ARTS_ASSERT(0 <= r);
807
808 return Tensor4View(
809 mdata + mrr.mstart + r * mrr.mstride, msr, mbr, mpr, mcr, s, b, p, c);
810}
811
815 const Range& s, const Range& b, Index p, const Range& r, const Range& c) {
816 // Check that p is valid:
817 ARTS_ASSERT(0 <= p);
819
820 return Tensor4View(
821 mdata + mpr.mstart + p * mpr.mstride, msr, mbr, mrr, mcr, s, b, r, c);
822}
823
827 const Range& s, Index b, const Range& p, const Range& r, const Range& c) {
828 // Check that b is valid:
829 ARTS_ASSERT(0 <= b);
831
832 return Tensor4View(
833 mdata + mbr.mstart + b * mbr.mstride, msr, mpr, mrr, mcr, s, p, r, c);
834}
835
839 Index s, const Range& b, const Range& p, const Range& r, const Range& c) {
840 // Check that s is valid:
841 ARTS_ASSERT(0 <= s);
843
844 return Tensor4View(
845 mdata + msr.mstart + s * msr.mstride, mbr, mpr, mrr, mcr, b, p, r, c);
846}
847
851 const Range& s, const Range& b, const Range& p, Index r, Index c) {
852 // Check that r and c is valid:
853 ARTS_ASSERT(0 <= r);
854 ARTS_ASSERT(0 <= c);
857
858 return Tensor3View(
860 msr,
861 mbr,
862 mpr,
863 s,
864 b,
865 p);
866}
867
871 const Range& s, const Range& b, Index p, const Range& r, Index c) {
872 // Check that p and c are valid:
873 ARTS_ASSERT(0 <= p);
874 ARTS_ASSERT(0 <= c);
877
878 return Tensor3View(
880 msr,
881 mbr,
882 mrr,
883 s,
884 b,
885 r);
886}
887
891 const Range& s, const Range& b, Index p, Index r, const Range& c) {
892 // Check that p and r are valid:
893 ARTS_ASSERT(0 <= p);
894 ARTS_ASSERT(0 <= r);
897
898 return Tensor3View(
899 mdata + mpr.mstart + p * mpr.mstride + mrr.mstart + r * mrr.mstride,
900 msr,
901 mbr,
902 mcr,
903 s,
904 b,
905 c);
906}
907
911 const Range& s, Index b, const Range& p, Index r, const Range& c) {
912 // Check that b and r are valid:
913 ARTS_ASSERT(0 <= b);
914 ARTS_ASSERT(0 <= r);
917
918 return Tensor3View(
920 msr,
921 mpr,
922 mcr,
923 s,
924 p,
925 c);
926}
927
931 const Range& s, Index b, const Range& p, const Range& r, Index c) {
932 // Check that b and c are valid:
933 ARTS_ASSERT(0 <= b);
934 ARTS_ASSERT(0 <= c);
937
938 return Tensor3View(
940 msr,
941 mpr,
942 mrr,
943 s,
944 p,
945 r);
946}
947
951 const Range& s, Index b, Index p, const Range& r, const Range& c) {
952 // Check that b and p are valid:
953 ARTS_ASSERT(0 <= b);
954 ARTS_ASSERT(0 <= p);
957
958 return Tensor3View(
960 msr,
961 mrr,
962 mcr,
963 s,
964 r,
965 c);
966}
967
971 Index s, const Range& b, Index p, const Range& r, const Range& c) {
972 // Check that s and p are valid:
973 ARTS_ASSERT(0 <= s);
974 ARTS_ASSERT(0 <= p);
977
978 return Tensor3View(
979 mdata + msr.mstart + s * msr.mstride + mpr.mstart + p * mpr.mstride,
980 mbr,
981 mrr,
982 mcr,
983 b,
984 r,
985 c);
986}
987
991 Index s, const Range& b, const Range& p, Index r, const Range& c) {
992 // Check that s and r are valid:
993 ARTS_ASSERT(0 <= s);
994 ARTS_ASSERT(0 <= r);
997
998 return Tensor3View(
999 mdata + msr.mstart + s * msr.mstride + mrr.mstart + r * mrr.mstride,
1000 mbr,
1001 mpr,
1002 mcr,
1003 b,
1004 p,
1005 c);
1006}
1007
1011 Index s, const Range& b, const Range& p, const Range& r, Index c) {
1012 // Check that s and c are valid:
1013 ARTS_ASSERT(0 <= s);
1014 ARTS_ASSERT(0 <= c);
1015 ARTS_ASSERT(s < msr.mextent);
1017
1018 return Tensor3View(
1019 mdata + msr.mstart + s * msr.mstride + mcr.mstart + c * mcr.mstride,
1020 mbr,
1021 mpr,
1022 mrr,
1023 b,
1024 p,
1025 r);
1026}
1027
1031 Index s, Index b, const Range& p, const Range& r, const Range& c) {
1032 // Check that s and b are valid:
1033 ARTS_ASSERT(0 <= s);
1034 ARTS_ASSERT(0 <= b);
1035 ARTS_ASSERT(s < msr.mextent);
1037
1038 return Tensor3View(
1039 mdata + msr.mstart + s * msr.mstride + mbr.mstart + b * mbr.mstride,
1040 mpr,
1041 mrr,
1042 mcr,
1043 p,
1044 r,
1045 c);
1046}
1047
1051 const Range& s, const Range& b, Index p, Index r, Index c) {
1052 // Check that p, r and c are valid:
1053 ARTS_ASSERT(0 <= p);
1054 ARTS_ASSERT(0 <= r);
1055 ARTS_ASSERT(0 <= c);
1056 ARTS_ASSERT(p < mpr.mextent);
1057 ARTS_ASSERT(r < mrr.mextent);
1059
1060 return MatrixView(mdata + mpr.mstart + p * mpr.mstride + mrr.mstart +
1061 r * mrr.mstride + mcr.mstart + c * mcr.mstride,
1062 msr,
1063 mbr,
1064 s,
1065 b);
1066}
1067
1071 const Range& s, Index b, const Range& p, Index r, Index c) {
1072 // Check that b, r and c are valid:
1073 ARTS_ASSERT(0 <= b);
1074 ARTS_ASSERT(0 <= r);
1075 ARTS_ASSERT(0 <= c);
1077 ARTS_ASSERT(r < mrr.mextent);
1079
1080 return MatrixView(mdata + mbr.mstart + b * mbr.mstride + mrr.mstart +
1081 r * mpr.mstride + mcr.mstart + c * mcr.mstride,
1082 msr,
1083 mpr,
1084 s,
1085 p);
1086}
1087
1091 const Range& s, Index b, Index p, const Range& r, Index c) {
1092 // Check that b, p and c are valid:
1093 ARTS_ASSERT(0 <= b);
1094 ARTS_ASSERT(0 <= p);
1095 ARTS_ASSERT(0 <= c);
1097 ARTS_ASSERT(p < mpr.mextent);
1099
1100 return MatrixView(mdata + mbr.mstart + b * mbr.mstride + mpr.mstart +
1101 p * mpr.mstride + mcr.mstart + c * mcr.mstride,
1102 msr,
1103 mrr,
1104 s,
1105 r);
1106}
1107
1111 const Range& s, Index b, Index p, Index r, const Range& c) {
1112 // Check that b, p and r are valid:
1113 ARTS_ASSERT(0 <= b);
1114 ARTS_ASSERT(0 <= p);
1115 ARTS_ASSERT(0 <= r);
1117 ARTS_ASSERT(p < mpr.mextent);
1118 ARTS_ASSERT(r < mrr.mextent);
1119
1120 return MatrixView(mdata + mbr.mstart + b * mbr.mstride + mpr.mstart +
1121 p * mpr.mstride + mrr.mstart + r * mrr.mstride,
1122 msr,
1123 mcr,
1124 s,
1125 c);
1126}
1127
1131 Index s, const Range& b, Index p, Index r, const Range& c) {
1132 // Check that s, p and r are valid:
1133 ARTS_ASSERT(0 <= s);
1134 ARTS_ASSERT(0 <= p);
1135 ARTS_ASSERT(0 <= r);
1136 ARTS_ASSERT(s < msr.mextent);
1137 ARTS_ASSERT(p < mpr.mextent);
1138 ARTS_ASSERT(r < mrr.mextent);
1139
1140 return MatrixView(mdata + msr.mstart + s * msr.mstride + mpr.mstart +
1141 p * mpr.mstride + mrr.mstart + r * mrr.mstride,
1142 mbr,
1143 mcr,
1144 b,
1145 c);
1146}
1147
1151 Index s, const Range& b, Index p, const Range& r, Index c) {
1152 // Check that s, p and c are valid:
1153 ARTS_ASSERT(0 <= s);
1154 ARTS_ASSERT(0 <= p);
1155 ARTS_ASSERT(0 <= c);
1156 ARTS_ASSERT(s < msr.mextent);
1157 ARTS_ASSERT(p < mpr.mextent);
1159
1160 return MatrixView(mdata + msr.mstart + s * msr.mstride + mpr.mstart +
1161 p * mpr.mstride + mcr.mstart + c * mcr.mstride,
1162 mbr,
1163 mrr,
1164 b,
1165 r);
1166}
1167
1171 Index s, const Range& b, const Range& p, Index r, Index c) {
1172 // Check that s, r and c are valid:
1173 ARTS_ASSERT(0 <= s);
1174 ARTS_ASSERT(0 <= r);
1175 ARTS_ASSERT(0 <= c);
1176 ARTS_ASSERT(s < msr.mextent);
1177 ARTS_ASSERT(r < mrr.mextent);
1179
1180 return MatrixView(mdata + msr.mstart + s * msr.mstride + mrr.mstart +
1181 r * mrr.mstride + mcr.mstart + c * mcr.mstride,
1182 mbr,
1183 mpr,
1184 b,
1185 p);
1186}
1187
1191 Index s, Index b, const Range& p, const Range& r, Index c) {
1192 // Check that s, b and c are valid:
1193 ARTS_ASSERT(0 <= s);
1194 ARTS_ASSERT(0 <= b);
1195 ARTS_ASSERT(0 <= c);
1196 ARTS_ASSERT(s < msr.mextent);
1199
1200 return MatrixView(mdata + msr.mstart + s * msr.mstride + mbr.mstart +
1201 b * mbr.mstride + mcr.mstart + c * mcr.mstride,
1202 mpr,
1203 mrr,
1204 p,
1205 r);
1206}
1207
1211 Index s, Index b, const Range& p, Index r, const Range& c) {
1212 // Check that s, b and r are valid:
1213 ARTS_ASSERT(0 <= s);
1214 ARTS_ASSERT(0 <= b);
1215 ARTS_ASSERT(0 <= r);
1216 ARTS_ASSERT(s < msr.mextent);
1218 ARTS_ASSERT(r < mrr.mextent);
1219
1220 return MatrixView(mdata + msr.mstart + s * msr.mstride + mbr.mstart +
1221 b * mbr.mstride + mrr.mstart + r * mrr.mstride,
1222 mpr,
1223 mcr,
1224 p,
1225 c);
1226}
1227
1231 Index s, Index b, Index p, const Range& r, const Range& c) {
1232 // Check that s, b and p are valid:
1233 ARTS_ASSERT(0 <= s);
1234 ARTS_ASSERT(0 <= b);
1235 ARTS_ASSERT(0 <= p);
1236 ARTS_ASSERT(s < msr.mextent);
1238 ARTS_ASSERT(p < mpr.mextent);
1239
1240 return MatrixView(mdata + msr.mstart + s * msr.mstride + mbr.mstart +
1241 b * mbr.mstride + mpr.mstart + p * mpr.mstride,
1242 mrr,
1243 mcr,
1244 r,
1245 c);
1246}
1247
1251 const Range& s, Index b, Index p, Index r, Index c) {
1252 // Check that b, p, r and c are valid:
1253 ARTS_ASSERT(0 <= b);
1254 ARTS_ASSERT(0 <= p);
1255 ARTS_ASSERT(0 <= r);
1256 ARTS_ASSERT(0 <= c);
1258 ARTS_ASSERT(p < mpr.mextent);
1259 ARTS_ASSERT(r < mrr.mextent);
1261
1262 return VectorView(mdata + mbr.mstart + b * mbr.mstride + mpr.mstart +
1263 p * mpr.mstride + mrr.mstart + r * mrr.mstride +
1264 mcr.mstart + c * mcr.mstride,
1265 msr,
1266 s);
1267}
1268
1272 Index s, const Range& b, Index p, Index r, Index c) {
1273 // Check that s, p, r and c are valid:
1274 ARTS_ASSERT(0 <= s);
1275 ARTS_ASSERT(0 <= p);
1276 ARTS_ASSERT(0 <= r);
1277 ARTS_ASSERT(0 <= c);
1278 ARTS_ASSERT(s < msr.mextent);
1279 ARTS_ASSERT(p < mpr.mextent);
1280 ARTS_ASSERT(r < mrr.mextent);
1282
1283 return VectorView(mdata + msr.mstart + s * msr.mstride + mpr.mstart +
1284 p * mpr.mstride + mrr.mstart + r * mrr.mstride +
1285 mcr.mstart + c * mcr.mstride,
1286 mbr,
1287 b);
1288}
1289
1293 Index s, Index b, const Range& p, Index r, Index c) {
1294 // Check that s, b, r and c are valid:
1295 ARTS_ASSERT(0 <= s);
1296 ARTS_ASSERT(0 <= b);
1297 ARTS_ASSERT(0 <= r);
1298 ARTS_ASSERT(0 <= c);
1299 ARTS_ASSERT(s < msr.mextent);
1301 ARTS_ASSERT(r < mrr.mextent);
1303
1304 return VectorView(mdata + msr.mstart + s * msr.mstride + mbr.mstart +
1305 b * mbr.mstride + mrr.mstart + r * mrr.mstride +
1306 mcr.mstart + c * mcr.mstride,
1307 mpr,
1308 p);
1309}
1310
1314 Index s, Index b, Index p, const Range& r, Index c) {
1315 // Check that s, b, p and c are valid:
1316 ARTS_ASSERT(0 <= s);
1317 ARTS_ASSERT(0 <= b);
1318 ARTS_ASSERT(0 <= p);
1319 ARTS_ASSERT(0 <= c);
1320 ARTS_ASSERT(s < msr.mextent);
1322 ARTS_ASSERT(p < mpr.mextent);
1324
1325 return VectorView(mdata + msr.mstart + s * msr.mstride + mbr.mstart +
1326 b * mbr.mstride + mpr.mstart + p * mpr.mstride +
1327 mcr.mstart + c * mcr.mstride,
1328 mrr,
1329 r);
1330}
1331
1335 Index s, Index b, Index p, Index r, const Range& c) {
1336 // Check that s, b, p and r are valid:
1337 ARTS_ASSERT(0 <= s);
1338 ARTS_ASSERT(0 <= b);
1339 ARTS_ASSERT(0 <= p);
1340 ARTS_ASSERT(0 <= r);
1341 ARTS_ASSERT(s < msr.mextent);
1343 ARTS_ASSERT(p < mpr.mextent);
1344 ARTS_ASSERT(r < mrr.mextent);
1345
1346 return VectorView(mdata + msr.mstart + s * msr.mstride + mbr.mstart +
1347 b * mbr.mstride + mpr.mstart + p * mpr.mstride +
1348 mrr.mstart + r * mrr.mstride,
1349 mcr,
1350 c);
1351}
1352
1356 msr.mstride);
1357}
1358
1361 return Iterator5D(
1364 msr.mstride);
1365}
1366
1372 // Check that sizes are compatible:
1378
1379 copy(m.begin(), m.end(), begin());
1380 return *this;
1381}
1382
1389 // Check that sizes are compatible:
1395
1396 copy(m.begin(), m.end(), begin());
1397 return *this;
1398}
1399
1404 // Check that sizes are compatible:
1410
1411 copy(m.begin(), m.end(), begin());
1412 return *this;
1413}
1414
1418 copy(x, begin(), end());
1419 return *this;
1420}
1421
1422// Some little helper functions:
1423//------------------------------
1424
1427 const Iterator5D es = end();
1428 for (Iterator5D s = begin(); s != es; ++s) {
1429 *s *= x;
1430 }
1431 return *this;
1432}
1433
1436 const Iterator5D es = end();
1437 for (Iterator5D s = begin(); s != es; ++s) {
1438 *s /= x;
1439 }
1440 return *this;
1441}
1442
1445 const Iterator5D es = end();
1446 for (Iterator5D s = begin(); s != es; ++s) {
1447 *s += x;
1448 }
1449 return *this;
1450}
1451
1454 const Iterator5D es = end();
1455 for (Iterator5D s = begin(); s != es; ++s) {
1456 *s -= x;
1457 }
1458 return *this;
1459}
1460
1463 ARTS_ASSERT(nshelves() == x.nshelves());
1464 ARTS_ASSERT(nbooks() == x.nbooks());
1465 ARTS_ASSERT(npages() == x.npages());
1466 ARTS_ASSERT(nrows() == x.nrows());
1467 ARTS_ASSERT(ncols() == x.ncols());
1468 ConstIterator5D xs = x.begin();
1469 Iterator5D s = begin();
1470 const Iterator5D es = end();
1471 for (; s != es; ++s, ++xs) {
1472 *s *= *xs;
1473 }
1474 return *this;
1475}
1476
1479 ARTS_ASSERT(nshelves() == x.nshelves());
1480 ARTS_ASSERT(nbooks() == x.nbooks());
1481 ARTS_ASSERT(npages() == x.npages());
1482 ARTS_ASSERT(nrows() == x.nrows());
1483 ARTS_ASSERT(ncols() == x.ncols());
1484 ConstIterator5D xs = x.begin();
1485 Iterator5D s = begin();
1486 const Iterator5D es = end();
1487 for (; s != es; ++s, ++xs) {
1488 *s /= *xs;
1489 }
1490 return *this;
1491}
1492
1495 ARTS_ASSERT(nshelves() == x.nshelves());
1496 ARTS_ASSERT(nbooks() == x.nbooks());
1497 ARTS_ASSERT(npages() == x.npages());
1498 ARTS_ASSERT(nrows() == x.nrows());
1499 ARTS_ASSERT(ncols() == x.ncols());
1500 ConstIterator5D xs = x.begin();
1501 Iterator5D s = begin();
1502 const Iterator5D es = end();
1503 for (; s != es; ++s, ++xs) {
1504 *s += *xs;
1505 }
1506 return *this;
1507}
1508
1511 ARTS_ASSERT(nshelves() == x.nshelves());
1512 ARTS_ASSERT(nbooks() == x.nbooks());
1513 ARTS_ASSERT(npages() == x.npages());
1514 ARTS_ASSERT(nrows() == x.nrows());
1515 ARTS_ASSERT(ncols() == x.ncols());
1516 ConstIterator5D xs = x.begin();
1517 Iterator5D s = begin();
1518 const Iterator5D es = end();
1519 for (; s != es; ++s, ++xs) {
1520 *s -= *xs;
1521 }
1522 return *this;
1523}
1524
1528 a.mdata,
1529 Range(0,
1530 1,
1531 a.mbr.mextent * a.mpr.mextent * a.mrr.mextent * a.mcr.mextent),
1532 a.mbr,
1533 a.mpr,
1534 a.mrr,
1535 a.mcr) {
1536 // Nothing to do here.
1537}
1538
1543 const Range& sr,
1544 const Range& br,
1545 const Range& pr,
1546 const Range& rr,
1547 const Range& cr)
1548 : ConstTensor5View(data, sr, br, pr, rr, cr) {
1549 // Nothing to do here.
1550}
1551
1573 const Range& ps,
1574 const Range& pb,
1575 const Range& pp,
1576 const Range& pr,
1577 const Range& pc,
1578 const Range& ns,
1579 const Range& nb,
1580 const Range& np,
1581 const Range& nr,
1582 const Range& nc)
1583 : ConstTensor5View(data, ps, pb, pp, pr, pc, ns, nb, np, nr, nc) {
1584 // Nothing to do here.
1585}
1586
1592 const ConstIterator5D& end,
1593 Iterator5D target) {
1594 for (; origin != end; ++origin, ++target) {
1595 // We use the copy function for the next smaller rank of tensor
1596 // recursively:
1597 copy(origin->begin(), origin->end(), target->begin());
1598 }
1599}
1600
1602void copy(Numeric x, Iterator5D target, const Iterator5D& end) {
1603 for (; target != end; ++target) {
1604 // We use the copy function for the next smaller rank of tensor
1605 // recursively:
1606 copy(x, target->begin(), target->end());
1607 }
1608}
1609
1610// Functions for Tensor5:
1611// ---------------------
1612
1616 : Tensor5View(new Numeric[s * b * p * r * c],
1617 Range(0, s, b * p * r * c),
1618 Range(0, b, p * r * c),
1619 Range(0, p, r * c),
1620 Range(0, r, c),
1621 Range(0, c)) {
1622 // Nothing to do here.
1623}
1624
1627 : Tensor5View(new Numeric[s * b * p * r * c],
1628 Range(0, s, b * p * r * c),
1629 Range(0, b, p * r * c),
1630 Range(0, p, r * c),
1631 Range(0, r, c),
1632 Range(0, c)) {
1633 // Here we can access the raw memory directly, for slightly
1634 // increased efficiency:
1635 std::fill_n(mdata, s * b * p * r * c, fill);
1636}
1637
1641 : Tensor5View(
1642 new Numeric[m.nshelves() * m.nbooks() * m.npages() * m.nrows() *
1643 m.ncols()],
1644 Range(
1645 0, m.nshelves(), m.nbooks() * m.npages() * m.nrows() * m.ncols()),
1646 Range(0, m.nbooks(), m.npages() * m.nrows() * m.ncols()),
1647 Range(0, m.npages(), m.nrows() * m.ncols()),
1648 Range(0, m.nrows(), m.ncols()),
1649 Range(0, m.ncols())) {
1650 copy(m.begin(), m.end(), begin());
1651}
1652
1656 : Tensor5View(
1657 new Numeric[m.nshelves() * m.nbooks() * m.npages() * m.nrows() *
1658 m.ncols()],
1659 Range(
1660 0, m.nshelves(), m.nbooks() * m.npages() * m.nrows() * m.ncols()),
1661 Range(0, m.nbooks(), m.npages() * m.nrows() * m.ncols()),
1662 Range(0, m.npages(), m.nrows() * m.ncols()),
1663 Range(0, m.nrows(), m.ncols()),
1664 Range(0, m.ncols())) {
1665 // There is a catch here: If m is an empty tensor, then it will have
1666 // dimensions of size 0. But these are used to initialize the stride
1667 // for higher dimensions! Thus, this method has to be consistent
1668 // with the behaviour of Range::Range. For now, Range::Range allows
1669 // also stride 0.
1670 std::memcpy(
1671 mdata,
1672 m.mdata,
1673 nshelves() * nbooks() * npages() * nrows() * ncols() * sizeof(Numeric));
1674}
1675
1677
1701 if (this != &x) {
1702 resize(x.nshelves(), x.nbooks(), x.npages(), x.nrows(), x.ncols());
1703 std::memcpy(
1704 mdata,
1705 x.mdata,
1706 nshelves() * nbooks() * npages() * nrows() * ncols() * sizeof(Numeric));
1707 }
1708 return *this;
1709}
1710
1713 if (this != &x) {
1714 delete[] mdata;
1715 mdata = x.mdata;
1716 msr = x.msr;
1717 mbr = x.mbr;
1718 mpr = x.mpr;
1719 mrr = x.mrr;
1720 mcr = x.mcr;
1721 x.msr = Range(0, 0);
1722 x.mbr = Range(0, 0);
1723 x.mpr = Range(0, 0);
1724 x.mrr = Range(0, 0);
1725 x.mcr = Range(0, 0);
1726 x.mdata = nullptr;
1727 }
1728 return *this;
1729}
1730
1734 std::fill_n(mdata, nshelves() * nbooks() * npages() * nrows() * ncols(), x);
1735 return *this;
1736}
1737
1742 ARTS_ASSERT(0 <= s);
1743 ARTS_ASSERT(0 <= b);
1744 ARTS_ASSERT(0 <= p);
1745 ARTS_ASSERT(0 <= r);
1746 ARTS_ASSERT(0 <= c);
1747
1748 if (msr.mextent != s || mbr.mextent != b || mpr.mextent != p ||
1749 mrr.mextent != r || mcr.mextent != c) {
1750 delete[] mdata;
1751 mdata = new Numeric[s * b * p * r * c];
1752
1753 msr.mstart = 0;
1754 msr.mextent = s;
1755 msr.mstride = b * p * r * c;
1756
1757 mbr.mstart = 0;
1758 mbr.mextent = b;
1759 mbr.mstride = p * r * c;
1760
1761 mpr.mstart = 0;
1762 mpr.mextent = p;
1763 mpr.mstride = r * c;
1764
1765 mrr.mstart = 0;
1766 mrr.mextent = r;
1767 mrr.mstride = c;
1768
1769 mcr.mstart = 0;
1770 mcr.mextent = c;
1771 mcr.mstride = 1;
1772 }
1773}
1774
1776void swap(Tensor5& t1, Tensor5& t2) {
1777 std::swap(t1.msr, t2.msr);
1778 std::swap(t1.mbr, t2.mbr);
1779 std::swap(t1.mpr, t2.mpr);
1780 std::swap(t1.mrr, t2.mrr);
1781 std::swap(t1.mcr, t2.mcr);
1782 std::swap(t1.mdata, t2.mdata);
1783}
1784
1788 // cout << "Destroying a Tensor5:\n"
1789 // << *this << "\n........................................\n";
1790 delete[] mdata;
1791}
1792
1808void transform(Tensor5View y, double (&my_func)(double), ConstTensor5View x) {
1809 // Check dimensions:
1810 ARTS_ASSERT(y.nshelves() == x.nshelves());
1811 ARTS_ASSERT(y.nbooks() == x.nbooks());
1812 ARTS_ASSERT(y.npages() == x.npages());
1813 ARTS_ASSERT(y.nrows() == x.nrows());
1814 ARTS_ASSERT(y.ncols() == x.ncols());
1815
1816 const ConstIterator5D xe = x.end();
1817 ConstIterator5D xi = x.begin();
1818 Iterator5D yi = y.begin();
1819 for (; xi != xe; ++xi, ++yi) {
1820 // Use the transform function of lower dimensional tensors
1821 // recursively:
1822 transform(*yi, my_func, *xi);
1823 }
1824}
1825
1828 const ConstIterator5D xe = x.end();
1829 ConstIterator5D xi = x.begin();
1830
1831 // Initial value for max:
1832 Numeric themax = max(*xi);
1833 ++xi;
1834
1835 for (; xi != xe; ++xi) {
1836 // Use the max function of lower dimensional tensors
1837 // recursively:
1838 Numeric maxi = max(*xi);
1839 if (maxi > themax) themax = maxi;
1840 }
1841
1842 return themax;
1843}
1844
1847 const ConstIterator5D xe = x.end();
1848 ConstIterator5D xi = x.begin();
1849
1850 // Initial value for min:
1851 Numeric themin = min(*xi);
1852 ++xi;
1853
1854 for (; xi != xe; ++xi) {
1855 // Use the min function of lower dimensional tensors
1856 // recursively:
1857 Numeric mini = min(*xi);
1858 if (mini < themin) themin = mini;
1859 }
1860
1861 return themin;
1862}
1863
1865// Helper function for debugging
1866#ifndef NDEBUG
1867
1885 Tensor5View& tv, Index s, Index b, Index p, Index r, Index c) {
1886 return tv(s, b, p, r, c);
1887}
1888
1889#endif
Const version of Iterator5D.
Definition: matpackV.h:84
A constant view of a Matrix.
Definition: matpackI.h:1050
A constant view of a Tensor3.
Definition: matpackIII.h:130
A constant view of a Tensor4.
Definition: matpackIV.h:131
ConstIterator4D end() const
Return const iterator behind last book.
Definition: matpackIV.cc:367
ConstIterator4D begin() const
Return const iterator to first book.
Definition: matpackIV.cc:361
A constant view of a Tensor5.
Definition: matpackV.h:141
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
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
ConstIterator5D end() const
Return const iterator behind last shelf.
Definition: matpackV.cc:694
Index size() const noexcept
Definition: matpackV.h:156
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
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
ConstIterator5D begin() const
Return const iterator to first shelf.
Definition: matpackV.cc:688
A constant view of a Vector.
Definition: matpackI.h:517
Implementation of Tensors of Rank 5.
Definition: matpackV.h:38
The MatrixView class.
Definition: matpackI.h:1169
The range class.
Definition: matpackI.h:166
Index mstart
The start index.
Definition: matpackI.h:368
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 Tensor4View class.
Definition: matpackIV.h:290
Iterator4D begin()
Return iterator to first book.
Definition: matpackIV.cc:696
Iterator4D end()
Return iterator behind last book.
Definition: matpackIV.cc:702
The Tensor5View class.
Definition: matpackV.h:341
Tensor5View & operator*=(Numeric x)
Multiplication by scalar.
Definition: matpackV.cc:1426
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
Tensor5View & operator-=(Numeric x)
Subtraction of scalar.
Definition: matpackV.cc:1453
Tensor5View & operator/=(Numeric x)
Division by scalar.
Definition: matpackV.cc:1435
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+=(Numeric x)
Addition of scalar.
Definition: matpackV.cc:1444
Tensor5View & operator=(const ConstTensor5View &v)
Assignment operator.
Definition: matpackV.cc:1371
The Tensor5 class.
Definition: matpackV.h:514
virtual ~Tensor5()
Destructor for Tensor5.
Definition: matpackV.cc:1787
void resize(Index s, Index b, Index p, Index r, Index c)
Resize function.
Definition: matpackV.cc:1741
Tensor5()=default
Tensor5 & operator=(const Tensor5 &x)
Assignment operator from another tensor.
Definition: matpackV.cc:1700
The VectorView class.
Definition: matpackI.h:658
#define ARTS_NOEXCEPT
Definition: debug.h:80
#define ARTS_ASSERT(condition,...)
Definition: debug.h:83
The declarations of all the exception classes.
#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
void swap(Tensor5 &t1, Tensor5 &t2)
Swaps two objects.
Definition: matpackV.cc:1776
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
constexpr Rational end(Rational Ju, Rational Jl, Polarization type) noexcept
Gives the largest M for a polarization type of this transition.
Definition: zeemandata.h:113
#define v
#define a
#define c
#define b