spis.Util.Func
Class TabulatedScalFunctionOfScal

java.lang.Object
  extended byspis.Util.Func.TabulatedScalFunctionOfScal
All Implemented Interfaces:
ScalFunctionOfScal

public class TabulatedScalFunctionOfScal
extends java.lang.Object
implements ScalFunctionOfScal

Class Name : TabulatedScalFunctionOfScal
Project ref : SPIS project
File name : TabulatedScalFunctionOfScal.java
File type : class
Copyright : ONERA, 2 Av. E. Belin, 31055 Toulouse cedex, France http://www.onecert.fr
Status : under development
Creation : Apr 16, 2004
Modification :

Description :
A tabulated function is stored at some points and allows to compute the value function at any argument inbetween (linear interpolation).

Versions and anomalies correction :

Version numberAuthor (name, e-mail) Corrections/Modifications
0.1 JF Roussel, roussel@onecert.frCreation


Version:
0.1
Author:
JF Roussel

Field Summary
private  float[] x
          x steps
private  float[] y
          y for each x
 
Constructor Summary
TabulatedScalFunctionOfScal(float[] x_, float[] y_)
          Default constructor.
 
Method Summary
 float compute(float xx)
          Computes the y as a function of x, based on the tables.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x

private float[] x
x steps


y

private float[] y
y for each x

Constructor Detail

TabulatedScalFunctionOfScal

public TabulatedScalFunctionOfScal(float[] x_,
                                   float[] y_)
Default constructor.
The table of x and y passed must verify the following:
- x and y tables must be of the same dimension
- they must be completely filled (all values will be used)
- x must ne in (strictly) increasing order

Parameters:
x_ - array of x values
y_ - array of y values
Method Detail

compute

public float compute(float xx)
Computes the y as a function of x, based on the tables.
The y is linearly interpolated between provided values.
If the x is out of the x interval of the table, the first or last value is returned.
Simple iterative method. If large tables are provided, a much more efficient dichotomic method should be implemented (TBD soon).

Specified by:
compute in interface ScalFunctionOfScal