Giter Site home page Giter Site logo

lapack's Introduction

Gonum

Build status Build status codecov.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).

Note that floating point behavior may differ between compiler versions and between architectures due to differences in floating point operation implementations.

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
  • 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.

lapack's People

Contributors

btracey avatar jonlawlor avatar kortschak avatar sbinet avatar vladimir-ch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lapack's Issues

cgo: Dormqr comment not in sync with reality

The comment says:

// ... lwork == -1 will not run Dormqr but will instead write the minimum
// work necessary to work[0]. If len(work) < lwork, Dormqr will panic.

The code does:

        if lwork == -1 {
                 if left {
                         work[0] = float64(m)
                         return
                 }
                 work[0] = float64(n)
                 return
         }

         if left {
                 if lwork < n {
                         panic(badWork)
                 }
         } else {
                 if lwork < m {
                         panic(badWork)
                 }
         }

That is,

  1. Values put into work[0] and checked values of lwork seem to be swapped.
  2. len(work) < lwork is not checked.

clapack: []int32 for lapack_int*?

  1. Why use int32, why not int?
  2. In case of iwork or ipiv parameters, they are arrays of int. However, in ?trexc, ifst and ilst are just single in/out integers, so using a slice for them seems inappropriate.

native: Dggsvp3 incorrectly calculates range for A cleanup

If a test is run with m=3, p=3, n=5 the code at line 264 panics with a bounds check failure.

--- FAIL: TestDggsvp3 (0.00s)
panic: runtime error: slice bounds out of range [recovered]
	panic: runtime error: slice bounds out of range

goroutine 5 [running]:
testing.tRunner.func1(0xc4200724e0)
	/home/daniel/Development/go/src/testing/testing.go:622 +0x29d
panic(0x6a1fc0, 0x895c00)
	/home/daniel/Development/go/src/runtime/panic.go:489 +0x2cf
github.com/gonum/lapack/native.Implementation.Dggsvp3(0x515655, 0x3, 0x3, 0x5, 0xc420080980, 0xf, 0xf, 0x5, 0xc420080a80, 0xf, ...)
	/home/daniel/Development/src/github.com/gonum/lapack/native/dggsvp3.go:264 +0xcf0
github.com/gonum/lapack/native.(*Implementation).Dggsvp3(0x8b84e8, 0x515655, 0x3, 0x3, 0x5, 0xc420080980, 0xf, 0xf, 0x5, 0xc420080a80, ...)
	<autogenerated>:25 +0x28b
github.com/gonum/lapack/testlapack.Dggsvp3Test(0xc4200724e0, 0x857340, 0x8b84e8)
	/home/daniel/Development/src/github.com/gonum/lapack/testlapack/dggsvp3.go:109 +0xd20
github.com/gonum/lapack/native.TestDggsvp3(0xc4200724e0)
	/home/daniel/Development/src/github.com/gonum/lapack/native/lapack_test.go:116 +0x5b
testing.tRunner(0xc4200724e0, 0x6e5600)
	/home/daniel/Development/go/src/testing/testing.go:657 +0x96
created by testing.(*T).Run
	/home/daniel/Development/go/src/testing/testing.go:697 +0x2ca
FAIL	github.com/gonum/lapack/native	0.005s

lapack/native: add dggsvd3 implementation

dggsvd3 implements Generalised Singular Value Decomposition that has uses in signal processing and genomics.

  • dggsvd3
  • - dtgsja
  • -- dlapll
  • -- dlags2
  • - dggsvp3
  • -- dlapmt
  • -- dgeqp3
  • --- dlaqps
  • --- dlaqp2
  • -- dgerq2
  • -- dormr2
  • --- dgerqf (required for testing)

native: bad computation of work matrix size in Dormqr

Dormqr computes the maximum number of columns of a work matrix nwxnb that fits into available workspace. If lwork is not long enough to hold the optimum block size nb, nb is reduced. The code however doesn't update ldwork, leaving it at the previous, unnecessarily large value. If the workspace is long enough to use the blocked code but not long enough to hold the nwxnb matrix, Dlarfb will panic later.

    ldwork := nb // nb is the optimal block size as returned from Ilaenv.
    if nb > 1 && nb < k {
        iws := nw * nb
        if lwork < iws {
            nb = lwork / nw
            // ldwork = nb // <--- Uncommenting fixes the issue.
            nbmin = max(2, impl.Ilaenv(2, "DORMQR", opts, m, n, k, -1))
        }
    }

Speaking of Dormqr, why is t allocated in Dormqr and not taken from work as in the reference LAPACK, @btracey ?

cgo: tests for Dormbr and Dormlq comments though fixes in OpenBLAS merged

This is a complicated issue. The tests for Dormbr and Dormlq are commented out with reference to OpenBLAS issues and PRs. The issues have been closed and the PRs have been merged. This would suggest that these tests could and should be uncommented. I have just tried that, and they fail.

$ CGO_LDFLAGS="-L/usr/local -lopenblas" go test -run Dormlq
*** Error in `/tmp/go-build141511666/github.com/gonum/lapack/cgo/_test/cgo.test': free(): invalid next size (fast): 0x00000000028bb7b0 ***
[more]
$ CGO_LDFLAGS="-L/usr/local -lopenblas" go test -run Dormbr
 ** On entry to DORMBRP parameter number 13 had an illegal value
[more]

native,clapack: mark functions as internal when not part of lapack.Float64 or lapack.Complex128

All of clapack can be noted as not really for public consumption (though not in flux - essentially the same as the std syscall package).

Methods in native are present in many cases because they are dependencies for routines that are published in lapack.Float64. We can either unexport them in the short term (probably the correct answer for things like Ilaenv that have been noted as targets for removal) or just document them as internal.

Lapack interface

How do we decide which of the lapack functions to include in the interface?
Should we just do it on a per need basis?

main.go example

Sorry if I'm out of place here, but can you refer me to a simple "main.go" that uses the lapack package you've contributed? It's really enticing, but I don't have anywhere to start (in go).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.