ARTS 2.5.10 (git: 2f1c442c)
|
A constant view of a ComplexMatrix. More...
#include <matpack_complex.h>
Public Types | |
using | const_iterator = ConstComplexIterator2D |
Public Member Functions | |
constexpr | ConstComplexMatrixView (const ConstComplexMatrixView &)=default |
constexpr | ConstComplexMatrixView (ConstComplexMatrixView &&)=default |
ConstComplexMatrixView & | operator= (const ConstComplexMatrixView &)=default |
ConstComplexMatrixView & | operator= (ConstComplexMatrixView &&)=default |
Index | selem () const noexcept |
Index | nrows () const noexcept |
Index | ncols () const noexcept |
Index | drows () const noexcept |
Index | dcols () const noexcept |
Index | size () const noexcept |
bool | empty () const noexcept |
Complex | operator() (Index r, Index c) const |
Plain const index operator. | |
Complex | get (Index r, Index c) const |
Get element implementation without assertions. | |
Numeric | get_real (Index r, Index c) const |
Get element implementation without assertions. | |
Numeric | get_imag (Index r, Index c) const |
Get element implementation without assertions. | |
ConstMatrixView | real () const |
Get a view of the real part of the matrix. | |
ConstMatrixView | imag () const |
Get a view of the imaginary part of the matrix. | |
Index | get_column_extent () const |
Get the extent of the underlying data. | |
ConstComplexMatrixView | operator() (const Range &r, const Range &c) const |
Returns true if variable size is zero. | |
ConstComplexVectorView | operator() (const Range &r, Index c) const |
Const index operator returning a column as an object of type C onstComplex*VectorView. | |
ConstComplexVectorView | operator() (Index r, const Range &c) const |
Const index operator returning a row as an object of type C onstComplex*VectorView. | |
ConstComplexIterator2D | begin () const |
Return const iterator to first row. | |
ConstComplexIterator2D | end () const |
Return const iterator behind last row. | |
ConstComplexVectorView | diagonal () const |
ComplexMatrix diagonal as vector. | |
virtual | ~ConstComplexMatrixView ()=default |
Destructor. | |
Complex * | get_c_array () const noexcept |
Static Public Attributes | |
static constexpr bool | matpack_type {true} |
Protected Member Functions | |
ConstComplexMatrixView ()=default | |
ConstComplexMatrixView (Complex *data, const Range &r, const Range &c) | |
Explicit constructor. | |
ConstComplexMatrixView (Complex *data, const Range &pr, const Range &pc, const Range &nr, const Range &nc) | |
Recursive constructor. | |
Protected Attributes | |
Range | mrr {0, 0, 1} |
The row range of mdata that is actually used. | |
Range | mcr {0, 0, 1} |
The column range of mdata that is actually used. | |
Complex * | mdata {nullptr} |
Pointer to the plain C array that holds the data. | |
Friends | |
class | ComplexMatrixView |
class | ConstComplexVectorView |
ConstComplexMatrixView | transpose (ConstComplexMatrixView m) |
Const version of transpose. | |
void | mult (ComplexVectorView, const ConstComplexMatrixView &, const ConstComplexVectorView &) |
Matrix-Vector Multiplication. | |
void | mult (ComplexMatrixView, const ConstComplexMatrixView &, const ConstComplexMatrixView &) |
Matrix-Matrix Multiplication. | |
void | mult (ComplexMatrixView, const ConstMatrixView &, const ConstComplexMatrixView &) |
void | mult (ComplexMatrixView, const ConstComplexMatrixView &, const ConstMatrixView &) |
std::ostream & | operator<< (std::ostream &os, const ConstComplexMatrixView &v) |
Output operator. | |
A constant view of a ComplexMatrix.
This, together with the derived class Complex*MatrixView, contains the * main implementation of a ComplexMatrix. It defines the concepts of ComplexMatrixView. Plus additionally the recursive subrange operator, which makes it possible to create a ComplexMatrixView from a subrange of a ComplexMatrixView.
The class ComplexMatrix is just a special case of a ComplexMatrixView which also allocates storage.
Definition at line 675 of file matpack_complex.h.
Definition at line 685 of file matpack_complex.h.
|
constexprdefault |
|
constexprdefault |
|
virtualdefault |
Destructor.
|
protecteddefault |
Referenced by operator()().
|
protected |
Explicit constructor.
This one is used by Matrix to initialize its own MatrixView part. The row range rr must have a stride to account for the length of one row.
Definition at line 860 of file matpack_complex.cc.
|
protected |
Recursive constructor.
This is used to construct SubMatrices from SubMatrices. That means that the new ranges have to be interpreted relative to the original ranges.
The new ranges may contain -1 for the extent which acts as a joker. However, the used Range constructor converts this to an explicit range, consistent with the original Range.
Definition at line 881 of file matpack_complex.cc.
ConstComplexIterator2D ConstComplexMatrixView::begin | ( | ) | const |
Return const iterator to first row.
Definition at line 829 of file matpack_complex.cc.
References ConstComplexVectorView, mcr, mdata, mrr, Range::mstart, and Range::mstride.
Referenced by ComplexMatrix::ComplexMatrix(), ComplexMatrixView::operator*=(), ComplexMatrixView::operator+=(), ComplexMatrixView::operator-=(), ComplexMatrixView::operator/=(), ComplexMatrixView::operator=(), and ComplexMatrix::operator=().
|
inlinenoexcept |
Definition at line 692 of file matpack_complex.h.
ConstComplexVectorView ConstComplexMatrixView::diagonal | ( | ) | const |
ComplexMatrix diagonal as vector.
R eturns a ConstComplex*MatrixView on the diagonal entries of the matrix. For a given (n,m) matrix M the diagonal vector v is the vector of length min{n,m} with entries
v[i] = M(i,i)
Definition at line 851 of file matpack_complex.cc.
References ConstComplexVectorView, mcr, mdata, Range::mextent, mrr, Range::mstart, and Range::mstride.
|
inlinenoexcept |
Definition at line 691 of file matpack_complex.h.
|
inlinenoexcept |
Definition at line 696 of file matpack_complex.h.
ConstComplexIterator2D ConstComplexMatrixView::end | ( | ) | const |
Return const iterator behind last row.
Definition at line 835 of file matpack_complex.cc.
References ConstComplexVectorView, mcr, mdata, Range::mextent, mrr, Range::mstart, and Range::mstride.
Referenced by ComplexMatrix::ComplexMatrix(), ComplexMatrixView::operator=(), and ComplexMatrix::operator=().
Get element implementation without assertions.
Definition at line 710 of file matpack_complex.h.
References c, and ConstComplexVectorView::mdata.
|
inlinenoexcept |
Definition at line 763 of file matpack_complex.h.
References ConstComplexVectorView::mdata.
Referenced by diagonalize(), and inv().
|
inline |
Get the extent of the underlying data.
Definition at line 728 of file matpack_complex.h.
Referenced by diagonalize().
Get element implementation without assertions.
Definition at line 719 of file matpack_complex.h.
References c, and ComplexVectorView::get().
Get element implementation without assertions.
Definition at line 716 of file matpack_complex.h.
References c, and ComplexVectorView::get().
ConstMatrixView ConstComplexMatrixView::imag | ( | ) | const |
Get a view of the imaginary part of the matrix.
Definition at line 698 of file matpack_complex.cc.
References mcr, mdata, Range::mextent, mrr, Range::mstart, and Range::mstride.
|
inlinenoexcept |
Definition at line 690 of file matpack_complex.h.
Referenced by diagonalize(), get_maximum_error(), inv(), ComplexMatrix::inv(), mult(), ComplexMatrixView::operator*=(), ComplexMatrixView::operator+=(), ComplexMatrixView::operator-=(), ComplexMatrixView::operator/=(), and random_fill_matrix().
|
inlinenoexcept |
Definition at line 689 of file matpack_complex.h.
Referenced by diagonalize(), get_maximum_error(), inv(), ComplexMatrix::inv(), mult(), ComplexMatrixView::operator*=(), ComplexMatrixView::operator+=(), ComplexMatrixView::operator-=(), ComplexMatrixView::operator/=(), and random_fill_matrix().
ConstComplexMatrixView ConstComplexMatrixView::operator() | ( | const Range & | r, |
const Range & | c | ||
) | const |
Returns true if variable size is zero.
Returns the number of rows. Returns the number of columns. Const index operator for subrange. We have to also account for the case, that *this is already a subrange of a Matrix. This allows correct recursive behavior.
Definition at line 795 of file matpack_complex.cc.
References c, ConstComplexMatrixView(), mcr, mdata, and mrr.
ConstComplexVectorView ConstComplexMatrixView::operator() | ( | const Range & | r, |
Index | c | ||
) | const |
Const index operator returning a column as an object of type C onstComplex*VectorView.
r | A range of rows. |
c | Index of selected column |
Definition at line 805 of file matpack_complex.cc.
References ARTS_ASSERT, c, ConstComplexVectorView, mcr, mdata, Range::mextent, mrr, Range::mstart, and Range::mstride.
ConstComplexVectorView ConstComplexMatrixView::operator() | ( | Index | r, |
const Range & | c | ||
) | const |
Const index operator returning a row as an object of type C onstComplex*VectorView.
r | Index of selected row. |
c | Range of columns |
Definition at line 819 of file matpack_complex.cc.
References ARTS_ASSERT, c, ConstComplexVectorView, mcr, mdata, Range::mextent, mrr, Range::mstart, and Range::mstride.
Plain const index operator.
Definition at line 700 of file matpack_complex.h.
References ARTS_ASSERT, c, and ComplexVectorView::get().
|
default |
|
default |
ConstMatrixView ConstComplexMatrixView::real | ( | ) | const |
Get a view of the real part of the matrix.
Definition at line 692 of file matpack_complex.cc.
References mcr, mdata, Range::mextent, mrr, Range::mstart, and Range::mstride.
|
inlinenoexcept |
Definition at line 688 of file matpack_complex.h.
|
inlinenoexcept |
Definition at line 695 of file matpack_complex.h.
|
friend |
Definition at line 745 of file matpack_complex.h.
|
friend |
Definition at line 746 of file matpack_complex.h.
Referenced by begin(), diagonal(), end(), and operator()().
|
friend |
Matrix-Matrix Multiplication.
Uses the Eigen library. Be carful to test the size of your input beforehand. Note that to keep speed, the inputs should be different variables. There is memory duplication if this is not the case. Note that it is mdata that is checked, so even if the matrices are at different parts of a tensor, there is still a slowdown
[in,out] | A | The matrix A, that will hold the result of the multiplication. |
[in] | B | The matrix B |
[in] | C | The matrix C |
Definition at line 1605 of file matpack_complex.cc.
|
friend |
Definition at line 1619 of file matpack_complex.cc.
|
friend |
Definition at line 1633 of file matpack_complex.cc.
|
friend |
Matrix-Vector Multiplication.
Uses the Eigen library. Be carful to test the size of your input beforehand.
For left-hand multiplication, please use pure matrix-mult.
[out] | y | The length-m ComplexVectorView where the result is stored. |
[in] | M | Reference to the m-times-n Const{Complex,}MatrixView holding the matrix M. |
[in] | x | Reference to the length-n Const{Complex,}VectorView holding the vector x. |
Definition at line 1580 of file matpack_complex.cc.
|
friend |
Output operator.
This demonstrates how iterators can be used to traverse the matrix. The iterators know which part of the matrix is ‘active’, and also the strides in both directions. This function is a bit more complicated than necessary to illustrate the concept, because the formating should look nice. This means that the first row, and the first element in each row, have to be treated individually.
Definition at line 897 of file matpack_complex.cc.
|
friend |
Const version of transpose.
Definition at line 1510 of file matpack_complex.cc.
|
staticconstexpr |
Definition at line 677 of file matpack_complex.h.
Referenced by test_concepts().
|
protected |
The column range of mdata that is actually used.
Definition at line 780 of file matpack_complex.h.
Referenced by ComplexMatrixView::begin(), begin(), ComplexMatrixView::diagonal(), diagonal(), ComplexMatrixView::end(), end(), ComplexMatrixView::imag(), imag(), ComplexMatrixView::operator()(), operator()(), ComplexMatrixView::operator=(), ComplexMatrixView::real(), real(), and ComplexMatrix::resize().
|
protected |
Pointer to the plain C array that holds the data.
Definition at line 782 of file matpack_complex.h.
Referenced by ComplexMatrixView::begin(), begin(), ComplexMatrix::ComplexMatrix(), ComplexMatrixView::diagonal(), diagonal(), ComplexMatrixView::end(), end(), ComplexMatrixView::imag(), imag(), ComplexMatrix::inv(), ComplexMatrixView::operator()(), operator()(), ComplexMatrixView::real(), real(), ComplexMatrix::resize(), and ComplexMatrix::~ComplexMatrix().
|
protected |
The row range of mdata that is actually used.
Definition at line 778 of file matpack_complex.h.
Referenced by ComplexMatrixView::begin(), begin(), ComplexMatrixView::diagonal(), diagonal(), ComplexMatrixView::end(), end(), ComplexMatrixView::imag(), imag(), ComplexMatrixView::operator()(), operator()(), ComplexMatrixView::operator=(), ComplexMatrixView::real(), real(), and ComplexMatrix::resize().