Clarabel.ConeDictConstant
ConeDict

A Dict that maps the user-facing SupportedCone types to the types used internally in the solver. See SupportedCone

Clarabel.DefaultSolutionType
DefaultSolution{T <: AbstractFloat}

Object returned by the Clarabel solver after calling optimize!(model).

Fieldname | Description –- | :–- | :–- x | Vector{T}| Primal variable z | Vector{T}| Dual variable s | Vector{T}| (Primal) set variable status | Symbol | Solution status objval | T | Objective value (primal) objvaldual | T | Objective value (dual) solvetime | T | Solver run time iterations | Int | Number of solver iterations rprim | primal residual at termination rdual | dual residual at termination

If the status field indicates that the problem is solved then (x,z,s) are the calculated solution, or a best guess if the solver has terminated early due to time or iterations limits.

If the status indicates either primal or dual infeasibility, then (x,z,s) provide instead an infeasibility certificate.

Clarabel.SettingsType
ArgumentDefault ValueDescription
Main Algorithm Settings
max_iter200maximum number of iterations
time_limitInfmaximum run time (seconds)
verbosetrueverbose printing
max_step_fraction0.99maximum interior point step length
Full Accuracy Settings
tol_gap_abs1e-8absolute duality gap tolerance
tol_gap_rel1e-8relative duality gap tolerance
tol_feas1e-8feasibility check tolerance (primal and dual)
tol_infeas_abs1e-8absolute infeasibility tolerance (primal and dual)
tol_infeas_rel1e-8relative infeasibility tolerance (primal and dual)
tol_ktratio1e-6κ/τ tolerance
Reduced Accuracy Settings
reduced_tol_gap_abs5e-5reduced absolute duality gap tolerance
reduced_tol_gap_rel5e-5reduced relative duality gap tolerance
reduced_tol_feas1e-4reduced feasibility check tolerance (primal and dual)
reduced_tol_infeas_abs5e-5reduced absolute infeasibility tolerance (primal and dual)
reduced_tol_infeas_rel5e-5reduced relative infeasibility tolerance (primal and dual)
reduced_tol_ktratio1e-4reduced κ/τ tolerance
Data Equilibration Settings
equilibrate_enabletrueenable data equilibration pre-scaling
equilibrate_max_iter10maximum equilibration scaling iterations
equilibrate_min_scaling1e-4minimum equilibration scaling allowed
equilibrate_max_scaling1e+4maximum equilibration scaling allowed
Step Size Settings
linesearch_backtrack_step0.8linesearch backtracking
min_switch_step_length1e-1minimum step size allowed for asymmetric cones with PrimalDual scaling
min_terminate_step_length1e-4minimum step size allowed for symmetric cones & asymmetric cones with Dual scaling
Linear Solver Settings
direct_kkt_solvertrueuse a direct linear solver method (required true)
direct_solve_method:qdldldirect linear solver (e.g. :qdldl, :mkl, :panua, :ma57, :cholmod, :faer)
static_regularization_enabletrueenable KKT static regularization
static_regularization_eps1e-8KKT static regularization parameter
static_regularization_proportionaleps(T)^2additional regularization parameter w.r.t. the maximum abs diagonal term
dynamic_regularization_enabletrueenable KKT dynamic regularization
dynamic_regularization_eps1e-13KKT dynamic regularization threshold
dynamic_regularization_delta2e-7KKT dynamic regularization shift
iterative_refinement_enabletrueKKT direct solve with iterative refinement
iterative_refinement_reltol1e-12iterative refinement relative tolerance
iterative_refinement_abstol1e-12iterative refinement absolute tolerance
iterative_refinement_max_iter10iterative refinement maximum iterations
iterative_refinement_stop_ratio5.0iterative refinement stalling tolerance
Preprocessing Settings
presolve_enabletrueenable presolve constraint reduction
Chordal Decomposition Settings
chordal_decomposition_enabletrueenable chordal decomposition
chordal_decomposition_merge_method:clique_graphchordal decomposition merge method (:clique_graph, :parent_child or :none)
chordal_decomposition_compacttrueassemble decomposed system in "compact" form
chordal_decomposition_complete_dualfalsecomplete PSD dual variables after decomposition
Clarabel.SolverType
Solver{T <: AbstractFloat}()

