| FEAT 3
    Finite Element Analysis Toolbox | 
Tiny Tensor3 class template. More...
#include <tiny_algebra.hpp>
| Public Types | |
| typedef Intern::DataTypeExtractor< ValueType >::MyDataType | DataType | 
| The basic data type buried in the lowest level of the vector.  More... | |
| typedef Matrix< T_, m_, n_, sm_, sn_ > | PlaneType | 
| Type of tensor data; that's an array of matrices.  More... | |
| typedef T_ | ValueType | 
| the data type of the tensor  More... | |
| Public Member Functions | |
| CUDA_HOST_DEVICE | Tensor3 () | 
| default constructor  More... | |
| template<typename Tx_ > | |
| CUDA_HOST_DEVICE | Tensor3 (const std::initializer_list< std::initializer_list< std::initializer_list< Tx_ > > > &x) | 
| Initializer list constructor.  More... | |
| template<typename Tx_ > | |
| CUDA_HOST_DEVICE | Tensor3 (const std::initializer_list< Tx_ > &x) | 
| Initializer list constructor.  More... | |
| template<int sla_, int sma_, int sna_> | |
| CUDA_HOST_DEVICE | Tensor3 (const Tensor3< T_, l_, m_, n_, sla_, sma_, sna_ > &a) | 
| copy-constructor  More... | |
| CUDA_HOST_DEVICE | Tensor3 (DataType value) | 
| value-assignment constructor  More... | |
| template<int lt_, int mt_, int nt_, int slt_, int smt_, int snt_, int smb_, int snb_, int smd_, int snd_> | |
| CUDA_HOST_DEVICE Tensor3 & | add_double_mat_mult (const Tensor3< T_, lt_, mt_, nt_, slt_, smt_, snt_ > &t, const Matrix< T_, nt_, n_, smb_, snb_ > &b, const Matrix< T_, mt_, m_, smd_, snd_ > &d, DataType alpha=DataType(1)) | 
| Adds the result of a matrix-tensor-matrix double-product onto this tensor.  More... | |
| template<int k_, int sma_, int sna_, int slt_, int smt_, int snt_> | |
| CUDA_HOST_DEVICE Tensor3 & | add_mat_tensor_mult (const Matrix< T_, l_, k_, sma_, sna_ > &a, const Tensor3< T_, k_, m_, n_, slt_, smt_, snt_ > &t, DataType alpha=DataType(1)) | 
| Adds the result of a matrix-tensor product onto this tensor.  More... | |
| template<int slx_, int sma_, int sna_> | |
| CUDA_HOST_DEVICE Tensor3 & | add_vec_mat_outer_product (const Vector< T_, l_, slx_ > &x, const Matrix< T_, m_, n_, sma_, sna_ > &a, DataType alpha=DataType(1)) | 
| Adds the result of a vector-matrix outer product onto this tensor.  More... | |
| template<typename Tx_ , int sla_, int sma_, int sna_> | |
| CUDA_HOST_DEVICE void | convert (const Tensor3< Tx_, l_, m_, n_, sla_, sma_, sna_ > &a) | 
| conversion operator  More... | |
| template<int sla_, int sma_, int sna_> | |
| CUDA_HOST_DEVICE void | copy (const Tensor3< T_, l_, m_, n_, sla_, sma_, sna_ > &a) | 
| Copies a tensor3.  More... | |
| template<int ll_, int mm_, int nn_, int la_, int ma_, int na_, int sla_, int sma_, int sna_> | |
| CUDA_HOST_DEVICE void | copy_n (const Tensor3< T_, la_, ma_, na_, sla_, sma_, sna_ > &a) | 
| Copies the upper left mm_ x nn_ entries of a matrix.  More... | |
| CUDA_HOST_DEVICE void | format (DataType alpha=DataType(0)) | 
| formats the tensor  More... | |
| CUDA_HOST_DEVICE T_ & | operator() (int h, int i, int j) | 
| Access operator.  More... | |
| CUDA_HOST_DEVICE const T_ & | operator() (int h, int i, int j) const | 
| Access operator.   More... | |
| CUDA_HOST_DEVICE Tensor3 & | operator*= (DataType alpha) | 
| scalar right-multiply-by operator  More... | |
| template<int sla_, int sma_, int sna_> | |
| CUDA_HOST_DEVICE Tensor3 & | operator+= (const Tensor3< T_, l_, m_, n_, sla_, sma_, sna_ > &a) | 
| tensor component-wise addition operator  More... | |
| template<int sla_, int sma_, int sna_> | |
| CUDA_HOST_DEVICE Tensor3 & | operator-= (const Tensor3< T_, l_, m_, n_, sla_, sma_, sna_ > &a) | 
| tensor component-wise subtraction operator  More... | |
| template<typename Tx_ > | |
| CUDA_HOST_DEVICE Tensor3 & | operator= (const std::initializer_list< std::initializer_list< std::initializer_list< Tx_ > > > &x) | 
| Initializer list assignment operator.  More... | |
| template<typename Tx_ > | |
| CUDA_HOST_DEVICE Tensor3 & | operator= (const std::initializer_list< Tx_ > &x) | 
| Initializer list assignment operator.  More... | |
| template<int sla_, int sma_, int sna_> | |
| CUDA_HOST_DEVICE Tensor3 & | operator= (const Tensor3< T_, l_, m_, n_, sla_, sma_, sna_ > &a) | 
| copy-assignment operator  More... | |
| CUDA_HOST_DEVICE Tensor3 & | operator= (DataType value) | 
| value-assignment operator  More... | |
| CUDA_HOST_DEVICE PlaneType & | operator[] (int h) | 
| Plane-Access operator.  More... | |
| CUDA_HOST_DEVICE const PlaneType & | operator[] (int h) const | 
| Plane-Access operator.   More... | |
| Static Public Member Functions | |
| static CUDA_HOST_DEVICE Tensor3 | null () | 
| Returns a null-tensor.  More... | |
| Public Attributes | |
| PlaneType | v [sl_] | 
| Actual tensor data.  More... | |
| Static Public Attributes | |
| static constexpr int | l = l_ | 
| the tube count of the tensor  More... | |
| static constexpr int | m = m_ | 
| the row count of the tensor  More... | |
| static constexpr int | n = n_ | 
| the column count of the tensor  More... | |
| static constexpr int | sl = sl_ | 
| the tube stride of the tensor  More... | |
| static constexpr int | sm = sm_ | 
| the row stride of the tensor  More... | |
| static constexpr int | sn = sn_ | 
| the column stride of the tensor  More... | |
This class template implements a 3rd-order tensor whose datatype and sizes are given at compile-time. This class template implements a 3rd order tensor whose value type and size is given at compile-time. The value type can be a primitive type, or some other object like a Vector.
Technically, the Tensor3 class template realizes a l-tuple of m-by-n matrices.
| T_ | The datatype that the vector shall contain. | 
| l_,m_,n_ | The number tubes, rows and columns of the tensor. Must be > 0. | 
| sl_,The | tube stride of the tensor. Must be >= l_. | 
| sm_ | The row stride of the tensor. Must be >= m_. | 
| sn_ | The column stride of the tensor. Must be >= n_. | 
Definition at line 116 of file tiny_algebra.hpp.
| typedef Intern::DataTypeExtractor<ValueType>::MyDataType FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::DataType | 
The basic data type buried in the lowest level of the vector.
Definition at line 2497 of file tiny_algebra.hpp.
| typedef Matrix<T_, m_, n_, sm_, sn_> FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::PlaneType | 
Type of tensor data; that's an array of matrices.
Definition at line 2500 of file tiny_algebra.hpp.
| typedef T_ FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::ValueType | 
the data type of the tensor
Definition at line 2495 of file tiny_algebra.hpp.
| 
 | inline | 
