Opm::MathToolbox< ScalarT > Struct Template Reference

#include <MathToolbox.hpp>

Public Types

typedef ScalarT Scalar
 The type used to represent "primitive" scalar values. More...
 
typedef ScalarT ValueType
 The type used to represent values. More...
 
typedef MathToolbox< ScalarInnerToolbox
 The toolbox for the type of value objects. More...
 

Static Public Member Functions

static Scalar value (Scalar value)
 Return the value of the function at a given evaluation point. More...
 
static Scalar scalarValue (Scalar value)
 Return the primitive scalar value of a value object. More...
 
static Scalar createBlank (Scalar)
 Given a scalar value, return a "compatible" object. More...
 
static Scalar createConstant (Scalar value)
 Given a scalar value, return an evaluation of a constant function. More...
 
static Scalar createConstant (unsigned numDerivatives, Scalar value)
 Given a scalar value, return an evaluation of a constant function that features a given number of derivatives. More...
 
static Scalar createConstant (Scalar, Scalar value)
 Given a scalar value, return an evaluation of a constant function that is compatible to a "template" variable. More...
 
static Scalar createVariable (Scalar, unsigned)
 Given a scalar value, return an evaluation of a linear function. More...
 
static Scalar createVariable (Scalar, Scalar, unsigned)
 Given a scalar value, return an evaluation of a linear function that is compatible with a "template" evaluation. More...
 
template<class LhsEval >
static LhsEval decay (Scalar value)
 Given a function evaluation, constrain it to its value (if necessary). More...
 
static bool isSame (Scalar a, Scalar b, Scalar tolerance)
 Returns true if two values are identical up to a specified tolerance. More...
 
static Scalar max (Scalar arg1, Scalar arg2)
 The maximum of two arguments. More...
 
static Scalar min (Scalar arg1, Scalar arg2)
 The minimum of two arguments. More...
 
static Scalar abs (Scalar arg)
 The absolute value. More...
 
static Scalar tan (Scalar arg)
 The tangens of a value. More...
 
static Scalar atan (Scalar arg)
 The arcus tangens of a value. More...
 
static Scalar atan2 (Scalar arg1, Scalar arg2)
 The arcus tangens of a value. More...
 
static Scalar sin (Scalar arg)
 The sine of a value. More...
 
static Scalar asin (Scalar arg)
 The arcus sine of a value. More...
 
static Scalar sinh (Scalar arg)
 The sine hyperbolicus of a value. More...
 
static Scalar asinh (Scalar arg)
 The arcus sine hyperbolicus of a value. More...
 
static Scalar cos (Scalar arg)
 The cosine of a value. More...
 
static Scalar acos (Scalar arg)
 The arcus cosine of a value. More...
 
static Scalar cosh (Scalar arg)
 The cosine hyperbolicus of a value. More...
 
static Scalar acosh (Scalar arg)
 The arcus cosine hyperbolicus of a value. More...
 
static Scalar sqrt (Scalar arg)
 The square root of a value. More...
 
static Scalar exp (Scalar arg)
 The natural exponentiation of a value. More...
 
static Scalar log10 (Scalar arg)
 The 10 logarithm of a value. More...
 
static Scalar log (Scalar arg)
 The natural logarithm of a value. More...
 
static Scalar pow (Scalar base, Scalar exp)
 Exponentiation to an arbitrary base. More...
 
static bool isfinite (Scalar arg)
 Return true iff the argument's value and all its derivatives are finite values. More...
 
static bool isnan (Scalar arg)
 Return true iff the argument's value or any of its derivatives are NaN values. More...
 

Member Typedef Documentation

◆ InnerToolbox

template<class ScalarT >
typedef MathToolbox<Scalar> Opm::MathToolbox< ScalarT >::InnerToolbox

The toolbox for the type of value objects.

For this class this is trivial because primitive floating point objects are endpoints in the "nesting graph". This typedef makes sense if nested automatic differentiation is used, though...

◆ Scalar

