28 using std::runtime_error;
47 const Range& c)
const {
67 const Range& c)
const {
79 const Range& c)
const {
91 const Range& c)
const {
154 :
mpr(0, 1, a.
mrr.mextent * a.
mcr.mextent),
199 if (ip != end_page) {
204 for (; ip != end_page; ++ip) {
309 throw std::runtime_error(
310 "A Tensor3View can only be converted to a plain C-array if it's pointing to a continuous block of data");
325 throw std::runtime_error(
326 "A Tensor3View can only be converted to a plain C-array if it's pointing to a continuous block of data");
441 for (; p != ep; ++p, ++xp) {
455 for (; p != ep; ++p, ++xp) {
469 for (; p != ep; ++p, ++xp) {
483 for (; p != ep; ++p, ++xp) {
541 for (; origin !=
end; ++origin, ++target) {
550 for (; target !=
end; ++target) {
578 std::fill_n(
mdata, p * r * c, fill);
727 for (; xi != xe; ++xi, ++yi) {
743 for (; xi != xe; ++xi) {
747 if (maxi > themax) themax = maxi;
762 for (; xi != xe; ++xi) {
766 if (mini < themin) themin = mini;
INDEX Index
The type to use for all integer numbers and indices.
Iterator2D begin()
Return const iterator to first row.
Tensor3View operator()(const Range &p, const Range &r, const Range &c)
Index operator for subrange.
void swap(Tensor3 &t1, Tensor3 &t2)
Swaps two objects.
Index mstart
The start index.
Range mcr
The column range of mdata that is actually used.
void copy(ConstIterator3D origin, const ConstIterator3D &end, Iterator3D target)
Copy data between begin and end to target.
bool empty() const
Check if variable is empty.
Iterator2D end()
Return iterator behind last row.
Range mpr
The page range of mdata that is actually used.
Numeric max(const ConstTensor3View &x)
Max function, tensor version.
Iterator3D end()
Return iterator behind last page.
ConstTensor3View()=default
Index nrows() const
Returns the number of rows.
Tensor3View & operator-=(Numeric x)
Subtraction of scalar.
G0 G2 FVC Y DV Numeric Numeric Numeric Zeeman LowerQuantumNumbers void * data
Index nelem() const
Returns the number of elements.
virtual ~Tensor3()
Destructor for Tensor3.
ConstIterator2D begin() const
Return const iterator to first row.
Index ncols() const
Returns the number of columns.
ConstIterator3D end() const
Return const iterator behind last page.
Tensor3View & operator/=(Numeric x)
Division by scalar.
Index ncols() const
Returns the number of columns.
Iterator3D begin()
Return iterator to first page.
Tensor3View & operator*=(Numeric x)
Multiplication by scalar.
The declarations of all the exception classes.
ConstIterator2D end() const
Return const iterator behind last row.
Numeric debug_tensor3view_get_elem(Tensor3View &tv, Index p, Index r, Index c)
Helper function to access tensor elements.
void transform(Tensor3View y, double(&my_func)(double), ConstTensor3View x)
A generic transform function for tensors, which can be used to implement mathematical functions opera...
friend void swap(Tensor3 &t1, Tensor3 &t2)
Swaps two objects.
NUMERIC Numeric
The type to use for all floating point numbers.
Index mextent
The number of elements.
void resize(Index p, Index r, Index c)
Resize function.
Numeric min(const ConstTensor3View &x)
Min function, tensor version.
Index npages() const
Returns the number of pages.
Tensor3 & operator=(const Tensor3 &x)
Assignment operator from another tensor.
ConstIterator3D begin() const
Return const iterator to first page.
A constant view of a Tensor3.
A constant view of a Vector.
Tensor3View & operator+=(Numeric x)
Addition of scalar.
ConstTensor3View operator()(const Range &p, const Range &r, const Range &c) const
Const index operator for subrange.
Numeric * mdata
Pointer to the plain C array that holds the data.
A constant view of a Matrix.
Implementation of Tensors of Rank 3.
Tensor3View & operator=(const ConstTensor3View &v)
Assignment operator.
Range mrr
The row range of mdata that is actually used.
const Numeric * get_c_array() const
Conversion to plain C-array.
std::ostream & operator<<(std::ostream &os, const ConstTensor3View &v)
Output operator.
Const version of Iterator3D.
Index nrows() const
Returns the number of rows.
void mult(Tensor3View A, const ConstVectorView B, const ConstMatrixView C)
mult Tensor3
Numeric add(Numeric x, Numeric y)