jhplot
Class F1D

java.lang.Object
  extended by jhplot.DrawOptions
      extended by jhplot.F1D
All Implemented Interfaces:
java.io.Serializable

public class F1D
extends DrawOptions
implements java.io.Serializable

Create a function in 1D. The function name could have parameters named in unique way as P0, P1, P2 ... They have to be replaced with values using setPar() method for evaluation

See Also:
Serialized Form

Constructor Summary
F1D(hep.aida.IFunction iname, double min, double max)
          Create a F1D function from JAIDA IFunction.
F1D(graph.ParseFunction function, double min, double max)
          Create a function in 1D.
F1D(java.lang.String name)
          Create a function in 1D for evaluation.
F1D(java.lang.String name, double min, double max)
          Create a function in 1D.
F1D(java.lang.String name, double min, double max, boolean parse)
           
F1D(java.lang.String title, hep.aida.IFunction iname, double min, double max)
          Create F1D function from JAIDA IFunction.
F1D(java.lang.String title, java.lang.String name, double min, double max)
          Create a function in 1D.
 
Method Summary
 void eval()
          Evaluate a function for graphic representation.
 double eval(double x)
          Evaluate a function at a specific point in x
 double[] eval(double[] x)
          Evaluate a function for an array of x-values
 void eval(double min, double max)
          Evaluate a function for graphic representation.
 void eval(double min, double max, int Npoints)
          Evaluate a function for graphic representation.
 hep.aida.IFunction getIFunction()
          Return AIDA function
 double getMax()
          Get the maximum value in X
 double getMin()
          Get the minimum value in X
 java.lang.String getName()
          Get the name of the function used for evaluation
 graph.ParseFunction getParse()
          Return parsed function.
 int getPoints()
          Get the number of points
 java.lang.String getTitle()
          Get a function title
 double getX(int i)
          Get value in X-axis
 double getY(int i)
          Get value in Y-axis
 boolean parse()
          Parse the function.
 void setMax(double max)
          Set the maximum value in X
 void setMin(double min)
          Set Min value in X
 void setName(java.lang.String name)
          Sets a name of the function, i.e.
 void setPar(java.lang.String parameter, double value)
          Replace abstract parameter with the value (double).
 void setPar(java.lang.String parameter, int value)
          Replace abstract parameter with the value (integer).
 void setPoints(int bins)
          Sets the number points between Min and Max for evaluation
 void setTitle(java.lang.String title)
          Sets a new title of a function
 void toTable()
          Print the F1D function to a Table in a separate Frame.
 void toTable(boolean format)
          Print the F1D function to a Table in a separate Frame.
 
Methods inherited from class jhplot.DrawOptions
copyLinePars, getBinWidth, getDrawOption, getDrawOptions, getLegend, getLineParm, getNameX, getNameY, getNameZ, getType, printDrawOptions, printDrawOptions, setBinWidth, setColor, setDrawLine, setDrawLineKey, setDrawOption, setDrawSymbol, setErr, setErrAll, setErrColor, setErrColorX, setErrColorY, setErrFill, setErrFillColor, setErrFillColor, setErrSys, setErrSysFill, setErrSysFillColor, setErrSysFillColor, setErrSysX, setErrSysY, setErrTicSize, setErrX, setErrY, setFill, setFillColor, setFillColorTransparency, setGraphStyle, setLegend, setNameX, setNameY, setNameZ, setPenDash, setPenDash, setPenWidth, setPenWidthErr, setPenWidthErrSys, setStyle, setSymbol, setSymbolSize, setType
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

F1D

public F1D(java.lang.String name)
Create a function in 1D for evaluation. The function may have one independent variable: x

If the answer is wrong then use the parenthesis to force the order of evaluation. The most likely place this will be needed is in the use of the power command. The exponent is not evaluated correctly if it begins with a unary operator.

List of commands

Parameters:
name - String representing the function

F1D

public F1D(java.lang.String name,
           double min,
           double max)
Create a function in 1D. 500 points are used between Min and Max for evaluation. The function may have up to 3 independent variables in it (x,y,z).

Known Bugs This class is not fool proof. If the answer is wrong then use the parenthesis to force the order of evaluation. The most likely place this will be needed is in the use of the power command. The exponent is not evaluated correctly if it begins with a unary operator.

List of commands

Parameters:
name - String representing the function
min - Min value
max - Max value

F1D

public F1D(java.lang.String name,
           double min,
           double max,
           boolean parse)

F1D

