Logo Search packages:      
Sourcecode: wims version File versions  Download package

edu::hws::jcm::functions::TableFunction Class Reference

Inheritance diagram for edu::hws::jcm::functions::TableFunction:

edu::hws::jcm::functions::FunctionParserExtension edu::hws::jcm::data::Function edu::hws::jcm::data::ParserExtension edu::hws::jcm::data::ExpressionCommand edu::hws::jcm::data::MathObject

List of all members.

Detailed Description

A TableFunction is a function that is specified by a table of (x,y)-points. Values are interpolated between the specified x-values. This can be done in several differnt ways; the method that is used is controlled by the "Style" property. Since a TableFunction extends FunctionParserExtension, a TableFunction can be added to a Parser (provided it has a name), and it can then be used in expressions parsed by that parser. Note that this class is meant to be used for functions that are defined by a fairly small number of points, since each function evaluation involves a linear search through the list of x-values of the defining points.

Definition at line 40 of file TableFunction.java.

Public Member Functions

void addIntervals (int intervals, double xmin, double xmax)
int addPoint (double x, double y)
void addPoints (double[] xCoords, double[] yCoords)
void appendOutputString (ExpressionProgram prog, int myIndex, StringBuffer buffer)
void apply (StackOfDouble stack, Cases cases)
void compileDerivative (ExpressionProgram prog, int myIndex, ExpressionProgram deriv, Variable wrt)
void copyDataFrom (TableFunction source)
boolean dependsOn (Variable wrt)
Function derivative (Variable wrt)
Function derivative (int wrt)
void doParse (Parser parser, ParserContext context)
int extent (ExpressionProgram prog, int myIndex)
int findPoint (double x)
int getArity ()
String getName ()
int getPointCount ()
int getStyle ()
double getVal (double[] params)
double getVal (double x)
double getValueWithCases (double[] params, Cases cases)
double getX (int i)
double getY (int i)
void removeAllPoints ()
void removePointAt (int i)
void setName (String name)
void setParensCanBeOptional (boolean b)
void setStyle (int style)
void setY (int i, double y)
 TableFunction (int sytle)
 TableFunction ()

Static Public Attributes

static final int PIECEWISE_LINEAR = 1
static final int SMOOTH = 0
static final int STEP = 2
static final int STEP_LEFT = 3
static final int STEP_RIGHT = 4

Protected Attributes

String name

Private Member Functions

double computeValue (double x, Cases cases, int derivativeLevel)
void interpolateDerivatives (int pos)

Private Attributes

int pointCt
CubicSegment[] segments
int style
double[] xCoords = new double[10]
double[] yCoords = new double[10]


class  Deriv

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index