Gonum is a set of numeric libraries for the Go programming language. It contains libraries for matrices, statistics, optimization, and more

Gonum

Build status Build Status Build status codecov.io coveralls.io go.dev reference GoDoc Go Report Card stability-unstable

Installation

The core packages of the Gonum suite are written in pure Go with some assembly. Installation is done using go get.

go get -u gonum.org/v1/gonum/...

Supported Go versions

Gonum supports and tests using the gc compiler on the two most recent Go releases on Linux (386, amd64 and arm64), macOS and Windows (both on amd64).

Release schedule

The Gonum modules are released on a six-month release schedule, aligned with the Go releases. i.e.: when Go-1.x is released, Gonum-v0.n.0 is released around the same time. Six months after, Go-1.x+1 is released, and Gonum-v0.n+1.0 as well.

The release schedule, based on the current Go release schedule is thus:

  • Gonum-v0.n.0: February
  • Gonum-v0.n+1.0: August

Build tags

The Gonum packages use a variety of build tags to set non-standard build conditions. Building Gonum applications will work without knowing how to use these tags, but they can be used during testing and to control the use of assembly and CGO code.

The current list of non-internal tags is as follows:

  • safe — do not use assembly or unsafe
  • bounds — use bounds checks even in internal calls
  • cblas — use CGO gonum.org/v1/netlib/blas/netlib BLAS implementation in tests (only in mat package)
  • noasm — do not use assembly implementations
  • tomita — use Tomita, Tanaka, Takahashi pivot choice for maximimal clique calculation, otherwise use random pivot (only in topo package)

Issues TODOs

If you find any bugs, feel free to file an issue on the github issue tracker. Discussions on API changes, added features, code review, or similar requests are preferred on the gonum-dev Google Group.

https://groups.google.com/forum/#!forum/gonum-dev

License

Original code is licensed under the Gonum License found in the LICENSE file. Portions of the code are subject to the additional licenses found in THIRD_PARTY_LICENSES. All third party code is licensed either under a BSD or MIT license.

Code in graph/formats/dot is dual licensed Public Domain Dedication and Gonum License, and users are free to choose the license which suits their needs for this code.

The W3C test suites in graph/formats/rdf are distributed under both the W3C Test Suite License and the W3C 3-clause BSD License.