public F1D(graph.ParseFunction function,
           double min,
           double max)
Create a function in 1D. 500 points are used between Min and Max for evaluation. The function may have up to 3 independent variables in it (x,y,z).

Known Bugs This class is not fool proof. If the answer is wrong then use the parenthesis to force the order of evaluation. The most likely place this will be needed is in the use of the power command. The exponent is not evaluated correctly if it begins with a unary operator.

List of commands

Parameters:
function - ParseFunction representing the function
min - Min value
max - Max value

F1D

public F1D(java.lang.String title,
           java.lang.String name,
           double min,
           double max)
Create a function in 1D. 500 points are used between Min and Max for evaluation

Parameters:
title - String representing the title
name - String representing the function
min - Min value
max - Max value

F1D

public F1D(hep.aida.IFunction iname,
           double min,
           double max)
Create a F1D function from JAIDA IFunction. By default, 500 points for evaluation are used

Parameters:
iname - input IFunction
min - Min value
max - Max value

F1D

public F1D(java.lang.String title,
           hep.aida.IFunction iname,
           double min,
           double max)
Create F1D function from JAIDA IFunction. By default 500 points are used

Parameters:
title - Title
iname - input IFunction
min - Min X values
max - Max X values
Method Detail

parse

public boolean parse()
Parse the function.

Parameters:
true - if parsed OK

eval

public double eval(double x)
Evaluate a function at a specific point in x

Parameters:
x - value in x for evaluation
Returns:
function value at x

eval

public double[] eval(double[] x)
Evaluate a function for an array of x-values

Parameters:
x - array of values in x for evaluation
Returns:
array of function values

eval

public void eval(double min,
                 double max)
Evaluate a function for graphic representation. Number of points for evaluations is 500.

Parameters:
Min - value in x
Max - value in x

eval

public void eval(double min,
                 double max,
                 int Npoints)
Evaluate a function for graphic representation. Number of points for evaluations is 500.

Parameters:
Min - value in x
Max - value in x
Number - of evaluation points

eval

public void eval()
Evaluate a function for graphic representation. Min and Max should be given in constructor.


toTable

public void toTable()
Print the F1D function to a Table in a separate Frame. The numbers are formatted to scientific format. One can sort and search the data in this table (data cannot be modified)


toTable

public void toTable(boolean format)
Print the F1D function to a Table in a separate Frame. The numbers are formatted to scientific format. One can sort and search the data in this table (but not modify)

Parameters:
format - if false, numbers will not be formatted to scientific format.

setPar

public void setPar(java.lang.String parameter,
                   double value)
Replace abstract parameter with the value (double). Case sensitive!

Parameters:
parameter - parameter name
value - value to be inserted

setPar

public void setPar(java.lang.String parameter,
                   int value)
Replace abstract parameter with the value (integer). Case sensitive.

Parameters:
parameter - parameter name
value - value to be inserted.

getX

public double getX(int i)
Get value in X-axis

Parameters:
i - index
Returns:
value in X

getY

public double getY(int i)
Get value in Y-axis

Parameters:
i - index
Returns:
value in Y

setTitle

public void setTitle(java.lang.String title)
Sets a new title of a function

Overrides:
setTitle in class DrawOptions
Parameters:
title - Title of a function

getTitle

public java.lang.String getTitle()
Get a function title

Overrides:
getTitle in class DrawOptions
Returns:
Title of a function

setName

public void setName(java.lang.String name)
Sets a name of the function, i.e. what will be used for evaluation

Parameters:
name - Name

getName

public java.lang.String getName()
Get the name of the function used for evaluation

Returns:
Name

getIFunction

public hep.aida.IFunction getIFunction()
Return AIDA function

Returns:
IFunction

getParse

public graph.ParseFunction getParse()
Return parsed function. One can evaluate Y as: y =function.getResult(x), where function is what returned by this method.

Returns:
function

setMin

public void setMin(double min)
Set Min value in X

Parameters:
min - Minimum value

getMin

public double getMin()
Get the minimum value in X

Returns:
min Minimum value

setMax

public void setMax(double max)
Set the maximum value in X

Parameters:
max - Maximal value

getMax

public double getMax()
Get the maximum value in X

Returns:
Maximal value

setPoints

public void setPoints(int bins)
Sets the number points between Min and Max for evaluation

Parameters:
bins - Number of points

getPoints

public int getPoints()
Get the number of points

Returns:
Number of points


jHepWork 1.7 (C) Chekanov