|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
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 x2
b
- the coefficient for x
c
- the constantpublic 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 determinedMethod Detail |
---|
public double evaluateFunction(double x)
OneDimensionalFunction
x
.
evaluateFunction
in class OneDimensionalFunction
x
- the current position
f(x)
public double findMax() throws IOException
QuadraticFunction
.
IOException
- if no maximum existspublic double findMin() throws IOException
QuadraticFunction
.
IOException
- if no minimum existspublic double getExtremum() throws IOException
QuadraticFunction
.
IOException
- if no extremum existspublic String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |