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

Second1D operator*(double f, const Second1D &der)
Second1D operator+(double f, const Second1D &h)
Second1D operator+(const Second1D &h, double f)
Second1D operator-(double f, const Second1D &h)
Second1D operator-(const Second1D &h, double f)
Second1D operator/(double v, const Second1D &der)
Second1D sqrt(const Second1D &der)
Second1D exp(const Second1D &der)
Second1D cos(const Second1D &der)
class Second1D
#include <Second1D.h>

Class representing values in one dimensions and allowing for the automatic calculation of first and second derivatives.

Public Functions

Second1D()

Default constructor.

Second1D(double v, double d, double h)

Constructor that takes a value, first derivative and second derivative of a function as an argument.

Parameters
  • v: Value of the function.

  • d: First derivative of the function.

  • h: Second derivative of the function.

double value() const

Getter for the value.

Return

double

double first() const

Getter for the first derivative.

Return

double

double second() const

Getter for the second derivative.

Return

double

void setValue(double v)

Setter for the value.

void setFirst(double d)

Setter for the first derivative.

void setSecond(double h)

Setter for the second derivative.

void setZero()

Zero initializer.

const Second1D &operator+=(const Second1D &rhs)

Definition of all differentiation rules.

const Second1D &operator-=(const Second1D &rhs)
const Second1D &operator*=(const Second1D &rhs)
const Second1D &operator/=(const Second1D &rhs)
const Second1D &operator*=(double rhs)
const Second1D &operator/=(double rhs)
Second1D operator+()
Second1D operator-()
Second1D operator+(const Second1D &der) const
Second1D operator-(const Second1D &rhs) const
Second1D operator*(const Second1D &rhs) const
Second1D operator/(const Second1D &rhs) const
Second1D operator*(double f) const
Second1D operator/(double f) const

Private Members

double v_ = {0}
double d_ = {0}
double h_ = {0}