User Guide¶
This guide covers the core concepts and features of Moreau.
Contents¶
Overview¶
Moreau solves convex conic optimization problems:
minimize (1/2)x'Px + q'x
subject to Ax + s = b
s in K
Where K is a Cartesian product of convex cones.
Key Concepts¶
Single vs Batched: Use
Solverfor one problem,CompiledSolverfor many with shared structureTwo APIs: NumPy-based core API, plus PyTorch/JAX integrations with autograd
Device Selection: Automatic CPU/GPU selection, or manual override
Cone Specification: Define constraint types via the
Conesclass
Data Flow¶
Problem Data (P, q, A, b, cones)
|
v
+-------------------+
| Solver/ | Validates dimensions, converts to CSR
| CompiledSolver |
+-------------------+
|
v
+-------------------+
| Backend | CPU (Rust) or CUDA (C++)
+-------------------+
|
v
+-------------------+
| Solution | x, z, s arrays + metadata
+-------------------+
Solver vs CompiledSolver¶
Feature |
Solver |
CompiledSolver |
|---|---|---|
Use case |
Single problem |
Batched problems |
Input format |
Dense or sparse matrices (NumPy/SciPy) |
CSR structure |
Batching |
No |
Yes |
Setup |
Implicit |
Explicit |
Best for |
Prototyping |
Production |