ng

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Array

type Array[T Scalar] []T

func NewArray

func NewArray[T Scalar](elements ...T) Array[T]

func Ones

func Ones[T Scalar](n int) Array[T]

Ones creates an array of n elements, all set to 1.

func Range

func Range[T Scalar](start, end, step T) Array[T]

create array with a range of Scalars

func Zeroes

func Zeroes[T Scalar](n int) Array[T]

func (Array[T]) Concat

func (arr Array[T]) Concat(other Array[T]) Array[T]

func (Array[T]) Dot

func (arr Array[T]) Dot(other Array[T]) T

func (Array[T]) Mean added in v0.3.0

func (arr Array[T]) Mean() T

func (Array[T]) Multiply

func (arr Array[T]) Multiply(other Array[T]) Array[T]

func (Array[T]) MultiplyScalar

func (arr Array[T]) MultiplyScalar(scalar T) Array[T]

func (Array[T]) Power added in v0.2.0

func (arr Array[T]) Power(n float64) Array[T]

func (Array[T]) Sort

func (arr Array[T]) Sort() Array[T]

func (Array[T]) String

func (arr Array[T]) String() string

func (Array[T]) Sub added in v0.2.0

func (arr Array[T]) Sub(other Array[T]) Array[T]

func (Array[T]) Sum

func (arr Array[T]) Sum(other Array[T]) Array[T]

type FloatScalar

type FloatScalar interface {
	~float32 | ~float64
}

type IntScalar

type IntScalar interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64
}

type Matrix

type Matrix[T Scalar] []Array[T]

func NewMatrix

func NewMatrix[T Scalar](elements ...Array[T]) Matrix[T]

func OnesMatrix

func OnesMatrix[T Scalar](m, n int) Matrix[T]

func ZeroesMatrix

func ZeroesMatrix[T Scalar](m, n int) Matrix[T]

func (Matrix[T]) String

func (mat Matrix[T]) String() string

type Scalar

type Scalar interface {
	IntScalar | UIntScalar | FloatScalar
}

type UIntScalar

type UIntScalar interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64
}

Jump to

Keyboard shortcuts

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