NEML2 2.1.0
Loading...
Searching...
No Matches

The symmetric second order tensor. More...

Detailed Description

The symmetric second order tensor.

Mandel notation is used, and so the storage space is (6).

#include <SR2.h>

Inheritance diagram for SR2:

Public Member Functions

 SR2 (const R2 &T)
 Symmetrize an R2 then fill.
SR2 rotate (const Rot &r) const
 Rotate.
SR2 rotate (const R2 &R) const
SFR3 drotate (const Rot &r) const
 Derivative of the rotated tensor w.r.t. the Rodrigues vector.
SFFR4 drotate (const R2 &R) const
Scalar operator() (Size i, Size j) const
SR2 transpose () const
 Transpose, no-op.
Public Member Functions inherited from PrimitiveTensor< SR2, 6 >
 PrimitiveTensor ()=default
 Special member functions.
 operator neml2::Tensor () const
 Implicit conversion to a Tensor (discards information on the fixed base shape).
Scalar operator() (Args... i) const
 Single-element accessor.
Public Member Functions inherited from TensorBase< SR2 >
 TensorBase ()=default
 Default constructor.
SR2 variable_data () const
 Variable data without function graph.
SR2 contiguous () const
SR2 clone () const
 Clone (take ownership).
SR2 detach () const
 Discard function graph.
SR2 to (const TensorOptions &options) const
 Change tensor options.
SR2 operator- () const
 Negation.
Size batch_dim () const
Size base_dim () const
Size dynamic_dim () const
Size static_dim () const
Size intmd_dim () const
TraceableTensorShape batch_sizes () const
TensorShapeRef base_sizes () const
const TraceableTensorShapedynamic_sizes () const
TensorShapeRef static_sizes () const
TensorShapeRef intmd_sizes () const
TraceableSize batch_size (Size i) const
Size base_size (Size i) const
const TraceableSizedynamic_size (Size i) const
Size static_size (Size i) const
Size intmd_size (Size i) const
SR2 dynamic_index (indexing::TensorIndicesRef indices) const
SR2 intmd_index (indexing::TensorIndicesRef indices) const
neml2::Tensor base_index (indexing::TensorIndicesRef indices) const
SR2 batch_index (indexing::TensorIndicesRef indices) const
SR2 dynamic_slice (Size d, const indexing::Slice &index) const
SR2 intmd_slice (Size d, const indexing::Slice &index) const
neml2::Tensor base_slice (Size d, const indexing::Slice &index) const
SR2 batch_slice (Size d, const indexing::Slice &index) const
void dynamic_index_put_ (indexing::TensorIndicesRef indices, const ATensor &other)
void intmd_index_put_ (indexing::TensorIndicesRef indices, const ATensor &other)
void base_index_put_ (indexing::TensorIndicesRef indices, const ATensor &other)
void batch_index_put_ (indexing::TensorIndicesRef indices, const ATensor &other)
SR2 dynamic_expand (const TraceableTensorShape &shape) const
SR2 intmd_expand (TensorShapeRef shape) const
neml2::Tensor base_expand (TensorShapeRef shape) const
SR2 batch_expand (const TraceableTensorShape &dynamic_shape, TensorShapeRef intmd_shape={}) const
neml2::Tensor static_expand (TensorShapeRef intmd_shape, TensorShapeRef base_shape) const
SR2 dynamic_expand_as (const neml2::Tensor &other) const
SR2 intmd_expand_as (const neml2::Tensor &other) const
neml2::Tensor base_expand_as (const neml2::Tensor &other) const
SR2 batch_expand_as (const neml2::Tensor &other) const
neml2::Tensor static_expand_as (const neml2::Tensor &other) const
SR2 dynamic_reshape (const TraceableTensorShape &shape) const
SR2 intmd_reshape (TensorShapeRef shape) const
neml2::Tensor base_reshape (TensorShapeRef shape) const
SR2 batch_reshape (const TraceableTensorShape &dynamic_shape, TensorShapeRef intmd_shape={}) const
neml2::Tensor static_reshape (TensorShapeRef intmd_shape, TensorShapeRef base_shape) const
SR2 dynamic_squeeze (Size d) const
SR2 intmd_squeeze (Size d) const
neml2::Tensor base_squeeze (Size d) const
SR2 batch_squeeze (Size d) const
SR2 dynamic_unsqueeze (Size d, Size n=1) const
SR2 intmd_unsqueeze (Size d, Size n=1) const
neml2::Tensor base_unsqueeze (Size d, Size n=1) const
SR2 batch_unsqueeze (Size d, Size n=1) const
SR2 dynamic_transpose (Size d1, Size d2) const
SR2 intmd_transpose (Size d1, Size d2) const
neml2::Tensor base_transpose (Size d1, Size d2) const
SR2 batch_transpose (Size d1, Size d2) const
SR2 dynamic_movedim (Size old_dim, Size new_dim) const
SR2 intmd_movedim (Size old_dim, Size new_dim) const
neml2::Tensor base_movedim (Size old_dim, Size new_dim) const
SR2 batch_movedim (Size old_dim, Size new_dim) const
SR2 dynamic_flatten (Size start_dim=0, Size end_dim=-1) const
SR2 intmd_flatten (Size start_dim=0, Size end_dim=-1) const
neml2::Tensor base_flatten (Size start_dim=0, Size end_dim=-1) const
SR2 batch_flatten () const
 Flatten batch dimensions.
