File MethodsHelpers.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

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>
void addDerivativeToContainer(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<>
void addDerivativeToContainer<derivativeType::first>(DerivativeContainerType<derivativeType::first> &container, int a, int b, const DerivativeType<derivativeType::first> &v)
template<>
void addDerivativeToContainer<derivativeType::second_atomic>(DerivativeContainerType<derivativeType::second_atomic> &container, int a, int b, const DerivativeType<derivativeType::second_atomic> &v)
template<>
void addDerivativeToContainer<derivativeType::second_full>(DerivativeContainerType<derivativeType::second_full> &container, int a, int b, const DerivativeType<derivativeType::second_full> &v)