ARTS
1.0.222
|
A constant view of a Vector. More...
#include <matpackI.h>
Public Member Functions | |
Index | nelem () const |
Returns the number of elements. More... | |
Numeric | sum () const |
The sum of all elements of a Vector. More... | |
Numeric | operator[] (Index n) const |
Plain const index operator. More... | |
ConstVectorView | operator[] (const Range &r) const |
Const index operator for subrange. More... | |
ConstIterator1D | begin () const |
Return const iterator to first element. More... | |
ConstIterator1D | end () const |
Return const iterator behind last element. More... | |
operator ConstMatrixView () const | |
Conversion to const 1 column matrix. More... | |
Protected Member Functions | |
ConstVectorView () | |
Default constructor. More... | |
ConstVectorView (Numeric *data, const Range &range) | |
Explicit constructor. More... | |
ConstVectorView (Numeric *data, const Range &p, const Range &n) | |
Recursive constructor. More... | |
Protected Attributes | |
Range | mrange |
The range of mdata that is actually used. More... | |
Numeric * | mdata |
Pointer to the plain C array that holds the data. More... | |
Friends | |
class | VectorView |
class | ConstIterator2D |
class | ConstMatrixView |
class | ConstTensor3View |
A constant view of a Vector.
Together with the derived class VectorView this contains the main implementation of a Vector. The class Vector is just a special case of a VectorView which also allocates storage.
Definition at line 232 of file matpackI.h.
|
inlineprotected |
Default constructor.
This is necessary, so that we can have a default constructor for the derived class Vector.
Definition at line 997 of file matpackI.h.
Explicit constructor.
This one is used by Vector to initialize its own VectorView part.
Definition at line 1005 of file matpackI.h.
|
inlineprotected |
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 1023 of file matpackI.h.
|
inline |
Return const iterator to first element.
Definition at line 975 of file matpackI.h.
|
inline |
Return const iterator behind last element.
Definition at line 981 of file matpackI.h.
|
inline |
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.
Definition at line 937 of file matpackI.h.
|
inline |
Conversion to const 1 column matrix.
Definition at line 990 of file matpackI.h.
|
inline |
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 969 of file matpackI.h.
Plain const index operator.
Definition at line 956 of file matpackI.h.
|
inline |
The sum of all elements of a Vector.
Definition at line 943 of file matpackI.h.
|
friend |
Definition at line 252 of file matpackI.h.
|
friend |
Definition at line 253 of file matpackI.h.
|
friend |
Definition at line 254 of file matpackI.h.
|
friend |
Definition at line 251 of file matpackI.h.
|
protected |
Pointer to the plain C array that holds the data.
Definition at line 267 of file matpackI.h.
|
protected |
The range of mdata that is actually used.
Definition at line 265 of file matpackI.h.