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

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

public class TriLinearIntervalsFunction
extends AbstractLinearIntervalsFunction
implements TrivariateFunction

Implements the representation of a linear function in dimension 2. If double[] are given to the constructor, they should be sorted by increasing order. 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: TriLinearIntervalsFunction.java 13046 2015-04-27 15:11:21Z 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
TriLinearIntervalsFunction(double[] xval, double[] yval, double[] zval, double[][][] fval)
          Constructor, in three dimensions.
TriLinearIntervalsFunction(ISearchIndex algoX, ISearchIndex algoY, ISearchIndex algoZ, double[][][] fval)
          Constructor, in three dimensions with a search index algorithm as a parameter.
 
Method Summary
 double[][][] getValues()
          Gets ftab in dimension 3
 double[] getytab()
          Gets ytab
 double[] getztab()
          Gets ztab
 double value(double x, double y, double z)
          Computation of the interpolated/extrapolated value f(x,y,z).
 
Methods inherited from class org.apache.commons.math3.analysis.interpolation.AbstractLinearIntervalsFunction
getxtab, interp1D, interp2D
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TriLinearIntervalsFunction

public TriLinearIntervalsFunction(double[] xval,
                                  double[] yval,
                                  double[] zval,
                                  double[][][] fval)
Constructor, in three 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 and zval and fval[i][j].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).
zval - : heights array increasingly sorted of length >= 2 (duplicates are allowed).
fval - : function values array increasingly sorted of length >= 2.
Preconditions :
: xval, yval, zval 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.

TriLinearIntervalsFunction

public TriLinearIntervalsFunction(ISearchIndex algoX,
                                  ISearchIndex algoY,
                                  ISearchIndex algoZ,
                                  double[][][] fval)
Constructor, in three dimensions with a search index algorithm as a parameter. The attributes xtab, ytab and ztab are retrieved from the search index algorithm. Checks the lengths of xval and fval.length and yval and fval[i].length and zval and fval[i][j].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.
algoZ - : an instance of a class implemented ISearchIndex, containing ztab. 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,
                    double z)
Computation of the interpolated/extrapolated value f(x,y,z).

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

getytab

public double[] getytab()
Gets ytab

Returns:
the y values

getztab

public double[] getztab()
Gets ztab

Returns:
the z values

getValues

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

Returns:
the function values


Copyright © 2016 CNES. All Rights Reserved.