Wildmeshing Toolkit
DiffScalarBase Struct Reference

Base class of all automatic differentiation types. More...

#include <autodiff.h>

Inheritance diagram for DiffScalarBase:
[legend]

Static Public Member Functions

Configuration
static void setVariableCount (size_t value)
 Set the independent variable count used by the automatic differentiation layer. More...
 
static size_t getVariableCount ()
 Get the variable count used by the automatic differentiation layer. More...
 

Static Public Attributes

static thread_local size_t m_variableCount
 

Detailed Description

Base class of all automatic differentiation types.

This class records the number of independent variables with respect to which derivatives are computed.

Definition at line 43 of file autodiff.h.

Member Function Documentation

◆ getVariableCount()

static size_t DiffScalarBase::getVariableCount ( )
inlinestatic

Get the variable count used by the automatic differentiation layer.

Definition at line 63 of file autodiff.h.

References m_variableCount.

Referenced by wmtk::function::utils::as_DScalar(), DScalar1< _Scalar, _Gradient >::DScalar1(), DScalar2< _Scalar, _Gradient, _Hessian >::DScalar2(), wmtk::function::utils::make_DScalar_matrix(), and DScalar2< _Scalar, _Gradient, _Hessian >::operator=().

Here is the caller graph for this function:

◆ setVariableCount()

static void DiffScalarBase::setVariableCount ( size_t  value)
inlinestatic

Set the independent variable count used by the automatic differentiation layer.

This function must be called before doing any computations with DScalar1 or DScalar2. The value will be recorded in thread-local storage.

Definition at line 57 of file autodiff.h.

References m_variableCount.

Referenced by wmtk::function::utils::AutoDiffRAII::AutoDiffRAII(), and wmtk::function::utils::AutoDiffRAII::~AutoDiffRAII().

Here is the caller graph for this function:

Member Data Documentation

◆ m_variableCount

thread_local size_t DiffScalarBase::m_variableCount
static

Definition at line 76 of file autodiff.h.

Referenced by getVariableCount(), and setVariableCount().


The documentation for this struct was generated from the following file: