OpenWalnut
1.5.0dev
|
Implements a tensor that has the same number of components in every direction. More...
#include <WTensor.h>
Public Member Functions | |
WTensor () | |
Standard constructor. More... | |
WTensor (WTensorSym< order, dim, Data_T > const &t) | |
Construct a Tensor from a symmetric tensor. More... | |
WTensor const & | operator= (WTensorSym< order, dim, Data_T > const &t) |
Copy from a symmetric tensor. More... | |
Implements a tensor that has the same number of components in every direction.
order | The order of the tensor. |
dim | The dimension of the tensor, i.e. the number of components in each direction. |
Data_T | The datatype of the components, double by default. |
Access to specific elements of the tensor can be achieved in 2 ways:
Examples:
Construct a tensor of order 2 and dimension 3 (i.e. a 3x3-Matrix):
WTensor< 2, 3 > w;
Change Element (2,0) to 4.0:
w( 2, 0 ) = 4.0;
Construct a 4D-vector:
WTensor< 1, 4 > v;
Access v at position 2:
v( 2 ) = ...;
std::vector< int > i( 1, 2 ); v[ i ] = ...;
WTensor< order, dim, Data_T >::WTensor | ( | WTensorSym< order, dim, Data_T > const & | t | ) |
WTensor< order, dim, Data_T > const & WTensor< order, dim, Data_T >::operator= | ( | WTensorSym< order, dim, Data_T > const & | t | ) |