default constructor
Definition at line 2505 of file tiny_algebra.hpp.
Referenced by FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::null().
| 
 | inlineexplicit | 
value-assignment constructor
Definition at line 2510 of file tiny_algebra.hpp.
References FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::v, and FEAT::value.
| 
 | inlineexplicit | 
Initializer list constructor.
| [in] | x | The initializer list whose elements are to be assigned. | 
Definition at line 2523 of file tiny_algebra.hpp.
References FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::v, and XASSERTM.
| 
 | inlineexplicit | 
Initializer list constructor.
| [in] | x | The initializer list whose elements are to be assigned. | 
Definition at line 2538 of file tiny_algebra.hpp.
References FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::v, and XASSERTM.
| 
 | inline | 
copy-constructor
Definition at line 2548 of file tiny_algebra.hpp.
References FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::v.
| 
 | inline | 
Adds the result of a matrix-tensor-matrix double-product onto this tensor.
Let K denote this l-by-m-by-n tensor, T the l-by-m'-by-n' input tensor, B the m'-by-m and D the n'-by-n input matrices, then this operation computes:
\[ \forall h\in\{0,...,l-1\}, i\in\{0,...,m-1\}, j\in\{0,...,n-1\}:~ K_{hij} \leftarrow K_{hij} + \alpha \sum_{p=0}^{m'-1}\sum_{q=0}^{n'-1} T_{hpq}\cdot B_{pi}\cdot D_{qj} \]
| [in] | t | The l-by-m'-by-n' tensor that serves as the inner multiplicand. | 
| [in] | b | The m'-by-m matrix that serves as the left multiplicand. | 
| [in] | d | The n'-by-n matrix that serves as the right multiplicand. | 
| [in] | alpha | A scaling factor for the product. | 
*this Definition at line 2812 of file tiny_algebra.hpp.
References ASSERTM, and FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::operator()().
| 
 | inline | 
