Gale guide
Gale provides real-Double linear algebra for Scala 3 on the JVM and
Scala.js. Its ordinary API combines immutable-facing dense and sparse values,
typed numerical failures, matrix-free operators, and diagnostics that qualify
iterative results. Optional allocation-control and JVM acceleration stay
explicit.
This site describes Gale 0.1.0-M1. The first milestone, 0.1.0-M1, is
available from Maven Central. Getting started covers
artifact installation and an optional exact source pin.
Reach a first result
Section titled “Reach a first result”Start with Getting started. It shows the core
dependency, builds and multiplies a matrix, solves a system, and explains when
to keep Either[LinAlgError, A] rather than call .orThrow.
Then read Core concepts for the five rules that explain later behavior: immutable-facing values, explicit shapes, typed failure, operator contracts, and opt-in execution policy.
Every mdoc block in this guide is compiled or executed by docsCheck against
the live gale-core API.
Continue with your task
Section titled “Continue with your task”- Vectors and matrices — construction, indexing, views, arithmetic, and square solves.
- Dense systems and least squares — square solves, pivoted QR, matrix right-hand sides, row scaling, and reusable scratch.
- Reductions, norms, and elementwise numerics — sums, extrema, per-axis reductions, norms, and stable softmax.
- Compare two linear fits — paired residual bounds and profile-decrease certificates.
- Complex Hermitian factors — complex storage, PSD factorization, and rank-aware solves.
- Sparse matrices and operator solves — CSR, iterative methods, and matrix-free application.
- Spectral analysis — dense eigenproblems, SVD, partial results, and diagnostics.
- First-order composite optimization — proximal, projected, primal-dual, and exact-reduction methods.
- Nonlinear fitting and bounded optimization — residual/Jacobian least squares and smooth box-constrained minimization.
- Moving from Breeze — the supported migration boundary, conversions, and deliberate differences.
The worked-example map routes by problem rather than by package name.
Make an informed advanced choice
Section titled “Make an informed advanced choice”Use Advanced topics when you need precise numerical guarantees, matrix-free generalized eigensolving, reusable destinations or workspaces, sparse structure reuse, or ownership details.
Use Reference for modules, platforms, factorization capabilities, and local Scaladoc. If a call fails or does not converge, start with Troubleshooting.
Internal implementation plans, acceptance audits, and release receipts remain versioned in the repository but are intentionally outside this public site.