java.lang.Object
dev.nm.analysis.function.rn2r1.AbstractRealScalarFunction
All Implemented Interfaces:
Function<Vector,Double>, RealScalarFunction
Direct Known Subclasses:
QPProblemOnlyEqualityConstraints

A quadratic function takes this form: $$f(x) = \frac{1}{2} \times x'Hx + x'p + c$$.
• "Andreas Antoniou, Wu-Sheng Lu, "Section 13.2, Convex QP Problems with Equality Constraints," Practical Optimization: Algorithms and Engineering Applications."

Nested classes/interfaces inherited from interface dev.nm.analysis.function.Function

Function.EvaluationException
• Constructor Summary

Constructors
Constructor
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.
• Method Summary

Modifier and Type
Method
Description
Double
evaluate(Vector z)
Evaluate the function f at x, where x is from the domain.
ImmutableMatrix
Hessian()

ImmutableVector
p()

String
toString()

Methods inherited from class dev.nm.analysis.function.rn2r1.AbstractRealScalarFunction

dimensionOfDomain, dimensionOfRange

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
• Constructor Details

public 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$$.
Parameters:
H - a symmetric, positive semi-definite matrix
p - a vector
c - a constant

Construct a quadratic function of this form: $$f(x) = \frac{1}{2} \times x'Hx + x'p$$.
Parameters:
H - a symmetric, positive semi-definite matrix
p - a vector

Copy constructor.
Parameters:
f - a quadratic function
• Method Details

• Hessian

public ImmutableMatrix Hessian()
• p

public ImmutableVector p()
• evaluate

public Double evaluate(Vector z)
Description copied from interface: Function
Evaluate the function f at x, where x is from the domain.
Parameters:
z - x
Returns:
f(x)
• toString

public String toString()
Overrides:
toString in class Object