Record Class Interpolation.SplineCoefficients
java.lang.Object
java.lang.Record
cloud.opencode.base.math.interpolation.Interpolation.SplineCoefficients
- Record Components:
x- the x-coordinates / x 坐标h- the interval widths / 区间宽度a- coefficient a (y values) / 系数 a(y 值)b- coefficient b / 系数 bc- coefficient c / 系数 cd- coefficient d / 系数 d
- Enclosing class:
Interpolation
public static record Interpolation.SplineCoefficients(double[] x, double[] h, double[] a, double[] b, double[] c, double[] d)
extends Record
Precomputed cubic spline coefficients for efficient multi-point evaluation.
预计算的三次样条系数,用于高效多点求值。
- Since:
- JDK 25, opencode-base-math V1.0.3
- Author:
- Leon Soo www.LeonSoo.com
-
Constructor Summary
ConstructorsConstructorDescriptionSplineCoefficients(double[] x, double[] h, double[] a, double[] b, double[] c, double[] d) Creates an instance of aSplineCoefficientsrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]a()Returns the value of thearecord component.double[]b()Returns the value of thebrecord component.double[]c()Returns the value of thecrecord component.double[]d()Returns the value of thedrecord component.final booleanIndicates whether some other object is "equal to" this one.doubleevaluate(double xi) Evaluates the precomputed spline at the given x value.double[]h()Returns the value of thehrecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.double[]x()Returns the value of thexrecord component.
-
Constructor Details
-
SplineCoefficients
public SplineCoefficients(double[] x, double[] h, double[] a, double[] b, double[] c, double[] d) Creates an instance of aSplineCoefficientsrecord class.
-
-
Method Details
-
evaluate
public double evaluate(double xi) Evaluates the precomputed spline at the given x value. 在给定 x 值处求值预计算的样条。- Parameters:
xi- the x value at which to evaluate — 待求值的 x 值- Returns:
- the interpolated y value — 插值后的 y 值
- Throws:
MathException- if xi is out of range — xi 超出范围时抛出
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
x
-
h
-
a
-
b
-
c
-
d
-