Owner
Consistent, composable, and comprehensible scientific code
null
Comments
  • fourier: new package for fourier analysis and related functions

    fourier: new package for fourier analysis and related functions

    Please take a look.

    So far I have only added the backing code. I want to add CFFT[IFB] and then I will dismantle some of the array.go support (remove 1-based indexing and the linear support types). It makes sense to add the API in this PR, so suggestions welcome here.

  • meta-issue: document deprecation of all old gonum/xyz repos

    meta-issue: document deprecation of all old gonum/xyz repos

    (putting it there, feel free to redirect to the best place)

    we should clearly put on all the old gonum/xyz repositories' README.md that these repos are deprecated and that issues, PRs should be redirected at gonum/gonum.

    I don't think we clearly communicated this.

  • optimize: completely overhaul Global

    optimize: completely overhaul Global

    The previous implementation of Global was a minefield for incorrectly implementing global optimization methods. It was very difficult to correctly implement methods (both of the provided methods were incorrect), and the resulting code is very ugly. This commit switches to use channels to communicate, allowing a more clear ordering of concurrent code. This also enables better shutdown of methods.

    In addition to the main fix of Global, this refactors the two Global methods to use the updated interface, and makes some small improvements that were previously not possible. In addition, there are some small cleanups of Local to better match between the two calls.

    If anyone has been curious about what is meant by 'Don't communicate by sharing memory, share memory by communicating' this is it, and why.

  • stat/spatial: new package for spatial statistic measures

    stat/spatial: new package for spatial statistic measures

    @btracey @vladimir-ch @Armadilloa16 @ReubenBuck Please take a look.

    This is commit one of ~~two~~ three. The ~~second~~ final commit will add element-wise weights, after the API is otherwise settled.

    Possible considerations are adding a reset method to allow data/locality reuse.

  • floats: add SameScalars to compare two float64 values with NaN == NaN.

    floats: add SameScalars to compare two float64 values with NaN == NaN.

    What

    floats/floats.go has a function

    // Same returns true if the input slices have the same length and all elements
    // have the same value with NaN treated as the same.
    func Same(s, t []float64) bool {
    ...}
    

    I would like to add there a function SameScalars which does the same for scalar inputs:

    // SameScalars returns true if the inputs have the same value with NaN treated as the same.
    func SameScalars(a, b float64) bool {
    	return a == b || (math.IsNaN(a) && math.IsNaN(b))
    }
    

    Rationale

    Such a function will be useful for unit testing functions which are expected to return NaNs for some inputs.

    Updated proposal

    Rename Same to AllSame (breaks code) and call the new function Same.

  • unit: Intermittent test failure in TestFormat

    unit: Intermittent test failure in TestFormat

    I seem to be getting an occasional test failure in TestFormat (and travis-ci does as well):

    --- FAIL: TestFormat (0.00 seconds) unit_test.go:44: Format "%#v": got: "&unit.Unit{dimensions:unit.Dimensions{6:-1, 4:2}, formatted:"", value:6.62606957e-34}" expected: "&unit.Unit{dimensions:unit.Dimensions{4:2, 6:-1}, formatted:"", value:6.62606957e-34}" FAIL

    go test -race doesn't find anything wrong.

  • stat: ROC signature

    stat: ROC signature

    I came up with what I think is an improvement to the ROC function, in which the cutoffs are defined explicitly instead of the number of cutoffs n. This allows for unequally-spaced cutoffs, allows for all cutoffs to be used more naturally, and simplifies the code itself.

    Is this a good idea -- should I put a PR in for it, @sbinet @kortschak ?

    Also, I was thinking maybe ROC should output an error as well, instead of all the panic statements? Or is it appropriate that it panic?

    What I did is here, in case you wanted to look at the specifics of what I am suggesting: https://github.com/Armadilloa16/stat/tree/roc

  • floats: adding AreUnique

    floats: adding AreUnique

    While discussing a PR (https://github.com/gonum/floats/pull/61) on the floats package before the merger, it was suggested that an AreUnique function would be useful.

  • lapack: add Dorgr2 routine

    lapack: add Dorgr2 routine

    Disclaimer: Only tested with square matrices since that's all I seem to be able to generate with constructQK helper.

    ARE issue: https://github.com/gonum/gonum/issues/1651

  • Interp

    Interp

    interp: This change modifies Gonum by adding a new interp/ package with interpolation algorithms.

    I implemented three basic 1D interpolators so far:

    • constant
    • piecewise linear
    • piecewise constant

    Submitting a PR now to start the review process and adjust the code design & style to the project requirements, before I go down some rabbit hole ;-)

    Cheers, Roman

  • mat: add Doer interface and implementations

    mat: add Doer interface and implementations

    This is a proposal for an approach to optimising sparse or sparsish matrix accesses raised in https://github.com/gonum/gonum/pull/124#discussion_r126201816

    ~~Only https://github.com/gonum/gonum/commit/2eb65a280581fdb47fa2714f84b793f652ccbb58 is relevant to this PR and I'll revise the history of the PR when #95 is merged.~~

    Depends #95.

  • graph/path: fix yen k-shortest path with root cycles

    graph/path: fix yen k-shortest path with root cycles

    Previously the code was not removing nodes on the root of the search path, resulting in searches that could re-enter previously searched nodes. In addition to this, the logic for making edges was incorrectly making both directions for digraphs and only one direction for undirected graphs.

    Finally, the range of nodes to include in the spur-node set was off-by-one. This is now clarified by including the comment from the wiki article since the pseudo-code is less clear than the English due to choice of range indexing convention.

    Please take a look.

    Fixes #1778

  • Renovate Bot can not lookup new versions for gonum

    Renovate Bot can not lookup new versions for gonum

    What are you trying to do?

    When running renovate bot on my project, it fails to resolve the gonum dependency:

    image

    Does anyone have any suggestions, why this is the case? I do not have this problem for any other dependency.

  • `stat.Quantile` returns wrong value when dataset is even size

    `stat.Quantile` returns wrong value when dataset is even size

    What are you trying to do?

    I'm trying to get median value when I request even size of dataset to stat.Quantile

    What did you do?

    func main() {
    	xs := []float64{2, 3, 5, 9}
    	median := stat.Quantile(0.5, stat.Empirical, xs, nil)
    
    	fmt.Println(median)
    }
    

    https://go.dev/play/p/8b6vDMunna8

    What did you expect to happen?

    I expect return value 4

    What actually happened?

    its returns 3

    What version of Go and Gonum are you using?

    1.19

    Does this issue reproduce with the current master?

    Yes

  • Add noise generation functionality

    Add noise generation functionality

    What are you trying to do?

    Create simplex noise in 2D.

    What did you try?

    Created my own package here: https://github.com/soypat/decaffeinator/blob/main/tagalong/pkg-noise/simplex.go

    How does Gonum not allow you to achieve your goal?

    I was not able to find noise generation in gonum.

    Are you able to help contribute the feature?

    Yes, see above link.

  • distuv NonCentralT

    distuv NonCentralT

    What are you trying to do?

    The current implementation of the StudentsT distribution doesn't allow you to specify a non-centrality parameter ($\delta$). This would be useful because the noncentral-t distribution is useful for power analyses and in Bayesian inference (my personal usecase)

    Are you able to help contribute the feature?

    See #1819: I'm currently using translations I've made of R's nmath C library, and these translations could be used as the basis for this.

indodate is a plugin for golang programming language for date convertion on indonesian format

indodate is a package for golang programming language for date conversion on indonesian format

Oct 23, 2021
Several functional programming supporting in golang

