joptima.functions
Class Sum2D
- java.lang.Object
-
- joptima.functions.Sum2D
-
- All Implemented Interfaces:
- Function, Function2D
public class Sum2D extends java.lang.Object implements Function2D
A two-dimensional sum of two one-dimensionalFunctions. In other words, z = xfunction(x) + yfunction(y). Either xfunction or yfunction may be null.
-
-
Constructor Summary
Constructors Constructor and Description Sum2D(Function xfunction, Function yfunction)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublecalculate(double x)Calculates the value of the function at the given point using the preset parameters.doublecalculate(double x, double y)Calculates the value of the function at the given x-y point using the preset parameters.java.lang.StringgetName()Gets the (user-settable) name of this function.Parameter[]getParameters()Lists all the mutable parameters to this function.voidsetName(java.lang.String newname)Overrides the default function name.
-
-
-
Method Detail
-
calculate
public double calculate(double x, double y)Calculates the value of the function at the given x-y point using the preset parameters. The returned value is the sum of xfunction(x) and yfunction(y).- Specified by:
calculatein interfaceFunction2D- Parameters:
x- the x coordinate to calculate the function aty- the y coordinate to calculate the function at- Returns:
- the value of the function at the given x-y point
-
getParameters
public Parameter[] getParameters()
Description copied from interface:FunctionLists all the mutable parameters to this function.- Specified by:
getParametersin interfaceFunction- Returns:
- a
Parameter[] of delegates that access the proper member variables.
-
calculate
public double calculate(double x)
Description copied from interface:FunctionCalculates the value of the function at the given point using the preset parameters.
-
getName
public java.lang.String getName()
Description copied from interface:FunctionGets the (user-settable) name of this function.
-
-
DMelt 3.0 © DataMelt by jWork.ORG