template<class ScalarT >
typedef ScalarT Opm::MathToolbox< ScalarT >::Scalar

The type used to represent "primitive" scalar values.

◆ ValueType

template<class ScalarT >
typedef ScalarT Opm::MathToolbox< ScalarT >::ValueType

The type used to represent values.

In general, these objects represent the function value at a given point plus a number of derivatives. In the case of the scalars, no derivatives will be evaluated.

Member Function Documentation

◆ abs()

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT >::abs ( Scalar  arg)
inlinestatic

The absolute value.

References Opm::abs().

Referenced by Opm::abs().

◆ acos()

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT >::acos ( Scalar  arg)
inlinestatic

The arcus cosine of a value.

References Opm::acos().

Referenced by Opm::acos().

◆ acosh()

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT >::acosh ( Scalar  arg)
inlinestatic

The arcus cosine hyperbolicus of a value.

References Opm::acosh().

Referenced by Opm::acosh().

◆ asin()

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT >::asin ( Scalar  arg)
inlinestatic

The arcus sine of a value.

References Opm::asin().

Referenced by Opm::asin().

◆ asinh()

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT >::asinh ( Scalar  arg)
inlinestatic

The arcus sine hyperbolicus of a value.

References Opm::asinh().

Referenced by Opm::asinh().

◆ atan()

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT >::atan ( Scalar  arg)
inlinestatic

The arcus tangens of a value.

References Opm::atan().

Referenced by Opm::atan().

◆ atan2()

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT >::atan2 ( Scalar  arg1,
Scalar  arg2 
)
inlinestatic

The arcus tangens of a value.

References Opm::atan2().

◆ cos()

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT >::cos ( Scalar  arg)
inlinestatic

The cosine of a value.

References Opm::cos().

Referenced by Opm::cos().

◆ cosh()

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT >::cosh ( Scalar  arg)
inlinestatic

The cosine hyperbolicus of a value.

References Opm::cosh().

Referenced by Opm::cosh().

◆ createBlank()

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT >::createBlank ( Scalar  )
inlinestatic

Given a scalar value, return a "compatible" object.

This basically boils down to creating an uninitialized object of sufficient size. This is method only non-trivial for dynamically-sized Evaluation objects.

Referenced by Opm::blank().

◆ createConstant() [1/3]

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT >::createConstant ( Scalar  value)
inlinestatic

Given a scalar value, return an evaluation of a constant function.

For this toolbox, an evaluation is the value, so this method is the identity function. In general, this returns an evaluation object for which all derivatives are zero.

References Opm::MathToolbox< ScalarT >::value().

Referenced by Opm::constant().

◆ createConstant() [2/3]

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT >::createConstant ( Scalar  ,
Scalar  value 
)
inlinestatic

Given a scalar value, return an evaluation of a constant function that is compatible to a "template" variable.

For this toolbox, an evaluation is the value, so this method is the identity function. In general, this returns an evaluation object for which all derivatives are zero.

References Opm::MathToolbox< ScalarT >::value().

◆ createConstant() [3/3]

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT >::createConstant ( unsigned  numDerivatives,
Scalar  value 
)
inlinestatic

Given a scalar value, return an evaluation of a constant function that features a given number of derivatives.

For this toolbox, an evaluation is the value, so this method is the identity function. In general, this returns an evaluation object for which all derivatives are zero.

References Opm::MathToolbox< ScalarT >::value().

◆ createVariable() [1/2]

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT >::createVariable ( Scalar  ,
Scalar  ,
unsigned   
)
inlinestatic

Given a scalar value, return an evaluation of a linear function that is compatible with a "template" evaluation.

i.e., Create an evaluation which represents f(x) = x and the derivatives with regard to x. For scalars (which do not consider derivatives), this method does nothing.

◆ createVariable() [2/2]

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT >::createVariable ( Scalar  ,
unsigned   
)
inlinestatic

Given a scalar value, return an evaluation of a linear function.

i.e., Create an evaluation which represents f(x) = x and the derivatives with regard to x. For scalars (which do not consider derivatives), this method does nothing.

