MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
Loading...
Searching...
No Matches
mtl::tensor::antisymmetric_tensor< Value, Dim > Class Template Reference

Antisymmetric (skew-symmetric) rank-2 tensor. More...

#include <symmetric.hpp>

Public Types

using value_type = Value
using size_type = std::size_t

Public Member Functions

 antisymmetric_tensor ()=default
void set (size_type i, size_type j, const Value &val)
 Set the (i,j) component where i < j.
Value operator() (size_type i, size_type j) const
 Access: returns -component for (j,i), zero for diagonal.
tensor< Value, 2, Dim > to_full () const
 Convert to a full tensor.
bool operator== (const antisymmetric_tensor &other) const

Static Public Member Functions

static constexpr size_type stored_size ()

Static Public Attributes

static constexpr size_type rank = 2
static constexpr size_type dimension = Dim
static constexpr size_type num_stored = detail_sym::asym2_count(Dim)

Detailed Description

template<typename Value, std::size_t Dim>
class mtl::tensor::antisymmetric_tensor< Value, Dim >

Antisymmetric (skew-symmetric) rank-2 tensor.

T(i,j) == -T(j,i), T(i,i) == 0. Stores only D*(D-1)/2 independent components (strictly upper triangle).

Member Typedef Documentation

◆ size_type

template<typename Value, std::size_t Dim>
using mtl::tensor::antisymmetric_tensor< Value, Dim >::size_type = std::size_t

◆ value_type

template<typename Value, std::size_t Dim>
using mtl::tensor::antisymmetric_tensor< Value, Dim >::value_type = Value

Constructor & Destructor Documentation

◆ antisymmetric_tensor()

template<typename Value, std::size_t Dim>
mtl::tensor::antisymmetric_tensor< Value, Dim >::antisymmetric_tensor ( )
default

Member Function Documentation

◆ operator()()

template<typename Value, std::size_t Dim>
Value mtl::tensor::antisymmetric_tensor< Value, Dim >::operator() ( size_type i,
size_type j ) const
inline

Access: returns -component for (j,i), zero for diagonal.

◆ operator==()

template<typename Value, std::size_t Dim>
bool mtl::tensor::antisymmetric_tensor< Value, Dim >::operator== ( const antisymmetric_tensor< Value, Dim > & other) const
inline

◆ set()

template<typename Value, std::size_t Dim>
void mtl::tensor::antisymmetric_tensor< Value, Dim >::set ( size_type i,
size_type j,
const Value & val )
inline

Set the (i,j) component where i < j.

Setting (j,i) sets -(i,j). Setting a diagonal element (i == j) is a no-op: the diagonal of an antisymmetric tensor is structurally zero and has no storage slot.

◆ stored_size()

template<typename Value, std::size_t Dim>
constexpr size_type mtl::tensor::antisymmetric_tensor< Value, Dim >::stored_size ( )
inlinestaticconstexpr

◆ to_full()

template<typename Value, std::size_t Dim>
tensor< Value, 2, Dim > mtl::tensor::antisymmetric_tensor< Value, Dim >::to_full ( ) const
inline

Convert to a full tensor.

Member Data Documentation

◆ dimension

template<typename Value, std::size_t Dim>
size_type mtl::tensor::antisymmetric_tensor< Value, Dim >::dimension = Dim
staticconstexpr

◆ num_stored

template<typename Value, std::size_t Dim>
size_type mtl::tensor::antisymmetric_tensor< Value, Dim >::num_stored = detail_sym::asym2_count(Dim)
staticconstexpr

◆ rank

template<typename Value, std::size_t Dim>
size_type mtl::tensor::antisymmetric_tensor< Value, Dim >::rank = 2
staticconstexpr

The documentation for this class was generated from the following files: