Class LogLinearInterpolation
Log-linear interpolation between discrete points: the exponential of the linear interpolation of the logarithms of the y values, which must be positive.
public sealed class LogLinearInterpolation : Interpolation
- Inheritance
-
LogLinearInterpolation
- Inherited Members
- Extension Methods
Remarks
It copies its inputs, as every Interpolation does. It has no primitive.
Constructors
LogLinearInterpolation(ReadOnlySpan<double>, ReadOnlySpan<double>)
Initializes a new instance of the LogLinearInterpolation class.
public LogLinearInterpolation(ReadOnlySpan<double> x, ReadOnlySpan<double> y)
Parameters
xReadOnlySpan<double>The x values, which must be sorted; at least 2.
yReadOnlySpan<double>The y values, one per x value, each positive.
Exceptions
- ArgumentException
The sizes differ, there are fewer than 2 points, or a y value isn't positive.
Methods
DerivativeCore(double)
The first derivative at a point, after the range check.
protected override double DerivativeCore(double x)
Parameters
xdoubleThe point.
Returns
- double
The derivative.
PrimitiveCore(double)
The primitive at a point, after the range check.
protected override double PrimitiveCore(double x)
Parameters
xdoubleThe point.
Returns
- double
The primitive.
Exceptions
- NanoQLException
Always: the log interpolations have no primitive.
SecondDerivativeCore(double)
The second derivative at a point, after the range check.
protected override double SecondDerivativeCore(double x)
Parameters
xdoubleThe point.
Returns
- double
The second derivative.
ValueCore(double)
The interpolated value at a point, after the range check.
protected override double ValueCore(double x)
Parameters
xdoubleThe point.
Returns
- double
The value.