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

nd

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: 3 Imported by: 0

Documentation

Overview

Package nd connects sparse matrices to go-ndarray arrays: dense vectors and matrices go in and out of the solvers as *ndarray.Array.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromCSR

func FromCSR(a *sparse.CSR[float64]) (*ndarray.Array, error)

FromCSR returns the dense 2-D array of a real CSR matrix.

func FromVector

func FromVector(v []float64) *ndarray.Array

FromVector copies a slice into a new 1-D array.

func MulMat

func MulMat(a *sparse.CSR[float64], b *ndarray.Array) (*ndarray.Array, error)

MulMat computes the sparse-times-dense product A B for a 2-D array B.

func MulVec

func MulVec(a *sparse.CSR[float64], x *ndarray.Array) (*ndarray.Array, error)

MulVec computes A x for a 1-D array x.

func ToCSR

func ToCSR(a *ndarray.Array) (*sparse.CSR[float64], error)

ToCSR converts a 2-D float64 array to CSR, dropping zeros.

func Vector

func Vector(a *ndarray.Array) ([]float64, error)

Vector copies a 1-D float64 array into a slice.

Types

This section is empty.

Jump to

Keyboard shortcuts

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