File AutomaticDifferentiationHelpers.h¶
- Copyright
This code is licensed under the 3-clause BSD license.
Copyright ETH Zurich, Laboratory for Physical Chemistry, Reiher Group.
See LICENSE.txt for details.
-
namespace
Scine
This header file contains functions that allow for common notation for common things that can be done at a different degree of derivatives.
This header contains alias definitions defining which classes to use for the different degrees of derivatives.
-
namespace
Utils
-
namespace
AutomaticDifferentiation
¶ 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)¶
-
derivOrder
-
namespace
-
namespace