math

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CPUMatrixMultiply

func CPUMatrixMultiply(a, b []float32, width int) []float32

CPUMatrixMultiply performs matrix multiplication on CPU for comparison

func CPUVectorAdd

func CPUVectorAdd(a, b []float32) []float32

CPUVectorAdd performs vector addition on CPU for comparison

func CompareVectors

func CompareVectors(a, b []float32, tolerance float32) bool

CompareVectors compares two vectors and returns true if they are equal within tolerance

func GenerateRandomMatrix

func GenerateRandomMatrix(width int) []float32

GenerateRandomMatrix creates a random square matrix of specified width

func GenerateRandomVector

func GenerateRandomVector(size int) []float32

GenerateRandomVector creates a random vector of specified size

func PrintMatrix

func PrintMatrix(matrix []float32, width int, name string)

PrintMatrix prints a matrix in a nice format

func PrintVector

func PrintVector(vec []float32, name string)

PrintVector prints a vector in a nice format

Types

This section is empty.

Jump to

Keyboard shortcuts

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