using Clarabel, SparseArrays

P = spzeros(6,6)

q = [0., 0., -1., 0., 0., -1.]

A = sparse([
       -1.  0.  0.  0.  0.  0.;
        0. -1.  0.  0.  0.  0.;
        0.  0. -1.  0.  0.  0.;
        0.  0.  0. -1.  0.  0.;
        0.  0.  0.  0. -1.  0.;
        0.  0.  0.  0.  0. -1.;
        1.  2.  0.  3.  0.  0.;
        0.  0.  0.  0.  1.  0.])

b = [0., 0., 0., 0., 0., 0., 3., 1.]

cones  = [Clarabel.PowerConeT(0.6), Clarabel.PowerConeT(0.1), Clarabel.ZeroConeT(2)]

solver = Clarabel.Solver()

settings = Clarabel.Settings()

Clarabel.setup!(solver, P, q, A, b, cones, settings)

result = Clarabel.solve!(solver)
-------------------------------------------------------------
           Clarabel.jl v0.8.1  -  Clever Acronym
                   (c) Paul Goulart
                University of Oxford, 2022
-------------------------------------------------------------

problem:
  variables     = 6
  constraints   = 8
  nnz(P)        = 0
  nnz(A)        = 10
  cones (total) = 3
    : Zero        = 1,  numel = 2
    : Power       = 2,  numel = (3,3)

settings:
  linear algebra: direct / qdldl, precision: Float64
  max iter = 200, time limit = Inf,  max step = 0.990
  tol_feas = 1.0e-08, tol_gap_abs = 1.0e-08, tol_gap_rel = 1.0e-08,
  static reg : on, ϵ1 = 1.0e-08, ϵ2 = 4.9e-32
  dynamic reg: on, ϵ = 1.0e-13, δ = 2.0e-07
  iter refine: on, reltol = 1.0e-13, abstol = 1.0e-12,
               max iter = 10, stop ratio = 5.0
  equilibrate: on, min_scale = 1.0e-04, max_scale = 1.0e+04
               max iter = 10

iter    pcost        dcost       gap       pres      dres      k/t        μ       step
---------------------------------------------------------------------------------------------
  0   0.0000e+00  -0.0000e+00  0.00e+00  7.43e-01  1.02e+00  1.00e+00  1.00e+00   ------
  1  -7.2016e-01  -7.0464e-01  1.55e-02  1.57e-01  2.11e-01  2.71e-01  2.63e-01  7.92e-01
  2  -1.8008e+00  -1.7671e+00  1.90e-02  2.13e-02  2.58e-02  7.82e-02  3.52e-02  9.80e-01
  3  -1.8433e+00  -1.8426e+00  3.44e-04  5.91e-04  7.02e-04  1.87e-03  9.76e-04  9.80e-01
  4  -1.8448e+00  -1.8447e+00  7.21e-05  1.27e-04  1.51e-04  3.98e-04  2.09e-04  7.92e-01
  5  -1.8452e+00  -1.8452e+00  1.52e-05  2.72e-05  3.23e-05  8.48e-05  4.49e-05  7.92e-01
  6  -1.8453e+00  -1.8453e+00  3.21e-06  5.83e-06  6.92e-06  1.81e-05  9.62e-06  7.92e-01
  7  -1.8453e+00  -1.8453e+00  6.77e-07  1.25e-06  1.48e-06  3.86e-06  2.06e-06  7.92e-01
  8  -1.8454e+00  -1.8454e+00  1.43e-07  2.68e-07  3.18e-07  8.23e-07  4.42e-07  7.92e-01
  9  -1.8454e+00  -1.8454e+00  3.03e-08  5.74e-08  6.81e-08  1.76e-07  9.47e-08  7.92e-01
 10  -1.8454e+00  -1.8454e+00  6.41e-09  1.23e-08  1.46e-08  3.75e-08  2.03e-08  7.92e-01
 11  -1.8454e+00  -1.8454e+00  1.36e-09  2.64e-09  3.13e-09  8.00e-09  4.35e-09  7.92e-01
---------------------------------------------------------------------------------------------
Terminated with status = solved
solve time =  904μs
>>> Clarabel - Results
Status: SOLVED
Iterations: 11
Objective: -1.845
Solve time:  904μs
result.x
6-element Vector{Float64}:
 1.6818451504042895
 0.5606011366352672
 1.0837601867673565
 0.06565085327599281
 0.9999999945009342
 0.7615949121634987

This page was generated using Literate.jl.