qpOASES  3.2.1
An Implementation of the Online Active Set Strategy
Functions
OQPinterface.cpp File Reference
#include <qpOASES/extras/OQPinterface.hpp>
#include <qpOASES/QProblem.hpp>

Functions

BEGIN_NAMESPACE_QPOASES returnValue readOqpDimensions (const char *path, int_t &nQP, int_t &nV, int_t &nC, int_t &nEC)
 
returnValue readOqpData (const char *path, int_t &nQP, int_t &nV, int_t &nC, int_t &nEC, real_t **H, real_t **g, real_t **A, real_t **lb, real_t **ub, real_t **lbA, real_t **ubA, real_t **xOpt, real_t **yOpt, real_t **objOpt)
 
returnValue solveOqpBenchmark (int_t nQP, int_t nV, int_t nC, int_t nEC, const real_t *const _H, const real_t *const g, const real_t *const _A, const real_t *const lb, const real_t *const ub, const real_t *const lbA, const real_t *const ubA, BooleanType isSparse, const Options &options, int_t &nWSR, real_t &maxCPUtime, real_t &maxStationarity, real_t &maxFeasibility, real_t &maxComplementarity)
 
returnValue solveOqpBenchmark (int_t nQP, int_t nV, int_t nC, int_t nEC, const real_t *const _H, const real_t *const g, const real_t *const _A, const real_t *const lb, const real_t *const ub, const real_t *const lbA, const real_t *const ubA, BooleanType isSparse, BooleanType useHotstarts, const Options &options, int_t maxAllowedNWSR, real_t &maxNWSR, real_t &avgNWSR, real_t &maxCPUtime, real_t &avgCPUtime, real_t &maxStationarity, real_t &maxFeasibility, real_t &maxComplementarity)
 
returnValue solveOqpBenchmark (int_t nQP, int_t nV, const real_t *const _H, const real_t *const g, const real_t *const lb, const real_t *const ub, BooleanType isSparse, const Options &options, int_t &nWSR, real_t &maxCPUtime, real_t &maxStationarity, real_t &maxFeasibility, real_t &maxComplementarity)
 
returnValue solveOqpBenchmark (int_t nQP, int_t nV, const real_t *const _H, const real_t *const g, const real_t *const lb, const real_t *const ub, BooleanType isSparse, BooleanType useHotstarts, const Options &options, int_t maxAllowedNWSR, real_t &maxNWSR, real_t &avgNWSR, real_t &maxCPUtime, real_t &avgCPUtime, real_t &maxStationarity, real_t &maxFeasibility, real_t &maxComplementarity)
 
returnValue runOqpBenchmark (const char *path, BooleanType isSparse, const Options &options, int_t &nWSR, real_t &maxCPUtime, real_t &maxStationarity, real_t &maxFeasibility, real_t &maxComplementarity)
 
returnValue runOqpBenchmark (const char *path, BooleanType isSparse, BooleanType useHotstarts, const Options &options, int_t maxAllowedNWSR, real_t &maxNWSR, real_t &avgNWSR, real_t &maxCPUtime, real_t &avgCPUtime, real_t &maxStationarity, real_t &maxFeasibility, real_t &maxComplementarity)
 

Detailed Description

Author
Hans Joachim Ferreau
Version
3.2
Date
2008-2017

Implementation of an interface comprising several utility functions for solving test problems from the Online QP Benchmark Collection (This collection is no longer maintained, see http://www.qpOASES.org/onlineQP for a backup).

Function Documentation

◆ readOqpData()

returnValue readOqpData ( const char *  path,
int_t nQP,
int_t nV,
int_t nC,
int_t nEC,
real_t **  H,
real_t **  g,
real_t **  A,
real_t **  lb,
real_t **  ub,
real_t **  lbA,
real_t **  ubA,
real_t **  xOpt,
real_t **  yOpt,
real_t **  objOpt 
)

Reads data of an Online QP Benchmark problem from file. This function allocates the required memory for all data; after successfully calling it, you have to free this memory yourself!

Returns
SUCCESSFUL_RETURN
RET_INVALID_ARGUMENTS
RET_UNABLE_TO_READ_FILE
RET_FILEDATA_INCONSISTENT

References MAX_STRING_LENGTH, readFromFile(), readOqpDimensions(), real_t, RET_FILEDATA_INCONSISTENT, RET_INVALID_ARGUMENTS, RET_UNABLE_TO_READ_FILE, SUCCESSFUL_RETURN, and THROWERROR.

Referenced by runOqpBenchmark().

◆ readOqpDimensions()

BEGIN_NAMESPACE_QPOASES returnValue readOqpDimensions ( const char *  path,
int_t nQP,
int_t nV,
int_t nC,
int_t nEC 
)

Reads dimensions of an Online QP Benchmark problem from file.

Returns
SUCCESSFUL_RETURN
RET_UNABLE_TO_READ_FILE
RET_FILEDATA_INCONSISTENT

References MAX_STRING_LENGTH, readFromFile(), RET_FILEDATA_INCONSISTENT, RET_UNABLE_TO_READ_FILE, SUCCESSFUL_RETURN, and THROWERROR.

Referenced by readOqpData(), and runOqpBenchmark().

◆ runOqpBenchmark() [1/2]

returnValue runOqpBenchmark ( const char *  path,
BooleanType  isSparse,
BooleanType  useHotstarts,
const Options options,
int_t  maxAllowedNWSR,
real_t maxNWSR,
real_t avgNWSR,
real_t maxCPUtime,
real_t avgCPUtime,
real_t maxStationarity,
real_t maxFeasibility,
real_t maxComplementarity 
)

Runs an Online QP Benchmark problem and determines the maximum violation of the KKT optimality conditions as well as the maximum and average number of iterations and CPU time to solve each QP.

Returns
SUCCESSFUL_RETURN
RET_UNABLE_TO_READ_BENCHMARK
RET_BENCHMARK_ABORTED

References readOqpData(), readOqpDimensions(), real_t, RET_UNABLE_TO_READ_BENCHMARK, solveOqpBenchmark(), SUCCESSFUL_RETURN, and THROWERROR.

◆ runOqpBenchmark() [2/2]

returnValue runOqpBenchmark ( const char *  path,
BooleanType  isSparse,
const Options options,
int_t nWSR,
real_t maxCPUtime,
real_t maxStationarity,
real_t maxFeasibility,
real_t maxComplementarity 
)

Runs an Online QP Benchmark problem and determines the maximum violation of the KKT optimality conditions as well as the maximum CPU time to solve each QP.

Returns
SUCCESSFUL_RETURN
RET_UNABLE_TO_READ_BENCHMARK
RET_BENCHMARK_ABORTED

References BT_TRUE, real_t, and runOqpBenchmark().

Referenced by main(), and runOqpBenchmark().

◆ solveOqpBenchmark() [1/4]

returnValue solveOqpBenchmark ( int_t  nQP,
int_t  nV,
const real_t *const  _H,
const real_t *const  g,
const real_t *const  lb,
const real_t *const  ub,
BooleanType  isSparse,
BooleanType  useHotstarts,
const Options options,
int_t  maxAllowedNWSR,
real_t maxNWSR,
real_t avgNWSR,
real_t maxCPUtime,
real_t avgCPUtime,
real_t maxStationarity,
real_t maxFeasibility,
real_t maxComplementarity 
)

Solves an Online QP Benchmark problem (without constraints) as specified by the arguments. The maximum deviations from the given optimal solution as well as the maximum CPU time to solve each QP are determined.

Returns
SUCCESSFUL_RETURN
RET_BENCHMARK_ABORTED

References BT_FALSE, BT_TRUE, SparseMatrix::createDiagInfo(), Matrix::doFreeMemory(), QProblemB::getDualSolution(), getKktViolation(), QProblemB::getPrimalSolution(), QProblemB::hotstart(), QProblemB::init(), real_t, RET_MAX_NWSR_REACHED, QProblemB::setOptions(), SUCCESSFUL_RETURN, and THROWERROR.

◆ solveOqpBenchmark() [2/4]

returnValue solveOqpBenchmark ( int_t  nQP,
int_t  nV,
const real_t *const  _H,
const real_t *const  g,
const real_t *const  lb,
const real_t *const  ub,
BooleanType  isSparse,
const Options options,
int_t nWSR,
real_t maxCPUtime,
real_t maxStationarity,
real_t maxFeasibility,
real_t maxComplementarity 
)

Solves an Online QP Benchmark problem (without constraints) as specified by the arguments. The maximum deviations from the given optimal solution as well as the maximum CPU time to solve each QP are determined.

Note: This variant is outdated and only kept to ensure backwards-compatibility!

Returns
SUCCESSFUL_RETURN
RET_BENCHMARK_ABORTED

References BT_TRUE, real_t, and solveOqpBenchmark().

◆ solveOqpBenchmark() [3/4]

returnValue solveOqpBenchmark ( int_t  nQP,
int_t  nV,
int_t  nC,
int_t  nEC,
const real_t *const  _H,
const real_t *const  g,
const real_t *const  _A,
const real_t *const  lb,
const real_t *const  ub,
const real_t *const  lbA,
const real_t *const  ubA,
BooleanType  isSparse,
BooleanType  useHotstarts,
const Options options,
int_t  maxAllowedNWSR,
real_t maxNWSR,
real_t avgNWSR,
real_t maxCPUtime,
real_t avgCPUtime,
real_t maxStationarity,
real_t maxFeasibility,
real_t maxComplementarity 
)

Solves an Online QP Benchmark problem as specified by the arguments. The maximum deviations from the given optimal solution as well as the maximum CPU time to solve each QP are determined.

Returns
SUCCESSFUL_RETURN
RET_BENCHMARK_ABORTED

References BT_FALSE, BT_TRUE, SparseMatrix::createDiagInfo(), Matrix::doFreeMemory(), QProblem::getDualSolution(), getKktViolation(), QProblemB::getPrimalSolution(), QProblem::hotstart(), QProblem::init(), real_t, RET_MAX_NWSR_REACHED, QProblemB::setOptions(), SUCCESSFUL_RETURN, and THROWERROR.

◆ solveOqpBenchmark() [4/4]

returnValue solveOqpBenchmark ( int_t  nQP,
int_t  nV,
int_t  nC,
int_t  nEC,
const real_t *const  _H,
const real_t *const  g,
const real_t *const  _A,
const real_t *const  lb,
const real_t *const  ub,
const real_t *const  lbA,
const real_t *const  ubA,
BooleanType  isSparse,
const Options options,
int_t nWSR,
real_t maxCPUtime,
real_t maxStationarity,
real_t maxFeasibility,
real_t maxComplementarity 
)

Solves an Online QP Benchmark problem as specified by the arguments. The maximum deviations from the given optimal solution as well as the maximum CPU time to solve each QP are determined.

Note: This variant is outdated and only kept to ensure backwards-compatibility!

Returns
SUCCESSFUL_RETURN
RET_BENCHMARK_ABORTED

References BT_TRUE, real_t, and solveOqpBenchmark().

Referenced by runOqpBenchmark(), and solveOqpBenchmark().