tfel
Loading...
Searching...
No Matches
Curve.hxx File Reference

functions to build and evaluate the curves read in files, used internally by the TFELCheck library More...

#include <string>
#include <vector>

Classes

struct  tfel::check::Curve
 a curve, i.e. a set of points sorted by increasing abscissa, with no duplicated abscissa. More...

Namespaces

namespace  tfel
 the namespace tfel encloses all the TFEL project. This namespace is empty.

Functions

Curve tfel::check::buildCurve (const std::string &, const std::vector< double > &, const std::vector< double > &)
bool tfel::check::covers (const Curve &, const std::vector< double > &)
std::vector< double > tfel::check::evaluateCurve (Interpolation &, const Curve &, const std::vector< double > &)

Detailed Description

functions to build and evaluate the curves read in files, used internally by the TFELCheck library

Date
20/10/2026

Function Documentation

◆ buildCurve()

Curve tfel::check::buildCurve ( const std::string & ,
const std::vector< double > & ,
const std::vector< double > &  )
Returns
the curve defined by the given abscissas and values
Parameters
[in]ffile from which the abscissas and values were read, used in error messages
[in]xabscissas
[in]yvalues

The points are sorted by increasing abscissa. If an abscissa appears more than once, only the first point is kept, as in the Linearization class. An exception is thrown if no point is given.

◆ covers()

bool tfel::check::covers ( const Curve & ,
const std::vector< double > &  )
Returns
true if the given abscissas are in the range of the curve
Parameters
[in]ccurve
[in]xabscissas

A small tolerance, relative to the magnitude of the abscissas of the curve, absorbs the rounding errors on the bounds of the range.

◆ evaluateCurve()

std::vector< double > tfel::check::evaluateCurve ( Interpolation & ,
const Curve & ,
const std::vector< double > &  )
Returns
the values of a curve at the given abscissas
Parameters
[in]iinterpolation
[in]ccurve
[in]xabscissas

The values of the curve are used at its own abscissas. Between them, the given interpolation is used. Outside the range of the curve, the first or last value is used. The interpolation is only built if needed.