edu.neu.ccs.gui
Class DataTables2D

java.lang.Object
  extended byedu.neu.ccs.gui.DataTables2D

public class DataTables2D
extends Object

Class DataTables2D provides static methods to create data tables from "functions" of type Function.OneArg.

The data tables may be used for numerical processing or for plotting with the plot tools.

See also the makeTable methods in BaseParser.

Version:
2.3.2

Constructor Summary
DataTables2D()
           
 
Method Summary
static Point2D[][] makeTable(Function.OneArg[] f, double endpointA, double endpointB, int divisions)
          Make a Point2D array of arrays of pairs (x, f[i](x)) where i ranges over the valid indices for the function array f and where x is sampled on the given interval divided into the number of divisions.
static Point2D[][] makeTable(Function.OneArg[] f, XInterval limits, int divisions)
          Make a Point2D array of arrays of pairs (x,f[i](x)) where i ranges over the valid indices for the function array f and where x is sampled on the given interval divided into the number of divisions.
static Point2D[] makeTable(Function.OneArg f, double endpointA, double endpointB, int divisions)
          Make a Point2D array of pairs (x,f(x)) where x is sampled on the given interval divided into the given number of divisions.
static Point2D[] makeTable(Function.OneArg f, XInterval limits, int divisions)
          Make a Point2D array of pairs (x,f(x)) where x is sampled on the given interval divided into the given number of divisions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataTables2D

public DataTables2D()
Method Detail

makeTable

public static Point2D[] makeTable(Function.OneArg f,
                                  XInterval limits,
                                  int divisions)

Make a Point2D array of pairs (x,f(x)) where x is sampled on the given interval divided into the given number of divisions.

If the given function or the given limits is null, returns null.

If divisions is less than 1, it will be set to 1. The size of the output array will be (divisions+1).

Parameters:
f - the function of one argument to evaluate
limits - the interval on which to evaluate
divisions - the number of subdivisions of the interval
Returns:
the array of (divisions+1) Point2D (x,f(x)) pairs

makeTable

public static Point2D[] makeTable(Function.OneArg f,
                                  double endpointA,
                                  double endpointB,
                                  int divisions)

Make a Point2D array of pairs (x,f(x)) where x is sampled on the given interval divided into the given number of divisions.

If the given function is null, returns null.

If divisions is less than 1, it will be set to 1. The size of the output array will be (divisions+1).

Parameters:
f - the function of one argument to evaluate
endpointA - an endpoint of the interval
endpointB - an endpoint of the interval
divisions - the number of subdivisions of the interval
Returns:
the array of (divisions + 1) Point2D (x,f(x)) pairs

makeTable

public static Point2D[][] makeTable(Function.OneArg[] f,
                                    XInterval limits,
                                    int divisions)

Make a Point2D array of arrays of pairs (x,f[i](x)) where i ranges over the valid indices for the function array f and where x is sampled on the given interval divided into the number of divisions.

If the given function array or the given limits is null, returns null.

If a particular function in the function array is null, the corresponding row of the return array will also be null.

If divisions is less than 1, it will be set to 1. The size of the output array will be (f.length)*(divisions+1).

Parameters:
f - the array of functions of one argument to evaluate
limits - the interval on which to evaluate
divisions - the number of subdivisions of the interval
Returns:
the array of arrays of Point2D pairs

makeTable

public static Point2D[][] makeTable(Function.OneArg[] f,
                                    double endpointA,
                                    double endpointB,
                                    int divisions)

Make a Point2D array of arrays of pairs (x, f[i](x)) where i ranges over the valid indices for the function array f and where x is sampled on the given interval divided into the number of divisions.

If the given function array is null, returns null.

If a particular function in the function array is null, the corresponding row of the return array will also be null.

If divisions is less than 1, it will be set to 1. The size of the output array will be (f.length)*(divisions+1).

Parameters:
f - the array of functions of one argument to evaluate
endpointA - an endpoint of the interval
endpointB - an endpoint of the interval
divisions - the number of subdivisions of the interval
Returns:
the array of arrays of Point2D pairs