neml2::Tensor static_flatten () const
 Flatten static dimensions.

Static Public Member Functions

static SR2 fill (const CScalar &a, const TensorOptions &options=default_tensor_options())
 Fill the diagonals with a11 = a22 = a33 = a.
static SR2 fill (const Scalar &a)
static SR2 fill (const CScalar &a11, const CScalar &a22, const CScalar &a33, const TensorOptions &options=default_tensor_options())
 Fill the diagonals with a11, a22, a33.
static SR2 fill (const Scalar &a11, const Scalar &a22, const Scalar &a33)
static SR2 fill (const CScalar &a11, const CScalar &a22, const CScalar &a33, const CScalar &a23, const CScalar &a13, const CScalar &a12, const TensorOptions &options=default_tensor_options())
 Fill all entries.
static SR2 fill (const Scalar &a11, const Scalar &a22, const Scalar &a33, const Scalar &a23, const Scalar &a13, const Scalar &a12)
static SR2 identity (const TensorOptions &options=default_tensor_options())
 Identity.
Static Public Member Functions inherited from PrimitiveTensor< SR2, 6 >
static SR2 create (const TensorDataContainer &data, Size intmd_dim=0, const TensorOptions &options=default_tensor_options())
 Arbitrary tensor from a nested container with inferred batch dimension.
static SR2 einsum (c10::string_view equation, TensorList tensors)
 Einstein summation along base dimensions.
static SR2 empty (const TensorOptions &options=default_tensor_options())
static SR2 zeros (const TensorOptions &options=default_tensor_options())
static SR2 ones (const TensorOptions &options=default_tensor_options())
static SR2 full (const CScalar &init, const TensorOptions &options=default_tensor_options())
static SR2 rand (const TensorOptions &options=default_tensor_options())
static SR2 fill (Args &&... args)
Static Public Member Functions inherited from TensorBase< SR2 >
static SR2 empty_like (const SR2 &other)
static SR2 zeros_like (const SR2 &other)
 Zero tensor like another, i.e. same batch and base shapes, same tensor options, etc.
static SR2 ones_like (const SR2 &other)
 Unit tensor like another, i.e. same batch and base shapes, same tensor options, etc.
static SR2 full_like (const SR2 &other, const CScalar &init)
static SR2 rand_like (const SR2 &other)

Additional Inherited Members

Public Types inherited from PrimitiveTensor< SR2, 6 >
using base_sizes_sequence
 Base shape sequence.
Static Public Attributes inherited from PrimitiveTensor< SR2, 6 >
static const TensorShape const_base_sizes
 The base shape.
static constexpr Size const_base_dim
 The base dim.
static constexpr Size const_base_numel
 The base numel.
Protected Member Functions inherited from PrimitiveTensor< SR2, 6 >
void validate_shapes_and_dims () const
 Validate shapes and dimensions.
Protected Member Functions inherited from TensorBase< SR2 >
void validate_shapes_and_dims () const
 Validate shapes and dimensions.

Constructor & Destructor Documentation

◆ SR2()

SR2 ( const R2 & T)

Symmetrize an R2 then fill.

Member Function Documentation

◆ drotate() [1/2]

SFFR4 drotate ( const R2 & R) const

◆ drotate() [2/2]

SFR3 drotate ( const Rot & r) const

Derivative of the rotated tensor w.r.t. the Rodrigues vector.

◆ fill() [1/6]

SR2 fill ( const CScalar & a,
const TensorOptions & options = default_tensor_options() )
staticnodiscard

Fill the diagonals with a11 = a22 = a33 = a.

◆ fill() [2/6]

SR2 fill ( const CScalar & a11,
const CScalar & a22,
const CScalar & a33,
const CScalar & a23,
const CScalar & a13,
const CScalar & a12,
const TensorOptions & options = default_tensor_options() )
staticnodiscard

Fill all entries.

◆ fill() [3/6]

SR2 fill ( const CScalar & a11,
const CScalar & a22,
const CScalar & a33,
const TensorOptions & options = default_tensor_options() )
staticnodiscard

Fill the diagonals with a11, a22, a33.

◆ fill() [4/6]

SR2 fill ( const Scalar & a)
staticnodiscard

◆ fill() [5/6]

SR2 fill ( const Scalar & a11,
const Scalar & a22,
const Scalar & a33 )
staticnodiscard

◆ fill() [6/6]

SR2 fill ( const Scalar & a11,
const Scalar & a22,
const Scalar & a33,
const Scalar & a23,
const Scalar & a13,
const Scalar & a12 )
staticnodiscard

◆ identity()

SR2 identity ( const TensorOptions & options = default_tensor_options())
staticnodiscard

Identity.

◆ operator()()

Scalar operator() ( Size i,
Size j ) const

◆ rotate() [1/2]

SR2 rotate ( const R2 & R) const

◆ rotate() [2/2]

SR2 rotate ( const Rot & r) const

Rotate.

◆ transpose()

SR2 transpose ( ) const

Transpose, no-op.