spis.Util.Func
Class ReciprocalFunction

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

public class ReciprocalFunction
extends java.lang.Object
implements ScalFunctionOfScal

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

Description : Defines the reciprocal function of a given function:
Given y = f(x) in the constructor, this function is x = f-1(y).
Valid only for a monotonic function (increasing or decreasing)
The implementation is through tabulation (parameters requested by the constructors).

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  boolean increasing
          if true function is increasing
private  int pointNb
          number of tabulated poins
private  float[] xT
          tabulated x values
private  float ymax
          maximum allowed y value
private  float ymin
          minimum allowed y value
private  float[] yT
          tabulated y values (increasing)
 
Constructor Summary
ReciprocalFunction(ScalFunctionOfScal f, float xmin, float xmax, float firstStep, float stepRatio)
          Constructor with a geometric spacing of tabulated x points.
ReciprocalFunction(ScalFunctionOfScal f, float xmin, float xmax, int stepNb)
          Constructor with a linear spacing of tabulated x points
 
Method Summary
 float compute(float y)
          applies this function to x and returns the result
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xT

private float[] xT
tabulated x values


yT

private float[] yT
tabulated y values (increasing)


pointNb

private int pointNb
number of tabulated poins


ymin

private float ymin
minimum allowed y value


ymax

private float ymax
maximum allowed y value


increasing

private boolean increasing
if true function is increasing

Constructor Detail

ReciprocalFunction

public ReciprocalFunction(ScalFunctionOfScal f,
                          float xmin,
                          float xmax,
                          int stepNb)
Constructor with a linear spacing of tabulated x points

Parameters:
f - function to be inverted
xmin - Minimum x to be consdered
xmax - Maximum x to be consdered
stepNb - Number of steps to cut the [xmin, xmax] interval into

ReciprocalFunction

public ReciprocalFunction(ScalFunctionOfScal f,
                          float xmin,
                          float xmax,
                          float firstStep,
                          float stepRatio)
Constructor with a geometric spacing of tabulated x points. Points will be: xmin, xmin + firstStep, xmin + firstStep + firstStep*stepRatio...

Parameters:
f - function to be inverted
xmin - Minimum x to be consdered
xmax - Maximum x to be consdered
firstStep - Size of the first x step (xmin -> xmin + firstStep)
stepRatio - Ratio for next step
Method Detail

compute

public float compute(float y)
Description copied from interface: ScalFunctionOfScal
applies this function to x and returns the result

Specified by:
compute in interface ScalFunctionOfScal
Parameters:
y -
Returns:
the reciprocal function x = f-1(y)
See Also:
ScalFunctionOfScal.compute(float)