public class QuadraticFunction extends java.lang.Object implements RealScalarFunction
Function.EvaluationException| Constructor and Description |
|---|
QuadraticFunction(Matrix H,
Vector p)
Construct a quadratic function of this form: \(f(x) = \frac{1}{2} \times x'Hx + x'p\).
|
QuadraticFunction(Matrix H,
Vector p,
double c)
Construct a quadratic function of this form: \(f(x) = \frac{1}{2} \times x'Hx + x'p + c\).
|
QuadraticFunction(QuadraticFunction f)
Copy constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
dimensionOfDomain()
Get the number of variables the function has.
|
int |
dimensionOfRange()
Get the dimension of the range space of the function.
|
java.lang.Double |
evaluate(Vector z)
Evaluate the function f at x, where x is from the domain.
|
ImmutableMatrix |
Hessian() |
ImmutableVector |
p() |
java.lang.String |
toString() |
public QuadraticFunction(Matrix H, Vector p, double c)
H - a symmetric, positive semi-definite matrixp - a vectorc - a constantpublic QuadraticFunction(Matrix H, Vector p)
H - a symmetric, positive semi-definite matrixp - a vectorpublic QuadraticFunction(QuadraticFunction f)
f - a quadratic functionpublic ImmutableMatrix Hessian()
public ImmutableVector p()
public java.lang.Double evaluate(Vector z)
Functionpublic int dimensionOfDomain()
FunctiondimensionOfDomain in interface Function<Vector,java.lang.Double>public int dimensionOfRange()
FunctiondimensionOfRange in interface Function<Vector,java.lang.Double>public java.lang.String toString()
toString in class java.lang.Object