#include <matpackI.h>

Public Member Functions | |
| Index | nelem () const |
| Returns the number of elements. | |
| Numeric | sum () const |
| The sum of all elements of a Vector. | |
| Numeric | operator[] (Index n) const |
| Plain const index operator. | |
| ConstVectorView | operator[] (const Range &r) const |
| Const index operator for subrange. | |
| ConstIterator1D | begin () const |
| Return const iterator to first element. | |
| ConstIterator1D | end () const |
| Return const iterator behind last element. | |
| operator ConstMatrixView () const | |
| Conversion to const 1 column matrix. | |
Protected Member Functions | |
| ConstVectorView () | |
| Default constructor. | |
| ConstVectorView (Numeric *data, const Range &range) | |
| Explicit constructor. | |
| ConstVectorView (Numeric *data, const Range &p, const Range &n) | |
| Recursive constructor. | |
Protected Attributes | |
| Range | mrange |
| The range of mdata that is actually used. | |
| Numeric * | mdata |
| Pointer to the plain C array that holds the data. | |
Friends | |
| class | VectorView |
| class | ConstIterator2D |
| class | ConstMatrixView |
| class | ConstTensor3View |
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.
| ConstVectorView::ConstVectorView | ( | ) | [inline, protected] |
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.
| ConstVectorView::ConstVectorView | ( | Numeric * | data, | |
| const Range & | p, | |||
| const Range & | n | |||
| ) | [inline, 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 1023 of file matpackI.h.
| Index ConstVectorView::nelem | ( | ) | const [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.
| Numeric ConstVectorView::sum | ( | ) | const [inline] |
| ConstVectorView ConstVectorView::operator[] | ( | const Range & | r | ) | const [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.
Reimplemented in VectorView.
Definition at line 969 of file matpackI.h.
| ConstIterator1D ConstVectorView::begin | ( | ) | const [inline] |
Return const iterator to first element.
Reimplemented in VectorView.
Definition at line 975 of file matpackI.h.
| ConstIterator1D ConstVectorView::end | ( | ) | const [inline] |
Return const iterator behind last element.
Reimplemented in VectorView.
Definition at line 981 of file matpackI.h.
| ConstVectorView::operator ConstMatrixView | ( | ) | const [inline] |
friend class VectorView [friend] |
Definition at line 251 of file matpackI.h.
friend class ConstIterator2D [friend] |
friend class ConstMatrixView [friend] |
Definition at line 253 of file matpackI.h.
friend class ConstTensor3View [friend] |
Definition at line 254 of file matpackI.h.
Range ConstVectorView::mrange [protected] |
Numeric* ConstVectorView::mdata [protected] |
1.5.6