package osdp

  1. Overview
  2. Docs

Interface towards SDPA{,-GMP}.

SDPA is a semidefinite programming optimization procedure. You may be interested in the slightly higher level interface Sdp.

See Sdp for definition of SDP with primal and dual.

type matrix = (int * int * float) list

Matrices. Sparse representation as triplet (i, j, x) meaning that the coefficient at line i >= 0 and column j >= 0 has value x. All forgotten coefficients are assumed to be 0.0. Since matrices are symmetric, only the lower triangular part (j <= i) must be given. No duplicates are allowed.

type block_diag_matrix = (int * matrix) list

Block diagonal matrices (sparse representation, forgetting null blocks). For instance, [(1, m1), (3, m2)] will be transformed into [m1; 0; m2]. No duplicates are allowed. There is no requirement for indices to be sorted.

type solver =
  1. | Sdpa
  2. | SdpaGmp
  3. | SdpaDd
type options = {
  1. solver : solver;
    (*

    default: Sdpa

    *)
  2. verbose : int;
    (*

    verbosity level, non negative integer, 0 (default) means no output

    *)
  3. max_iteration : int;
    (*

    maxIteration (default: 100)

    *)
  4. stop_criterion : float;
    (*

    epsilonStar and epsilonDash (default: 1.0E-7)

    *)
  5. initial : float;
    (*

    lambdaStar (default: 1.0E2)

    *)
  6. precision : int;
    (*

    precision (only for SDPA-GMP, default: 200)

    *)
}

Options for calling SDPA.

val default : options

Default values above.

val solve : ?options:options -> ?init: ((int * float array array) list * float array * (int * float array array) list) -> block_diag_matrix -> (block_diag_matrix * float) list -> SdpRet.t * (float * float) * ((int * float array array) list * float array * (int * float array array) list)

solve obj constraints solves the SDP problem: max{ tr(obj X) | tr(A_1 X) = a_1,..., tr(A_n X) = a_n, X psd } with [(A_1, a_1);...; (A_n, a_n)] the constraints list. It returns both the primal and dual objective values and a witness for X (primal) and y and Z (dual, see Sdp). In case of success (or partial success), the block diagonal matrices returned for X and Z contain exactly the indices, sorted by increasing order, that appear in the objective or one of the constraints. Size of each diagonal block in X or Z is the maximum size appearing for that block in the objective or one of the constraints. In case of success (or partial success), the array returned for y has the same size and same order than the input list of constraints.

OCaml

Innovation. Community. Security.