Initializes an empty Clarabel solver that can be filled with problem data using:

setup!(solver, P, q, A, b, cones, [settings]).
Clarabel.SolverStatusType
SolverStatus

An Enum of of possible conditions set by solve!.

If no call has been made to solve!, then the SolverStatus is:

  • UNSOLVED: The algorithm has not started.

Otherwise:

  • SOLVED : Solver terminated with a solution.
  • PRIMAL_INFEASIBLE : Problem is primal infeasible. Solution returned is a certificate of primal infeasibility.
  • DUAL_INFEASIBLE : Problem is dual infeasible. Solution returned is a certificate of dual infeasibility.
  • ALMOST_SOLVED : Solver terminated with a solution (reduced accuracy).
  • ALMOST_PRIMAL_INFEASIBLE : Problem is primal infeasible. Solution returned is a certificate of primal infeasibility (reduced accuracy).
  • ALMOST_DUAL_INFEASIBLE : Problem is dual infeasible. Solution returned is a certificate of dual infeasibility (reduced accuracy).
  • MAX_ITERATIONS : Iteration limit reached before solution or infeasibility certificate found.
  • MAX_TIME : Time limit reached before solution or infeasibility certificate found.
  • NUMERICAL_ERROR : Solver terminated with a numerical error.
  • INSUFFICIENT_PROGRESS : Solver terminated due to lack of progress.
Clarabel.SupportedConeType
SupportedCone

An abstract type use by the Clarabel API used when passing cone specifications to the solver setup!. The currently supported concrete types are:

  • ZeroConeT : The zero cone. Used to define equalities.
  • NonnegativeConeT: The nonnegative orthant.
  • SecondOrderConeT: The second order / Lorentz / ice-cream cone.
  • ExponentialConeT: The exponential cone (in R^3)
  • PowerConeT : The power cone with power α (in R^3)
  • GenPowerConeT : The generalized power cone
  • PSDTriangleConeT: The positive semidefinite cone (triangular format).
Clarabel.setup!Method
setup!(solver, P, q, A, b, cones, [settings])

Populates a Solver with a cost function defined by P and q, and one or more conic constraints defined by A, b and a description of a conic constraint composed of cones whose types and dimensions are specified by cones.

The solver will be configured to solve the following optimization problem:

min   1/2 x'Px + q'x
s.t.  Ax + s = b, s ∈ K

All data matrices must be sparse. The matrix P is assumed to be symmetric and positive semidefinite, and only the upper triangular part is used.

The cone K is a composite cone. To define the cone the user should provide a vector of cone specifications along with the appropriate dimensional information. For example, to generate a cone in the nonnegative orthant followed by a second order cone, use:

cones = [Clarabel.NonnegativeConeT(dim_1),
         Clarabel.SecondOrderConeT(dim_2)]

If the argument 'cones' is constructed incrementally, the should should initialize it as an empty array of the supertype for all allowable cones, e.g.

cones = Clarabel.SupportedCone[]
push!(cones,Clarabel.NonnegativeConeT(dim_1))
...

The optional argument settings can be used to pass custom solver settings:

settings = Clarabel.Settings(verbose = true)
setup!(model, P, q, A, b, cones, settings)

To solve the problem, you must make a subsequent call to solve!

Clarabel.solve!Method
solve!(solver)

Computes the solution to the problem in a Clarabel.Solver previously defined in setup!.

Clarabel.write_to_fileMethod
write_to_file(solver, filename)

Write the problem data in a Clarabel.Solver to filename in JSON format. The data is written in a format that can be read back into a Clarabel.Solver using read_from_file. The problem data will be written in unscaled form, but in the internal format used by the solver after applying chordal decomposition and presolve. It is not necessary to solve the problem before writing it to a file.