|
| constexpr | BasicTensor () |
| | Constructs a tensor filled with zeros. More...
|
| |
| constexpr | BasicTensor (T value) |
| | Constructs a tensor filled with with the specified value. More...
|
| |
| template<typename V > |
| constexpr | BasicTensor (const BasicTensor< V, R, N > &value) |
| | Constructs a tensor by explicitly casting from a compatible tensor type. More...
|
| |
| template<typename U , std::size_t D = N, typename = std::enable_if_t<((D == N) && (R == 2))>> |
| constexpr | BasicTensor (const BasicMatrix< U, D > &rhs) |
| | Constructs a tensor equal to the specified matrix. More...
|
| |
| template<typename U , std::size_t D = N, typename = std::enable_if_t<((D == N) && (R == 1))>> |
| constexpr | BasicTensor (const BasicVector< U, D > &rhs) |
| | Construct a tensor equal to the specified vector. More...
|
| |
| constexpr | BasicTensor (const BasicTensor< T, R, N > &)=default |
| | Copy constructor. More...
|
| |
| constexpr | BasicTensor (BasicTensor< T, R, N > &&)=default |
| | Move constructor. More...
|
| |
| constexpr BasicTensor & | operator= (T rhs) |
| | Sets all entries in the tensor equal to the specified constant. More...
|
| |
| constexpr BasicTensor & | operator= (const BasicTensor< T, R, N > &rhs) |
| | Sets this tensor equal to the specified tensor. More...
|
| |
| constexpr BasicTensor & | operator+= (T rhs) |
| | Adds the specified constant to every entry of this tensor. More...
|
| |
| template<typename U > |
| constexpr BasicTensor & | operator+= (const BasicTensor< U, R, N > &rhs) |
| | Adds the specified tensor elementwise to this tensor. More...
|
| |
| constexpr BasicTensor & | operator-= (T rhs) |
| | Subtracts the specified constant to every entry of this tensor. More...
|
| |
| template<typename U > |
| constexpr BasicTensor & | operator-= (const BasicTensor< U, R, N > &rhs) |
| | Subtracts the specified tensor elementwise from this tensor. More...
|
| |
| constexpr BasicTensor & | operator*= (T rhs) |
| | Multiplies every entry of this tensor by the specified constant. More...
|
| |
| template<typename U > |
| constexpr BasicTensor & | ElementalMultiply (const BasicTensor< U, R, N > &rhs) |
| | Multiplies every entry in this tensor by the corresponding entry in the passed tensor (elementwise multiplication) More...
|
| |
| constexpr BasicTensor & | operator/= (T rhs) |
| | Divides every entry of this tensor by the specified constant. More...
|
| |
| template<typename U > |
| constexpr BasicTensor & | ElementalDivide (const BasicTensor< U, R, N > &rhs) |
| | Divides every entry in this tensor by the corresponding entry in the passed tensor (elementwise division) More...
|
| |
| constexpr BasicTensor | operator- () const |
| | Gets a tensor containing the negation of this tensor. More...
|
| |
| template<typename... IDX> |
| constexpr std::enable_if_t< sizeof...(IDX)==R, T > | operator() (IDX... idx) const |
| | Gets the value in the specified entry of the tensor. More...
|
| |
| template<typename... IDX> |
| constexpr std::enable_if_t< sizeof...(IDX)==R, T & > | operator() (IDX... idx) |
| | Gets a mutable reference to the specified entry of the tensor. More...
|
| |
| const T * | data () const |
| | Gets a const pointer to the underlying array for the tensor. More...
|
| |
| T * | data () |
| | Gets a pointer to the mutable underlying array for the tensor. More...
|
| |
|
|
template<typename U , typename V , std::size_t R1, std::size_t N1> |
| constexpr friend BasicTensor< std::common_type_t< U, V >, R1, N1 > | operator+ (const BasicTensor< U, R1, N1 > &lhs, const BasicTensor< V, R1, N1 > &rhs) |
| |
|
template<typename U , typename V , std::size_t R1, std::size_t N1> |
| constexpr friend BasicTensor< std::common_type_t< U, V >, R1, N1 > | operator- (const BasicTensor< U, R1, N1 > &lhs, const BasicTensor< V, R1, N1 > &rhs) |
| |
|
template<typename U , typename V , std::size_t R1, std::size_t N1> |
| constexpr friend BasicTensor< std::common_type_t< U, V >, R1, N1 > | ElementalMultiply (const BasicTensor< U, R1, N1 > &lhs, const BasicTensor< V, R1, N1 > &rhs) |
| |
|
template<typename U , typename V , std::size_t R1, std::size_t N1> |
| constexpr friend BasicTensor< std::common_type_t< U, V >, R1, N1 > | ElementalDivide (const BasicTensor< U, R1, N1 > &lhs, const BasicTensor< V, R1, N1 > &rhs) |
| |
template<typename T, std::size_t R, std::size_t N>
class ptems::BasicTensor< T, R, N >
A basic class for storing high-order tensors.
- Note
- This class should only be used for rank 3 or higher tensors; use BasicVector and BasicMatrix for rank one and two tensors, respectively.
- Template Parameters
-
| T | Type of the tensor entries |
| R | The rank of the matrix |
| N | The number of entries in each rank |