|
||||||||||
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 |
double |
findMin()
This method returns the minimum |
double |
getExtremum()
This method returns the extremum |
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
- the coefficient for x2b
- the coefficient for xc
- the constantpublic QuadraticFunction(double x1, double fx1, double x2, double fx2, double x3, double fx3) throws IOException
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 determinedMethod Detail |
---|
public double evaluateFunction(double x)
OneDimensionalFunction
evaluateFunction
in class OneDimensionalFunction
x
- the current position
public double findMax() throws IOException
IOException
- if no maximum existspublic double findMin() throws IOException
IOException
- if no minimum existspublic double getExtremum() throws IOException
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 |