SMILE
v2.5
Schwarzschild Modelling Interactive expLoratory Environment
|
The interface class for various third-party quadratic optimization solvers. More...
#include <common.h>
Public Member Functions | |
virtual int | callSolver (const CMatrix< NumT > *linearMatrix, const std::vector< NumT > &rhs, const std::vector< NumT > &maxSolValue, const std::vector< NumT > &objFuncLinear, const CMatrix< NumT > *objFuncQuadratic, std::vector< NumT > *sol) const =0 |
virtual std::string | errorDescription (int result) const =0 |
reports text information for a given error code | |
The interface class for various third-party quadratic optimization solvers.
solves the linear or quadratic optimization problem defined as the linear system M sol = rhs, where M is N_v * N_c matrix, sol is N_v vector of variables to be found, rhs is N_c vector of constraints to be satisfied; the solution vector has to be non-negative and <= maxSolValue if the latter is provided.
Of all possible solutions, the one is chosen that minimizes the objective (cost) function CF = 1/2 sol^T Q sol + L^T sol, where Q is N_v*N_v matrix (most likely a sparse one), and L is N_v vector.
If Q=NULL then the problem is solved by the linear programming method, otherwise the quadratic programming is employed.
Return value is 0 for success, <0 for error code; standard error codes are: -1 model is infeasible -2 not enough memory
NumT | is a numerical type (double or float) |
|
pure virtual |
linearMatrix | matrix M of linear equations for the optimization problem "M w = rhs". Passed as an interface to an abstract class, must not be NULL |
rhs | constraints to be satisfied |
maxSolValue | upper limits for sol[v] (zero means no limit) |
objFuncLinear | vector L in the objective function, which is multiplied by the solution vector |
objFuncQuadratic | matrix Q in the objective function, may be NULL |
sol | returns solution in this vector |
Implemented in smile::COptimizationSolverCVXOPT< NumT >, smile::COptimizationSolverGLPK< NumT >, and smile::COptimizationSolverBPMPD< NumT >.