Namespace Scine::Utils::AutomaticDifferentiationΒΆ
-
namespace
AutomaticDifferentiation
Typedefs
-
using
Value1DType
= typename Value1DOrder<o>::ValueType Templated type for a value in 1 dimension.
-
using
Value3DType
= typename Value3DOrder<o>::ValueType Templated type for a value in 3 dimension.
-
using
DerivativeType
= typename Derivative3DImpl<o>::ValueType Templated type for a derivative.
-
using
DerivativeContainerType
= typename DerivativeContainer3DImpl<o>::ValueType Templated type for a derivative container.
Functions
-
derivOrder
getDerivativeOrderEnum
(unsigned order) Get the enum corresponding to the derivative order.
-
int
getDerivativeOrder
(derivOrder order) Get the integer corresponding to the derivative order.
-
template<derivOrder
o
>
Value1DType<o>getFromFull
(double v, double firstDer, double secondDer) Create a value with derivatives in 1 dimension and neglect the unnecessary derivatives.
-
template<derivOrder
o
>
Value1DType<o>constant1D
(double c) Transform a double to a ValueWithDerivative in one dimension, with derivatives equal to zero.
-
template<derivOrder
o
>
Value1DType<o>variableWithUnitDerivative
(double v) Transform v to a ValueWithDerivative in one dimension, with first derivative 1 and second derivative 0.
-
template<derivOrder
o
>
Value3DType<o>constant3D
(double c) Transform a double to a ValueWithDerivative in three dimensions, with derivatives equal to zero.
-
template<derivOrder
o
>
Value3DType<o>toX
(double x) Get X as a value with derivatives in three dimensions.
The only non-zero derivative is the first derivative in x-direction.
-
template<derivOrder
o
>
Value3DType<o>toY
(double y) Get Y as a value with derivatives in three dimensions.
The only non-zero derivative is the first derivative in y-direction.
-
template<derivOrder
o
>
Value3DType<o>toZ
(double z) Get Z as a value with derivatives in three dimensions.
The only non-zero derivative is the first derivative in z-direction.
-
template<derivOrder
o
>
Value3DType<o>toRSquared
(double x, double y, double z) Get R-squared as a value with derivatives in three dimensions.
-
template<derivOrder
o
>
Value3DType<o>get3Dfrom1D
(Value1DType<o> v, const Eigen::Vector3d &R) Get a value with derivatives in 3 dimensions from the value with derivatives in one dimension, given a vector R.
-
template<derivOrder
o
>
Value3DType<o>getValueWithOppositeDerivative
(const Value3DType<o> &v) Get the value with inverted derivatives (useful for pairs of derivatives for two atoms).
The sign of the first derivatives changes.
-
template<derivOrder
o
>
doublegetValue1DAsDouble
(const Value1DType<o> &v) Extract the value with derivatives in 1 dimension as a double.
-
template<derivOrder
o
>
doublegetValue3DAsDouble
(const Value3DType<o> &v) Extract the value with derivatives in 3 dimension as a double.
-
template<>
doubleconstant1D
<derivOrder::zero>(double c)
-
template<>
doublevariableWithUnitDerivative
<derivOrder::zero>(double v)
-
template<>
doublegetFromFull
<derivOrder::zero>(double v, double, double)
-
template<>
doubleconstant3D
<derivOrder::zero>(double c)
-
template<>
doubletoX
<derivOrder::zero>(double x)
-
template<>
doubletoY
<derivOrder::zero>(double y)
-
template<>
doubletoZ
<derivOrder::zero>(double z)
-
template<>
doubletoRSquared
<derivOrder::zero>(double x, double y, double z)
-
template<>
doubleget3Dfrom1D
<derivOrder::zero>(double v, const Eigen::Vector3d&)
-
template<>
doublegetValueWithOppositeDerivative
<derivOrder::zero>(const double &v)
-
template<>
doublegetValue1DAsDouble
<derivOrder::zero>(const double &v)
-
template<>
doublegetValue3DAsDouble
<derivOrder::zero>(const double &v)
-
template<>
First1Dconstant1D
<derivOrder::one>(double c)
-
template<>
First1DvariableWithUnitDerivative
<derivOrder::one>(double v)
-
template<>
First1DgetFromFull
<derivOrder::one>(double v, double firstDer, double)
-
template<>
First3Dconstant3D
<derivOrder::one>(double c)
-
template<>
First3DtoX
<derivOrder::one>(double x)
-
template<>
First3DtoY
<derivOrder::one>(double y)
-
template<>
First3DtoZ
<derivOrder::one>(double z)
-
template<>
First3DtoRSquared
<derivOrder::one>(double x, double y, double z)
-
template<>
First3Dget3Dfrom1D
<derivOrder::one>(First1D v, const Eigen::Vector3d &R)
-
template<>
First3DgetValueWithOppositeDerivative
<derivOrder::one>(const First3D &v)
-
template<>
doublegetValue1DAsDouble
<derivOrder::one>(const First1D &v)
-
template<>
doublegetValue3DAsDouble
<derivOrder::one>(const First3D &v)
-
template<>
Second1Dconstant1D
<derivOrder::two>(double c)
-
template<>
Second1DvariableWithUnitDerivative
<derivOrder::two>(double v)
-
template<>
Second1DgetFromFull
<derivOrder::two>(double v, double firstDer, double secondDer)
-
template<>
Second3Dconstant3D
<derivOrder::two>(double c)
-
template<>
Second3DtoX
<derivOrder::two>(double x)
-
template<>
Second3DtoY
<derivOrder::two>(double y)
-
template<>
Second3DtoZ
<derivOrder::two>(double z)
-
template<>
Second3DtoRSquared
<derivOrder::two>(double x, double y, double z)
-
template<>
Second3Dget3Dfrom1D
<derivOrder::two>(Second1D v, const Eigen::Vector3d &R)
-
template<>
Second3DgetValueWithOppositeDerivative
<derivOrder::two>(const Second3D &v)
-
template<>
doublegetValue1DAsDouble
<derivOrder::two>(const Second1D &v)
-
template<>
doublegetValue3DAsDouble
<derivOrder::two>(const Second3D &v)
-
template<typename
DerivativeT
, typenameCrtp
>
Crtpoperator+
(double v, const FirstBase<DerivativeT, Crtp> &rhs)
-
template<typename
DerivativeT
, typenameCrtp
>
Crtpoperator-
(double v, const FirstBase<DerivativeT, Crtp> &rhs)
-
template<typename
DerivativeT
, typenameCrtp
>
Crtpoperator*
(double f, const FirstBase<DerivativeT, Crtp> &rhs)
-
template<typename
DerivativeT
, typenameCrtp
>
Crtpoperator/
(double f, const FirstBase<DerivativeT, Crtp> &rhs)
-
template<typename
DerivativeT
, typenameCrtp
>
Crtpsquare
(const FirstBase<DerivativeT, Crtp> &value)
-
template<typename
DerivativeT
, typenameCrtp
>
Crtpsqrt
(const FirstBase<DerivativeT, Crtp> &value)
-
template<typename
DerivativeT
, typenameCrtp
>
Crtpexp
(const FirstBase<DerivativeT, Crtp> &value)
-
template<derivativeType
o
>
DerivativeType<o>getOppositeDerivative
(const DerivativeType<o> &v) Get opposed derivatives.
i.e. sign of first derivative changes.
-
template<derivativeType
o
>
DerivativeType<o>getDerivativeFromValueWithDerivatives
(const Value3DType<UnderlyingOrder<o>> &v) Extract the derivatives from a value type with derivatives.
-
template<derivativeType
o
>
voidaddDerivativeToContainer
(DerivativeContainerType<o> &container, int a, int b, const DerivativeType<o> &v) Add derivatives to a derivative container.
- Parameters
v
: Derivative for the pair of indexes a-b. Considering the direction a->b.
-
template<>
DerivativeType<derivativeType::first>getOppositeDerivative
<derivativeType::first>(const DerivativeType<derivativeType::first> &v)
-
template<>
DerivativeType<derivativeType::second_atomic>getOppositeDerivative
<derivativeType::second_atomic>(const DerivativeType<derivativeType::second_atomic> &v)
-
template<>
DerivativeType<derivativeType::second_full>getOppositeDerivative
<derivativeType::second_full>(const DerivativeType<derivativeType::second_full> &v)
-
template<>
DerivativeType<derivativeType::first>getDerivativeFromValueWithDerivatives
<derivativeType::first>(const Value3DType<derivOrder::one> &v)
-
template<>
DerivativeType<derivativeType::second_atomic>getDerivativeFromValueWithDerivatives
<derivativeType::second_atomic>(const Value3DType<derivOrder::two> &v)
-
template<>
DerivativeType<derivativeType::second_full>getDerivativeFromValueWithDerivatives
<derivativeType::second_full>(const Value3DType<derivOrder::two> &v)
-
template<>
voidaddDerivativeToContainer
<derivativeType::first>(DerivativeContainerType<derivativeType::first> &container, int a, int b, const DerivativeType<derivativeType::first> &v)
-
template<>
voidaddDerivativeToContainer
<derivativeType::second_atomic>(DerivativeContainerType<derivativeType::second_atomic> &container, int a, int b, const DerivativeType<derivativeType::second_atomic> &v)
-
template<>
voidaddDerivativeToContainer
<derivativeType::second_full>(DerivativeContainerType<derivativeType::second_full> &container, int a, int b, const DerivativeType<derivativeType::second_full> &v)
Variables
-
constexpr derivOrder
UnderlyingOrder
= UnderlyingOrderImpl<O>::o Template variable for the derivative order corresponding to a derivative type.
-
template<derivOrder
O
>
structValue3DOrder
- #include <AutomaticDifferentiationTypesHelper.h>
Values in 3 dimensions.
-
template<derivOrder
O
>
structValue1DOrder
- #include <AutomaticDifferentiationTypesHelper.h>
Values in 1 dimension.
-
class
First1D
: public Scine::Utils::AutomaticDifferentiation::FirstBase<double, First1D> - #include <First1D.h>
Class representing values in one dimension and allowing for the automatic calculation of first derivatives.
-
class
First3D
: public Scine::Utils::AutomaticDifferentiation::FirstBase<Eigen::Vector3d, First3D> - #include <First3D.h>
Class representing values in one dimensions and allowing for the automatic calculation of first derivatives.
-
template<typename
DerivativeT
, typenameCrtp
>
classFirstBase
- #include <FirstBase.h>
Base class representing values with some derivative type and allowing for the automatic calculation of first derivatives.
This class makes use of CRTP so that the functions will directly have the correct return type for the derived classes.
-
class
FirstND
: public Scine::Utils::AutomaticDifferentiation::FirstBase<Eigen::MatrixXd, FirstND> - #include <FirstND.h>
Class representing values in N dimensions and allowing for the automatic calculation of first derivatives in those N dimensions.
-
class
Second1D
- #include <Second1D.h>
Class representing values in one dimensions and allowing for the automatic calculation of first and second derivatives.
-
class
Second3D
- #include <Second3D.h>
Class representing values in three dimensions and allowing for the automatic calculation of first and second derivatives.
-
using