From d22599e22c25311208d69b30773390fc4d359d1f Mon Sep 17 00:00:00 2001 From: Vladimir Chalupecky Date: Thu, 14 Sep 2017 18:01:17 +0200 Subject: [PATCH 001/107] blas/netlib: run 'go generate' --- blas/netlib/blas.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/blas/netlib/blas.go b/blas/netlib/blas.go index a27921c5..cbeeaaf4 100644 --- a/blas/netlib/blas.go +++ b/blas/netlib/blas.go @@ -3890,6 +3890,10 @@ func (Implementation) Zhpmv(ul blas.Uplo, n int, alpha complex128, ap, x []compl C.cblas_zhpmv(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.int(n), unsafe.Pointer(&alpha), unsafe.Pointer(_ap), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(&beta), unsafe.Pointer(_y), C.int(incY)) } +// Zgeru performs the rank-one operation +// A += alpha * x * y^T +// where A is an m×n dense matrix, alpha is a scalar, x is an m element vector, +// and y is an n element vector. func (Implementation) Zgeru(m, n int, alpha complex128, x []complex128, incX int, y []complex128, incY int, a []complex128, lda int) { // declared at cblas.h:412:6 void cblas_zgeru ... @@ -3972,6 +3976,11 @@ func (Implementation) Zgerc(m, n int, alpha complex128, x []complex128, incX int C.cblas_zgerc(C.enum_CBLAS_ORDER(rowMajor), C.int(m), C.int(n), unsafe.Pointer(&alpha), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(_y), C.int(incY), unsafe.Pointer(_a), C.int(lda)) } +// Zher performs the Hermitian rank-one operation +// A += alpha * x * x^H +// where A is an n×n Hermitian matrix, alpha is a real scalar, and x is an n +// element vector. On entry, the imaginary parts of the diagonal elements of A +// are ignored and assumed to be zero, on return they will be set to zero. func (Implementation) Zher(ul blas.Uplo, n int, alpha float64, x []complex128, incX int, a []complex128, lda int) { // declared at cblas.h:418:6 void cblas_zher ... @@ -4033,6 +4042,11 @@ func (Implementation) Zhpr(ul blas.Uplo, n int, alpha float64, x []complex128, i C.cblas_zhpr(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.int(n), C.double(alpha), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(_ap)) } +// Zher2 performs the Hermitian rank-two operation +// A += alpha*x*y^H + conj(alpha)*y*x^H +// where alpha is a scalar, x and y are n element vectors and A is an n×n +// Hermitian matrix. On entry, the imaginary parts of the diagonal elements are +// ignored and assumed to be zero. On return they will be set to zero. func (Implementation) Zher2(ul blas.Uplo, n int, alpha complex128, x []complex128, incX int, y []complex128, incY int, a []complex128, lda int) { // declared at cblas.h:424:6 void cblas_zher2 ... From cf91ee36ac12682611fac45f65162f2a23e33645 Mon Sep 17 00:00:00 2001 From: kortschak Date: Fri, 27 Oct 2017 12:18:57 +1030 Subject: [PATCH 002/107] all: remove go1.7 build constraints and update travis.yml --- .travis.yml | 2 +- blas/netlib/dtrmvbench_test.go | 2 -- lapack/netlib/bench_test.go | 2 -- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 270b3815..cdbaf63b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,9 +4,9 @@ language: go # Versions of go that are explicitly supported by gonum. go: - - 1.6.x - 1.7.x - 1.8.x + - 1.9.x go_import_path: gonum.org/v1/netlib diff --git a/blas/netlib/dtrmvbench_test.go b/blas/netlib/dtrmvbench_test.go index 8ef77ad6..12f99ab6 100644 --- a/blas/netlib/dtrmvbench_test.go +++ b/blas/netlib/dtrmvbench_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build go1.7 - package netlib import ( diff --git a/lapack/netlib/bench_test.go b/lapack/netlib/bench_test.go index c9ce885b..8524ac00 100644 --- a/lapack/netlib/bench_test.go +++ b/lapack/netlib/bench_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build go1.7 - package netlib import ( From d75b8e694ab1bae5779db19cc9405a93b3815e22 Mon Sep 17 00:00:00 2001 From: kortschak Date: Fri, 27 Oct 2017 13:46:40 +1030 Subject: [PATCH 003/107] blas/netlib: update generated docs --- blas/netlib/blas.go | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/blas/netlib/blas.go b/blas/netlib/blas.go index cbeeaaf4..46e54ca2 100644 --- a/blas/netlib/blas.go +++ b/blas/netlib/blas.go @@ -1365,9 +1365,9 @@ func (Implementation) Zdscal(n int, alpha float64, x []complex128, incX int) { } // Sgemv computes -// y = alpha * a * x + beta * y if tA = blas.NoTrans -// y = alpha * A^T * x + beta * y if tA = blas.Trans or blas.ConjTrans -// where A is an m×n dense matrix, x and y are vectors, and alpha is a scalar. +// y = alpha * A * x + beta * y if tA = blas.NoTrans +// y = alpha * A^T * x + beta * y if tA = blas.Trans or blas.ConjTrans +// where A is an m×n dense matrix, x and y are vectors, and alpha and beta are scalars. func (Implementation) Sgemv(tA blas.Transpose, m, n int, alpha float32, a []float32, lda int, x []float32, incX int, beta float32, y []float32, incY int) { // declared at cblas.h:171:6 void cblas_sgemv ... @@ -1738,9 +1738,9 @@ func (Implementation) Stpsv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, } // Dgemv computes -// y = alpha * a * x + beta * y if tA = blas.NoTrans -// y = alpha * A^T * x + beta * y if tA = blas.Trans or blas.ConjTrans -// where A is an m×n dense matrix, x and y are vectors, and alpha is a scalar. +// y = alpha * A * x + beta * y if tA = blas.NoTrans +// y = alpha * A^T * x + beta * y if tA = blas.Trans or blas.ConjTrans +// where A is an m×n dense matrix, x and y are vectors, and alpha and beta are scalars. func (Implementation) Dgemv(tA blas.Transpose, m, n int, alpha float64, a []float64, lda int, x []float64, incX int, beta float64, y []float64, incY int) { // declared at cblas.h:204:6 void cblas_dgemv ... @@ -2434,6 +2434,11 @@ func (Implementation) Ctpsv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, C.cblas_ctpsv(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.enum_CBLAS_TRANSPOSE(tA), C.enum_CBLAS_DIAG(d), C.int(n), unsafe.Pointer(_ap), unsafe.Pointer(_x), C.int(incX)) } +// Zgemv performs one of the matrix-vector operations +// y = alpha * A * x + beta * y if trans = blas.NoTrans +// y = alpha * A^T * x + beta * y if trans = blas.Trans +// y = alpha * A^H * x + beta * y if trans = blas.ConjTrans +// where alpha and beta are scalars, x and y are vectors, and A is an m×n dense matrix. func (Implementation) Zgemv(tA blas.Transpose, m, n int, alpha complex128, a []complex128, lda int, x []complex128, incX int, beta complex128, y []complex128, incY int) { // declared at cblas.h:270:6 void cblas_zgemv ... @@ -3767,6 +3772,11 @@ func (Implementation) Chpr2(ul blas.Uplo, n int, alpha complex64, x []complex64, C.cblas_chpr2(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.int(n), unsafe.Pointer(&alpha), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(_y), C.int(incY), unsafe.Pointer(_ap)) } +// Zhemv performs the matrix-vector operation +// y = alpha * A * x + beta * y +// where alpha and beta are scalars, x and y are vectors, and A is an n×n +// Hermitian matrix. The imaginary parts of the diagonal elements of A are +// ignored and assumed to be zero. func (Implementation) Zhemv(ul blas.Uplo, n int, alpha complex128, a []complex128, lda int, x []complex128, incX int, beta complex128, y []complex128, incY int) { // declared at cblas.h:400:6 void cblas_zhemv ... From 54218160c46ed0983225c17ce23f665ea26ad211 Mon Sep 17 00:00:00 2001 From: kortschak Date: Wed, 6 Dec 2017 11:19:43 +1030 Subject: [PATCH 004/107] travis: update testing matrix --- .travis.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.travis.yml b/.travis.yml index cdbaf63b..0752c235 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,12 @@ go: - 1.7.x - 1.8.x - 1.9.x + - master + +matrix: + fast_finish: true + allow_failures: + - go: master go_import_path: gonum.org/v1/netlib From 06768cd2c2bfce643d343bff31adbb79b972f986 Mon Sep 17 00:00:00 2001 From: Vladimir Chalupecky Date: Tue, 5 Dec 2017 22:20:44 +0100 Subject: [PATCH 005/107] internal/binding: enable anonymous struct fields when parsing This avoids the error binding: failed to parse ["lapacke.h"]: /usr/include/bits/thread-shared-types.h:139:4: unnamed fields not allowed (and 1 more errors) that occurs on Fedora 27. --- internal/binding/binding.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/binding/binding.go b/internal/binding/binding.go index 1b02a4bb..92dda1b2 100644 --- a/internal/binding/binding.go +++ b/internal/binding/binding.go @@ -341,6 +341,7 @@ unsigned long long __builtin_bswap64 (unsigned long long x); model(), cc.IncludePaths(includePaths), cc.SysIncludePaths(sysIncludePaths), + cc.EnableAnonymousStructFields(), ) if err != nil { return nil, fmt.Errorf("binding: failed to parse %q: %v", paths, err) From 89d8312aee77cba4fbfe58d7a695a4406bae5aed Mon Sep 17 00:00:00 2001 From: Vladimir Chalupecky Date: Tue, 5 Dec 2017 22:24:22 +0100 Subject: [PATCH 006/107] internal/binding: fix a typo --- internal/binding/binding.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/binding/binding.go b/internal/binding/binding.go index 92dda1b2..2d8222a0 100644 --- a/internal/binding/binding.go +++ b/internal/binding/binding.go @@ -320,7 +320,7 @@ func (d *Declaration) Parameters() []Parameter { return p } -// Declarations returns the C function declarations in the givel set of file paths. +// Declarations returns the C function declarations in the given set of file paths. func Declarations(paths ...string) ([]Declaration, error) { predefined, includePaths, sysIncludePaths, err := cc.HostConfig() if err != nil { From cb1b26b0032867f8d49abb664967d9bf84230419 Mon Sep 17 00:00:00 2001 From: kortschak Date: Thu, 7 Dec 2017 11:45:49 +1030 Subject: [PATCH 007/107] travis: wait longer for OpenBLAS build --- .travis.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0752c235..0891d87c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,11 +9,6 @@ go: - 1.9.x - master -matrix: - fast_finish: true - allow_failures: - - go: master - go_import_path: gonum.org/v1/netlib os: @@ -30,6 +25,9 @@ env: #- BLAS_LIB=Accellerate matrix: + fast_finish: true + allow_failures: + - go: master exclude: - os: linux env: BLAS_LIB=Accelerate @@ -47,7 +45,7 @@ cache: # Install the appropriate blas library (if any) and associated gonum software. install: - - source ${TRAVIS_BUILD_DIR}/.travis/$TRAVIS_OS_NAME/$BLAS_LIB/install.sh + - travis_wait 20 source ${TRAVIS_BUILD_DIR}/.travis/$TRAVIS_OS_NAME/$BLAS_LIB/install.sh script: - source ${TRAVIS_BUILD_DIR}/.travis/$TRAVIS_OS_NAME/$BLAS_LIB/test.sh From 0c948787021673557422ac1400cf752df0f087de Mon Sep 17 00:00:00 2001 From: kortschak Date: Thu, 7 Dec 2017 11:56:48 +1030 Subject: [PATCH 008/107] travis: restore output of OpenBLAS version during build --- .travis/linux/OpenBLAS/install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis/linux/OpenBLAS/install.sh b/.travis/linux/OpenBLAS/install.sh index 3ec75525..74981ced 100644 --- a/.travis/linux/OpenBLAS/install.sh +++ b/.travis/linux/OpenBLAS/install.sh @@ -29,6 +29,7 @@ if [ ! -e ${CACHE_DIR}/last_commit_id ]; then sudo git clone --depth=1 git://github.com/xianyi/OpenBLAS pushd OpenBLAS + echo OpenBLAS version:$(git rev-parse HEAD) sudo make FC=gfortran &> /dev/null && sudo make PREFIX=${CACHE_DIR} install popd From eb67595f573b1b4e2ad9457cd120d6c809f483f6 Mon Sep 17 00:00:00 2001 From: kortschak Date: Thu, 7 Dec 2017 12:30:24 +1030 Subject: [PATCH 009/107] travis: ensure go test knows where cgo libs are --- .travis/linux/OpenBLAS/test.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis/linux/OpenBLAS/test.sh b/.travis/linux/OpenBLAS/test.sh index 50c7cc45..1a9378f7 100644 --- a/.travis/linux/OpenBLAS/test.sh +++ b/.travis/linux/OpenBLAS/test.sh @@ -2,6 +2,7 @@ set -ex go env go get -d -t -v ./... +export CGO_LDFLAGS="-L/usr/lib -lopenblas" go test -a -v ./... if [[ $TRAVIS_SECURE_ENV_VARS = "true" ]]; then bash -c "$GOPATH/src/gonum.org/v1/netlib/.travis/test-coverage.sh"; fi From 9f546bb272f19e95bf1f732bd59216194a03a136 Mon Sep 17 00:00:00 2001 From: kortschak Date: Thu, 7 Dec 2017 16:42:43 +1030 Subject: [PATCH 010/107] blas/netlib: regenerate comments --- blas/netlib/blas.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/blas/netlib/blas.go b/blas/netlib/blas.go index 46e54ca2..59661b0f 100644 --- a/blas/netlib/blas.go +++ b/blas/netlib/blas.go @@ -2541,6 +2541,11 @@ func (Implementation) Zgbmv(tA blas.Transpose, m, n, kL, kU int, alpha complex12 C.cblas_zgbmv(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_TRANSPOSE(tA), C.int(m), C.int(n), C.int(kL), C.int(kU), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(&beta), unsafe.Pointer(_y), C.int(incY)) } +// Ztrmv performs one of the matrix-vector operations +// x = A * x if trans = blas.NoTrans +// x = A^T * x if trans = blas.Trans +// x = A^H * x if trans = blas.ConjTrans +// where x is a vector, and A is an n×n triangular matrix. func (Implementation) Ztrmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, a []complex128, lda int, x []complex128, incX int) { // declared at cblas.h:280:6 void cblas_ztrmv ... @@ -2652,6 +2657,17 @@ func (Implementation) Ztpmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, C.cblas_ztpmv(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.enum_CBLAS_TRANSPOSE(tA), C.enum_CBLAS_DIAG(d), C.int(n), unsafe.Pointer(_ap), unsafe.Pointer(_x), C.int(incX)) } +// Ztrsv solves one of the systems of equations +// A*x = b if trans == blas.NoTrans, +// A^T*x = b, if trans == blas.Trans, +// A^H*x = b, if trans == blas.ConjTrans, +// where b and x are n element vectors and A is an n×n triangular matrix. +// +// On entry, x contains the values of b, and the solution is +// stored in-place into x. +// +// No test for singularity or near-singularity is included in this +// routine. Such tests must be performed before calling this routine. func (Implementation) Ztrsv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, a []complex128, lda int, x []complex128, incX int) { // declared at cblas.h:291:6 void cblas_ztrsv ... From fdc5c407cfff79d1848b45fe32b7992f2169b4c5 Mon Sep 17 00:00:00 2001 From: kortschak Date: Fri, 8 Dec 2017 10:37:11 +1030 Subject: [PATCH 011/107] README: update and clean-up front page documentation --- README.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4fb32b6b..61180ec0 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Wrapper packages providing an interface to the NETLIB C BLAS and LAPACKE impleme ## Installation ``` - go get gonum.org/v1/netlib/... + go get -d gonum.org/v1/netlib/... ``` @@ -17,9 +17,13 @@ Install OpenBLAS: make ``` -Then install the lapack/cgo package: +Then install the CGO BLAS wrapper package: ```sh - CGO_LDFLAGS="-L/path/to/OpenBLAS -lopenblas" go install github.com/gonum/lapack/cgo + CGO_LDFLAGS="-L/path/to/OpenBLAS -lopenblas" go install gonum.org/v1/netlib/blas/netlib +``` +or the CGO LAPACKE wrapper package: +```sh + CGO_LDFLAGS="-L/path/to/OpenBLAS -lopenblas" go install gonum.org/v1/netlib/lapack/netlib ``` For Windows you can download binary packages for OpenBLAS at @@ -33,13 +37,13 @@ adjust the `CGO_LDFLAGS` variable: ## Packages -### blas +### blas/netlib Binding to a C implementation of the cblas interface (e.g. ATLAS, OpenBLAS, Intel MKL) The recommended (free) option for good performance on both Linux and Darwin is OpenBLAS. -### lapack +### lapack/netlib Binding to a C implementation of the lapacke interface (e.g. ATLAS, OpenBLAS, Intel MKL) From 0167ac88c4a455d88806bc90acaed30ec77ee725 Mon Sep 17 00:00:00 2001 From: kortschak Date: Fri, 8 Dec 2017 10:39:22 +1030 Subject: [PATCH 012/107] travis: do not install NETLIB CBLAS when installing OpenBLAS --- .travis/linux/OpenBLAS/install.sh | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/.travis/linux/OpenBLAS/install.sh b/.travis/linux/OpenBLAS/install.sh index 74981ced..244948fc 100644 --- a/.travis/linux/OpenBLAS/install.sh +++ b/.travis/linux/OpenBLAS/install.sh @@ -31,21 +31,8 @@ if [ ! -e ${CACHE_DIR}/last_commit_id ]; then pushd OpenBLAS echo OpenBLAS version:$(git rev-parse HEAD) sudo make FC=gfortran &> /dev/null && sudo make PREFIX=${CACHE_DIR} install - popd - - curl http://www.netlib.org/blas/blast-forum/cblas.tgz | tar -zx - - pushd CBLAS - sudo mv Makefile.LINUX Makefile.in - sudo BLLIB=${CACHE_DIR}/lib/libopenblas.a make alllib - sudo mv lib/cblas_LINUX.a ${CACHE_DIR}/lib/libcblas.a - popd - - # Record commit id used to generate cache. - pushd OpenBLAS echo $(git rev-parse HEAD) > ${CACHE_DIR}/last_commit_id popd - fi # copy the cache files into /usr From 763c2d35f84f5203d30dd463a18c013d9eb831b7 Mon Sep 17 00:00:00 2001 From: Vladimir Chalupecky Date: Fri, 8 Dec 2017 11:52:37 +0100 Subject: [PATCH 013/107] blas/netlib: enable tests for complex128 BLAS level 1 functions --- blas/netlib/level1cmplx128_test.go | 51 ++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 blas/netlib/level1cmplx128_test.go diff --git a/blas/netlib/level1cmplx128_test.go b/blas/netlib/level1cmplx128_test.go new file mode 100644 index 00000000..7cb4ae0c --- /dev/null +++ b/blas/netlib/level1cmplx128_test.go @@ -0,0 +1,51 @@ +// Copyright ©2017 The Gonum Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package netlib + +import ( + "testing" + + "gonum.org/v1/gonum/blas/testblas" +) + +func TestDzasum(t *testing.T) { + testblas.DzasumTest(t, impl) +} + +func TestDznrm2(t *testing.T) { + testblas.Dznrm2Test(t, impl) +} + +func TestIzamax(t *testing.T) { + testblas.IzamaxTest(t, impl) +} + +func TestZaxpy(t *testing.T) { + testblas.ZaxpyTest(t, impl) +} + +func TestZcopy(t *testing.T) { + testblas.ZcopyTest(t, impl) +} + +func TestZdotc(t *testing.T) { + testblas.ZdotcTest(t, impl) +} + +func TestZdotu(t *testing.T) { + testblas.ZdotuTest(t, impl) +} + +func TestZdscal(t *testing.T) { + testblas.ZdscalTest(t, impl) +} + +func TestZscal(t *testing.T) { + testblas.ZscalTest(t, impl) +} + +func TestZswap(t *testing.T) { + testblas.ZswapTest(t, impl) +} From 36010b25f9fec4b27743e3330af727ccba16fdf5 Mon Sep 17 00:00:00 2001 From: Vladimir Chalupecky Date: Fri, 8 Dec 2017 11:53:08 +0100 Subject: [PATCH 014/107] blas/netlib: enable tests for complex128 BLAS level 2 functions --- blas/netlib/level2cmplx128_test.go | 47 ++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 blas/netlib/level2cmplx128_test.go diff --git a/blas/netlib/level2cmplx128_test.go b/blas/netlib/level2cmplx128_test.go new file mode 100644 index 00000000..6d9b880b --- /dev/null +++ b/blas/netlib/level2cmplx128_test.go @@ -0,0 +1,47 @@ +// Copyright ©2017 The Gonum Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package netlib + +import ( + "testing" + + "gonum.org/v1/gonum/blas/testblas" +) + +func TestZgemv(t *testing.T) { + testblas.ZgemvTest(t, impl) +} + +func TestZgerc(t *testing.T) { + testblas.ZgercTest(t, impl) +} + +func TestZgeru(t *testing.T) { + testblas.ZgeruTest(t, impl) +} + +func TestZhemv(t *testing.T) { + testblas.ZhemvTest(t, impl) +} + +func TestZher(t *testing.T) { + testblas.ZherTest(t, impl) +} + +func TestZher2(t *testing.T) { + testblas.Zher2Test(t, impl) +} + +func TestZhpr(t *testing.T) { + testblas.ZhprTest(t, impl) +} + +func TestZtrmv(t *testing.T) { + testblas.ZtrmvTest(t, impl) +} + +func TestZtrsv(t *testing.T) { + testblas.ZtrsvTest(t, impl) +} From c034b9e26ce72cf898f7e8db6fdf3eeb0ac53d40 Mon Sep 17 00:00:00 2001 From: Vladimir Chalupecky Date: Fri, 8 Dec 2017 11:55:01 +0100 Subject: [PATCH 015/107] blas/netlib: generate docs for Zhpr --- blas/netlib/blas.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/blas/netlib/blas.go b/blas/netlib/blas.go index 59661b0f..9fb55e07 100644 --- a/blas/netlib/blas.go +++ b/blas/netlib/blas.go @@ -4036,6 +4036,11 @@ func (Implementation) Zher(ul blas.Uplo, n int, alpha float64, x []complex128, i C.cblas_zher(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.int(n), C.double(alpha), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(_a), C.int(lda)) } +// Zhpr performs the Hermitian rank-1 operation +// A += alpha * x * x^H, +// where alpha is a real scalar, x is a vector, and A is an n×n hermitian matrix +// in packed form. On entry, the imaginary parts of the diagonal elements are +// assumed to be zero, and on return they are set to zero. func (Implementation) Zhpr(ul blas.Uplo, n int, alpha float64, x []complex128, incX int, ap []complex128) { // declared at cblas.h:421:6 void cblas_zhpr ... From bf658f3ea12ce25d39a6dd85a81c23a1ee79e553 Mon Sep 17 00:00:00 2001 From: Vladimir Chalupecky Date: Wed, 13 Dec 2017 23:48:09 +0100 Subject: [PATCH 016/107] blas/netlib: generate comment for Zhpr2 --- blas/netlib/blas.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/blas/netlib/blas.go b/blas/netlib/blas.go index 9fb55e07..a314e8e1 100644 --- a/blas/netlib/blas.go +++ b/blas/netlib/blas.go @@ -4117,6 +4117,11 @@ func (Implementation) Zher2(ul blas.Uplo, n int, alpha complex128, x []complex12 C.cblas_zher2(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.int(n), unsafe.Pointer(&alpha), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(_y), C.int(incY), unsafe.Pointer(_a), C.int(lda)) } +// Zhpr2 performs the Hermitian rank-2 operation +// A += alpha*x*y^H + conj(alpha)*y*x^H, +// where alpha is a complex scalar, x and y are n element vectors, and A is an +// n×n Hermitian matrix, supplied in packed form. On entry, the imaginary parts +// of the diagonal elements are assumed to be zero, and on return they are set to zero. func (Implementation) Zhpr2(ul blas.Uplo, n int, alpha complex128, x []complex128, incX int, y []complex128, incY int, ap []complex128) { // declared at cblas.h:427:6 void cblas_zhpr2 ... From c73ff28633b449299f0728d2e5729395c625554a Mon Sep 17 00:00:00 2001 From: Vladimir Chalupecky Date: Wed, 13 Dec 2017 23:48:38 +0100 Subject: [PATCH 017/107] blas/netlib: enable test for Zhpr2 --- blas/netlib/level2cmplx128_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/blas/netlib/level2cmplx128_test.go b/blas/netlib/level2cmplx128_test.go index 6d9b880b..bfa6edc0 100644 --- a/blas/netlib/level2cmplx128_test.go +++ b/blas/netlib/level2cmplx128_test.go @@ -38,6 +38,10 @@ func TestZhpr(t *testing.T) { testblas.ZhprTest(t, impl) } +func TestZhpr2(t *testing.T) { + testblas.Zhpr2Test(t, impl) +} + func TestZtrmv(t *testing.T) { testblas.ZtrmvTest(t, impl) } From 3a9a1943bbb53135fd0e5002b7d6c0b5e4b4c93a Mon Sep 17 00:00:00 2001 From: Vladimir Chalupecky Date: Thu, 14 Dec 2017 11:04:19 +0100 Subject: [PATCH 018/107] travis: remove unnecessary sudo when installing OpenBLAS at Linux --- .travis/linux/OpenBLAS/install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis/linux/OpenBLAS/install.sh b/.travis/linux/OpenBLAS/install.sh index 244948fc..ee74f96d 100644 --- a/.travis/linux/OpenBLAS/install.sh +++ b/.travis/linux/OpenBLAS/install.sh @@ -26,11 +26,11 @@ if [ ! -e ${CACHE_DIR}/last_commit_id ]; then # cache generation echo "Building cache at $CACHE_DIR" mkdir ${CACHE_DIR} - sudo git clone --depth=1 git://github.com/xianyi/OpenBLAS + git clone --depth=1 git://github.com/xianyi/OpenBLAS pushd OpenBLAS echo OpenBLAS version:$(git rev-parse HEAD) - sudo make FC=gfortran &> /dev/null && sudo make PREFIX=${CACHE_DIR} install + make FC=gfortran &> /dev/null && make PREFIX=${CACHE_DIR} install echo $(git rev-parse HEAD) > ${CACHE_DIR}/last_commit_id popd fi From e672cacbdac92a4434c3c208c70543f669dc0be5 Mon Sep 17 00:00:00 2001 From: Vladimir Chalupecky Date: Thu, 14 Dec 2017 11:28:29 +0100 Subject: [PATCH 019/107] blas/netlib: generate comment for Zhpmv --- blas/netlib/blas.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/blas/netlib/blas.go b/blas/netlib/blas.go index a314e8e1..daca0e64 100644 --- a/blas/netlib/blas.go +++ b/blas/netlib/blas.go @@ -3874,6 +3874,11 @@ func (Implementation) Zhbmv(ul blas.Uplo, n, k int, alpha complex128, a []comple C.cblas_zhbmv(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.int(n), C.int(k), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(&beta), unsafe.Pointer(_y), C.int(incY)) } +// Zhpmv performs the matrix-vector operation +// y = alpha * A * x + beta * y +// where alpha and beta are scalars, x and y are vectors, and A is an n×n +// Hermitian matrix in packed form. The imaginary parts of the diagonal +// elements of A are ignored and assumed to be zero. func (Implementation) Zhpmv(ul blas.Uplo, n int, alpha complex128, ap, x []complex128, incX int, beta complex128, y []complex128, incY int) { // declared at cblas.h:408:6 void cblas_zhpmv ... From 942a909d26bccdbfe94f2dd207bd7327b12cdef8 Mon Sep 17 00:00:00 2001 From: Vladimir Chalupecky Date: Fri, 12 Jan 2018 12:24:09 +0100 Subject: [PATCH 020/107] blas/netlib: generate comment for Ztpmv --- blas/netlib/blas.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/blas/netlib/blas.go b/blas/netlib/blas.go index daca0e64..b2311e75 100644 --- a/blas/netlib/blas.go +++ b/blas/netlib/blas.go @@ -2619,6 +2619,12 @@ func (Implementation) Ztbmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n, k i C.cblas_ztbmv(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.enum_CBLAS_TRANSPOSE(tA), C.enum_CBLAS_DIAG(d), C.int(n), C.int(k), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_x), C.int(incX)) } +// Ztpmv performs one of the matrix-vector operations +// x = A * x if trans = blas.NoTrans +// x = A^T * x if trans = blas.Trans +// x = A^H * x if trans = blas.ConjTrans +// where x is an n element vector and A is an n×n triangular matrix, supplied in +// packed form. func (Implementation) Ztpmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, ap, x []complex128, incX int) { // declared at cblas.h:288:6 void cblas_ztpmv ... From 705f31626b459aba626a0a72714a4dde0f756b9a Mon Sep 17 00:00:00 2001 From: Vladimir Chalupecky Date: Fri, 12 Jan 2018 12:35:39 +0100 Subject: [PATCH 021/107] blas/netlib: enable test for Zhpmv --- blas/netlib/level2cmplx128_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/blas/netlib/level2cmplx128_test.go b/blas/netlib/level2cmplx128_test.go index bfa6edc0..393fd5af 100644 --- a/blas/netlib/level2cmplx128_test.go +++ b/blas/netlib/level2cmplx128_test.go @@ -34,6 +34,10 @@ func TestZher2(t *testing.T) { testblas.Zher2Test(t, impl) } +func TestZhpmv(t *testing.T) { + testblas.ZhpmvTest(t, impl) +} + func TestZhpr(t *testing.T) { testblas.ZhprTest(t, impl) } From 7b8918779da707ca0287f51966700def32437554 Mon Sep 17 00:00:00 2001 From: Vladimir Chalupecky Date: Fri, 12 Jan 2018 12:35:50 +0100 Subject: [PATCH 022/107] blas/netlib: enable test for Ztpmv --- blas/netlib/level2cmplx128_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/blas/netlib/level2cmplx128_test.go b/blas/netlib/level2cmplx128_test.go index 393fd5af..40df84c9 100644 --- a/blas/netlib/level2cmplx128_test.go +++ b/blas/netlib/level2cmplx128_test.go @@ -46,6 +46,10 @@ func TestZhpr2(t *testing.T) { testblas.Zhpr2Test(t, impl) } +func TestZtpmv(t *testing.T) { + testblas.ZtpmvTest(t, impl) +} + func TestZtrmv(t *testing.T) { testblas.ZtrmvTest(t, impl) } From 4a317e9799436b6b82722e749bfa000546c4cd1d Mon Sep 17 00:00:00 2001 From: Dan Kortschak Date: Wed, 21 Feb 2018 12:52:50 +1030 Subject: [PATCH 023/107] github: add issue and pull request templates --- .github/ISSUE_TEMPLATE | 31 +++++++++++++++++++++++++++++++ .github/PULL_REQUEST_TEMPLATE | 16 ++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE create mode 100644 .github/PULL_REQUEST_TEMPLATE diff --git a/.github/ISSUE_TEMPLATE b/.github/ISSUE_TEMPLATE new file mode 100644 index 00000000..1ad0889e --- /dev/null +++ b/.github/ISSUE_TEMPLATE @@ -0,0 +1,31 @@ + +### What are you trying to do? + + +### What did you do? + + + +### What did you expect to happen? + + +### What actually happened? + + +### What version of Go, Gonum and C implementation are you using? + + + +### Does this issue reproduce with the current master? + diff --git a/.github/PULL_REQUEST_TEMPLATE b/.github/PULL_REQUEST_TEMPLATE new file mode 100644 index 00000000..7ca2a15f --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE @@ -0,0 +1,16 @@ +Please take a look. + + From 1f4b37356e2019fc69c5e6f39f1755d93442c485 Mon Sep 17 00:00:00 2001 From: Dan Kortschak Date: Fri, 23 Feb 2018 10:52:41 +1030 Subject: [PATCH 024/107] github: ask for netlib version too --- .github/ISSUE_TEMPLATE | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE b/.github/ISSUE_TEMPLATE index 1ad0889e..63523b35 100644 --- a/.github/ISSUE_TEMPLATE +++ b/.github/ISSUE_TEMPLATE @@ -20,10 +20,11 @@ https://groups.google.com/forum/#!forum/gonum-dev ### What actually happened? -### What version of Go, Gonum and C implementation are you using? +### What version of Go, Gonum, Gonum/netlib and C implementation are you using? From 2314d7fc96148ef01adb6de6911b68ce0669f694 Mon Sep 17 00:00:00 2001 From: Dan Kortschak Date: Mon, 19 Feb 2018 10:04:00 +1030 Subject: [PATCH 025/107] travis: add go-1.10.x --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0891d87c..e67d0ba8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,9 +4,9 @@ language: go # Versions of go that are explicitly supported by gonum. go: - - 1.7.x - 1.8.x - 1.9.x + - 1.10.x - master go_import_path: gonum.org/v1/netlib From 11eb90b46a50714845e499815463382785e1a1e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Chalupeck=C3=BD?= Date: Thu, 1 Mar 2018 18:58:38 +0100 Subject: [PATCH 026/107] Update ISSUE_TEMPLATE --- .github/ISSUE_TEMPLATE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE b/.github/ISSUE_TEMPLATE index 63523b35..2b78c008 100644 --- a/.github/ISSUE_TEMPLATE +++ b/.github/ISSUE_TEMPLATE @@ -1,5 +1,5 @@