Adds the result of a matrix-tensor product onto this tensor.
Let K denote this tensor, A the input matrix and T the input tensor, then this operation computes:
\[ \forall h\in\{0,...,l-1\}, i\in\{0,...,m-1\},j\in\{0,...,n-1\}:~ K_{hij} \leftarrow K_{hij} + \alpha \sum_{p=0}^{k-1} A_{hp}\cdot T_{pij}\]
| [in] | a | The l-by-k matrix that serves as the left multiplicand. | 
| [in] | t | The k-by-m-by-n tensor that serves as the right multiplicand. | 
| [in] | alpha | A scaling factor for the product. | 
*this Definition at line 2758 of file tiny_algebra.hpp.
References ASSERTM, and FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::operator()().
| 
 | inline | 
Adds the result of a vector-matrix outer product onto this tensor.
Let K denote this tensor, x the input vector and A the input matrix, then this operation computes:
\[ \forall h\in\{0,...,l-1\}, i\in\{0,...,m-1\},j\in\{0,...,n-1\}:~ K_{hij} \leftarrow K_{hij} + \alpha x_h A_{ij}\]
| [in] | x | The l-length vector that serves as the left multiplicand. | 
| [in] | a | The m-by-n matrix that serves as the right multiplicand. | 
| [in] | alpha | A scaling factor for the product. | 
*this Definition at line 2863 of file tiny_algebra.hpp.
References FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::operator()().
| 
 | inline | 
conversion operator
Definition at line 2609 of file tiny_algebra.hpp.
References FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::convert(), and FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::v.
Referenced by FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::convert().
| 
 | inline | 
Copies a tensor3.
| [in] | a | The source tensor3 to copy | 
Definition at line 2696 of file tiny_algebra.hpp.
References FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::v, and FEAT::Tiny::Matrix< T_, m_, n_, sm_, sn_ >::v.
| 
 | inline | 
Copies the upper left mm_ x nn_ entries of a matrix.
| mm_ | The number of matrix rows to copy; must be mm_ <= min(m_, ma_) | 
| nn_ | The number of matrix columns to copy; must be nn_ <= min(n_, na_) | 
| [in] | x | The source vector to copy the elements from | 
Definition at line 2717 of file tiny_algebra.hpp.
References FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::v, and FEAT::Tiny::Matrix< T_, m_, n_, sm_, sn_ >::v.
| 
 | inline | 
formats the tensor
Definition at line 2732 of file tiny_algebra.hpp.
| 
 | inlinestatic | 
Returns a null-tensor.
Definition at line 2884 of file tiny_algebra.hpp.
References FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::Tensor3().
| 
 | inline | 
Access operator.
| [in] | h,i,j | The indices of the tensor entry that is to be returned. | 
Definition at line 2624 of file tiny_algebra.hpp.
References ASSERTM, and FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::v.
Referenced by FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::add_double_mat_mult(), FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::add_mat_tensor_mult(), and FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::add_vec_mat_outer_product().
| 
 | inline | 
Access operator.
| [in] | h,i,j | The indices of the tensor entry that is to be returned. | 
Definition at line 2633 of file tiny_algebra.hpp.
References ASSERTM, and FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::v.
| 
 | inline | 
scalar right-multiply-by operator
Definition at line 2664 of file tiny_algebra.hpp.
References FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::v.
| 
 | inline | 
tensor component-wise addition operator
Definition at line 2673 of file tiny_algebra.hpp.
References FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::v, and FEAT::Tiny::Matrix< T_, m_, n_, sm_, sn_ >::v.
| 
 | inline | 
tensor component-wise subtraction operator
Definition at line 2682 of file tiny_algebra.hpp.
References FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::v, and FEAT::Tiny::Matrix< T_, m_, n_, sm_, sn_ >::v.
| 
 | inline | 
Initializer list assignment operator.
| [in] | x | The initializer list whose elements are to be assigned. | 
Definition at line 2598 of file tiny_algebra.hpp.
References FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::v, and XASSERTM.
| 
 | inline | 
Initializer list assignment operator.
| [in] | x | The initializer list whose elements are to be assigned. | 
Definition at line 2580 of file tiny_algebra.hpp.
References FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::v, and XASSERTM.
| 
 | inline | 
copy-assignment operator
Definition at line 2564 of file tiny_algebra.hpp.
References FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::v, and FEAT::Tiny::Matrix< T_, m_, n_, sm_, sn_ >::v.
| 
 | inline | 
value-assignment operator
Definition at line 2555 of file tiny_algebra.hpp.
References FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::v, and FEAT::value.
| 
 | inline | 
Plane-Access operator.
| [in] | h | The index of the plane that is to be returned. | 
h-th plane of the tensor. Definition at line 2650 of file tiny_algebra.hpp.
References ASSERTM, and FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::v.
| 
 | inline | 
Plane-Access operator.
| [in] | h | The index of the plane that is to be returned. | 
h-th plane of the tensor.  Definition at line 2657 of file tiny_algebra.hpp.
References ASSERTM, and FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::v.
| 
 | staticconstexpr | 
the tube count of the tensor
Definition at line 2482 of file tiny_algebra.hpp.
| 
 | staticconstexpr | 
the row count of the tensor
Definition at line 2484 of file tiny_algebra.hpp.
| 
 | staticconstexpr | 
the column count of the tensor
Definition at line 2486 of file tiny_algebra.hpp.
| 
 | staticconstexpr | 
the tube stride of the tensor
Definition at line 2488 of file tiny_algebra.hpp.
| 
 | staticconstexpr | 
the row stride of the tensor
Definition at line 2490 of file tiny_algebra.hpp.
| 
 | staticconstexpr | 
the column stride of the tensor
Definition at line 2492 of file tiny_algebra.hpp.
| PlaneType FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::v[sl_] | 
Actual tensor data.
Definition at line 2502 of file tiny_algebra.hpp.
Referenced by FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::Tensor3(), FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::convert(), FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::copy(), FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::copy_n(), FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::operator()(), FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::operator*=(), FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::operator+=(), FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::operator-=(), FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::operator=(), and FEAT::Tiny::Tensor3< T_, l_, m_, n_, sl_, sm_, sn_ >::operator[]().