Go to the documentation of this file.
98 #include <Eigen/Dense>
107 typedef Eigen::Stride<Eigen::Dynamic, Eigen::Dynamic>
StrideType;
108 typedef Eigen::Matrix<Numeric, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>
213 assert(
mstart < max_size);
229 assert(fin < max_size);
271 assert(fin <= prev_fin);
615 using ConstVectorView::operator[];
898 Vector(
const std::vector<Numeric>&);
1098 using ConstMatrixView::operator();
1315 #endif // matpackI_h
ConstMatrixView()=default
Const version of Iterator7D.
Numeric * mx
Current position.
friend void copy(ConstIterator1D origin, const ConstIterator1D &end, Iterator1D target)
ConstMatrix4x4ViewMap MapToEigen4x4(const ConstMatrixView &A)
ConstIterator1D & operator++()
Prefix increment operator.
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...
friend Numeric operator*(const ConstVectorView &a, const ConstVectorView &b)
Scalar product.
constexpr MatrixView(const MatrixView &)=default
bool operator!=(const Iterator2D &other) const
Not equal operator, needed for algorithms like copy.
virtual ~ConstVectorView()=default
Destructor.
ConstVectorView msv
Current position.
constexpr Index operator()(const Index i) const
Eigen::Map< const MatrixType, 0, StrideType > ConstMatrixViewMap
Iterator2D & operator++()
Prefix increment operator.
Eigen::Stride< Eigen::Dynamic, Eigen::Dynamic > StrideType
MatrixView & operator=(const ConstMatrixView &v)
Assignment operator.
const ConstVectorView & operator*() const
Dereferencing.
Eigen::Matrix< Numeric, 4, 4, Eigen::RowMajor > Matrix4x4Type
The constant iterator class for sub vectors.
friend int poly_root_solve(Matrix &roots, Vector &coeffs)
The const row iterator class for sub matrices.
Iterator1D(Numeric *x, Index stride)
Explicit constructor.
Numeric get(Index r, Index c) const
Get element implementation without assertions.
ConstMatrixViewMap MapToEigen(const ConstMatrixView &A)
ConstMatrixView transpose(ConstMatrixView m)
Const version of transpose.
ConstMatrixView & operator=(const ConstMatrixView &)=default
A constant view of a Tensor7.
ConstVectorView & operator=(const ConstVectorView &)=default
Eigen::Map< Matrix4x4Type, 0, StrideType > Matrix4x4ViewMap
ConstIterator2D const_iterator
Numeric mean(const ConstVectorView &x)
Mean function, vector version.
friend ConstMatrixView transpose(ConstMatrixView m)
Const version of transpose.
Implementation of Tensors of Rank 7.
Const version of Iterator3D.
Numeric vector_angle(ConstVectorView a, ConstVectorView b)
friend ConstMatrixViewMap MapToEigen(const ConstMatrixView &)
Numeric * mdata
Pointer to the plain C array that holds the data.
friend void copy(ConstIterator1D origin, const ConstIterator1D &end, Iterator1D target)
Copy data between begin and end to target.
bool operator==(const QuantumIdentifier &a, const QuantumIdentifier &b)
Is everything the same between the identifiers.
Iterator2D(const VectorView &x, Index stride)
Explicit constructor.
Vector y(Workspace &ws) noexcept
ConstMatrixView & operator=(ConstMatrixView &&)=default
void resize(Index n)
Resize function.
constexpr Range(const Range &p, const Range &n)
Constructor of a new range relative to an old range.
MatrixView & operator+=(Numeric x)
Addition of scalar.
Vector(Vector &&v) noexcept
G0 G2 FVC Y DV Numeric Numeric Numeric Zeeman LowerQuantumNumbers void * data
Numeric get(Index n) const
Get element implementation without assertions.
Index nrows() const
Returns the number of rows.
void copy(ConstIterator1D origin, const ConstIterator1D &end, Iterator1D target)
virtual ~VectorView()=default
Destructor.
friend void swap(Matrix &m1, Matrix &m2)
Swaps two objects.
Range mrange
The range of mdata that is actually used.
Index mstart
The start index.
Implementation of Tensors of Rank 5.
MatrixView & operator-=(Numeric x)
Subtraction of scalar.
Numeric get(Index r, Index c) const
Get element implementation without assertions.
MatrixView & operator/=(Numeric x)
Division by scalar.
Iterator2D()=default
Default constructor.
friend ConstMatrixView transpose(ConstMatrixView m)
Const version of transpose.
friend int poly_root_solve(Matrix &roots, Vector &coeffs)
Numeric get(Index n) const
Get element implementation without assertions.
This file contains the definition of Array.
constexpr VectorView(const VectorView &)=default
void mult(VectorView y, const ConstMatrixView &M, const ConstVectorView &x)
Matrix-Vector Multiplication.
Numeric & get(Index r, Index c)
Get element implementation without assertions.
Range mcr
The column range of mdata that is actually used.
ConstIterator1D(const Numeric *x, Index stride)
Explicit constructor.
VectorView & operator=(const ConstVectorView &v)
Assignment operator.
VectorView operator/=(Numeric x)
Division by scalar.
Range mrr
The row range of mdata that is actually used.
constexpr Index get_start() const
Returns the start index of the range.
ConstVectorView & operator=(ConstVectorView &&)=default
Const version of Iterator4D.
friend void ludcmp(Matrix &, ArrayOfIndex &, ConstMatrixView)
LU decomposition.
A constant view of a Tensor4.
Workspace & init(Workspace &ws)
ConstMatrixViewMap MapToEigenRow(const ConstVectorView &A)
void mult_general(MatrixView A, const ConstMatrixView &B, const ConstMatrixView &C)
General matrix multiplication.
Implementation of Tensors of Rank 3.
friend void mult(VectorView, const ConstMatrixView &, const ConstVectorView &)
Matrix-Vector Multiplication.
ConstIterator1D end() const
Return const iterator behind last element.
virtual ~MatrixView()=default
Destructor.
ConstIterator2D end() const
Return const iterator behind last row.
ConstIterator1D()=default
Default constructor.
Numeric debug_matrixview_get_elem(MatrixView &mv, Index r, Index c)
Helper function to access matrix elements.
virtual ~Matrix()
Destructor for Matrix.
std::ostream & operator<<(std::ostream &os, const ConstVectorView &v)
ConstIterator2D()=default
Default constructor.
The row iterator class for sub matrices.
std::random_access_iterator_tag iterator_category
Vector & operator=(const Vector &v)
Assignment from another Vector.
Const version of Iterator6D.
Index ncols() const
Returns the number of columns.
Numeric max(const ConstVectorView &x)
Max function, vector version.
friend void transpose_mult(VectorView, const Sparse &, ConstVectorView)
Sparse matrix - Vector multiplication.
The iterator class for sub vectors.
friend ConstMatrixViewMap MapToEigenCol(const ConstVectorView &)
bool operator!=(const ConstIterator2D &other) const
Not equal operator, needed for algorithms like copy.
Index nelem() const
Returns the number of elements.
virtual ~Vector()
Destructor for Vector.
const Numeric & operator*() const
Dereferencing.
ConstIterator1D begin() const
Return const iterator to first element.
friend void mult_general(VectorView, const ConstMatrixView &, const ConstVectorView &)
Matrix Vector multiplication.
Numeric sum() const
The sum of all elements of a Vector.
Iterator2D begin()
** Return const iterator to first row. Has to be redefined here, since it is
A constant view of a Tensor6.
NUMERIC Numeric
The type to use for all floating point numbers.
Numeric & operator*() const
Dereferencing.
friend void lubacksub(VectorView, ConstMatrixView, ConstVectorView, const ArrayOfIndex &)
LU backsubstitution.
VectorView & operator*()
Dereferencing.
friend void swap(Vector &v1, Vector &v2)
Swaps two objects.
ConstVectorView()=default
ConstIterator2D(const ConstVectorView &x, Index stride)
Explicit constructor.
friend ConstMatrix4x4ViewMap MapToEigen4x4(const ConstMatrixView &)
Numeric & operator()(Index r, Index c)
Plain index operator.
constexpr ConstMatrixView(const ConstMatrixView &)=default
Numeric * mdata
Pointer to the plain C array that holds the data.
Numeric operator[](Index n) const
Plain const index operator.
Numeric min(const ConstVectorView &x)
Min function, vector version.
A constant view of a ComplexVector.
Eigen::Matrix< Numeric, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > MatrixType
constexpr Range(Index start, Index extent, Index stride=1)
Explicit constructor.
constexpr ConstVectorView(ConstVectorView &&)=default
constexpr ConstMatrixView(ConstMatrixView &&)=default
Numeric operator()(Index r, Index c) const
Plain const index operator.
void resize(Index r, Index c)
Resize function.
std::random_access_iterator_tag iterator_category
ConstVectorView diagonal() const
Matrix diagonal as vector.
bool operator!=(const ConstIterator1D &other) const
Not equal operator, needed for algorithms like copy.
friend void mult(VectorView, const ConstMatrixView &, const ConstVectorView &)
Matrix-Vector Multiplication.
constexpr Rational end(Rational Ju, Rational Jl, Polarization type) noexcept
Gives the largest M for a polarization type of this transition.
The outermost iterator class for rank 6 tensors.
The const row iterator class for sub matrices.
bool empty() const
Returns true if variable size is zero.
friend void mult(MatrixView, const ConstMatrixView &, const ConstMatrixView &)
Matrix-Matrix Multiplication.
A constant view of a Matrix.
constexpr Range(Index max_size, const Range &r)
Constructor which converts a range with joker to an explicit range.
constexpr Index get_extent() const
Returns the extent of the range.
void cross3(VectorView c, const ConstVectorView &a, const ConstVectorView &b)
cross3
Iterator1D & operator++()
Prefix increment operator.
Eigen::Map< const Matrix4x4Type, 0, StrideType > ConstMatrix4x4ViewMap
constexpr Index get_stride() const
Returns the stride of the range.
The ComplexMatrixView class.
Iterator1D()=default
Default constructor.
Index mextent
The number of elements.
Eigen::Map< MatrixType, 0, StrideType > MatrixViewMap
VectorView msv
Current position.
VectorView operator*=(Numeric x)
Multiplication by scalar.
Numeric & operator[](Index n)
Plain Index operator.
Implementation of Tensors of Rank 4.
constexpr Rational start(Rational Ju, Rational Jl, Polarization type) noexcept
Gives the lowest M for a polarization type of this transition.
VectorView operator-=(Numeric x)
Subtraction of scalar.
friend void mult_general(VectorView, const ConstMatrixView &, const ConstVectorView &)
Matrix Vector multiplication.
Iterator1D end()
Return iterator behind last element.
bool empty() const
Returns true if variable size is zero.
A constant view of a Tensor3.
Numeric & get(Index n)
Get element implementation without assertions.
friend void lubacksub(VectorView, ConstMatrixView, ConstVectorView, const ArrayOfIndex &)
LU backsubstitution.
A constant view of a ComplexMatrix.
ConstIterator2D begin() const
Return const iterator to first row.
Iterator1D begin()
Return iterator to first element.
constexpr Range(Index start, Joker, Index stride=1)
Constructor with joker extent.
Matrix & operator=(const Matrix &x)
Assignment operator from another matrix.
Iterator2D end()
Return iterator behind last row.
The row iterator class for sub matrices.
ConstIterator2D & operator++()
Prefix increment operator.
const ConstVectorView * operator->() const
The -> operator is needed, so that we can write i->begin() to get the 1D iterators.
friend void inv(MatrixView, ConstMatrixView)
Matrix Inverse.
Vector x(Workspace &ws) noexcept
Matrix(Matrix &&v) noexcept
constexpr Range(Joker, Index stride=1)
Constructor with just a joker.
friend void diagonalize(MatrixView, VectorView, VectorView, ConstMatrixView)
Matrix Diagonalization.
INDEX Index
The type to use for all integer numbers and indices.
MatrixView & operator*=(Numeric x)
Multiplication by scalar.
ConstIterator1D const_iterator
constexpr Complex operator-(Complex c, Numeric n)
virtual ~ConstMatrixView()=default
Destructor.
Numeric operator*(const ConstVectorView &a, const ConstVectorView &b)
Scalar product.
const Numeric * get_c_array() const
Conversion to plain C-array.
bool operator!=(const Iterator1D &other) const
Not equal operator, needed for algorithms like copy.
Const version of Iterator5D.
friend void diagonalize(MatrixView, VectorView, VectorView, ConstMatrixView)
Matrix Diagonalization.
friend ConstMatrixViewMap MapToEigen(const ConstVectorView &)
void proj(Vector &c, ConstVectorView a, ConstVectorView b)
A constant view of a Vector.
const Numeric & reference
VectorView operator+=(Numeric x)
Addition of scalar.
constexpr Range operator()(const Range r) const
Range of range.
The ComplexVectorView class.
friend class ConstMatrixView
constexpr ConstVectorView(const ConstVectorView &)=default
const Numeric * mx
Current position.
A constant view of a Tensor5.
const Numeric * get_c_array() const
Conversion to plain C-array, const-version.
ConstMatrixViewMap MapToEigenCol(const ConstVectorView &A)
Binary output file stream class.
VectorView * operator->()
The -> operator is needed, so that we can write i->begin() to get the 1D iterators.
friend void mult_general(VectorView, const ConstMatrixView &, const ConstVectorView &)
Matrix Vector multiplication.