numgo

package module
v0.0.0-...-8d9db13 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2023 License: MIT Imports: 1 Imported by: 0

README

numgo

Fundamental package for array computing in Golang

NumGo is the fundamental package for scientific computing with Golang.

It provides:

a powerful N-dimensional array object

///////////////////////////////////////////////////////////////

go get github.com/nesazeri/numgo

go get -u github.com/nesazeri/numgo

package main

import (

"fmt"
"github.com/nesazeri/numgo"

)

func main(){

arrData := []float64{1, 2, 3, 4, 5}
arr := numgo.Array(arrData)
fmt.Println("Array: ", arr)

}

go run .\test.go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NumgoArray

type NumgoArray struct {
	Data  []float64
	Shape []int
}

NumgoArray represents a multidimensional array

func Array

func Array(data []float64) *NumgoArray

Array creates a new NumgoArray from a slice of float64 values

func NewNumgoArray

func NewNumgoArray(shape []int) *NumgoArray

NewNumgoArray creates a new NumgoArray with the given shape and initializes it with zeros

func NewNumgoArrayFromSlice

func NewNumgoArrayFromSlice(data []float64, shape []int) *NumgoArray

NewNumgoArrayFromSlice creates a new NumgoArray from a slice of float64 values and the given shape

func (*NumgoArray) Get

func (a *NumgoArray) Get(indices ...int) float64

Get returns the value of an element at the given indices

func (*NumgoArray) Set

func (a *NumgoArray) Set(value float64, indices ...int)

Set sets the value of an element at the given indices

Jump to

Keyboard shortcuts

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