org.apache.commons.math3.analysis.interpolation
Class AbstractLinearIntervalsFunction

java.lang.Object
  extended by org.apache.commons.math3.analysis.interpolation.AbstractLinearIntervalsFunction
Direct Known Subclasses:
BiLinearIntervalsFunction, TriLinearIntervalsFunction, UniLinearIntervalsFunction

public abstract class AbstractLinearIntervalsFunction
extends Object

Abstract class for linear interpolation. Allows 1, 2 or 3 dimensions. Owns an optimised indices search.

Since:
2.3
Version:
$Id: AbstractLinearIntervalsFunction.java 17603 2017-05-18 08:28:32Z bignon $
Author:
Sophie LAURENS

Field Summary
protected static double EPSILON
          Numerical precision.
protected  int nxmax
          Maximal indices in the first dimension of fthe tab in dimension 1, 2 and 3.
protected  int nymax
          Maximal indices in the second dimension of ftab in dimension 2 and 3.
protected  int nzmax
          Maximal indices in the third dimension of ftab in dimension 3.
protected  ISearchIndex searchXIndex
          xtab used for search and satisfies condition from SearchIndex.
protected  ISearchIndex searchYIndex
          ytab used for search and satisfies condition from SearchIndex.
protected  ISearchIndex searchZIndex
          ztab used for search and satisfies condition from SearchIndex.
protected  double[] xtab
          Abscissas array.
protected  double[] ytab
          Ordinates array.
protected  double[] ztab
          Heights array.
 
Constructor Summary
AbstractLinearIntervalsFunction()
           
 
Method Summary
 double[] getxtab()
          Gets xtab
protected  double interp1D(double f0, double f1, double x0, double x1, double x)
          Interpolates in 1D.
protected  double interp2D(double fx0y0, double fx1y0, double fx0y1, double fx1y1, double x0, double x1, double y0, double y1, double x, double y)
          Interpolates in 2D by 2-successives 1D interpolation.
protected  boolean isNan(double[] val)
          Tests if an array of double contains NaN values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EPSILON

protected static final double EPSILON
Numerical precision.

See Also:
Constant Field Values

nxmax

protected int nxmax
Maximal indices in the first dimension of fthe tab in dimension 1, 2 and 3.


nymax

protected int nymax
Maximal indices in the second dimension of ftab in dimension 2 and 3.


nzmax

protected int nzmax
Maximal indices in the third dimension of ftab in dimension 3.


xtab

protected double[] xtab
Abscissas array.


ytab

protected double[] ytab
Ordinates array.


ztab

protected double[] ztab
Heights array.


searchXIndex

protected ISearchIndex searchXIndex
xtab used for search and satisfies condition from SearchIndex.


searchYIndex

protected ISearchIndex searchYIndex
ytab used for search and satisfies condition from SearchIndex.


searchZIndex

protected ISearchIndex searchZIndex
ztab used for search and satisfies condition from SearchIndex.

Constructor Detail

AbstractLinearIntervalsFunction

public AbstractLinearIntervalsFunction()
Method Detail

interp1D

protected double interp1D(double f0,
                          double f1,
                          double x0,
                          double x1,
                          double x)
Interpolates in 1D.

Parameters:
f0 - : f(x0)
f1 - : f(x1)
x0 - : lower bound
x1 - : upper bound
x - : the point where to do the interpolation
Returns:
finterp : f(x) = a x + b.
Preconditions :
x0 different from x1, and x belongs to [x0, x1[

interp2D

protected double interp2D(double fx0y0,
                          double fx1y0,
                          double fx0y1,
                          double fx1y1,
                          double x0,
                          double x1,
                          double y0,
                          double y1,
                          double x,
                          double y)
Interpolates in 2D by 2-successives 1D interpolation. In this case, the first interpolation is in the x direction, and the second in y.

Parameters:
fx0y0 - : f(x0,y0): lower point for the 1st interpolation (the lower bound for the 2nd interpolation).
fx1y0 - : f(x1,y0): upper point for the 1st interpolation (the lower bound for the 2nd interpolation).
fx0y1 - : f(x0,y1): lower point for the 2nd interpolation (the upper bound for the 2nd interpolation).
fx1y1 - : f(x1,y1): upper point for the 2nd interpolation (the upper bound for the 2nd interpolation).
x0 - : lower bound for the first direction
x1 - : upper bound for the first direction
y0 - : lower bound for the second direction
y1 - : upper bound for the second direction
x - : the point where to do the interpolation in the 1st direction
y - : the point where to do the interpolation in the 2nd direction
Returns:
finterp : f(x,y) = b f(x,y0) + (1-b) f(x,y1), and f(x,y0) = a0 f(x0,y0) + (1-a0) f(x1,y0) f(x,y1) = a1 f(x0,y1) + (1-a1) f(x1,y1).
Preconditions :
x0 (resp. y0) different from x1 (resp. y1), and x (resp. y) belongs to [x0, x1[ (resp. [y0, y1[).

isNan

protected boolean isNan(double[] val)
Tests if an array of double contains NaN values.

Parameters:
val - the array
Returns:
true if at least one value is NaN

getxtab

public double[] getxtab()
Gets xtab

Returns:
the x values


Copyright © 2017 CNES. All Rights Reserved.