NEML2 2.1.0
Loading...
Searching...
No Matches
Derivative< N > Class Template Reference

Derivative wrapper. More...

Detailed Description

template<std::size_t N>
class neml2::Derivative< N >

Derivative wrapper.

#include <Derivative.h>

Public Member Functions

 Derivative ()=default
 Derivative (std::size_t intrsc_intmd_dim, const std::array< std::size_t, N+1 > &intrsc_intmd_dims, const std::array< TensorShapeRef, N+1 > &intmd_sizes, const std::array< TensorShapeRef, N+1 > &base_sizes, std::string var_name="", std::array< std::string, N > arg_names={})
std::string name () const
 Get the derivative name.
const std::string & var_name () const
 Get the variable name.
const std::string & arg_name (std::size_t i) const
 Get the i-th argument name.
const Tensortensor () const
 Get the derivative.
void clear ()
 Clear the derivative.
bool defined () const
 Whether this derivative contains defined value.
bool is_intrsc_intmd_broadcast () const
 Whether this derivative represents a broadcast over intrinsic intermediate dimensions.
Derivative< N > reinterpret (std::size_t additional_intrsc_intmd_dim) const
 Reinterpret the derivative to add additional intrinsic intermediate dimensions to the variable and arguments.
Tensor fullify () const
 Derivative (const Derivative< N > &val)=default
 Derivative (Derivative< N > &&val)=default
 ~Derivative ()=default
Derivativeoperator= (const Tensor &val)
Derivativeoperator= (const Derivative< N > &val)=default
Derivativeoperator= (Derivative< N > &&val) noexcept=default
Derivativeoperator+= (const Tensor &val)
Derivativeoperator+= (const Derivative< N > &val)
TensorShapeRef intmd_sizes () const
TensorShapeRef extrsc_intmd_sizes () const
TensorShapeRef intrsc_intmd_sizes () const
TensorShapeRef var_intmd_sizes () const
TensorShapeRef var_intrsc_intmd_sizes () const
TensorShapeRef arg_intmd_sizes (std::size_t i) const
TensorShapeRef arg_intrsc_intmd_sizes (std::size_t i) const
TensorShape base_sizes () const
TensorShapeRef var_base_sizes () const
TensorShapeRef arg_base_sizes (std::size_t i) const
Size intmd_dim () const
Size intrsc_intmd_dim () const
Size var_intrsc_intmd_dim () const
Size arg_intrsc_intmd_dim (std::size_t i) const
Size base_dim () const
Size var_base_dim () const
Size arg_base_dim (std::size_t i) const

Constructor & Destructor Documentation

◆ Derivative() [1/4]

template<std::size_t N>
Derivative ( )
default

◆ Derivative() [2/4]

template<std::size_t N>
Derivative ( std::size_t intrsc_intmd_dim,
const std::array< std::size_t, N+1 > & intrsc_intmd_dims,
const std::array< TensorShapeRef, N+1 > & intmd_sizes,
const std::array< TensorShapeRef, N+1 > & base_sizes,
std::string var_name = "",
std::array< std::string, N > arg_names = {} )

◆ Derivative() [3/4]

template<std::size_t N>
Derivative ( const Derivative< N > & val)
default

◆ Derivative() [4/4]

template<std::size_t N>
Derivative ( Derivative< N > && val)
default

◆ ~Derivative()

template<std::size_t N>
~Derivative ( )
default

Member Function Documentation

◆ arg_base_dim()

template<std::size_t N>
Size arg_base_dim ( std::size_t i) const

◆ arg_base_sizes()

template<std::size_t N>
TensorShapeRef arg_base_sizes ( std::size_t i) const

◆ arg_intmd_sizes()

template<std::size_t N>
TensorShapeRef arg_intmd_sizes ( std::size_t i) const

◆ arg_intrsc_intmd_dim()

template<std::size_t N>
Size arg_intrsc_intmd_dim ( std::size_t i) const

◆ arg_intrsc_intmd_sizes()

template<std::size_t N>
TensorShapeRef arg_intrsc_intmd_sizes ( std::size_t i) const

◆ arg_name()

template<std::size_t N>
const std::string & arg_name ( std::size_t i) const

Get the i-th argument name.

◆ base_dim()

template<std::size_t N>
Size base_dim ( ) const

◆ base_sizes()

template<std::size_t N>
TensorShape base_sizes ( ) const

◆ clear()

template<std::size_t N>
void clear ( )

Clear the derivative.

◆ defined()

template<std::size_t N>
bool defined ( ) const

Whether this derivative contains defined value.

◆ extrsc_intmd_sizes()

template<std::size_t N>
TensorShapeRef extrsc_intmd_sizes ( ) const

◆ fullify()

template<std::size_t N>
Tensor fullify ( ) const

Convert the derivative with broadcasting intrinsic intermediate dimensions into a Tensor with full intrinsic intermediate dimensions. If this derivative is already full, simply returns the underlying tensor.

◆ intmd_dim()

template<std::size_t N>
Size intmd_dim ( ) const

Dimensions

◆ intmd_sizes()

template<std::size_t N>
TensorShapeRef intmd_sizes ( ) const

Base shapes

◆ intrsc_intmd_dim()

template<std::size_t N>
Size intrsc_intmd_dim ( ) const

◆ intrsc_intmd_sizes()

template<std::size_t N>
TensorShapeRef intrsc_intmd_sizes ( ) const

◆ is_intrsc_intmd_broadcast()

template<std::size_t N>
bool is_intrsc_intmd_broadcast ( ) const

Whether this derivative represents a broadcast over intrinsic intermediate dimensions.

◆ name()

template<std::size_t N>
std::string name ( ) const

Get the derivative name.

◆ operator+=() [1/2]

template<std::size_t N>
Derivative & operator+= ( const Derivative< N > & val)

◆ operator+=() [2/2]

template<std::size_t N>
Derivative & operator+= ( const Tensor & val)

Compound assignment operator

◆ operator=() [1/3]

template<std::size_t N>
Derivative & operator= ( const Derivative< N > & val)
default

◆ operator=() [2/3]

template<std::size_t N>
Derivative & operator= ( const Tensor & val)

Assignment operator

◆ operator=() [3/3]

template<std::size_t N>
Derivative & operator= ( Derivative< N > && val)
defaultnoexcept

◆ reinterpret()

template<std::size_t N>
Derivative< N > reinterpret ( std::size_t additional_intrsc_intmd_dim) const

Reinterpret the derivative to add additional intrinsic intermediate dimensions to the variable and arguments.

◆ tensor()

template<std::size_t N>
const Tensor & tensor ( ) const

Get the derivative.

◆ var_base_dim()

template<std::size_t N>
Size var_base_dim ( ) const

◆ var_base_sizes()

template<std::size_t N>
TensorShapeRef var_base_sizes ( ) const

◆ var_intmd_sizes()

template<std::size_t N>
TensorShapeRef var_intmd_sizes ( ) const

◆ var_intrsc_intmd_dim()

template<std::size_t N>
Size var_intrsc_intmd_dim ( ) const

◆ var_intrsc_intmd_sizes()

template<std::size_t N>
TensorShapeRef var_intrsc_intmd_sizes ( ) const

◆ var_name()

template<std::size_t N>
const std::string & var_name ( ) const

Get the variable name.