32 using std::runtime_error;
64 for (; i != e; ++
i) s += *i;
142 for (; i !=
end; ++
i) {
143 os <<
" " << setw(3) << *
i;
156 "Creating a ComplexVectorView from a const ComplexVector is not allowed.");
307 for (; i != e; ++
i, ++s) *i *= *s;
320 for (; i != e; ++
i, ++s) *i *= *s;
334 for (; i != e; ++
i, ++s) *i /= *s;
347 for (; i != e; ++
i, ++s) *i /= *s;
361 for (; i != e; ++
i, ++s) *i += *s;
374 for (; i != e; ++
i, ++s) *i += *s;
388 for (; i != e; ++
i, ++s) *i -= *s;
401 for (; i != e; ++
i, ++s) *i -= *s;
424 "A ComplexVectorView can only be converted to a plain C-array if it's pointing to a continuous block of data");
438 "A VectorView can only be converted to a plain C-array if it's pointing to a continuous block of data");
482 memcpy((
void*)target.
mx,
486 for (; origin !=
end; ++origin, ++target) *target = *origin;
491 for (; target !=
end; ++target) *target = x;
540 for (; i != e; ++
i) {
560 for (; i != e; ++
i) {
580 for (; i != e; ++
i) {
600 for (; i != e; ++
i) {
626 std::vector<Complex>::const_iterator vec_it_end = v.
end();
628 for (std::vector<Complex>::const_iterator vec_it = v.begin();
629 vec_it != vec_it_end;
637 std::vector<Numeric>::const_iterator vec_it_end = v.
end();
639 for (std::vector<Numeric>::const_iterator vec_it = v.begin();
640 vec_it != vec_it_end;
778 assert(c < mcr.mextent);
792 assert(r < mrr.mextent);
823 Range(0, n, mrr.mstride + mcr.mstride));
832 : mrr(rr), mcr(cr),
mdata(data) {
876 os << setw(3) << *ic;
879 for (; ic != end_col; ++ic) {
880 os <<
" " << setw(3) << *ic;
884 for (; ir != end_row; ++ir) {
890 os << setw(3) << *ic;
893 for (; ic != end_col; ++ic) {
894 os <<
" " << setw(3) << *ic;
1115 throw std::runtime_error(
1116 "A MatrixView can only be converted to a plain C-array if it's pointing to a continuous block of data");
1130 throw std::runtime_error(
1131 "A MatrixView can only be converted to a plain C-array if it's pointing to a continuous block of data");
1144 for (; r != er; ++
r, ++sr) {
1148 for (; c != ec; ++c, ++sc) *c *= *sc;
1160 for (; r != er; ++
r, ++sr) {
1164 for (; c != ec; ++c, ++sc) *c *= *sc;
1177 for (; r != er; ++
r, ++sr) {
1181 for (; c != ec; ++c, ++sc) *c /= *sc;
1193 for (; r != er; ++
r, ++sr) {
1197 for (; c != ec; ++c, ++sc) *c /= *sc;
1210 for (; r != er; ++
r, ++sr) {
1214 for (; c != ec; ++c, ++sc) *c += *sc;
1226 for (; r != er; ++
r, ++sr) {
1230 for (; c != ec; ++c, ++sc) *c += *sc;
1243 for (; r != er; ++
r, ++sr) {
1247 for (; c != ec; ++c, ++sc) *c -= *sc;
1259 for (; r != er; ++
r, ++sr) {
1263 for (; c != ec; ++c, ++sc) *c -= *sc;
1319 for (; origin !=
end; ++origin, ++target) {
1323 for (; o != e; ++o, ++t) *t = *o;
1329 for (; target !=
end; ++target) {
1332 for (; t != e; ++t) *t = x;
1338 for (; target !=
end; ++target) {
1341 for (; t != e; ++t) *t = x;
1448 copy(dummy.begin(), dummy.end(),
begin());
1501 if (info not_eq 0) {
1502 throw runtime_error(
"Error inverting matrix: Matrix not of full rank.");
1538 assert(mrange.mextent == v.
nelem());
1546 for (; i != e; ++
i, ++target) *target = *i;
1564 for (; ai != ae; ++ai, ++bi) res += (*ai) * (*bi);
INDEX Index
The type to use for all integer numbers and indices.
ComplexIterator1D end()
Return iterator behind last element.
void copy(ConstComplexIterator1D origin, const ConstComplexIterator1D &end, ComplexIterator1D target)
Copy data between begin and end to target.
Complex * mdata
Pointer to the plain C array that holds the data.
T * workdata() const noexcept
Range mrange
The range of mdata that is actually used.
bool resize_if_smaller(Index N) const
Complex operator*(const ConstComplexVectorView &a, const ConstComplexVectorView &b)
Scalar product.
A class implementing complex numbers for ARTS.
ConstIterator1D begin() const
Return const iterator to first element.
Index nelem() const
Number of elements.
ComplexMatrixView & operator/=(Complex x)
Division by scalar.
Interface for BLAS library.
Index mstart
The start index.
const Complex * get_c_array() const
Conversion to plain C-array.
Complex * mx
Current position.
ComplexVectorView operator+=(Complex x)
Addition of scalar.
friend class ComplexMatrixView
The constant iterator class for sub vectors.
ComplexMatrixView & operator-=(Complex x)
Subtraction of scalar.
Complex & operator()(Index r, Index c)
Plain index operator.
ComplexMatrixView & operator=(const ConstComplexMatrixView &v)
Assignment operator.
ComplexVectorView()=default
The ComplexVectorView class.
std::ostream & operator<<(std::ostream &os, const ConstComplexVectorView &v)
Output operator.
ComplexIterator2D begin()
Return iterator to first row.
Eigen::Stride< Eigen::Dynamic, Eigen::Dynamic > ComplexStrideType
friend ConstComplexMatrixView transpose(ConstComplexMatrixView m)
Const version of transpose.
friend class ComplexVectorView
virtual ~ComplexMatrix()
Destructor for Matrix.
ComplexConstMatrixViewMap MapToEigenRow(const ConstComplexVectorView &A)
constexpr Index get_start() const
Returns the start index of the range.
G0 G2 FVC Y DV Numeric Numeric Numeric Zeeman LowerQuantumNumbers void * data
ComplexMatrix & inv(const lapack_help::Inverse< Complex > &help=lapack_help::Inverse< Complex >{0})
ComplexVectorView & operator=(const ConstComplexVectorView &v)
Assignment operator.
Index nelem() const
Returns the number of elements.
Complex operator()(Index r, Index c) const
Plain const index operator.
friend class ConstComplexMatrixView
ConstIterator2D begin() const
Return const iterator to first row.
The const row iterator class for sub matrices.
Index ncols() const
Returns the number of columns.
void resize(Index n)
Assignment operator from VectorView.
Complex debug_matrixview_get_elem(ComplexMatrixView &mv, Index r, Index c)
Helper function to access matrix elements.
void swap(ComplexVector &v1, ComplexVector &v2)
Swaps two objects.
ComplexMatrixView()
Default constructor.
int * ipivdata() const noexcept
virtual ~ComplexVector()
Destructor for ComplexVector.
friend void swap(ComplexVector &v1, ComplexVector &v2)
Swaps two objects.
ConstComplexVectorView diagonal() const
ComplexMatrix diagonal as vector.
Eigen::Map< const ComplexMatrixType, 0, ComplexStrideType > ComplexConstMatrixViewMap
std::complex< Numeric > Complex
const Complex * mx
Current position.
Struct cannot be const, but can be passed as const to allow defaults.
The iterator class for sub vectors.
The declarations of all the exception classes.
Complex & operator[](Index n)
Plain Index operator.
Complex * mdata
Pointer to the plain C array that holds the data.
The const row iterator class for sub matrices.
ComplexMatrixView & operator*=(Complex x)
Multiplication by scalar.
ComplexVector & operator=(ComplexVector v)
Assignment from another Vector.
Eigen::Map< ComplexMatrixType, 0, ComplexStrideType > ComplexMatrixViewMap
void resize(Index r, Index c)
Resize function.
friend ComplexConstMatrixViewMap MapToEigen(const ConstComplexMatrixView &)
ComplexVectorView operator-=(Complex x)
Subtraction of scalar.
NUMERIC Numeric
The type to use for all floating point numbers.
ConstComplexIterator1D end() const
Return const iterator behind last element.
ComplexVectorView operator*=(Complex x)
Multiplication by scalar.
constexpr Index get_stride() const
Returns the stride of the range.
const Complex & operator[](Index n) const
Plain const index operator.
ComplexMatrixView & operator+=(Complex x)
Addition of scalar.
Index mextent
The number of elements.
ComplexVector()
Default constructor.
This can be used to make arrays out of anything.
ComplexConstMatrixViewMap MapToEigenCol(const ConstComplexVectorView &A)
void zgetrf_(int *m, int *n, std::complex< double > *A, int *lda, int *ipiv, int *info)
ConstComplexIterator2D end() const
Return const iterator behind last row.
int * lsize() const noexcept
A constant view of a Vector.
ConstComplexVectorView()=default
ComplexVectorView operator/=(Complex x)
Division by scalar.
Range mcr
The column range of mdata that is actually used.
constexpr Rational start(Rational Ju, Rational Jl, Polarization type) noexcept
Gives the lowest M for a polarization type of this transition.
A constant view of a Matrix.
ConstComplexIterator2D begin() const
Return const iterator to first row.
A constant view of a ComplexMatrix.
friend void mult(ComplexVectorView, const ConstComplexMatrixView &, const ConstComplexVectorView &)
Matrix-Vector Multiplication.
void zgetri_(int *n, std::complex< double > *A, int *lda, int *ipiv, std::complex< double > *work, int *lwork, int *info)
ComplexIterator1D begin()
Return iterator to first element.
Complex sum() const
Returns true if variable size is zero.
The constant iterator class for sub vectors.
ComplexMatrix & operator=(ComplexMatrix x)
Assignment operator from another matrix.
A constant view of a ComplexVector.
int * size() const noexcept
friend void swap(ComplexMatrix &m1, ComplexMatrix &m2)
Swaps two objects.
const Complex * get_c_array() const
Conversion to plain C-array.
ComplexIterator2D end()
Return iterator behind last row.
ComplexVectorView diagonal()
ComplexMatrix diagonal as vector.
friend class ConstComplexIterator2D
ConstComplexIterator1D begin() const
Return const iterator to first element.
Range mrr
The row range of mdata that is actually used.
Index nrows() const
Returns the number of rows.
ConstComplexMatrixView()=default
The row iterator class for sub matrices.
The ComplexMatrixView class.