public class QuadraticFunction extends TwiceDifferentiableFunction
Constructor and Description |
---|
QuadraticFunction(double[][] A,
double[] b,
double c)
Construct quadratic function 0.5*(x^T)A(x) + b.x + c
|
QuadraticFunction(org.hipparchus.linear.RealMatrix A,
org.hipparchus.linear.RealVector b,
double c)
Construct quadratic function 0.5*(x^T)A(x) + b.x + c
|
Modifier and Type | Method and Description |
---|---|
int |
dim()
Returns the dimensionality of the function domain.
|
org.hipparchus.linear.RealVector |
getC() |
double |
getD() |
org.hipparchus.linear.RealMatrix |
getH() |
org.hipparchus.linear.RealVector |
gradient(org.hipparchus.linear.RealVector x)
Returns the gradient of this function at (x)
|
org.hipparchus.linear.RealMatrix |
hessian(org.hipparchus.linear.RealVector x)
The Hessian of this function at (x)
|
double |
value(org.hipparchus.linear.RealVector x)
Returns the value of this function at (x)
|
gradient, hessian, value
public QuadraticFunction(org.hipparchus.linear.RealMatrix A, org.hipparchus.linear.RealVector b, double c)
A
- square matrix of weights for quadratic terms.
Typically expected to be positive definite or positive semi-definite.b
- vector of weights for linear terms.c
- a constantpublic QuadraticFunction(double[][] A, double[] b, double c)
A
- square matrix of weights for quadratic terms.
Typically expected to be positive definite or positive semi-definite.b
- vector of weights for linear terms.c
- a constantpublic org.hipparchus.linear.RealMatrix getH()
public org.hipparchus.linear.RealVector getC()
public double getD()
public int dim()
TwiceDifferentiableFunction
dim
in class TwiceDifferentiableFunction
public double value(org.hipparchus.linear.RealVector x)
TwiceDifferentiableFunction
value
in class TwiceDifferentiableFunction
x
- a point to evaluate this function at.public org.hipparchus.linear.RealVector gradient(org.hipparchus.linear.RealVector x)
TwiceDifferentiableFunction
gradient
in class TwiceDifferentiableFunction
x
- a point to evaluate this gradient atpublic org.hipparchus.linear.RealMatrix hessian(org.hipparchus.linear.RealVector x)
TwiceDifferentiableFunction
hessian
in class TwiceDifferentiableFunction
x
- a point to evaluate this Hessian at