# optimize -- solve a semidefinite program

## Synopsis

• Usage:
(X,y,Z,stat) = optimize P
(X,y,Z,stat) = optimize(P,y0)
• Inputs:
• P, an instance of the type SDP, a semidefinite programming problem
• y0, , a dual strictly feasible matrix (optional)
• Optional inputs:
• Solver => ..., default value null, picking a semidefinite programming solver
• Verbosity => ..., default value 0, control the level of information printed
• Outputs:
• X, an $n\times n$ matrix, primal variable (not available if Solver=>"M2")
• y, an $m\times 1$ matrix, dual variable
• Z, an $n\times n$ matrix, dual variable
• stat, , the status of the SDP solver

## Description

This method solves a semidefinite programming problem. There is an interface to the solvers CSDP, SDPA and MOSEK. The default solver is CSDP, which is preinstalled with Macaulay2. Alternatively, there is rudimentary dual interior point method implemented entirely in Macaulay2 language.

 i1 : P = sdp(matrix{{1,0},{0,2}}, matrix{{0,1},{1,0}}, matrix{{-1}}); i2 : (X,y,Z,stat) = optimize P; i3 : y o3 = | -1.41421 | 1 1 o3 : Matrix RR <--- RR 53 53

References: Convex Optimization, Boyd, Vandenberghe, Cambridge University Press (2004), pp. 618-619, pp. 463-466.

## Caveat

The "M2" solver might fail if the dual problem is not strictly feasible. It also does not return the primal solution.