API Reference

Solver

The main entry point for solving conic optimization problems.

ConicIP.conicIPFunction

conicIP(Q, c, A, b, conedims, G, d; solve3x3gen = solve3x3gensparse, optTol = 1e-5, DTB = 0.01, verbose = true, maxRefinementSteps = 3, maxIters = 100, cache_nestodd = false, refinementThreshold = optTol/1e7)

Interior point solver for the system

minimize    ½yᵀQy - cᵀy
s.t         Ay >= b
            Gy  = d

c, b, d are vectors (or any AbstractVector)

cone_dims is an array of tuples (Cone Type, Dimension)

e.g. [("R",2),("Q",4)] means
(y₁, y₂)          in  R+
(y₃, y₄, y₅, y₆)  in  Q

SDP Cones are NOT supported and purely experimental at this point.

The parameter solve3x3gen allows the passing of a custom solver for the KKT System, as follows

julia> L = solve3x3gen(F,F⁻ᵀ,Q,A,G)

Then this

julia> (a,b,c) = L(y,w,v)

solves the system
┌             ┐ ┌   ┐   ┌   ┐
│ Q   G'  -A' │ │ a │ = │ y │
│ G           │ │ b │   │ w │
│ A       FᵀF │ │ c │   │ v │
└             ┘ └   ┘   └   ┘

We can also wrap a 2x2 solver using pivot3gen(solve2x2gen) The 2x2 solves the system

julia> L = solve2x2gen(F,F⁻ᵀ,Q,A,G)

Then this

julia> (a,b) = L(y,w)

solves the system

┌                     ┐ ┌   ┐   ┌   ┐
│ Q + Aᵀinv(FᵀF)A  G' │ │ a │ = │ y │
│ G                   │ │ b │   │ w │
└                     ┘ └   ┘   └   ┘
source
ConicIP.preprocess_conicIPFunction

ConicIP with preprocessing to ensure the following rank constraints

Primal equailty constraints : Gx = d Rank condition : rank(G) = size(G,1)

Dual equality constraints : [ Q A' G'] = c Rank condition : rank([Q A' G']) = size(Q,1)

source

Solution

The solver returns a Solution struct containing primal/dual variables, status, and convergence information.

ConicIP.SolutionType
Solution

Return type of conicIP and preprocess_conicIP.

Fields

  • y::Vector{Float64} – primal variables
  • w::Vector{Float64} – dual variables for equality constraints (Gy = d)
  • v::Vector{Float64} – dual variables for inequality constraints (Ay ≥_K b)
  • status::Symbol:Optimal, :Infeasible, :Unbounded, :Abandoned, or :Error
  • Iter::Integer – number of interior-point iterations
  • Mu::Real – final complementarity gap parameter
  • prFeas::Real – primal feasibility residual
  • duFeas::Real – dual feasibility residual
  • muFeas::Real – complementarity residual
  • pobj::Real – primal objective value
  • dobj::Real – dual objective value
source

Key fields:

FieldTypeDescription
yMatrixPrimal variables
wMatrixDual variables for equality constraints (Gy = d)
vMatrixDual variables for inequality constraints (Ay ≥ b)
statusSymbolTermination status (see below)
pobjRealPrimal objective value
dobjRealDual objective value
prFeasRealPrimal feasibility residual
duFeasRealDual feasibility residual
muFeasRealComplementarity residual
IterIntegerNumber of iterations
MuRealFinal barrier parameter

Status values:

StatusMeaning
:OptimalConverged to an optimal solution
:InfeasibleProblem is primal infeasible (dual certificate found)
:UnboundedProblem is dual infeasible / primal unbounded
:AbandonedSolver stalled (step size too small or numerical issues)
:ErrorSolver encountered an error

See Troubleshooting Solver Output in the Mathematical Background for guidance on non-optimal statuses.

JuMP / MathOptInterface

ConicIP.OptimizerType
Optimizer(; verbose=false, optTol=1e-6, maxIters=100)

MathOptInterface optimizer wrapping the ConicIP interior-point solver. Use as a JuMP solver via Model(ConicIP.Optimizer).

Keyword Arguments

  • verbose::Bool – print solver iterations (default: false)
  • optTol::Float64 – optimality tolerance (default: 1e-6)
  • maxIters::Int – maximum iterations (default: 100)

Supported Constraints

  • Vector: Zeros, Nonnegatives, Nonpositives, SecondOrderCone, PositiveSemidefiniteConeTriangle
  • Scalar: EqualTo, GreaterThan, LessThan
