Loading...
Searching...
No Matches
Opm::NonuniformTableLinear< T > Class Template Reference

This class uses linear interpolation to compute the value (and its derivative) of a function f sampled at possibly nonuniform points. More...

`#include <NonuniformTableLinear.hpp>`

## Public Member Functions

| NonuniformTableLinear ()
| Default constructor.
template<class XContainer , class YContainer >
| NonuniformTableLinear (const XContainer &x_values, const YContainer &y_values)
| Construct from vectors of x and y values.
std::pair< double, double > | domain ()
| Get the domain.
void | rescaleDomain (std::pair< double, double > new_domain)
| Rescale the domain.
double | operator() (const double x) const
| Evaluate the value at x.
double | derivative (const double x) const
| Evaluate the derivative at x.
double | inverse (const double y) const
| Evaluate the inverse at y.
bool | operator== (const NonuniformTableLinear &other) const
| Equality operator.

## Protected Attributes

std::vector< double > | x_values_
std::vector< T > | y_values_
std::vector< T > | x_values_reversed_
std::vector< T > | y_values_reversed_

## Detailed Description

template<typename T>
class Opm::NonuniformTableLinear< T >

This class uses linear interpolation to compute the value (and its derivative) of a function f sampled at possibly nonuniform points.

If values outside the domain are sought, values will be extrapolated linearly.

Template Parameters

  T | the range type of the function (should be an algebraic ring type)

## Constructor & Destructor Documentation

## NonuniformTableLinear()

template<typename T >
template<class XContainer , class YContainer >

Opm::NonuniformTableLinear< T >::NonuniformTableLinear | ( | const XContainer & | x_values,
|  | const YContainer & | y_values
| ) |  |

inline

Construct from vectors of x and y values.

Parameters

  x_values | vector of domain values
  y_values | vector of corresponding range values.

## Member Function Documentation

## derivative()

template<typename T >

double Opm::NonuniformTableLinear< T >::derivative | ( | const double | x | ) | const

inline

Evaluate the derivative at x.

Parameters

  x | a domain value

Returns
  f'(x)

## domain()

template<typename T >

std::pair< double, double > Opm::NonuniformTableLinear< T >::domain | ( |  | ) |

inline

Get the domain.

Returns
  the domain as a pair of doubles.

## inverse()

template<typename T >

double Opm::NonuniformTableLinear< T >::inverse | ( | const double | y | ) | const

inline

Evaluate the inverse at y.

Requires T to be a double.

Parameters

  y | a range value

Returns
  f^{-1}(y)

## operator()()

template<typename T >

double Opm::NonuniformTableLinear< T >::operator() | ( | const double | x | ) | const

inline

Evaluate the value at x.

Parameters

  x | a domain value

Returns
  f(x)

## operator==()

template<typename T >

bool Opm::NonuniformTableLinear< T >::operator== | ( | const NonuniformTableLinear< T > & | other | ) | const

inline

Equality operator.

Parameters

  other | another NonuniformTableLinear.

Returns
  true if they are represented exactly alike.

## rescaleDomain()

template<typename T >

void Opm::NonuniformTableLinear< T >::rescaleDomain | ( | std::pair< double, double > | new_domain | ) |

inline

Rescale the domain.

Parameters

  new_domain | the new domain as a pair of doubles.

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

- opm/common/utility/numeric/NonuniformTableLinear.hpp