Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ selects the best available solver for the platform:
- **Linux / Windows**: MKL Pardiso if available, otherwise QDLDL

```python
import numpy as np
import scipy.sparse as sp
import scs

# A minimal LP: maximize x subject to 0 <= x <= 1
data = {
"A": sp.csc_matrix(np.array([[1.0], [-1.0]])),
"b": np.array([1.0, 0.0]),
"c": np.array([-1.0]),
}
cone = {"l": 2}

# Auto-detect best backend (default)
solver = scs.SCS(data, cone)

Expand Down Expand Up @@ -87,6 +99,8 @@ import numpy as np
import scipy.sparse as sp
import scs

np.random.seed(0) # so the printed status below is reproducible

m, n = 4, 2
A = sp.random(m, n, density=0.5, format="csc")
b = np.random.randn(m)
Expand Down