matrix

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package matrix provides internal utilities built on top of the gonum matrix package to support common matrix operations.

This package includes functions for extracting columns, creating identity matrices, and resizing dense matrices and vectors.

It is intended for internal use within the gspl project.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractColumns

func ExtractColumns(A *mat.Dense, indices *mat.VecDense) *mat.Dense

ExtractColumns extracts columns from a *mat.Dense matrix based on the provided indices.

func Eye

func Eye(size int) *mat.DiagDense

Eye creates a dense diagonal matrix of the given size with ones on the diagonal.

func MatDenseAppendColumn

func MatDenseAppendColumn(A *mat.Dense, col *mat.VecDense) *mat.Dense

MatDenseAppendColumn appends a column vector to a *mat.Dense matrix.

func MatDenseAppendRow

func MatDenseAppendRow(A *mat.Dense, row *mat.Dense) *mat.Dense

func MatDenseFromArray

func MatDenseFromArray(arr [][]float64) *mat.Dense

MatDenseFromArray converts a 2D slice of float64 to a *mat.Dense matrix.

func MatDenseToArray

func MatDenseToArray(A *mat.Dense) [][]float64

MatDenseToArray converts a *mat.Dense matrix to a 2D slice of float64.

func ResizeMatDense

func ResizeMatDense(m *mat.Dense, newRows, newCols int) *mat.Dense

ResizeMatDense resizes a *mat.Dense matrix to newRows x newCols, copying over the existing data as much as possible.

func ResizeVecDense

func ResizeVecDense(v *mat.VecDense, newLen int) *mat.VecDense

ResizeVecDense resizes a *mat.VecDense vector to newLen, copying over the existing data as much as possible.

func VecDenseAppend

func VecDenseAppend(v *mat.VecDense, newElem *mat.VecDense) *mat.VecDense

VecDenseAppend appends a new *mat.VecDense vector to an existing one,

func VecDenseFromArray

func VecDenseFromArray(arr [][]float64) *mat.VecDense

func VecToSlice

func VecToSlice(v *mat.VecDense) []float64

Types

This section is empty.

Jump to

Keyboard shortcuts

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