#include <matpackIII.h>
Public Member Functions | |
ConstTensor3View | operator() (const Range &p, const Range &r, const Range &c) const |
Const index operator for subrange. | |
ConstMatrixView | operator() (const Range &p, const Range &r, Index c) const |
Const index operator returning an object of type ConstMatrixView. | |
ConstMatrixView | operator() (const Range &p, Index r, const Range &c) const |
Const index operator returning an object of type ConstMatrixView. | |
ConstMatrixView | operator() (Index p, const Range &r, const Range &c) const |
Const index operator returning an object of type ConstMatrixView. | |
ConstVectorView | operator() (Index p, Index r, const Range &c) const |
Const index operator returning an object of type ConstVectorView. | |
ConstVectorView | operator() (Index p, const Range &r, Index c) const |
Const index operator returning an object of type ConstVectorView. | |
ConstVectorView | operator() (const Range &p, Index r, Index c) const |
Const index operator returning an object of type ConstVectorView. | |
Numeric | operator() (Index p, Index r, Index c) const |
Plain const index operator. | |
Tensor3View | operator() (const Range &p, const Range &r, const Range &c) |
Index operator for subrange. | |
MatrixView | operator() (const Range &p, const Range &r, Index c) |
Index operator returning an object of type MatrixView. | |
MatrixView | operator() (const Range &p, Index r, const Range &c) |
Index operator returning an object of type MatrixView. | |
MatrixView | operator() (Index p, const Range &r, const Range &c) |
Index operator returning an object of type MatrixView. | |
VectorView | operator() (Index p, Index r, const Range &c) |
Index operator returning an object of type VectorView. | |
VectorView | operator() (Index p, const Range &r, Index c) |
Index operator returning an object of type VectorView. | |
VectorView | operator() (const Range &p, Index r, Index c) |
Index operator returning an object of type VectorView. | |
Numeric & | operator() (Index p, Index r, Index c) |
Plain non-const index operator. | |
ConstIterator3D | begin () const |
Return const iterator to first row. | |
ConstIterator3D | end () const |
Return const iterator behind last row. | |
Iterator3D | begin () |
Return iterator to first page. | |
Iterator3D | end () |
Return iterator behind last page. | |
Tensor3View & | operator= (const ConstTensor3View &v) |
Assignment operator. | |
Tensor3View & | operator= (const Tensor3View &v) |
Assignment from Tensor3View to Tensor3View. | |
Tensor3View & | operator= (const Tensor3 &v) |
Assignment from a Tensor3. | |
Tensor3View & | operator= (Numeric x) |
Assigning a scalar to a Tensor3View will set all elements to this value. | |
Tensor3View & | operator*= (Numeric x) |
Multiplication by scalar. | |
Tensor3View & | operator/= (Numeric x) |
Division by scalar. | |
Tensor3View & | operator+= (Numeric x) |
Addition of scalar. | |
Tensor3View & | operator-= (Numeric x) |
Subtraction of scalar. | |
Tensor3View & | operator*= (const ConstTensor3View &x) |
Element-vise multiplication by another Tensor3. | |
Tensor3View & | operator/= (const ConstTensor3View &x) |
Element-vise division by another Tensor3. | |
Tensor3View & | operator+= (const ConstTensor3View &x) |
Element-vise addition of another Tensor3. | |
Tensor3View & | operator-= (const ConstTensor3View &x) |
Element-vise subtraction of another Tensor3. | |
Protected Member Functions | |
Tensor3View () | |
Default constructor. | |
Tensor3View (Numeric *data, const Range &p, const Range &r, const Range &c) | |
Explicit constructor. | |
Tensor3View (Numeric *data, const Range &pp, const Range &pr, const Range &pc, const Range &np, const Range &nr, const Range &nc) | |
Recursive constructor. |
This contains the main implementation of a Tensor3. It defines the concepts of Tensor3View. Plus additionally the recursive subrange operator, which makes it possible to create a Tensor3View from a subrange of a Tensor3View.
The class Tensor3 is just a special case of a Tensor3View which also allocates storage.
Definition at line 151 of file matpackIII.h.
Tensor3View::Tensor3View | ( | ) | [inline, protected] |
Default constructor.
This is necessary, so that we can have a default constructor for the derived class Tensor3.
Definition at line 1041 of file matpackIII.h.
Tensor3View::Tensor3View | ( | Numeric * | data, | |
const Range & | pr, | |||
const Range & | rr, | |||
const Range & | cr | |||
) | [inline, protected] |
Explicit constructor.
This one is used by Tensor3 to initialize its own Tensor3View part. The row range rr must have a stride to account for the length of one row.
Definition at line 1050 of file matpackIII.h.
Tensor3View::Tensor3View | ( | Numeric * | data, | |
const Range & | pp, | |||
const Range & | pr, | |||
const Range & | pc, | |||
const Range & | np, | |||
const Range & | nr, | |||
const Range & | nc | |||
) | [inline, 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.
*data | The actual data. | |
p | Previous range. | |
n | New Range. |
Definition at line 1070 of file matpackIII.h.
ConstTensor3View Tensor3View::operator() | ( | const Range & | p, | |
const Range & | r, | |||
const Range & | c | |||
) | const [inline] |
Const index operator for subrange.
We have to also account for the case, that *this is already a subrange of a Tensor3. This allows correct recursive behavior. Has to be redefined here, since it is hiden by the non-const operator of the derived class.
Reimplemented from ConstTensor3View.
Definition at line 632 of file matpackIII.h.
ConstMatrixView Tensor3View::operator() | ( | const Range & | p, | |
const Range & | r, | |||
Index | c | |||
) | const [inline] |
Const index operator returning an object of type ConstMatrixView.
(Reducing the dimension by one.) Has to be redefined here, since it is hiden by the non-const operator of the derived class.
Reimplemented from ConstTensor3View.
Definition at line 643 of file matpackIII.h.
ConstMatrixView Tensor3View::operator() | ( | const Range & | p, | |
Index | r, | |||
const Range & | c | |||
) | const [inline] |
Const index operator returning an object of type ConstMatrixView.
(Reducing the dimension by one.) Has to be redefined here, since it is hiden by the non-const operator of the derived class.
Reimplemented from ConstTensor3View.
Definition at line 654 of file matpackIII.h.
ConstMatrixView Tensor3View::operator() | ( | Index | p, | |
const Range & | r, | |||
const Range & | c | |||
) | const [inline] |
Const index operator returning an object of type ConstMatrixView.
(Reducing the dimension by one.) Has to be redefined here, since it is hiden by the non-const operator of the derived class.
Reimplemented from ConstTensor3View.
Definition at line 665 of file matpackIII.h.
ConstVectorView Tensor3View::operator() | ( | Index | p, | |
Index | r, | |||
const Range & | c | |||
) | const [inline] |
Const index operator returning an object of type ConstVectorView.
(Reducing the dimension by two.) Has to be redefined here, since it is hiden by the non-const operator of the derived class.
Reimplemented from ConstTensor3View.
Definition at line 676 of file matpackIII.h.
ConstVectorView Tensor3View::operator() | ( | Index | p, | |
const Range & | r, | |||
Index | c | |||
) | const [inline] |
Const index operator returning an object of type ConstVectorView.
(Reducing the dimension by two.) Has to be redefined here, since it is hiden by the non-const operator of the derived class.
Reimplemented from ConstTensor3View.
Definition at line 687 of file matpackIII.h.
ConstVectorView Tensor3View::operator() | ( | const Range & | p, | |
Index | r, | |||
Index | c | |||
) | const [inline] |
Const index operator returning an object of type ConstVectorView.
(Reducing the dimension by two.) Has to be redefined here, since it is hiden by the non-const operator of the derived class.
Reimplemented from ConstTensor3View.
Definition at line 698 of file matpackIII.h.
Plain const index operator.
Has to be redefined here, since it is hiden by the non-const operator of the derived class.
Reimplemented from ConstTensor3View.
Definition at line 707 of file matpackIII.h.
Tensor3View Tensor3View::operator() | ( | const Range & | p, | |
const Range & | r, | |||
const Range & | c | |||
) | [inline] |
Index operator for subrange.
We have to also account for the case, that *this is already a subrange of a Tensor3. This allows correct recursive behavior.
Definition at line 715 of file matpackIII.h.
MatrixView Tensor3View::operator() | ( | const Range & | p, | |
const Range & | r, | |||
Index | c | |||
) | [inline] |
Index operator returning an object of type MatrixView.
(Reducing the dimension by one.)
Definition at line 724 of file matpackIII.h.
MatrixView Tensor3View::operator() | ( | const Range & | p, | |
Index | r, | |||
const Range & | c | |||
) | [inline] |
Index operator returning an object of type MatrixView.
(Reducing the dimension by one.)
Definition at line 739 of file matpackIII.h.
MatrixView Tensor3View::operator() | ( | Index | p, | |
const Range & | r, | |||
const Range & | c | |||
) | [inline] |
Index operator returning an object of type MatrixView.
(Reducing the dimension by one.)
Definition at line 754 of file matpackIII.h.
VectorView Tensor3View::operator() | ( | Index | p, | |
Index | r, | |||
const Range & | c | |||
) | [inline] |
Index operator returning an object of type VectorView.
(Reducing the dimension by two.)
Definition at line 769 of file matpackIII.h.
VectorView Tensor3View::operator() | ( | Index | p, | |
const Range & | r, | |||
Index | c | |||
) | [inline] |
Index operator returning an object of type VectorView.
(Reducing the dimension by two.)
Definition at line 787 of file matpackIII.h.
VectorView Tensor3View::operator() | ( | const Range & | p, | |
Index | r, | |||
Index | c | |||
) | [inline] |
Index operator returning an object of type VectorView.
(Reducing the dimension by two.)
Definition at line 805 of file matpackIII.h.
ConstIterator3D Tensor3View::begin | ( | ) | const [inline] |
Return const iterator to first row.
Has to be redefined here, since it is hiden by the non-const operator of the derived class.
Reimplemented from ConstTensor3View.
Definition at line 840 of file matpackIII.h.
ConstIterator3D Tensor3View::end | ( | ) | const [inline] |
Return const iterator behind last row.
Reimplemented from ConstTensor3View.
Definition at line 846 of file matpackIII.h.
Iterator3D Tensor3View::begin | ( | ) | [inline] |
Iterator3D Tensor3View::end | ( | ) | [inline] |
Tensor3View & Tensor3View::operator= | ( | const ConstTensor3View & | m | ) | [inline] |
Assignment operator.
This copies the data from another Tensor3View to this Tensor3View. Dimensions must agree! Resizing would destroy the selection that we might have done in this Tensor3View by setting its range.
Definition at line 874 of file matpackIII.h.
Tensor3View & Tensor3View::operator= | ( | const Tensor3View & | m | ) | [inline] |
Assignment from Tensor3View to Tensor3View.
This is a tricky one. The problem is that since Tensor3View is derived from ConstTensor3View, a default = operator is generated by the compiler, which does not do what we want. So we need this one to override the default.
Definition at line 890 of file matpackIII.h.
Tensor3View & Tensor3View::operator= | ( | const Tensor3 & | m | ) | [inline] |
Assignment from a Tensor3.
This must exist to overide the automatically generated assignment operators, which don't copy the contents!
Reimplemented in Tensor3.
Definition at line 904 of file matpackIII.h.
Tensor3View & Tensor3View::operator= | ( | Numeric | x | ) | [inline] |
Assigning a scalar to a Tensor3View will set all elements to this value.
Reimplemented in Tensor3.
Definition at line 917 of file matpackIII.h.
Tensor3View & Tensor3View::operator*= | ( | Numeric | x | ) | [inline] |
Tensor3View & Tensor3View::operator/= | ( | Numeric | x | ) | [inline] |
Tensor3View & Tensor3View::operator+= | ( | Numeric | x | ) | [inline] |
Tensor3View & Tensor3View::operator-= | ( | Numeric | x | ) | [inline] |
Tensor3View & Tensor3View::operator*= | ( | const ConstTensor3View & | x | ) | [inline] |
Tensor3View & Tensor3View::operator/= | ( | const ConstTensor3View & | x | ) | [inline] |
Tensor3View & Tensor3View::operator+= | ( | const ConstTensor3View & | x | ) | [inline] |
Tensor3View & Tensor3View::operator-= | ( | const ConstTensor3View & | x | ) | [inline] |