A golang library that makes operations on slice easilier What can I do? slice process Map Filter Sort Reverse map process Keys Values output (starting

Jun 27, 2022
CUE is an open source data constraint language which aims to simplify tasks involving defining and using data.

CUE is an open source data constraint language which aims to simplify tasks involving defining and using data.

Jan 1, 2023
Map, Reduce, Filter, De/Multiplex, etc. for the Go language.

proto proto gives Go operations like Map, Reduce, Filter, De/Multiplex, etc. without sacrificing idiomatic harmony or speed. It also introduces a conv

Nov 17, 2022
Fast, efficient, and scalable distributed map/reduce system, DAG execution, in memory or on disk, written in pure Go, runs standalone or distributedly.

Gleam Gleam is a high performance and efficient distributed execution system, and also simple, generic, flexible and easy to customize. Gleam is built

Jan 5, 2023
DEPRECATED: Data collection and processing made easy.

This project is deprecated. Please see this email for more details. Heka Data Acquisition and Processing Made Easy Heka is a tool for collecting and c

Nov 30, 2022
Open source framework for processing, monitoring, and alerting on time series data

Kapacitor Open source framework for processing, monitoring, and alerting on time series data Installation Kapacitor has two binaries: kapacitor – a CL

Dec 24, 2022
Baker is a high performance, composable and extendable data-processing pipeline for the big data era

Baker is a high performance, composable and extendable data-processing pipeline for the big data era. It shines at converting, processing, extracting or storing records (structured data), applying whatever transformation between input and output through easy-to-write filters.

Dec 14, 2022
Kanzi is a modern, modular, expendable and efficient lossless data compressor implemented in Go.

kanzi Kanzi is a modern, modular, expendable and efficient lossless data compressor implemented in Go. modern: state-of-the-art algorithms are impleme

Dec 22, 2022
Graphik is a Backend as a Service implemented as an identity-aware document & graph database with support for gRPC and graphQL
Graphik is a Backend as a Service implemented as an identity-aware document & graph database with support for gRPC and graphQL

Graphik is a Backend as a Service implemented as an identity-aware, permissioned, persistant document/graph database & pubsub server written in Go.

Dec 30, 2022
Dud is a lightweight tool for versioning data alongside source code and building data pipelines.

Dud Website | Install | Getting Started | Source Code Dud is a lightweight tool for versioning data alongside source code and building data pipelines.

Jan 1, 2023
churro is a cloud-native Extract-Transform-Load (ETL) application designed to build, scale, and manage data pipeline applications.

Churro - ETL for Kubernetes churro is a cloud-native Extract-Transform-Load (ETL) application designed to build, scale, and manage data pipeline appli

Mar 10, 2022
Simple CRUD application using CockroachDB and Go

Simple CRUD application using CockroachDB and Go

Feb 20, 2022
Prometheus Common Data Exporter can parse JSON, XML, yaml or other format data from various sources (such as HTTP response message, local file, TCP response message and UDP response message) into Prometheus metric data.
Prometheus Common Data Exporter can parse JSON, XML, yaml or other format data from various sources (such as HTTP response message, local file, TCP response message and UDP response message) into Prometheus metric data.

Prometheus Common Data Exporter Prometheus Common Data Exporter 用于将多种来源(如http响应报文、本地文件、TCP响应报文、UDP响应报文)的Json、xml、yaml或其它格式的数据,解析为Prometheus metric数据。

May 18, 2022
xyr is a very lightweight, simple and powerful data ETL platform that helps you to query available data sources using SQL.

xyr [WIP] xyr is a very lightweight, simple and powerful data ETL platform that helps you to query available data sources using SQL. Supported Drivers

Dec 2, 2022
Dev Lake is the one-stop solution that integrates, analyzes, and visualizes software development data
Dev Lake is the one-stop solution that integrates, analyzes, and visualizes software development data

Dev Lake is the one-stop solution that integrates, analyzes, and visualizes software development data throughout the software development life cycle (SDLC) for engineering teams.

Dec 30, 2022
Gonum is a set of numeric libraries for the Go programming language. It contains libraries for matrices, statistics, optimization, and more

Gonum Installation The core packages of the Gonum suite are written in pure Go with some assembly. Installation is done using go get. go get -u gonum.

Dec 29, 2022
Evolutionary optimization library for Go (genetic algorithm, partical swarm optimization, differential evolution)
Evolutionary optimization library for Go (genetic algorithm, partical swarm optimization, differential evolution)

eaopt is an evolutionary optimization library Table of Contents Changelog Example Background Features Usage General advice Genetic algorithms Overview

Dec 30, 2022
matex - extension of gonum.mat

matex - extension of gonum.mat

Dec 25, 2021
Convert Arabic numeric amounts to Chinese character

将阿拉伯数字金额转换为汉字的形式 Convert Arabic numeric amounts to Chinese character form. 安装使用 Golang 版本大于等于1.16 go get -u github.com/aliliin/rmb-character import (

Sep 9, 2021