SMILE  v2.5
Schwarzschild Modelling Interactive expLoratory Environment
Public Member Functions | List of all members
smile::CBasicQuadraticOptimizationSolver< NumT > Class Template Referenceabstract

The interface class for various third-party quadratic optimization solvers. More...

#include <common.h>

Inheritance diagram for smile::CBasicQuadraticOptimizationSolver< NumT >:
Inheritance graph
[legend]

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
 

Detailed Description

template<typename NumT>
class smile::CBasicQuadraticOptimizationSolver< NumT >

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

Template Parameters
NumTis a numerical type (double or float)

Member Function Documentation

template<typename NumT>
virtual int smile::CBasicQuadraticOptimizationSolver< NumT >::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
pure virtual
Returns
0 for success, otherwise an error code
Parameters
linearMatrixmatrix M of linear equations for the optimization problem "M w = rhs". Passed as an interface to an abstract class, must not be NULL
rhsconstraints to be satisfied
maxSolValueupper limits for sol[v] (zero means no limit)
objFuncLinearvector L in the objective function, which is multiplied by the solution vector
objFuncQuadraticmatrix Q in the objective function, may be NULL
solreturns solution in this vector

Implemented in smile::COptimizationSolverCVXOPT< NumT >, smile::COptimizationSolverGLPK< NumT >, and smile::COptimizationSolverBPMPD< NumT >.


The documentation for this class was generated from the following file: