ARTS
2.4.0(git:4fb77825)
|
A constant view of a ComplexVector. More...
#include <complex.h>
Public Types | |
typedef ConstComplexIterator1D | const_iterator |
Public Member Functions | |
constexpr | ConstComplexVectorView (const ConstComplexVectorView &)=default |
constexpr | ConstComplexVectorView (ConstComplexVectorView &&)=default |
ConstComplexVectorView & | operator= (const ConstComplexVectorView &)=default |
ConstComplexVectorView & | operator= (ConstComplexVectorView &&)=default |
bool | empty () const |
Index | nelem () const |
Complex | sum () const |
Returns true if variable size is zero. More... | |
const Complex & | operator[] (Index n) const |
Plain const index operator. More... | |
const Complex & | get (Index n) const |
Get element implementation without assertions. More... | |
const Numeric & | get_real (Index n) const |
Get element implementation without assertions. More... | |
const Numeric & | get_imag (Index n) const |
Get element implementation without assertions. More... | |
ConstVectorView | real () const |
Get a view of the real part of the vector. More... | |
ConstVectorView | imag () const |
Get a view of the imaginary part of the vector. More... | |
ConstComplexVectorView | operator[] (const Range &r) const |
Const index operator for subrange. More... | |
ConstComplexIterator1D | begin () const |
Return const iterator to first element. More... | |
ConstComplexIterator1D | end () const |
Return const iterator behind last element. More... | |
operator ConstComplexMatrixView () const | |
Conversion to const 1 column matrix. More... | |
virtual | ~ConstComplexVectorView ()=default |
Destructor. More... | |
ConstComplexVectorView (const Complex &a) | |
A special constructor, which allows to make a ConstComplexVectorView from a scalar. More... | |
Protected Member Functions | |
ConstComplexVectorView ()=default | |
ConstComplexVectorView (Complex *data, const Range &range) | |
Explicit constructor. More... | |
ConstComplexVectorView (Complex *data, const Range &p, const Range &n) | |
Recursive constructor. More... | |
Protected Attributes | |
Range | mrange {0, 0} |
The range of mdata that is actually used. More... | |
Complex * | mdata {nullptr} |
Pointer to the plain C array that holds the data. More... | |
Friends | |
class | ComplexVectorView |
class | ConstComplexIterator2D |
class | ConstComplexMatrixView |
Complex | operator* (const ConstComplexVectorView &a, const ConstComplexVectorView &b) |
Scalar product. More... | |
void | mult (ComplexVectorView, const ConstComplexMatrixView &, const ConstComplexVectorView &) |
Matrix-Vector Multiplication. More... | |
ComplexConstMatrixViewMap | MapToEigen (const ConstComplexVectorView &) |
ComplexConstMatrixViewMap | MapToEigenCol (const ConstComplexVectorView &) |
ComplexMatrixViewMap | MapToEigen (ComplexVectorView &) |
ComplexMatrixViewMap | MapToEigenCol (ComplexVectorView &) |
A constant view of a ComplexVector.
Together with the derived class ComplexVectorView this contains the main implementation of a ComplexVector. The class ComplexVector is just a special case of a ComplexVectorView which also allocates storage.
|
constexprdefault |
|
constexprdefault |
|
virtualdefault |
Destructor.
ConstComplexVectorView::ConstComplexVectorView | ( | const Complex & | a | ) |
A special constructor, which allows to make a ConstComplexVectorView from a scalar.
This one is a bit tricky: We have to cast away the arguments const qualifier, because mdata is not const. This should be safe, since there are no non-const methods for ConstComplexVectorView.
Definition at line 101 of file complex.cc.
|
protecteddefault |
Referenced by operator[]().
Explicit constructor.
This one is used by Vector to initialize its own VectorView part.
Definition at line 108 of file complex.cc.
|
protected |
Recursive constructor.
This is used to construct sub ranges from sub ranges. That means that the new range has to be interpreted relative to the original range. The new range 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.
*data | The actual data. |
p | Previous range. |
n | New Range. |
Definition at line 124 of file complex.cc.
ConstComplexIterator1D ConstComplexVectorView::begin | ( | ) | const |
Return const iterator to first element.
Definition at line 78 of file complex.cc.
References mdata, mrange, Range::mstart, and Range::mstride.
Referenced by ComplexVector::ComplexVector(), copy(), operator*(), ComplexMatrixView::operator*=(), ComplexMatrixView::operator+=(), ComplexMatrixView::operator-=(), ComplexMatrixView::operator/=(), operator<<(), ComplexVectorView::operator=(), and sum().
|
inline |
ConstComplexIterator1D ConstComplexVectorView::end | ( | ) | const |
Return const iterator behind last element.
Definition at line 83 of file complex.cc.
References mdata, Range::mextent, mrange, Range::mstart, and Range::mstride.
Referenced by ComplexVector::ComplexVector(), operator*(), operator<<(), and ComplexVectorView::operator=().
Get element implementation without assertions.
Definition at line 292 of file complex.h.
Referenced by ComplexVectorView::get_imag(), ComplexVectorView::get_real(), and operator[]().
|
inline |
|
inline |
Definition at line 280 of file complex.h.
References Range::mextent, and mrange.
Referenced by diagonalize(), empty(), MapToEigen(), MapToEigenCol(), operator*(), ComplexVectorView::operator*=(), ComplexVectorView::operator+=(), ComplexVectorView::operator-=(), ComplexVectorView::operator/=(), ComplexMatrixView::operator=(), and ComplexMatrix::operator=().
ConstComplexVectorView::operator ConstComplexMatrixView | ( | ) | const |
Conversion to const 1 column matrix.
Definition at line 90 of file complex.cc.
|
default |
|
default |
ConstComplexVectorView ConstComplexVectorView::operator[] | ( | const Range & | r | ) | const |
Const index operator for subrange.
We have to also account for the case, that *this is already a subrange of a Vector. This allows correct recursive behavior.
Definition at line 72 of file complex.cc.
References ConstComplexVectorView(), mdata, and mrange.
Plain const index operator.
Definition at line 285 of file complex.h.
References get(), Range::mextent, and mrange.
|
inline |
Complex ConstComplexVectorView::sum | ( | ) | const |
Returns true if variable size is zero.
Returns the number of elements. The names ‘size’ and ‘length’ are already used by STL functions returning size_t. To avoid confusion we choose the name ‘nelem’. This is also more consistent with ‘nrow’ and ‘ncol’ for matrices.
The value range of long, which is used to store the index is on a PC from -2147483648 to 2147483647. This means that a 15GB large array of float can be addressed with this index. So the extra bit that size_t has compared to long is not needed. The sum of all elements of a Vector.
Definition at line 59 of file complex.cc.
References begin().
|
friend |
|
friend |
|
friend |
|
friend |
Definition at line 1694 of file complex.cc.
|
friend |
Definition at line 1664 of file complex.cc.
|
friend |
Definition at line 1707 of file complex.cc.
|
friend |
Definition at line 1677 of file 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 1579 of file complex.cc.
|
friend |
|
protected |
Pointer to the plain C array that holds the data.
Definition at line 353 of file complex.h.
Referenced by ComplexVectorView::begin(), begin(), ComplexVector::ComplexVector(), ComplexVectorView::ComplexVectorView(), ComplexVectorView::end(), end(), ComplexVectorView::get(), ComplexVectorView::get_c_array(), ComplexVectorView::imag(), MapToEigen(), MapToEigenCol(), ComplexIterator2D::operator!=(), ConstComplexIterator2D::operator!=(), ComplexIterator2D::operator++(), ConstComplexIterator2D::operator++(), ComplexVectorView::operator[](), operator[](), ComplexVectorView::real(), ComplexVector::resize(), swap(), and ComplexVector::~ComplexVector().
|
protected |
The range of mdata that is actually used.
Definition at line 351 of file complex.h.
Referenced by ComplexVectorView::begin(), begin(), ComplexVectorView::ComplexVectorView(), ComplexVectorView::end(), end(), ComplexVectorView::get(), ComplexVectorView::get_c_array(), ComplexVectorView::imag(), MapToEigen(), MapToEigenCol(), nelem(), ComplexIterator2D::operator!=(), ConstComplexIterator2D::operator!=(), ComplexVectorView::operator=(), ComplexVectorView::operator[](), operator[](), ComplexVectorView::real(), ComplexVector::resize(), and swap().