Optex.Solver.COPT (Optex v0.1.0)

Copy Markdown View Source

COPT (Cardinal Optimizer) backend. Implements the same Optex.Solver contract as the other backends and accepts the same neutral options; use it with Optex.optimize(m, solver: Optex.Solver.COPT).

Requires an installed, licensed COPT: the native crate is compile-gated on COPT_HOME (check available?/0). All constants, attribute names, and parameter names were verified against COPT 8.0.5's copt.h (and are byte-identical to 7.2.11's, where they were first verified).

Supported options: :time_limit, :mip_gap, :threads, :log (false | true | pid receiving {:optex_copt_log, line}), :cancel (token from cancel_token/0). qcp_duals: true is rejected as unsupported: COPT's C API exposes quadratic constraint slacks but no dual multipliers (COPT_GetQConstrInfo rejects the "Dual" info name), so QCP duals remain Gurobi-only.

Capabilities: indicator constraints, convex quadratic objectives (including MIQP), and convex quadratic constraints (<=/>= only, like CPLEX). No abs/pwl/min-max general constraints: COPT has no native equivalents, and constructs are never reformulated.

Summary

Functions

Whether the native COPT binding was compiled (COPT_HOME at build).

Ask the solve holding this token to terminate.

Create a cancellation token to pass as the :cancel solve option.

Functions

available?()

Whether the native COPT binding was compiled (COPT_HOME at build).

cancel(token)

Ask the solve holding this token to terminate.

cancel_token()

Create a cancellation token to pass as the :cancel solve option.