Class Scine::Utils::AutomaticDifferentiation::FirstBase

template<typename DerivativeT, typename Crtp>
class FirstBase

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.

Public Functions

void setValue(double v)

Set the value of the function.

double value() const

Get the value of the function.

Return

double

const DerivativeT &derivatives() const

Get derivatives.

Return

DerivativeT& Object type of derivatives in the derived class.

const Crtp &operator+=(double v)

Definition of operators for differentiation rules.

Crtp opposite() const

Returns the opposite of the derivative.

Return

Crtp Type of the derived class