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

java.lang.Object
  extended by org.apache.commons.math3.analysis.interpolation.AbstractLinearIntervalsFunction
      extended by org.apache.commons.math3.analysis.interpolation.BiLinearIntervalsFunction
All Implemented Interfaces:
BivariateFunction

public class BiLinearIntervalsFunction
extends AbstractLinearIntervalsFunction
implements BivariateFunction

Implements the representation of a linear function in dimension 2. If double[] are given to the constructor, they should be sorted by increasing order (duplicates are allowed). No test to ensure that will be made, therefore, if these tab are not correctly sorted, results can be totally wrong. No exception will be thrown.

Since:
2.3
Version:
$Id: BiLinearIntervalsFunction.java 17603 2017-05-18 08:28:32Z bignon $
Author:
Sophie LAURENS
Concurrency :
not thread-safe
Concurrency comment :
input ISearchIndex not thread-safe

Field Summary
 
Fields inherited from class org.apache.commons.math3.analysis.interpolation.AbstractLinearIntervalsFunction
EPSILON, nxmax, nymax, nzmax, searchXIndex, searchYIndex, searchZIndex, xtab, ytab, ztab
 
Constructor Summary
BiLinearIntervalsFunction(double[] xval, double[] yval, double[][] fval)
          Constructor, in two dimensions.
BiLinearIntervalsFunction(ISearchIndex algoX, ISearchIndex algoY, double[][] fval)
          Constructor, in two dimensions with a search index algorithm as a parameter.
 
Method Summary
 double[][] getValues()
          Gets ftab in dimension 2
 double[] getytab()
          Gets ytab
 double value(double x, double y)
          Computation of the interpolated/extrapolated value f(x,y).
 
Methods inherited from class org.apache.commons.math3.analysis.interpolation.AbstractLinearIntervalsFunction
getxtab, interp1D, interp2D, isNan
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BiLinearIntervalsFunction

public BiLinearIntervalsFunction(double[] xval,
                                 double[] yval,
                                 double[][] fval)
Constructor, in two dimensions. The search index algorithm is set by default to an instance of class BinarySearchIndexClosedOpen, see its javadoc for convention details. Checks the lengths of xval and fval.length and yval and fval[i].length : they should be equal, and at least 2.

Parameters:
xval - : abscissas array increasingly sorted of length >= 2 (duplicates are allowed).
yval - : ordinates array increasingly sorted of length >= 2 (duplicates are allowed).
fval - : function values array increasingly sorted of length >= 2.
Preconditions :
: xval, yval, and fval are increasingly sorted. No test to ensure that will be made, therefore, if these tab are not correctly sorted, results can be totally wrong. No exception will be thrown.

BiLinearIntervalsFunction

public BiLinearIntervalsFunction(ISearchIndex algoX,
                                 ISearchIndex algoY,
                                 double[][] fval)
Constructor, in two dimensions with a search index algorithm as a parameter. The attributes xtab and ytab are retrieved from the search index algorithm. Checks the lengths of xval and fval.length and yval and fval[i].length : they should be equal, and at least 2.

Parameters:
algoX - : an instance of a class implemented ISearchIndex, containing xtab. When it has been created, it should have been with a sorted tab.
algoY - : an instance of a class implemented ISearchIndex, containing ytab. When it has been created, it should have been with a sorted tab.
fval - : function values array increasingly sorted of length >= 2.
Preconditions :
: fval is increasingly sorted, and the search index algorithm had to be created with a sorted tab also. No test to ensure that will be made, therefore, if these tab are not correctly sorted, results can be totally wrong. No exception will be thrown.
Method Detail

value

public double value(double x,
                    double y)
Computation of the interpolated/extrapolated value f(x,y).

Specified by:
value in interface BivariateFunction
Parameters:
x - : abscissa where to interpolate.
y - : ordinate where to interpolate.
Returns:
fxy : the value of the function at (x,y).

getytab

public double[] getytab()
Gets ytab

Returns:
the y values

getValues

public double[][] getValues()
Gets ftab in dimension 2

Returns:
the function values


Copyright © 2017 CNES. All Rights Reserved.