|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.jstacs.algorithms.optimization.OneDimensionalFunction
de.jstacs.algorithms.optimization.QuadraticFunction
public class QuadraticFunction
This class implements a quadratic function.
| Constructor Summary | |
|---|---|
QuadraticFunction(double a,
double b,
double c)
This constructor creates a quadratic function with: a*x2 + b*x + c. |
|
QuadraticFunction(double x1,
double fx1,
double x2,
double fx2,
double x3,
double fx3)
This constructor creates an instance from 3 points (x,f(x)). |
|
| Method Summary | |
|---|---|
double |
evaluateFunction(double x)
Evaluates the function at position x. |
double |
findMax()
This method returns the maximum of the QuadraticFunction. |
double |
findMin()
This method returns the minimum of the QuadraticFunction. |
double |
getExtremum()
This method returns the extremum of the QuadraticFunction. |
String |
toString()
|
| Methods inherited from class de.jstacs.algorithms.optimization.OneDimensionalFunction |
|---|
evaluateFunction, findMin, getDimensionOfScope |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public QuadraticFunction(double a,
double b,
double c)
a*x2 + b*x + c.
a - the coefficient for x2b - the coefficient for xc - the constant
public QuadraticFunction(double x1,
double fx1,
double x2,
double fx2,
double x3,
double fx3)
throws IOException
(x,f(x)).
x1 - the first x-coordinatefx1 - f(x1)x2 - the second x-coordinatefx2 - f(x2)x3 - the third x-coordinatefx3 - f(x3)
IOException - if the quadratic function could not be determined| Method Detail |
|---|
public double evaluateFunction(double x)
OneDimensionalFunctionx.
evaluateFunction in class OneDimensionalFunctionx - the current position
f(x)
public double findMax()
throws IOException
QuadraticFunction.
IOException - if no maximum exists
public double findMin()
throws IOException
QuadraticFunction.
IOException - if no minimum exists
public double getExtremum()
throws IOException
QuadraticFunction.
IOException - if no extremum existspublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||