mmc
Class Interpolate

java.lang.Object
  extended by mmc.MathModel
      extended by mmc.Interpolate
All Implemented Interfaces:
FunctionInt

public class Interpolate
extends MathModel
implements FunctionInt

This class provides routines for function interpolation. Include the function to be interpolated in a class that implements the interface FunctionInt or FunctionInt2 (defined below). Methods contained here are based on the Numerical Recipes (W. H. Press et al.).

 interface FunctionInt{
     double functionInt(double x);
 }

 interface FunctionInt2{
     double functionInt(double x1, double x2);
 }
 


Field Summary
protected static double aBigNumber
           
protected static double bigNumber
           
static boolean fast
           
 double precision
           
 double precision2
           
 double precisionY
           
 double worstX
           
 double worstX2
           
 double worstY
           
 
Fields inherited from class mmc.MathModel
computerPrecision
 
Constructor Summary
Interpolate(double[] x, double[] y, int romberg, boolean rational, boolean relative)
          initializes class for the 1-dimensional function if the arrays already exist.
Interpolate(int max, double xmin, double xmax, FunctionInt function2int, int romberg, boolean rational, boolean relative, boolean isLog, int rombergY, boolean rationalY, boolean relativeY, boolean logSubst)
          initializes class for the 1-dimensional function
Interpolate(int max1, double x1min, double x1max, int max2, double x2min, double x2max, FunctionInt2 function2int, int romberg1, boolean rational1, boolean relative1, boolean isLog1, int romberg2, boolean rational2, boolean relative2, boolean isLog2, int rombergY, boolean rationalY, boolean relativeY, boolean logSubst)
          initializes class for the 2-dimensional function
 
Method Summary
 double findLimit(double y)
          finds x: f(x)=y, 1d initialization required
 double findLimit(double x1, double y)
          finds x: f(a,x)=y, 2d initialization required
 double functionInt(double x)
          defines a function for every row
 double interpolate(double x)
          interpolates f(x) for 1d function
 double interpolate(double x1, double x2)
          interpolates f(x) for 2d function
 double interpolateArray(double x)
          interpolates f(x) for 1d function if the arrays already exist.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

precision

public double precision

worstX

public double worstX

precision2

public double precision2

worstX2

public double worstX2

precisionY

public double precisionY

worstY

public double worstY

fast

public static boolean fast

bigNumber

protected static final double bigNumber
See Also:
Constant Field Values

aBigNumber

protected static final double aBigNumber
See Also:
Constant Field Values
Constructor Detail

Interpolate

public Interpolate(int max,
                   double xmin,
                   double xmax,
                   FunctionInt function2int,
                   int romberg,
                   boolean rational,
                   boolean relative,
                   boolean isLog,
                   int rombergY,
                   boolean rationalY,
                   boolean relativeY,
                   boolean logSubst)
initializes class for the 1-dimensional function


Interpolate

public Interpolate(int max1,
                   double x1min,
                   double x1max,
                   int max2,
                   double x2min,
                   double x2max,
                   FunctionInt2 function2int,
                   int romberg1,
                   boolean rational1,
                   boolean relative1,
                   boolean isLog1,
                   int romberg2,
                   boolean rational2,
                   boolean relative2,
                   boolean isLog2,
                   int rombergY,
                   boolean rationalY,
                   boolean relativeY,
                   boolean logSubst)
initializes class for the 2-dimensional function


Interpolate

public Interpolate(double[] x,
                   double[] y,
                   int romberg,
                   boolean rational,
                   boolean relative)
initializes class for the 1-dimensional function if the arrays already exist.

Method Detail

functionInt

public double functionInt(double x)
defines a function for every row

Specified by:
functionInt in interface FunctionInt

interpolate

public double interpolate(double x)
interpolates f(x) for 1d function


interpolate

public double interpolate(double x1,
                          double x2)
interpolates f(x) for 2d function


interpolateArray

public double interpolateArray(double x)
interpolates f(x) for 1d function if the arrays already exist.


findLimit

public double findLimit(double y)
finds x: f(x)=y, 1d initialization required


findLimit

public double findLimit(double x1,
                        double y)
finds x: f(a,x)=y, 2d initialization required