3 Examples
Each example below is a literate program: the prose and the code you see are the same source that lives in the package’s "scs/examples/" directory and is exercised by the test suite, so the walkthroughs never drift from working code. Every example provides a run-example thunk; its companion harness in "scs/examples/test/" drives it and checks the result (run with raco test).
The examples build up in three arcs. The foundations
(Linear program through Power cone) introduce one cone family at a
time through the high-level solve interface: a linear program, then a
quadratic objective, then the second-order, exponential, semidefinite, and
power cones. The solver mechanics (Indirect solver,
Warm starting and re-solving) cover choosing the indirect linear-system solver and
reusing a workspace across re-solves. The applications
(Lasso along a regularization path through Model predictive control) assemble those pieces into
recognizable models —