source

KKT Solver Functions

Three built-in KKT solvers are provided. See the KKT Solvers guide for detailed usage and custom solver development.

ConicIP.kktsolver_qrFunction

Solves the 3x3 system

┌             ┐ ┌    ┐   ┌   ┐
│ Q   G'  -A' │ │ y' │ = │ y │
│ G           │ │ w' │   │ w │
│ A       FᵀF │ │ v' │   │ v │
└             ┘ └    ┘   └   ┘

by the double QR method described in CVXOPT http://www.seas.ucla.edu/~vandenbe/publications/coneprog.pdf section 10.2

source
ConicIP.kktsolver_sparseFunction

Solves the 3x3 system

┌             ┐ ┌    ┐   ┌   ┐
│ Q   G'  -A' │ │ y' │ = │ y │
│ G           │ │ w' │   │ w │
│ A       FᵀF │ │ v' │   │ v │
└             ┘ └    ┘   └   ┘

By lifting the large diagonal plus rank 3 blocks of FᵀF

Intelligently chooses between solve3x3gensparselift and solve3x3gensparsedense by approximating the number of non-zeros in both and choosing the form with more sparsity. The former is better for large second order cones, while the latter is better if the constraints are the product of many small cones.

source
ConicIP.kktsolver_2x2Function

Solves the 2x2 system

┌                   ┐ ┌    ┐   ┌   ┐
│ Q + A'F⁻¹F⁻ᵀA  G' │ │ y' │ = │ y │
│ G                 │ │ w' │   │ w │
└                   ┘ └    ┘   └   ┘
source
ConicIP.pivotFunction
pivot(kktsolver_2x2)

Wrap a 2-by-2 KKT solver into a 3-by-3 solver by pivoting on the third component. The inner solver handles the Schur complement system; pivot reconstructs the full solution.

See also conicIP for the KKT solver interface specification.

source

Block Diagonal Matrices

The Nesterov-Todd scaling matrix is represented as a block diagonal matrix where each block corresponds to a cone in the cone specification.

ConicIP.BlockType
Block(size::Int)
Block(Blk::Vector)

Block diagonal matrix type. Each diagonal block can be a different matrix type (Diagonal, SymWoodbury, VecCongurance, or dense Matrix).

Used internally to represent the Nesterov-Todd scaling matrix, where each block corresponds to a cone in the cone specification.

Supports arithmetic (*, +, -, inv, adjoint, ^), conversion to sparse and Matrix, and block-wise function application via broadcastf.

Indexing

  • B[i] returns the i-th diagonal block
  • B[i] = M sets the i-th diagonal block
source
ConicIP.block_idxFunction
block_idx(A::Block)

Return a vector of UnitRange{Int} giving the row/column index ranges for each diagonal block of A.

source
ConicIP.broadcastfFunction
broadcastf(op, A::Block)
broadcastf(op, A::Block, B::Block)
broadcastf(op, A::Block, x::Union{Vector,Matrix})

Apply function op block-wise to the diagonal blocks of A (and optionally B or the corresponding segments of x).

source

Utilities

ConicIP.IdFunction
Id(n)

Create an n-by-n identity matrix as Diagonal(ones(n)).

source
ConicIP.VecConguranceType
VecCongurance(R)

Linear operator representing a congruence transform in vectorized form. The action W * x computes vecm(R' * mat(x) * R).

Used internally as the Nesterov-Todd scaling matrix for semidefinite cones.

source
ConicIP.matFunction
mat(x)

Convert a vectorized symmetric matrix (scaled lower-triangular form) back to a full symmetric matrix. Inverse of vecm.

source
ConicIP.vecmFunction
vecm(Z)

Vectorize a symmetric matrix Z into scaled lower-triangular form. Off-diagonal entries are scaled by √2 so that dot(vecm(X), vecm(Y)) == tr(X*Y). Inverse of mat.

source
ConicIP.imcolsFunction

imcols(A, b; ϵ = 1e-10)

Removes redundant inequalities in a system of equations

Ax = b

and checks if the equations are consistent.

source

Internal

These functions are implementation details and not part of the public API.

ConicIP.inv_adjoint!Function
inv_adjoint!(dest::Block, src::Block)

Compute adjoint(inv(src)) block-wise, reusing the dest Block shell. Avoids allocating two intermediate Blocks for inv(F)'.

source
ConicIP.pivotgenFunction

Wrapper around solve2xegen to solve 3x3 systems by pivoting on the third component.

source