Skip to content

Latest commit

 

History

History
32 lines (22 loc) · 979 Bytes

File metadata and controls

32 lines (22 loc) · 979 Bytes
layout title parent nav_order
default
Solving from File
Usage
2

Solving problems from a file

SDPA for Python can read and solve problems saved in CLP and SDPA Sparse formats.

The below example shows how to read and solve a CLP formatted file (i.e. one having .clp extension):

import sdpap

A, b, c, K, J = sdpap.readproblem('example1.clp')
x, y, sdpapinfo, timeinfo, sdpainfo = sdpap.solve(A,b,c,K,J)

Example CLP formatted problems can be found in the examples folder of the SDPA for Python GitHub repository.

The below example shows how to read and solve an SDPA sparse formatted file (i.e. one having .dat-s extension):

import sdpap

A, b, c, K, J = sdpap.importsdpa('mcp500-3.dat-s')
x, y, sdpapinfo, timeinfo, sdpainfo = sdpap.solve(A,b,c,K,J)

SDPLIB is a database of problems in SDPA sparse format. It's available as a GitHub repository.