Referenced by Opm::variable().

◆ decay()

template<class ScalarT >
template<class LhsEval >
static LhsEval Opm::MathToolbox< ScalarT >::decay ( Scalar  value)
inlinestatic

Given a function evaluation, constrain it to its value (if necessary).

If the left hand side is a scalar and the right hand side is an evaluation, the scalar gets the value of the right hand side assigned. Also if both sides are scalars, this method returns the identity. The final case (left hand side being an evaluation, right hand side is a scalar) yields a compiler error.

The purpose of this method is to be able to transparantly use evaluation objects in scalar computations.

References Opm::MathToolbox< ScalarT >::value().

◆ exp()

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT >::exp ( Scalar  arg)
inlinestatic

The natural exponentiation of a value.

References Opm::exp().

Referenced by Opm::exp(), and Opm::MathToolbox< ScalarT >::pow().

◆ isfinite()

template<class ScalarT >
static bool Opm::MathToolbox< ScalarT >::isfinite ( Scalar  arg)
inlinestatic

Return true iff the argument's value and all its derivatives are finite values.

References Opm::isfinite().

Referenced by Opm::MathToolbox< DenseAd::Evaluation< ValueT, numVars, staticSize > >::isfinite(), and Opm::isfinite().

◆ isnan()

template<class ScalarT >
static bool Opm::MathToolbox< ScalarT >::isnan ( Scalar  arg)
inlinestatic

Return true iff the argument's value or any of its derivatives are NaN values.

References Opm::isnan().

Referenced by Opm::MathToolbox< DenseAd::Evaluation< ValueT, numVars, staticSize > >::isnan(), and Opm::isnan().

◆ isSame()

template<class ScalarT >
static bool Opm::MathToolbox< ScalarT >::isSame ( Scalar  a,
Scalar  b,
Scalar  tolerance 
)
inlinestatic

Returns true if two values are identical up to a specified tolerance.

References Opm::abs().

◆ log()

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT >::log ( Scalar  arg)
inlinestatic

The natural logarithm of a value.

References Opm::log().

Referenced by Opm::log().

◆ log10()

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT >::log10 ( Scalar  arg)
inlinestatic

The 10 logarithm of a value.

References Opm::log10().

Referenced by Opm::log10().

◆ max()

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT >::max ( Scalar  arg1,
Scalar  arg2 
)
inlinestatic

The maximum of two arguments.

References Opm::max().

◆ min()

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT >::min ( Scalar  arg1,
Scalar  arg2 
)
inlinestatic

The minimum of two arguments.

References Opm::min().

◆ pow()

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT >::pow ( Scalar  base,
Scalar  exp 
)
inlinestatic

Exponentiation to an arbitrary base.

References Opm::MathToolbox< ScalarT >::exp(), and Opm::pow().

◆ scalarValue()

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT >::scalarValue ( Scalar  value)
inlinestatic

Return the primitive scalar value of a value object.

Since this toolbox's value objects are primitive scalars, this method just passes through the argument it was given.

References Opm::MathToolbox< ScalarT >::value().

Referenced by Opm::MathToolbox< DenseAd::Evaluation< ValueT, numVars, staticSize > >::scalarValue(), and Opm::scalarValue().

◆ sin()

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT >::sin ( Scalar  arg)
inlinestatic

The sine of a value.

References Opm::sin().

Referenced by Opm::sin().

◆ sinh()

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT >::sinh ( Scalar  arg)
inlinestatic

The sine hyperbolicus of a value.

References Opm::sinh().

Referenced by Opm::sinh().

◆ sqrt()

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT >::sqrt ( Scalar  arg)
inlinestatic

The square root of a value.

References Opm::sqrt().

Referenced by Opm::sqrt().

◆ tan()

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT >::tan ( Scalar  arg)
inlinestatic

The tangens of a value.

References Opm::tan().

Referenced by Opm::tan().

◆ value()


The documentation for this struct was generated from the following file: