Exit flags

QOCO’s exit flags are defined in the include/enums.h file.

Status

Status Code

Value

Solver hasn’t been called

QOCO_UNSOLVED

0

Solved to desired accuracy

QOCO_SOLVED

1

Solved to low accuracy

QOCO_SOLVED_INACCURATE

2

Numerical error or infeasible

QOCO_NUMERICAL_ERROR

3

Iteration limit reached

QOCO_MAX_ITER

4

Status descriptions

QOCO_SOLVED

The problem was solved to the tolerances specified by abstol and reltol. The solution in results is reliable.

QOCO_SOLVED_INACCURATE

The solver could not reach the primary tolerances (abstol, reltol) but the solution satisfies the looser tolerances abstol_inacc and reltol_inacc. The returned solution is an approximation and may be usable depending on the application.

QOCO_NUMERICAL_ERROR

The solver encountered a numerical failure (e.g. a singular KKT system) the problem is primal or dual infeasible. Check that the problem data is well-scaled. If the problem is feasible, try increasing kkt_static_reg or kkt_dynamic_reg to improve numerical stability.

QOCO_MAX_ITER

The solver reached the iteration limit set by max_iters without converging. Try increasing max_iters, enabling Ruiz equilibration with ruiz_iters, or reformulating the problem to improve conditioning.

QOCO_UNSOLVED

solve() has not been called yet.

Setup error codes

qoco_setup() and qoco_update_settings() return one of the following integer error codes:

Error Code

Value

Meaning

QOCO_NO_ERROR

0

Setup completed successfully.

QOCO_DATA_VALIDATION_ERROR

1

Invalid problem data (e.g. wrong dimensions, null matrix).

QOCO_SETTINGS_VALIDATION_ERROR

2

Invalid settings (e.g. non-positive tolerance).

QOCO_SETUP_ERROR

3

Internal setup failure.

QOCO_AMD_ERROR

4

Failure during AMD fill-reducing ordering.

QOCO_MALLOC_ERROR

5

Memory allocation failure.