ARTS  2.4.0(git:4fb77825)
matpackI.h
Go to the documentation of this file.
1 /* Copyright (C) 2001-2019 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 
95 #ifndef matpackI_h
96 #define matpackI_h
97 
98 #include <Eigen/Dense>
99 #include <cassert>
100 #include "array.h"
101 #include "matpack.h"
102 
103 // Declare existance of some classes
104 class bofstream;
105 
106 // Declaration of Eigen types
107 typedef Eigen::Stride<Eigen::Dynamic, Eigen::Dynamic> StrideType;
108 typedef Eigen::Matrix<Numeric, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>
110 typedef Eigen::Map<MatrixType, 0, StrideType> MatrixViewMap;
111 typedef Eigen::Map<const MatrixType, 0, StrideType> ConstMatrixViewMap;
112 typedef Eigen::Matrix<Numeric, 4, 4, Eigen::RowMajor> Matrix4x4Type;
113 typedef Eigen::Map<Matrix4x4Type, 0, StrideType> Matrix4x4ViewMap;
114 typedef Eigen::Map<const Matrix4x4Type, 0, StrideType> ConstMatrix4x4ViewMap;
115 
126 class Joker {
127  // Nothing here.
128 };
129 
130 // Declare existence of the global joker object:
131 extern const Joker joker;
132 
133 // Declare the existence of class ConstMatrixView:
134 class ConstIterator1D;
135 
136 // Declare the existence of class VectorView:
137 class VectorView;
138 
139 // Declare the existence of class ConstVectorView:
140 class ConstVectorView;
141 
142 // Declare the existence of class ConstMatrixView:
143 class ConstMatrixView;
144 
160 class Range {
161  public:
162 
163  // Constructors:
164 
175  constexpr Range(Index start, Index extent, Index stride = 1)
176  : mstart(start), mextent(extent), mstride(stride) {
177  // Start must be >= 0:
178  assert(0 <= mstart);
179  // Extent also. Although internally negative extent means "to the end",
180  // this can not be created this way, only with the joker. Zero
181  // extent is allowed, though, which corresponds to an empty range.
182  assert(0 <= mextent);
183  // Stride can be anything except 0.
184  // SAB 2001-09-21: Allow 0 stride.
185  // assert( 0!=mstride);
186  }
187 
190  constexpr Range(Index start, Joker, Index stride = 1)
191  : mstart(start), mextent(-1), mstride(stride) {
192  // Start must be >= 0:
193  assert(0 <= mstart);
194  }
195 
199  constexpr Range(Joker, Index stride = 1) : mstart(0), mextent(-1), mstride(stride) {
200  // Nothing to do here.
201  };
202 
208  constexpr Range(Index max_size, const Range& r)
209  : mstart(r.mstart), mextent(r.mextent), mstride(r.mstride) {
210  // Start must be >= 0:
211  assert(0 <= mstart);
212  // ... and < max_size:
213  assert(mstart < max_size);
214 
215  // Stride must be != 0:
216  assert(0 != mstride);
217 
218  // Convert negative extent (joker) to explicit extent
219  if (mextent < 0) {
220  if (0 < mstride)
221  mextent = 1 + (max_size - 1 - mstart) / mstride;
222  else
223  mextent = 1 + (0 - mstart) / mstride;
224  } else {
225  #ifndef NDEBUG
226  // Check that extent is ok:
227  Index fin = mstart + (mextent - 1) * mstride;
228  assert(0 <= fin);
229  assert(fin < max_size);
230  #endif
231  }
232  }
233 
239  constexpr Range(const Range& p, const Range& n)
240  : mstart(p.mstart + n.mstart * p.mstride),
241  mextent(n.mextent),
242  mstride(p.mstride * n.mstride) {
243  // We have to juggle here a bit with previous, new, and resulting
244  // quantities. I.e.;
245  // p.mstride: Previous stride
246  // n.mstride: New stride (as specified)
247  // mstride: Resulting stride (old*new)
248 
249  // Get the previous final element:
250  Index prev_fin = p.mstart + (p.mextent - 1) * p.mstride;
251 
252  // Resulting start must be >= previous start:
253  assert(p.mstart <= mstart);
254  // and <= prev_fin, except for Joker:
255  assert(mstart <= prev_fin || mextent == -1);
256 
257  // Resulting stride must be != 0:
258  assert(0 != mstride);
259 
260  // Convert negative extent (joker) to explicit extent
261  if (mextent < 0) {
262  if (0 < mstride)
263  mextent = 1 + (prev_fin - mstart) / mstride;
264  else
265  mextent = 1 + (p.mstart - mstart) / mstride;
266  } else {
267  #ifndef NDEBUG
268  // Check that extent is ok:
269  Index fin = mstart + (mextent - 1) * mstride;
270  assert(p.mstart <= fin);
271  assert(fin <= prev_fin);
272  #endif
273  }
274  };
275 
276  // Friends:
277  friend class ConstVectorView;
278  friend class VectorView;
279  friend class Vector;
280  friend class ConstMatrixView;
281  friend class MatrixView;
282  friend class Matrix;
283  friend class Iterator2D;
284  friend class Iterator3D;
285  friend class Iterator4D;
286  friend class Iterator5D;
287  friend class Iterator6D;
288  friend class Iterator7D;
289  friend class ConstIterator2D;
290  friend class ConstIterator3D;
291  friend class ConstIterator4D;
292  friend class ConstIterator5D;
293  friend class ConstIterator6D;
294  friend class ConstIterator7D;
295  friend class ConstTensor3View;
296  friend class Tensor3View;
297  friend class Tensor3;
298  friend class ConstTensor4View;
299  friend class Tensor4View;
300  friend class Tensor4;
301  friend class ConstTensor5View;
302  friend class Tensor5View;
303  friend class Tensor5;
304  friend class ConstTensor6View;
305  friend class Tensor6View;
306  friend class Tensor6;
307  friend class ConstTensor7View;
308  friend class Tensor7View;
309  friend class Tensor7;
310  friend class Sparse;
312  friend class ComplexVectorView;
313  friend class ComplexVector;
315  friend class ComplexMatrixView;
316  friend class ComplexMatrix;
317  friend class ComplexIterator2D;
319 
320  friend void mult_general(VectorView,
321  const ConstMatrixView&,
322  const ConstVectorView&);
323 
324  // Member functions:
325 
327  constexpr Index get_start() const { return mstart; }
329  constexpr Index get_extent() const { return mextent; }
331  constexpr Index get_stride() const { return mstride; }
332 
334  constexpr Range operator()(const Range r) const {
335  return (r.mextent < 0) ? (mextent < 0) ? Range(mstart + r.mstart * mstride,
336  joker,
337  r.mstride * mstride)
338  : Range(mstart + r.mstart * mstride,
339  mextent,
340  r.mstride * mstride)
341  : Range(mstart + r.mstart * mstride,
342  r.mextent,
343  r.mstride * mstride);
344  }
345 
346  constexpr Index operator()(const Index i) const { return mstart + i * mstride; };
347 
348  private:
356 };
357 
360 class Iterator1D {
361  public:
364  using pointer = Numeric*;
365  using reference = Numeric&;
366  using iterator_category = std::random_access_iterator_tag;
367 
369  Iterator1D() = default;
370 
373  : mx(x), mstride(stride) { /* Nothing to do here. */
374  }
375 
376  // Operators:
377 
380  mx += mstride;
381  return *this;
382  }
383 
385  Numeric& operator*() const { return *mx; }
386 
388  bool operator!=(const Iterator1D& other) const {
389  if (mx != other.mx)
390  return true;
391  else
392  return false;
393  }
394 
395 #ifdef __GLIBCXX__
396  bool operator==(const Iterator1D& other) const { return !operator!=(other); }
397 
398  Index operator-(const Iterator1D& other) const {
399  return (Index)(mx - other.mx) / mstride;
400  }
401 #endif
402 
407  friend void copy(ConstIterator1D origin,
408  const ConstIterator1D& end,
409  Iterator1D target);
410 
411  private:
413  Numeric* mx{nullptr};
416 };
417 
421  public:
423  using value_type = const Numeric;
424  using pointer = const Numeric*;
425  using reference = const Numeric&;
426  using iterator_category = std::random_access_iterator_tag;
427 
429  ConstIterator1D() = default;
430 
432  ConstIterator1D(const Numeric* x, Index stride)
433  : mx(x), mstride(stride) { /* Nothing to do here. */
434  }
435 
436  // Operators:
439  mx += mstride;
440  return *this;
441  }
442 
444  const Numeric& operator*() const { return *mx; }
445 
447  bool operator!=(const ConstIterator1D& other) const {
448  if (mx != other.mx)
449  return true;
450  else
451  return false;
452  }
453 
454  friend void copy(ConstIterator1D origin,
455  const ConstIterator1D& end,
456  Iterator1D target);
457 
458  private:
460  const Numeric* mx{nullptr};
463 };
464 
465 // Declare the vector class:
466 class Vector;
467 
468 // Declare the MatrixView class
469 class MatrixView;
470 
477  public:
478  constexpr ConstVectorView(const ConstVectorView&) = default;
479  constexpr ConstVectorView(ConstVectorView&&) = default;
482 
483  // Typedef for compatibility with STL
485 
486  // Member functions:
487 
489  bool empty() const;
490 
500  Index nelem() const;
501 
503  Numeric sum() const;
504 
505  // Const index operators:
507  Numeric operator[](Index n) const { // Check if index is valid:
508  assert(0 <= n);
509  assert(n < mrange.mextent);
510  return get(n);
511  }
512 
514  Numeric get(Index n) const {
515  return *(mdata + mrange.mstart + n * mrange.mstride);
516  }
517 
521  ConstVectorView operator[](const Range& r) const;
522 
523  friend Numeric operator*(const ConstVectorView& a, const ConstVectorView& b);
524 
525  // Functions returning iterators:
526 
528  ConstIterator1D begin() const;
529 
531  ConstIterator1D end() const;
532 
534  operator ConstMatrixView() const;
535 
537  virtual ~ConstVectorView() = default;
538 
539  // Friends:
540  friend class VectorView;
541  friend class ConstIterator2D;
542  friend class ConstMatrixView;
543  friend class ConstTensor3View;
544  friend class ConstTensor4View;
545  friend class ConstTensor5View;
546  friend class ConstTensor6View;
547  friend class ConstTensor7View;
549  friend int poly_root_solve(Matrix& roots, Vector& coeffs);
550  friend void mult(VectorView, const ConstMatrixView&, const ConstVectorView&);
551  friend void mult(VectorView, const Sparse&, ConstVectorView);
552  friend void transpose_mult(VectorView, const Sparse&, ConstVectorView);
553  friend void mult_general(VectorView,
554  const ConstMatrixView&,
555  const ConstVectorView&);
556  friend void lubacksub(VectorView,
559  const ArrayOfIndex&);
561 
566 
569  ConstVectorView(const Numeric& a);
570 
571  protected:
572  // Constructors:
573  ConstVectorView() = default;
574 
577  ConstVectorView(Numeric* data, const Range& range);
578 
589  ConstVectorView(Numeric* data, const Range& p, const Range& n);
590 
591  // Data members:
592  // -------------
594  Range mrange{0, 0};
596  Numeric* mdata{nullptr};
597 };
598 
610 class VectorView : public ConstVectorView {
611  public:
612  // Make const methods visible from base class
614  using ConstVectorView::end;
615  using ConstVectorView::operator[];
616  using ConstVectorView::get;
617 
618  constexpr VectorView(const VectorView&) = default;
619 
622  VectorView(const Vector&);
623 
625  VectorView(Vector& v);
626 
627  // Typedef for compatibility with STL
629 
631  Numeric& operator[](Index n) { // Check if index is valid:
632  assert(0 <= n);
633  assert(n < mrange.mextent);
634  return get(n);
635  }
636 
639  return *(mdata + mrange.mstart + n * mrange.mstride);
640  }
641 
645  VectorView operator[](const Range& r);
646 
647  // Iterators:
648 
650  Iterator1D begin();
651 
653  Iterator1D end();
654 
655  // Assignment operators:
656 
662 
668  VectorView& operator=(const VectorView& v);
669 
672  VectorView& operator=(const Vector& v);
673 
675 
679 
680  // Other operators:
681 
684 
687 
690 
693 
696 
699 
702 
705 
707  operator MatrixView();
708 
714  const Numeric* get_c_array() const;
715 
721  Numeric* get_c_array();
722 
724  virtual ~VectorView() = default;
725 
726  // Friends:
727  friend class ConstIterator2D;
728  friend class Iterator2D;
729  friend class MatrixView;
730  friend class Tensor3View;
731  friend class Tensor4View;
732  friend class Tensor5View;
733  friend class Tensor6View;
734  friend class Tensor7View;
735  friend class ComplexVectorView;
736 
739  VectorView(Numeric& a);
740 
741  protected:
742  // Constructors:
743  VectorView() = default;
744 
747  VectorView(Numeric* data, const Range& range);
748 
759  VectorView(Numeric* data, const Range& p, const Range& n);
760 };
761 
765 class Iterator2D {
766  public:
767  // Constructors:
769  Iterator2D() = default;
770 
772  Iterator2D(const VectorView& x, Index stride)
773  : msv(x), mstride(stride) { /* Nothing to do here. */
774  }
775 
776  // Operators:
779  msv.mdata += mstride;
780  return *this;
781  }
782 
784  bool operator!=(const Iterator2D& other) const {
785  if (msv.mdata + msv.mrange.mstart !=
786  other.msv.mdata + other.msv.mrange.mstart)
787  return true;
788  else
789  return false;
790  }
791 
794  VectorView* operator->() { return &msv; }
795 
797  VectorView& operator*() { return msv; }
798 
799  private:
804 };
805 
810  public:
811  // Constructors:
813  ConstIterator2D() = default;
814 
817  : msv(x), mstride(stride) { /* Nothing to do here. */
818  }
819 
820  // Operators:
823  msv.mdata += mstride;
824  return *this;
825  }
826 
828  bool operator!=(const ConstIterator2D& other) const {
829  if (msv.mdata + msv.mrange.mstart !=
830  other.msv.mdata + other.msv.mrange.mstart)
831  return true;
832  else
833  return false;
834  }
835 
838  const ConstVectorView* operator->() const { return &msv; }
839 
841  const ConstVectorView& operator*() const { return msv; }
842 
843  private:
848 };
849 
860 class Vector : public VectorView {
861  public:
862  // Constructors:
863  Vector() = default;
864 
866  Vector(std::initializer_list<Numeric> init);
867 
869  explicit Vector(Index n);
870 
872  Vector(Index n, Numeric fill);
873 
881  Vector(Numeric start, Index extent, Numeric stride);
882 
888  Vector(const ConstVectorView& v);
889 
892  Vector(const Vector& v);
893  Vector(Vector&& v) noexcept : VectorView(std::forward<VectorView>(v)) {
894  v.mdata = nullptr;
895  }
896 
898  Vector(const std::vector<Numeric>&);
899 
900  // Assignment operators:
901 
926  Vector& operator=(const Vector& v);
927 
929  Vector& operator=(Vector&& v) noexcept;
930 
932  Vector& operator=(std::initializer_list<Numeric> v);
933 
950  Vector& operator=(const Array<Numeric>& v);
951 
955 
959  void resize(Index n);
960 
962  friend void swap(Vector& v1, Vector& v2);
963 
966  virtual ~Vector();
967 };
968 
969 // Declare class Matrix:
970 class Matrix;
971 
983  public:
984  constexpr ConstMatrixView(const ConstMatrixView&) = default;
985  constexpr ConstMatrixView(ConstMatrixView&&) = default;
988 
989  // Typedef for compatibility with STL
991 
992  // Member functions:
993  bool empty() const;
994  Index nrows() const;
995  Index ncols() const;
996 
997  // Const index operators:
999  Numeric operator()(Index r, Index c) const { // Check if indices are valid:
1000  assert(0 <= r);
1001  assert(0 <= c);
1002  assert(r < mrr.mextent);
1003  assert(c < mcr.mextent);
1004 
1005  return get(r, c);
1006  }
1007 
1009  Numeric get(Index r, Index c) const {
1010  return *(mdata + mrr.mstart + r * mrr.mstride + mcr.mstart +
1011  c * mcr.mstride);
1012  }
1013 
1014  ConstMatrixView operator()(const Range& r, const Range& c) const;
1015  ConstVectorView operator()(const Range& r, Index c) const;
1016  ConstVectorView operator()(Index r, const Range& c) const;
1017 
1018  // Functions returning iterators:
1019  ConstIterator2D begin() const;
1020  ConstIterator2D end() const;
1021 
1022  // View on diagonal vector
1023  ConstVectorView diagonal() const;
1024 
1026  virtual ~ConstMatrixView() = default;
1027 
1028  // Friends:
1029  friend class MatrixView;
1030  friend class ConstIterator3D;
1031  friend class ConstVectorView;
1032  friend class ConstTensor3View;
1033  friend class ConstTensor4View;
1034  friend class ConstTensor5View;
1035  friend class ConstTensor6View;
1036  friend class ConstTensor7View;
1039  friend int poly_root_solve(Matrix& roots, Vector& coeffs);
1040  friend void mult(VectorView, const ConstMatrixView&, const ConstVectorView&);
1041  friend void mult(MatrixView, const ConstMatrixView&, const ConstMatrixView&);
1042  friend void mult(MatrixView, const Sparse&, const ConstMatrixView&);
1043  friend void mult(MatrixView, const ConstMatrixView&, const Sparse&);
1044  friend void mult_general(VectorView,
1045  const ConstMatrixView&,
1046  const ConstVectorView&);
1047  friend void mult_general(MatrixView,
1048  const ConstMatrixView&,
1049  const ConstMatrixView&);
1050  friend void ludcmp(Matrix&, ArrayOfIndex&, ConstMatrixView);
1051  friend void lubacksub(VectorView,
1054  const ArrayOfIndex&);
1055  friend void inv(MatrixView, ConstMatrixView);
1057 
1060 
1063 
1064  protected:
1065  // Constructors:
1066  ConstMatrixView() = default;
1067  ConstMatrixView(Numeric* data, const Range& r, const Range& c);
1069  const Range& pr,
1070  const Range& pc,
1071  const Range& nr,
1072  const Range& nc);
1073 
1074  // Data members:
1075  // -------------
1077  Range mrr{0, 0, 1};
1079  Range mcr{0, 0, 1};
1081  Numeric* mdata{nullptr};
1082 };
1083 
1093 class MatrixView : public ConstMatrixView {
1094  public:
1095  // Make const methods visible from base class
1096  using ConstMatrixView::begin;
1097  using ConstMatrixView::end;
1098  using ConstMatrixView::operator();
1099  using ConstMatrixView::get;
1100 
1101  constexpr MatrixView(const MatrixView&) = default;
1102 
1103  // Typedef for compatibility with STL
1105 
1106  // Index Operators:
1108  Numeric& operator()(Index r, Index c) { // Check if indices are valid:
1109  assert(0 <= r);
1110  assert(0 <= c);
1111  assert(r < mrr.mextent);
1112  assert(c < mcr.mextent);
1113 
1114  return get(r, c);
1115  }
1116 
1119  return *(mdata + mrr.mstart + r * mrr.mstride + mcr.mstart +
1120  c * mcr.mstride);
1121  }
1122 
1123  MatrixView operator()(const Range& r, const Range& c);
1124  VectorView operator()(const Range& r, Index c);
1125  VectorView operator()(Index r, const Range& c);
1126 
1127  // Functions returning iterators:
1128  Iterator2D begin();
1129  Iterator2D end();
1130 
1131  // Assignment operators:
1133  MatrixView& operator=(const MatrixView& v);
1134  MatrixView& operator=(const Matrix& v);
1137 
1138  // Other operators:
1143 
1148 
1153 
1154  // Conversion to a plain C-array
1155  const Numeric* get_c_array() const;
1156  Numeric* get_c_array();
1157 
1159  virtual ~MatrixView() = default;
1160 
1161  // Friends:
1162  friend class VectorView;
1163  friend class Iterator3D;
1164  friend class Tensor3View;
1165  friend class Tensor4View;
1166  friend class Tensor5View;
1167  friend class Tensor6View;
1168  friend class Tensor7View;
1169  friend class ComplexMatrixView;
1171  friend MatrixView transpose(MatrixView m);
1172  friend void mult(MatrixView, const ConstMatrixView&, const ConstMatrixView&);
1173 
1174  protected:
1175  // Constructors:
1176  MatrixView() = default;
1177  MatrixView(Numeric* data, const Range& r, const Range& c);
1179  const Range& pr,
1180  const Range& pc,
1181  const Range& nr,
1182  const Range& nc);
1183 };
1184 
1193 class Matrix : public MatrixView {
1194  public:
1195  // Constructors:
1196  Matrix() = default;
1197  Matrix(Index r, Index c);
1198  Matrix(Index r, Index c, Numeric fill);
1199  Matrix(const ConstMatrixView& v);
1200  Matrix(const Matrix& v);
1201  Matrix(Matrix&& v) noexcept : MatrixView(std::forward<MatrixView>(v)) {
1202  v.mdata = nullptr;
1203  }
1204 
1205  // Assignment operators:
1206  Matrix& operator=(const Matrix& x);
1207  Matrix& operator=(Matrix&& x) noexcept;
1209  Matrix& operator=(const ConstVectorView& v);
1210 
1211  // Resize function:
1212  void resize(Index r, Index c);
1213 
1214  // Swap function:
1215  friend void swap(Matrix& m1, Matrix& m2);
1216 
1217  // Destructor:
1218  virtual ~Matrix();
1219 
1220  Numeric* get_raw_data() { return mdata; }
1221 };
1222 
1223 // Function declarations:
1224 // ----------------------
1225 
1226 void copy(ConstIterator1D origin,
1227  const ConstIterator1D& end,
1228  Iterator1D target);
1229 
1231 void copy(Numeric x, Iterator1D target, const Iterator1D& end);
1232 
1233 void copy(ConstIterator2D origin,
1234  const ConstIterator2D& end,
1235  Iterator2D target);
1236 
1237 void copy(Numeric x, Iterator2D target, const Iterator2D& end);
1238 
1239 void mult(VectorView y, const ConstMatrixView& M, const ConstVectorView& x);
1240 
1241 void mult_general(MatrixView A,
1242  const ConstMatrixView& B,
1243  const ConstMatrixView& C);
1244 
1245 void mult(MatrixView A, const ConstMatrixView& B, const ConstMatrixView& C);
1246 
1247 void mult_general(MatrixView A,
1248  const ConstMatrixView& B,
1249  const ConstMatrixView& C);
1250 
1251 void cross3(VectorView c, const ConstVectorView& a, const ConstVectorView& b);
1252 
1254 
1256 
1258 
1260 
1261 void transform(VectorView y, double (&my_func)(double), ConstVectorView x);
1262 
1263 void transform(MatrixView y, double (&my_func)(double), ConstMatrixView x);
1264 
1265 Numeric max(const ConstVectorView& x);
1266 
1267 Numeric max(const ConstMatrixView& x);
1268 
1269 Numeric min(const ConstVectorView& x);
1270 
1271 Numeric min(const ConstMatrixView& x);
1272 
1273 Numeric mean(const ConstVectorView& x);
1274 
1275 Numeric mean(const ConstMatrixView& x);
1276 
1277 Numeric operator*(const ConstVectorView& a, const ConstVectorView& b);
1278 
1279 std::ostream& operator<<(std::ostream& os, const ConstVectorView& v);
1280 
1281 std::ostream& operator<<(std::ostream& os, const ConstMatrixView& v);
1282 
1283 std::ostream& operator<<(std::ostream& os, const Range& r);
1284 
1285 // Converts constant matrix to constant eigen map
1287 // Converts constant vector to constant eigen row-view
1289 // Converts constant vector to constant eigen row-view
1291 // Converts constant vector to constant eigen row-view
1293 // Converts constant vector to constant eigen column-view
1295 // Converts matrix to eigen map
1297 // Converts vector to eigen map row-view
1299 // Converts vector to eigen map row-view
1301 // Converts vector to eigen map row-view
1303 // Converts vector to eigen map column-view
1305 
1307 // Helper function for debugging
1308 #ifndef NDEBUG
1309 
1311 
1312 #endif
1313 
1315 #endif // matpackI_h
ConstMatrixView::ConstMatrixView
ConstMatrixView()=default
Matrix
The Matrix class.
Definition: matpackI.h:1193
ConstIterator7D
Const version of Iterator7D.
Definition: matpackVII.h:84
Tensor7View
The Tensor7View class.
Definition: matpackVII.h:1286
Iterator1D::mx
Numeric * mx
Current position.
Definition: matpackI.h:413
ConstIterator1D::copy
friend void copy(ConstIterator1D origin, const ConstIterator1D &end, Iterator1D target)
Definition: matpackI.cc:302
MapToEigen4x4
ConstMatrix4x4ViewMap MapToEigen4x4(const ConstMatrixView &A)
Definition: matpackI.cc:1720
ConstIterator1D::operator++
ConstIterator1D & operator++()
Prefix increment operator.
Definition: matpackI.h:438
transform
void transform(VectorView y, double(&my_func)(double), ConstVectorView x)
A generic transform function for vectors, which can be used to implement mathematical functions opera...
Definition: matpackI.cc:1476
ConstVectorView::operator*
friend Numeric operator*(const ConstVectorView &a, const ConstVectorView &b)
Scalar product.
Definition: matpackI.cc:1092
Iterator1D::reference
Numeric & reference
Definition: matpackI.h:365
MatrixView
The MatrixView class.
Definition: matpackI.h:1093
MatrixView::MatrixView
MatrixView()=default
MatrixView::MatrixView
constexpr MatrixView(const MatrixView &)=default
Iterator2D::operator!=
bool operator!=(const Iterator2D &other) const
Not equal operator, needed for algorithms like copy.
Definition: matpackI.h:784
matpack.h
ConstVectorView::~ConstVectorView
virtual ~ConstVectorView()=default
Destructor.
ConstIterator2D::msv
ConstVectorView msv
Current position.
Definition: matpackI.h:845
Range::operator()
constexpr Index operator()(const Index i) const
Definition: matpackI.h:346
ConstMatrixViewMap
Eigen::Map< const MatrixType, 0, StrideType > ConstMatrixViewMap
Definition: matpackI.h:111
Iterator2D::operator++
Iterator2D & operator++()
Prefix increment operator.
Definition: matpackI.h:778
StrideType
Eigen::Stride< Eigen::Dynamic, Eigen::Dynamic > StrideType
Definition: matpackI.h:104
MatrixView::operator=
MatrixView & operator=(const ConstMatrixView &v)
Assignment operator.
Definition: matpackI.cc:633
ConstIterator2D::operator*
const ConstVectorView & operator*() const
Dereferencing.
Definition: matpackI.h:841
Tensor3
The Tensor3 class.
Definition: matpackIII.h:339
Matrix4x4Type
Eigen::Matrix< Numeric, 4, 4, Eigen::RowMajor > Matrix4x4Type
Definition: matpackI.h:112
ConstIterator1D
The constant iterator class for sub vectors.
Definition: matpackI.h:420
ConstMatrixView::poly_root_solve
friend int poly_root_solve(Matrix &roots, Vector &coeffs)
Definition: poly_roots.cc:90
ConstComplexIterator2D
The const row iterator class for sub matrices.
Definition: complex.h:522
Iterator1D::Iterator1D
Iterator1D(Numeric *x, Index stride)
Explicit constructor.
Definition: matpackI.h:372
MatrixView::get
Numeric get(Index r, Index c) const
Get element implementation without assertions.
Definition: matpackI.h:1009
MapToEigen
ConstMatrixViewMap MapToEigen(const ConstMatrixView &A)
Definition: matpackI.cc:1652
transpose
ConstMatrixView transpose(ConstMatrixView m)
Const version of transpose.
Definition: matpackI.cc:1444
ConstMatrixView::operator=
ConstMatrixView & operator=(const ConstMatrixView &)=default
ConstTensor7View
A constant view of a Tensor7.
Definition: matpackVII.h:147
ConstVectorView::operator=
ConstVectorView & operator=(const ConstVectorView &)=default
Matrix::get_raw_data
Numeric * get_raw_data()
Definition: matpackI.h:1220
MatrixView::iterator
Iterator2D iterator
Definition: matpackI.h:1104
ComplexVector
The ComplexVector class.
Definition: complex.h:573
Matrix4x4ViewMap
Eigen::Map< Matrix4x4Type, 0, StrideType > Matrix4x4ViewMap
Definition: matpackI.h:113
ConstMatrixView::const_iterator
ConstIterator2D const_iterator
Definition: matpackI.h:990
Iterator2D::mstride
Index mstride
Row stride.
Definition: matpackI.h:803
mean
Numeric mean(const ConstVectorView &x)
Mean function, vector version.
Definition: matpackI.cc:1589
MatrixView::transpose
friend ConstMatrixView transpose(ConstMatrixView m)
Const version of transpose.
Definition: matpackI.cc:1444
Iterator7D
Implementation of Tensors of Rank 7.
Definition: matpackVII.h:36
ConstIterator1D::mstride
Index mstride
Stride.
Definition: matpackI.h:462
ConstIterator3D
Const version of Iterator3D.
Definition: matpackIII.h:76
ConstIterator1D::value_type
const Numeric value_type
Definition: matpackI.h:423
vector_angle
Numeric vector_angle(ConstVectorView a, ConstVectorView b)
Definition: matpackI.cc:1412
ConstMatrixView::MapToEigen
friend ConstMatrixViewMap MapToEigen(const ConstMatrixView &)
Definition: matpackI.cc:1652
ConstMatrixView::mdata
Numeric * mdata
Pointer to the plain C array that holds the data.
Definition: matpackI.h:1081
Sparse
The Sparse class.
Definition: matpackII.h:60
Iterator1D::copy
friend void copy(ConstIterator1D origin, const ConstIterator1D &end, Iterator1D target)
Copy data between begin and end to target.
Definition: matpackI.cc:302
operator==
bool operator==(const QuantumIdentifier &a, const QuantumIdentifier &b)
Is everything the same between the identifiers.
Definition: quantum.h:702
Iterator2D::Iterator2D
Iterator2D(const VectorView &x, Index stride)
Explicit constructor.
Definition: matpackI.h:772
ARTS::Var::y
Vector y(Workspace &ws) noexcept
Definition: autoarts.h:7401
ConstMatrixView::operator=
ConstMatrixView & operator=(ConstMatrixView &&)=default
Vector::resize
void resize(Index n)
Resize function.
Definition: matpackI.cc:404
Range::Range
constexpr Range(const Range &p, const Range &n)
Constructor of a new range relative to an old range.
Definition: matpackI.h:239
MatrixView::operator+=
MatrixView & operator+=(Numeric x)
Addition of scalar.
Definition: matpackI.cc:710
Vector::Vector
Vector(Vector &&v) noexcept
Definition: matpackI.h:893
VectorView::VectorView
VectorView()=default
data
G0 G2 FVC Y DV Numeric Numeric Numeric Zeeman LowerQuantumNumbers void * data
Definition: arts_api_classes.cc:232
ConstVectorView::get
Numeric get(Index n) const
Get element implementation without assertions.
Definition: matpackI.h:514
VectorView::iterator
Iterator1D iterator
Definition: matpackI.h:628
ConstMatrixView::nrows
Index nrows() const
Returns the number of rows.
Definition: matpackI.cc:429
copy
void copy(ConstIterator1D origin, const ConstIterator1D &end, Iterator1D target)
Definition: matpackI.cc:302
VectorView::~VectorView
virtual ~VectorView()=default
Destructor.
Iterator1D::pointer
Numeric * pointer
Definition: matpackI.h:364
Matrix::swap
friend void swap(Matrix &m1, Matrix &m2)
Swaps two objects.
Definition: matpackI.cc:1075
ConstVectorView::mrange
Range mrange
The range of mdata that is actually used.
Definition: matpackI.h:594
Range::mstart
Index mstart
The start index.
Definition: matpackI.h:346
Iterator5D
Implementation of Tensors of Rank 5.
Definition: matpackV.h:38
MatrixView::operator-=
MatrixView & operator-=(Numeric x)
Subtraction of scalar.
Definition: matpackI.cc:720
ConstMatrixView::get
Numeric get(Index r, Index c) const
Get element implementation without assertions.
Definition: matpackI.h:1009
MatrixView::operator/=
MatrixView & operator/=(Numeric x)
Division by scalar.
Definition: matpackI.cc:700
Iterator2D::Iterator2D
Iterator2D()=default
Default constructor.
ConstMatrixView::transpose
friend ConstMatrixView transpose(ConstMatrixView m)
Const version of transpose.
Definition: matpackI.cc:1444
ConstVectorView::poly_root_solve
friend int poly_root_solve(Matrix &roots, Vector &coeffs)
Definition: poly_roots.cc:90
VectorView::get
Numeric get(Index n) const
Get element implementation without assertions.
Definition: matpackI.h:514
Tensor4
The Tensor4 class.
Definition: matpackIV.h:421
array.h
This file contains the definition of Array.
VectorView::VectorView
constexpr VectorView(const VectorView &)=default
mult
void mult(VectorView y, const ConstMatrixView &M, const ConstVectorView &x)
Matrix-Vector Multiplication.
Definition: matpackI.cc:1123
MatrixView::get
Numeric & get(Index r, Index c)
Get element implementation without assertions.
Definition: matpackI.h:1118
ConstMatrixView::mcr
Range mcr
The column range of mdata that is actually used.
Definition: matpackI.h:1079
ConstIterator1D::ConstIterator1D
ConstIterator1D(const Numeric *x, Index stride)
Explicit constructor.
Definition: matpackI.h:432
VectorView::operator=
VectorView & operator=(const ConstVectorView &v)
Assignment operator.
Definition: matpackI.cc:153
VectorView::operator/=
VectorView operator/=(Numeric x)
Division by scalar.
Definition: matpackI.cc:197
ConstMatrixView::mrr
Range mrr
The row range of mdata that is actually used.
Definition: matpackI.h:1077
Range::get_start
constexpr Index get_start() const
Returns the start index of the range.
Definition: matpackI.h:327
ConstVectorView::operator=
ConstVectorView & operator=(ConstVectorView &&)=default
ConstIterator4D
Const version of Iterator4D.
Definition: matpackIV.h:77
ConstMatrixView::ludcmp
friend void ludcmp(Matrix &, ArrayOfIndex &, ConstMatrixView)
LU decomposition.
Definition: lin_alg.cc:56
ConstTensor4View
A constant view of a Tensor4.
Definition: matpackIV.h:133
ARTS::Continua::init
Workspace & init(Workspace &ws)
Definition: test_cpp_api.cc:145
Tensor3View
The Tensor3View class.
Definition: matpackIII.h:239
MapToEigenRow
ConstMatrixViewMap MapToEigenRow(const ConstVectorView &A)
Definition: matpackI.cc:1668
Array< Index >
mult_general
void mult_general(MatrixView A, const ConstMatrixView &B, const ConstMatrixView &C)
General matrix multiplication.
Definition: matpackI.cc:1346
Iterator3D
Implementation of Tensors of Rank 3.
Definition: matpackIII.h:34
ConstVectorView::mult
friend void mult(VectorView, const ConstMatrixView &, const ConstVectorView &)
Matrix-Vector Multiplication.
Definition: matpackI.cc:1123
Vector::Vector
Vector()=default
ConstVectorView::end
ConstIterator1D end() const
Return const iterator behind last element.
Definition: matpackI.cc:71
MatrixView::~MatrixView
virtual ~MatrixView()=default
Destructor.
ConstMatrixView::end
ConstIterator2D end() const
Return const iterator behind last row.
Definition: matpackI.cc:474
Iterator1D::value_type
Numeric value_type
Definition: matpackI.h:363
ConstIterator1D::ConstIterator1D
ConstIterator1D()=default
Default constructor.
debug_matrixview_get_elem
Numeric debug_matrixview_get_elem(MatrixView &mv, Index r, Index c)
Helper function to access matrix elements.
Definition: matpackI.cc:1745
Matrix::Matrix
Matrix()=default
Matrix::~Matrix
virtual ~Matrix()
Destructor for Matrix.
Definition: matpackI.cc:1083
operator<<
std::ostream & operator<<(std::ostream &os, const ConstVectorView &v)
Definition: matpackI.cc:107
ConstIterator2D::ConstIterator2D
ConstIterator2D()=default
Default constructor.
ComplexIterator2D
The row iterator class for sub matrices.
Definition: complex.h:478
Iterator1D::iterator_category
std::random_access_iterator_tag iterator_category
Definition: matpackI.h:366
Vector::operator=
Vector & operator=(const Vector &v)
Assignment from another Vector.
Definition: matpackI.cc:374
ConstIterator6D
Const version of Iterator6D.
Definition: matpackVI.h:87
ConstMatrixView::ncols
Index ncols() const
Returns the number of columns.
Definition: matpackI.cc:432
max
Numeric max(const ConstVectorView &x)
Max function, vector version.
Definition: matpackI.cc:1521
ConstVectorView::transpose_mult
friend void transpose_mult(VectorView, const Sparse &, ConstVectorView)
Sparse matrix - Vector multiplication.
Definition: matpackII.cc:452
Iterator1D
The iterator class for sub vectors.
Definition: matpackI.h:360
ConstVectorView::MapToEigenCol
friend ConstMatrixViewMap MapToEigenCol(const ConstVectorView &)
Definition: matpackI.cc:1673
ConstIterator2D::operator!=
bool operator!=(const ConstIterator2D &other) const
Not equal operator, needed for algorithms like copy.
Definition: matpackI.h:828
ConstVectorView::nelem
Index nelem() const
Returns the number of elements.
Definition: matpackI.cc:51
Vector::~Vector
virtual ~Vector()
Destructor for Vector.
Definition: matpackI.cc:420
VectorView
The VectorView class.
Definition: matpackI.h:610
ConstIterator1D::operator*
const Numeric & operator*() const
Dereferencing.
Definition: matpackI.h:444
ConstVectorView::begin
ConstIterator1D begin() const
Return const iterator to first element.
Definition: matpackI.cc:67
ConstMatrixView::mult_general
friend void mult_general(VectorView, const ConstMatrixView &, const ConstVectorView &)
Matrix Vector multiplication.
Definition: matpackI.cc:1181
ComplexMatrix
The ComplexMatrix class.
Definition: complex.h:858
ConstVectorView::sum
Numeric sum() const
The sum of all elements of a Vector.
Definition: matpackI.cc:53
MatrixView::begin
Iterator2D begin()
‍** Return const iterator to first row. Has to be redefined here, since it is
Definition: matpackI.cc:618
ConstTensor6View
A constant view of a Tensor6.
Definition: matpackVI.h:149
Numeric
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33
Tensor5View
The Tensor5View class.
Definition: matpackV.h:333
Iterator1D::operator*
Numeric & operator*() const
Dereferencing.
Definition: matpackI.h:385
ConstIterator2D::mstride
Index mstride
Row stride.
Definition: matpackI.h:847
ConstMatrixView::lubacksub
friend void lubacksub(VectorView, ConstMatrixView, ConstVectorView, const ArrayOfIndex &)
LU backsubstitution.
Definition: lin_alg.cc:91
Iterator2D::operator*
VectorView & operator*()
Dereferencing.
Definition: matpackI.h:797
Vector::swap
friend void swap(Vector &v1, Vector &v2)
Swaps two objects.
Definition: matpackI.cc:415
ConstVectorView::ConstVectorView
ConstVectorView()=default
ConstIterator2D::ConstIterator2D
ConstIterator2D(const ConstVectorView &x, Index stride)
Explicit constructor.
Definition: matpackI.h:816
ConstMatrixView::MapToEigen4x4
friend ConstMatrix4x4ViewMap MapToEigen4x4(const ConstMatrixView &)
Definition: matpackI.cc:1720
MatrixView::operator()
Numeric & operator()(Index r, Index c)
Plain index operator.
Definition: matpackI.h:1108
ConstMatrixView::ConstMatrixView
constexpr ConstMatrixView(const ConstMatrixView &)=default
ConstVectorView::mdata
Numeric * mdata
Pointer to the plain C array that holds the data.
Definition: matpackI.h:596
ConstVectorView::operator[]
Numeric operator[](Index n) const
Plain const index operator.
Definition: matpackI.h:507
ConstIterator1D::difference_type
Index difference_type
Definition: matpackI.h:422
min
Numeric min(const ConstVectorView &x)
Min function, vector version.
Definition: matpackI.cc:1555
ConstComplexVectorView
A constant view of a ComplexVector.
Definition: complex.h:268
MatrixType
Eigen::Matrix< Numeric, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > MatrixType
Definition: matpackI.h:109
Range::Range
constexpr Range(Index start, Index extent, Index stride=1)
Explicit constructor.
Definition: matpackI.h:175
ConstVectorView::ConstVectorView
constexpr ConstVectorView(ConstVectorView &&)=default
ConstMatrixView::ConstMatrixView
constexpr ConstMatrixView(ConstMatrixView &&)=default
ConstMatrixView::operator()
Numeric operator()(Index r, Index c) const
Plain const index operator.
Definition: matpackI.h:999
Matrix::resize
void resize(Index r, Index c)
Resize function.
Definition: matpackI.cc:1056
ConstIterator1D::iterator_category
std::random_access_iterator_tag iterator_category
Definition: matpackI.h:426
ConstMatrixView::diagonal
ConstVectorView diagonal() const
Matrix diagonal as vector.
Definition: matpackI.cc:489
ConstIterator1D::operator!=
bool operator!=(const ConstIterator1D &other) const
Not equal operator, needed for algorithms like copy.
Definition: matpackI.h:447
ConstMatrixView::mult
friend void mult(VectorView, const ConstMatrixView &, const ConstVectorView &)
Matrix-Vector Multiplication.
Definition: matpackI.cc:1123
Zeeman::end
constexpr Rational end(Rational Ju, Rational Jl, Polarization type) noexcept
Gives the largest M for a polarization type of this transition.
Definition: zeemandata.h:108
Iterator6D
The outermost iterator class for rank 6 tensors.
Definition: matpackVI.h:40
ConstIterator2D
The const row iterator class for sub matrices.
Definition: matpackI.h:809
ConstMatrixView::empty
bool empty() const
Returns true if variable size is zero.
Definition: matpackI.cc:426
MatrixView::mult
friend void mult(MatrixView, const ConstMatrixView &, const ConstMatrixView &)
Matrix-Matrix Multiplication.
Definition: matpackI.cc:1242
ConstMatrixView
A constant view of a Matrix.
Definition: matpackI.h:982
Range::Range
constexpr Range(Index max_size, const Range &r)
Constructor which converts a range with joker to an explicit range.
Definition: matpackI.h:208
Range::get_extent
constexpr Index get_extent() const
Returns the extent of the range.
Definition: matpackI.h:329
cross3
void cross3(VectorView c, const ConstVectorView &a, const ConstVectorView &b)
cross3
Definition: matpackI.cc:1393
Tensor5
The Tensor5 class.
Definition: matpackV.h:506
Iterator1D::operator++
Iterator1D & operator++()
Prefix increment operator.
Definition: matpackI.h:379
ConstMatrix4x4ViewMap
Eigen::Map< const Matrix4x4Type, 0, StrideType > ConstMatrix4x4ViewMap
Definition: matpackI.h:114
Range::get_stride
constexpr Index get_stride() const
Returns the stride of the range.
Definition: matpackI.h:331
ComplexMatrixView
The ComplexMatrixView class.
Definition: complex.h:731
Range
The range class.
Definition: matpackI.h:160
Iterator1D::Iterator1D
Iterator1D()=default
Default constructor.
Range::mextent
Index mextent
The number of elements.
Definition: matpackI.h:353
MatrixViewMap
Eigen::Map< MatrixType, 0, StrideType > MatrixViewMap
Definition: matpackI.h:110
Iterator2D::msv
VectorView msv
Current position.
Definition: matpackI.h:801
VectorView::operator*=
VectorView operator*=(Numeric x)
Multiplication by scalar.
Definition: matpackI.cc:191
ConstIterator1D::pointer
const Numeric * pointer
Definition: matpackI.h:424
VectorView::operator[]
Numeric & operator[](Index n)
Plain Index operator.
Definition: matpackI.h:631
Iterator4D
Implementation of Tensors of Rank 4.
Definition: matpackIV.h:38
Zeeman::start
constexpr Rational start(Rational Ju, Rational Jl, Polarization type) noexcept
Gives the lowest M for a polarization type of this transition.
Definition: zeemandata.h:77
VectorView::operator-=
VectorView operator-=(Numeric x)
Subtraction of scalar.
Definition: matpackI.cc:209
Joker
The Joker class.
Definition: matpackI.h:126
Iterator1D::mstride
Index mstride
Stride.
Definition: matpackI.h:415
Range::mult_general
friend void mult_general(VectorView, const ConstMatrixView &, const ConstVectorView &)
Matrix Vector multiplication.
Definition: matpackI.cc:1181
VectorView::end
Iterator1D end()
Return iterator behind last element.
Definition: matpackI.cc:148
ConstVectorView::empty
bool empty() const
Returns true if variable size is zero.
Definition: matpackI.cc:49
ConstTensor3View
A constant view of a Tensor3.
Definition: matpackIII.h:132
Tensor4View
The Tensor4View class.
Definition: matpackIV.h:284
VectorView::get
Numeric & get(Index n)
Get element implementation without assertions.
Definition: matpackI.h:638
ConstVectorView::lubacksub
friend void lubacksub(VectorView, ConstMatrixView, ConstVectorView, const ArrayOfIndex &)
LU backsubstitution.
Definition: lin_alg.cc:91
ConstComplexMatrixView
A constant view of a ComplexMatrix.
Definition: complex.h:618
ConstMatrixView::begin
ConstIterator2D begin() const
Return const iterator to first row.
Definition: matpackI.cc:469
VectorView::MatrixView
friend class MatrixView
Definition: matpackI.h:729
VectorView::begin
Iterator1D begin()
Return iterator to first element.
Definition: matpackI.cc:144
Range::Range
constexpr Range(Index start, Joker, Index stride=1)
Constructor with joker extent.
Definition: matpackI.h:190
Matrix::operator=
Matrix & operator=(const Matrix &x)
Assignment operator from another matrix.
Definition: matpackI.cc:1004
MatrixView::end
Iterator2D end()
Return iterator behind last row.
Definition: matpackI.cc:623
Iterator2D
The row iterator class for sub matrices.
Definition: matpackI.h:765
joker
const Joker joker
ConstIterator2D::operator++
ConstIterator2D & operator++()
Prefix increment operator.
Definition: matpackI.h:822
ConstIterator2D::operator->
const ConstVectorView * operator->() const
The -> operator is needed, so that we can write i->begin() to get the 1D iterators.
Definition: matpackI.h:838
ConstMatrixView::inv
friend void inv(MatrixView, ConstMatrixView)
Matrix Inverse.
Definition: lin_alg.cc:167
ARTS::Var::x
Vector x(Workspace &ws) noexcept
Definition: autoarts.h:7346
Matrix::Matrix
Matrix(Matrix &&v) noexcept
Definition: matpackI.h:1201
Range::Range
constexpr Range(Joker, Index stride=1)
Constructor with just a joker.
Definition: matpackI.h:199
ConstMatrixView::diagonalize
friend void diagonalize(MatrixView, VectorView, VectorView, ConstMatrixView)
Matrix Diagonalization.
Definition: lin_alg.cc:245
Index
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
MatrixView::operator*=
MatrixView & operator*=(Numeric x)
Multiplication by scalar.
Definition: matpackI.cc:690
ConstVectorView::const_iterator
ConstIterator1D const_iterator
Definition: matpackI.h:484
Iterator1D::difference_type
Index difference_type
Definition: matpackI.h:362
operator-
constexpr Complex operator-(Complex c, Numeric n)
Definition: complex.h:73
Tensor6
The Tensor6 class.
Definition: matpackVI.h:1088
ConstMatrixView::~ConstMatrixView
virtual ~ConstMatrixView()=default
Destructor.
operator*
Numeric operator*(const ConstVectorView &a, const ConstVectorView &b)
Scalar product.
Definition: matpackI.cc:1092
MatrixView::get_c_array
const Numeric * get_c_array() const
Conversion to plain C-array.
Definition: matpackI.cc:735
Iterator1D::operator!=
bool operator!=(const Iterator1D &other) const
Not equal operator, needed for algorithms like copy.
Definition: matpackI.h:388
M
#define M
Definition: rng.cc:165
Vector
The Vector class.
Definition: matpackI.h:860
ConstIterator5D
Const version of Iterator5D.
Definition: matpackV.h:85
ConstVectorView::diagonalize
friend void diagonalize(MatrixView, VectorView, VectorView, ConstMatrixView)
Matrix Diagonalization.
Definition: lin_alg.cc:245
ConstVectorView::MapToEigen
friend ConstMatrixViewMap MapToEigen(const ConstVectorView &)
Definition: matpackI.cc:1660
Range::mstride
Index mstride
The stride.
Definition: matpackI.h:355
proj
void proj(Vector &c, ConstVectorView a, ConstVectorView b)
Definition: matpackI.cc:1434
ConstVectorView
A constant view of a Vector.
Definition: matpackI.h:476
ConstIterator1D::reference
const Numeric & reference
Definition: matpackI.h:425
VectorView::operator+=
VectorView operator+=(Numeric x)
Addition of scalar.
Definition: matpackI.cc:203
Range::operator()
constexpr Range operator()(const Range r) const
Range of range.
Definition: matpackI.h:334
ComplexVectorView
The ComplexVectorView class.
Definition: complex.h:367
ConstVectorView::ConstMatrixView
friend class ConstMatrixView
Definition: matpackI.h:542
ConstVectorView::ConstVectorView
constexpr ConstVectorView(const ConstVectorView &)=default
ConstIterator1D::mx
const Numeric * mx
Current position.
Definition: matpackI.h:460
ConstTensor5View
A constant view of a Tensor5.
Definition: matpackV.h:143
VectorView::get_c_array
const Numeric * get_c_array() const
Conversion to plain C-array, const-version.
Definition: matpackI.cc:272
Tensor7
The Tensor7 class.
Definition: matpackVII.h:2382
Tensor6View
The Tensor6View class.
Definition: matpackVI.h:621
MapToEigenCol
ConstMatrixViewMap MapToEigenCol(const ConstVectorView &A)
Definition: matpackI.cc:1673
bofstream
Binary output file stream class.
Definition: bofstream.h:42
Iterator2D::operator->
VectorView * operator->()
The -> operator is needed, so that we can write i->begin() to get the 1D iterators.
Definition: matpackI.h:794
ConstVectorView::mult_general
friend void mult_general(VectorView, const ConstMatrixView &, const ConstVectorView &)
Matrix Vector multiplication.
Definition: matpackI.cc:1181