Package mat provides implementations of float64 and complex128 matrix structures and linear algebra operations on them.

pkg.go.dev/gonum.org/v1/gonum/mat
gonum/mat homepage screenshot

About gonum/mat

gonum/mat is a matrix package for the Go language. It provides float64 and complex128 matrix structures and linear algebra operations, including concrete types such as Dense, SymDense, TriDense and VecDense, interfaces for Matrix, Symmetric and Triangular types, and factorization types such as QR and LU.

Matrices are stored in row-major format and can be created zeroed or from a supplied data slice. Functions accept interface types, and empty matrices resize automatically to operation results; non-empty destinations panic if sized incorrectly.

Key features

  • Float64 and complex128 matrix structures with linear algebra operations
  • Concrete types Dense, SymDense, TriDense, and VecDense
  • Matrix factorization types including QR and LU
  • Empty matrices automatically assume correct result size
  • Transpose with T and conjugate transpose with H
  • Row-major storage with zeroed or supplied backing data
Best for: Go developers working with float64 and complex128 matrices and factorizations.
Good for
  • Accepts Matrix interfaces, allowing use of internal and external matrix types
  • Tagged stable v1 version for more predictable builds
  • Redistributable license with minimal use and redistribution restrictions
Watch out for
  • Operations panic if a non-empty destination has the wrong size
  • Empty matrices cannot be sliced, only expanded with Grow where available
  • Reset should not be used when matrices share the same backing slice

gonum/mat at a glance

Type
Online tool
Pricing
Not confirmed. Check the site
Platforms
Web
Open source
Not stated
Language
English
Last checked
Oct 5, 2026 · Online when checked
Listed
Oct 5, 2026

Popular in AI Data & Analytics

Well-known listings from the same topic.

All 302

gonum/mat FAQ

How do I create a matrix?
Use the corresponding New function; without a backing array it is initialized to all zeros, with a data slice it uses those elements.
What happens when the result matrix is empty?
It automatically assumes the correct size, re-using backing data if available or allocating new data if necessary.
How is transposition expressed?
Use T for real matrices and H for conjugate transpose on complex matrices; for example, c.Mul(a.T(), b) computes c = aᵀ * b.
Is something wrong or out of date?

Tell us and an editor will check it.

Own this website?

Claim the listing and suggest updates yourself. An editor checks every claim first.

Claim this listing