Help us shape the future of Go! Take the 2026 Go Developer Survey

gallery

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2026 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package gallery generates deterministic test matrices: finite-difference Laplacians, a convection-diffusion operator, and seeded random sparse matrices. They are the inputs of the verification and benchmark harnesses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvectionDiffusion2D

func ConvectionDiffusion2D(nx, ny int, peclet float64) *sparse.CSR[float64]

ConvectionDiffusion2D is the nonsymmetric upwind 5-point operator -Δu + peclet*(u_x + u_y) on an nx x ny grid with unit spacing.

func Laplacian1D

func Laplacian1D(n int) *sparse.CSR[float64]

Laplacian1D is the n x n tridiagonal matrix tridiag(-1, 2, -1).

func Laplacian2D

func Laplacian2D(nx, ny int) *sparse.CSR[float64]

Laplacian2D is the 5-point Laplacian on an nx x ny grid (Dirichlet).

func Laplacian3D

func Laplacian3D(nx, ny, nz int) *sparse.CSR[float64]

Laplacian3D is the 7-point Laplacian on an nx x ny x nz grid (Dirichlet).

func RandomSparse

func RandomSparse(n, perRow int, sym bool, seed uint64) *sparse.CSR[float64]

RandomSparse is an n x n matrix with about perRow random off-diagonal entries per row (uniform in [-1, 1]) and a diagonal making it strictly diagonally dominant; sym mirrors the pattern and values (symmetric positive definite then).

func Scramble

func Scramble(a *sparse.CSR[float64], seed uint64) (*sparse.CSR[float64], []int)

Scramble returns A with rows and columns symmetrically permuted by a seeded random permutation, and the permutation (B[i,j] = A[p[i],p[j]]).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL