diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 00000000..0360b00f --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,2 @@ +fixes: + - "src/gonum.org/v1/netlib/::" diff --git a/.github/ISSUE_TEMPLATE b/.github/ISSUE_TEMPLATE new file mode 100644 index 00000000..2b78c008 --- /dev/null +++ b/.github/ISSUE_TEMPLATE @@ -0,0 +1,32 @@ + +### What are you trying to do? + + +### What did you do? + + + +### What did you expect to happen? + + +### What actually happened? + + +### What version of Go, Gonum, Gonum/netlib 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. + + diff --git a/.github/workflows/check-copyright.sh b/.github/workflows/check-copyright.sh new file mode 100755 index 00000000..209dca39 --- /dev/null +++ b/.github/workflows/check-copyright.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +set -e +check-copyright -notice "Copyright ©20[0-9]{2} The Gonum Authors\. All rights reserved\." diff --git a/.github/workflows/check-formatting.sh b/.github/workflows/check-formatting.sh new file mode 100755 index 00000000..63445546 --- /dev/null +++ b/.github/workflows/check-formatting.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +test -z "$(goimports -d .)" +if [[ -n "$(gofmt -s -l .)" ]]; then + echo -e '\e[31mCode not gofmt simplified in:\n\n' + gofmt -s -l . + echo -e "\e[0" +fi diff --git a/.github/workflows/check-generate.sh b/.github/workflows/check-generate.sh new file mode 100755 index 00000000..d18fe820 --- /dev/null +++ b/.github/workflows/check-generate.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -ex + +go generate gonum.org/v1/netlib/blas/netlib +go generate gonum.org/v1/netlib/lapack/lapacke +go generate gonum.org/v1/netlib/lapack/netlib + +git checkout -- go.{mod,sum} +if [ -n "$(git diff)" ]; then + git diff + exit 1 +fi diff --git a/.github/workflows/check-imports.sh b/.github/workflows/check-imports.sh new file mode 100755 index 00000000..f88fc5ab --- /dev/null +++ b/.github/workflows/check-imports.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +set -e +check-imports -b "math/rand,github.com/gonum/.*" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..71d2c0ba --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,83 @@ +name: CI + +on: + pull_request: + branches: [ master ] + +jobs: + + build: + name: Build + strategy: + matrix: + go-version: [1.20.x, 1.19.x] + platform: [ubuntu-latest] + + runs-on: ${{ matrix.platform }} + env: + GO111MODULE: on + GOPATH: ${{ github.workspace }} + CGO_LDFLAGS: "-L/usr/lib -lopenblas" + defaults: + run: + working-directory: ${{ env.GOPATH }}/src/gonum.org/v1/netlib + + steps: + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + + - name: Cache-Go + uses: actions/cache@v1 + with: + path: | + ~/go/pkg/mod # Module download cache + ~/.cache/go-build # Build cache (Linux) + ~/Library/Caches/go-build # Build cache (Mac) + '%LocalAppData%\go-build' # Build cache (Windows) + ~/.cache/OpenBLAS # OpenBLAS build cache + + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + + - name: Checkout code + uses: actions/checkout@v2 + with: + path: ${{ env.GOPATH }}/src/gonum.org/v1/netlib + + - name: Check copyrights+imports+formatting+generate + if: matrix.platform == 'ubuntu-latest' + run: | + go install golang.org/x/tools/cmd/cover@latest + # Required for format check. + go install golang.org/x/tools/cmd/goimports@latest + # Required for imports check. + go install gonum.org/v1/tools/cmd/check-imports@latest + # Required for copyright header check. + go install gonum.org/v1/tools/cmd/check-copyright@latest + ./.github/workflows/check-copyright.sh + ./.github/workflows/check-formatting.sh + ./.github/workflows/check-generate.sh + ./.github/workflows/check-imports.sh + + - name: Install Dependencies + if: matrix.platform == 'ubuntu-latest' + run: | + sudo apt-get update + sudo apt-get install -qq gfortran + ./.github/workflows/install-openblas.sh + + - name: Test + run: | + ./.github/workflows/test.sh + + - name: Coverage + if: matrix.platform == 'ubuntu-latest' + run: | + ./.github/workflows/test-coverage.sh + + - name: Upload-Coverage + if: matrix.platform == 'ubuntu-latest' + uses: codecov/codecov-action@v1 diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml new file mode 100644 index 00000000..8ed82c72 --- /dev/null +++ b/.github/workflows/codecov.yml @@ -0,0 +1,68 @@ +name: Codecov + +on: + pull_request: + branches: [ master ] + types: + - closed + +jobs: + + build: + name: Build + if: github.event.pull_request.merged == true + strategy: + matrix: + go-version: [1.18.x, 1.17.x] + platform: [ubuntu-latest] + + runs-on: ${{ matrix.platform }} + env: + GO111MODULE: on + GOPATH: ${{ github.workspace }} + CGO_LDFLAGS: "-L/usr/lib -lopenblas" + defaults: + run: + working-directory: ${{ env.GOPATH }}/src/gonum.org/v1/netlib + + steps: + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + + - name: Cache-Go + uses: actions/cache@v1 + with: + path: | + ~/go/pkg/mod # Module download cache + ~/.cache/go-build # Build cache (Linux) + ~/Library/Caches/go-build # Build cache (Mac) + '%LocalAppData%\go-build' # Build cache (Windows) + ~/.cache/OpenBLAS # OpenBLAS build cache + + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + + - name: Checkout code + uses: actions/checkout@v2 + with: + path: ${{ env.GOPATH }}/src/gonum.org/v1/netlib + + - name: Install Dependencies + if: matrix.platform == 'ubuntu-latest' + run: | + sudo apt-get update + sudo apt-get install -qq gfortran + go install golang.org/x/tools/cmd/cover@latest + ./.github/workflows/install-openblas.sh + + - name: Coverage + if: matrix.platform == 'ubuntu-latest' + run: | + ./.github/workflows/test-coverage.sh + + - name: Upload-Coverage + if: matrix.platform == 'ubuntu-latest' + uses: codecov/codecov-action@v1 diff --git a/.github/workflows/install-openblas.sh b/.github/workflows/install-openblas.sh new file mode 100755 index 00000000..eb6bd9e6 --- /dev/null +++ b/.github/workflows/install-openblas.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +set -ex + +CACHE_DIR="/home/runner/.cache/OpenBLAS" +mkdir -p ${CACHE_DIR} + +# check if cache exists +if [ -e ${CACHE_DIR}/last_commit_id ]; then + echo "Cache $CACHE_DIR hit" + LAST_COMMIT="$(git ls-remote https://github.com/xianyi/OpenBLAS HEAD | grep -o '^\S*')" + CACHED_COMMIT="$(cat ${CACHE_DIR}/last_commit_id)" + # determine current OpenBLAS master commit id and compare + # with commit id in cache directory + if [ "$LAST_COMMIT" != "$CACHED_COMMIT" ]; then + echo "Cache Directory $CACHE_DIR has stale commit" + # if commit is different, delete the cache + rm -rf ${CACHE_DIR}/* + fi +fi + +if [ ! -e ${CACHE_DIR}/last_commit_id ]; then + # Clear cache. + rm -rf ${CACHE_DIR}/* + + # cache generation + echo "Building cache at $CACHE_DIR" + git clone --depth=1 https://github.com/xianyi/OpenBLAS + + pushd OpenBLAS + make FC=gfortran &> /dev/null && make PREFIX=${CACHE_DIR} install + echo $(git rev-parse HEAD) > ${CACHE_DIR}/last_commit_id + popd +fi + +# Instrument the build state +echo OpenBLAS version:$(cat ${CACHE_DIR}/last_commit_id) +cat /proc/cpuinfo + +# copy the cache files into /usr +sudo cp -r ${CACHE_DIR}/* /usr/ + +# install gonum/blas against OpenBLAS +export CGO_LDFLAGS="-L/usr/lib -lopenblas" +go get -v -x gonum.org/v1/netlib/... diff --git a/.github/workflows/test-coverage.sh b/.github/workflows/test-coverage.sh new file mode 100755 index 00000000..693fd3f5 --- /dev/null +++ b/.github/workflows/test-coverage.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +MODE=set +PROFILE_OUT="${PWD}/profile.out" +ACC_OUT="${PWD}/coverage.txt" + +testCover() { + # set the return value to 0 (successful) + retval=0 + # get the directory to check from the parameter. Default to '.' + d=${1:-.} + # skip if there are no Go files here + ls $d/*.go &> /dev/null || return $retval + # switch to the directory to check + pushd $d > /dev/null + # create the coverage profile + coverageresult=$(go test -coverprofile="${PROFILE_OUT}" -covermode=${MODE}) + # output the result so we can check the shell output + echo ${coverageresult} + # append the results to acc.out if coverage didn't fail, else set the retval to 1 (failed) + ( [[ ${coverageresult} == *FAIL* ]] && retval=1 ) || ( [ -f "${PROFILE_OUT}" ] && grep -v "mode: ${MODE}" "${PROFILE_OUT}" >> "${ACC_OUT}" ) + # return to our working dir + popd > /dev/null + # return our return value + return $retval +} + +# Init coverage.txt +echo "mode: ${MODE}" > $ACC_OUT + +# Run test coverage on all directories containing go files. +find . -type d | while read d; do testCover $d || exit; done diff --git a/.github/workflows/test.sh b/.github/workflows/test.sh new file mode 100755 index 00000000..0ecd0a8a --- /dev/null +++ b/.github/workflows/test.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +set -ex + +go env +export CGO_LDFLAGS="-L/usr/lib -lopenblas" +go test -a -v ./... diff --git a/.travis.yml b/.travis.yml index 270b3815..505adc7a 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.16.x + - 1.15.x + - master go_import_path: gonum.org/v1/netlib @@ -15,7 +15,9 @@ os: - osx env: - matrix: + global: + - GO111MODULE=on + matrix: - BLAS_LIB=OpenBLAS # Does not currently link correctly. Note that there is an issue with drotgm in ATLAS. # - BLAS_LIB=ATLAS @@ -23,7 +25,20 @@ env: # There are some issues with the Accellerate implementation. #- BLAS_LIB=Accellerate +cache: + directories: + - $HOME/.cache/go-build + - $HOME/gopath/pkg/mod + # Persist the compiled OpenBLAS library between CI calls. + - .travis/OpenBLAS.cache + +git: + depth: 1 + matrix: + fast_finish: true + allow_failures: + - go: master exclude: - os: linux env: BLAS_LIB=Accelerate @@ -34,17 +49,22 @@ matrix: - os: osx env: BLAS_LIB=OpenBLAS -# Cache used to persist the compiled BLAS library between CI calls. -cache: - directories: - - .travis/OpenBLAS.cache +before_install: + # Required for format check. + - go get golang.org/x/tools/cmd/goimports + # Required for imports check. + - go get gonum.org/v1/tools/cmd/check-imports + # Required for copyright header check. + - go get gonum.org/v1/tools/cmd/check-copyright # 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 ${TRAVIS_BUILD_DIR}/.travis/$TRAVIS_OS_NAME/$BLAS_LIB/install.sh script: - - source ${TRAVIS_BUILD_DIR}/.travis/$TRAVIS_OS_NAME/$BLAS_LIB/test.sh - - test -z "$(gofmt -d .)" + - ${TRAVIS_BUILD_DIR}/.travis/check-copyright.sh + - ${TRAVIS_BUILD_DIR}/.travis/check-imports.sh + - ${TRAVIS_BUILD_DIR}/.travis/check-formatting.sh + - ${TRAVIS_BUILD_DIR}/.travis/$TRAVIS_OS_NAME/$BLAS_LIB/test.sh # This is run last since it alters the tree. - ${TRAVIS_BUILD_DIR}/.travis/check-generate.sh diff --git a/.travis/check-copyright.sh b/.travis/check-copyright.sh new file mode 100755 index 00000000..209dca39 --- /dev/null +++ b/.travis/check-copyright.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +set -e +check-copyright -notice "Copyright ©20[0-9]{2} The Gonum Authors\. All rights reserved\." diff --git a/.travis/check-formatting.sh b/.travis/check-formatting.sh new file mode 100755 index 00000000..63445546 --- /dev/null +++ b/.travis/check-formatting.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +test -z "$(goimports -d .)" +if [[ -n "$(gofmt -s -l .)" ]]; then + echo -e '\e[31mCode not gofmt simplified in:\n\n' + gofmt -s -l . + echo -e "\e[0" +fi diff --git a/.travis/check-generate.sh b/.travis/check-generate.sh index 099eefd4..d18fe820 100755 --- a/.travis/check-generate.sh +++ b/.travis/check-generate.sh @@ -3,6 +3,10 @@ set -ex go generate gonum.org/v1/netlib/blas/netlib go generate gonum.org/v1/netlib/lapack/lapacke +go generate gonum.org/v1/netlib/lapack/netlib + +git checkout -- go.{mod,sum} if [ -n "$(git diff)" ]; then + git diff exit 1 fi diff --git a/.travis/check-imports.sh b/.travis/check-imports.sh new file mode 100755 index 00000000..f88fc5ab --- /dev/null +++ b/.travis/check-imports.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +set -e +check-imports -b "math/rand,github.com/gonum/.*" diff --git a/.travis/linux/OpenBLAS/install.sh b/.travis/linux/OpenBLAS/install.sh old mode 100644 new mode 100755 index 3ec75525..5cc0d619 --- a/.travis/linux/OpenBLAS/install.sh +++ b/.travis/linux/OpenBLAS/install.sh @@ -1,3 +1,5 @@ +#!/bin/bash + set -ex CACHE_DIR=${TRAVIS_BUILD_DIR}/.travis/${BLAS_LIB}.cache @@ -26,27 +28,18 @@ 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 - - pushd OpenBLAS - 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 + git clone --depth=1 git://github.com/xianyi/OpenBLAS - # Record commit id used to generate cache. pushd OpenBLAS + make FC=gfortran &> /dev/null && make PREFIX=${CACHE_DIR} install echo $(git rev-parse HEAD) > ${CACHE_DIR}/last_commit_id popd - fi +# Instrument the build state +echo OpenBLAS version:$(cat ${CACHE_DIR}/last_commit_id) +cat /proc/cpuinfo + # copy the cache files into /usr sudo cp -r ${CACHE_DIR}/* /usr/ @@ -56,13 +49,3 @@ go get -v -x gonum.org/v1/netlib/... # run the OS common installation script source ${TRAVIS_BUILD_DIR}/.travis/$TRAVIS_OS_NAME/install.sh - -# travis compiles commands in script and then executes in bash. By adding -# set -e we are changing the travis build script's behavior, and the set -# -e lives on past the commands we are providing it. Some of the travis -# commands are supposed to exit with non zero status, but then continue -# executing. set -x makes the travis log files extremely verbose and -# difficult to understand. -# -# see travis-ci/travis-ci#5120 -set +ex diff --git a/.travis/linux/OpenBLAS/test.sh b/.travis/linux/OpenBLAS/test.sh old mode 100644 new mode 100755 index 50c7cc45..4b68fa33 --- a/.travis/linux/OpenBLAS/test.sh +++ b/.travis/linux/OpenBLAS/test.sh @@ -1,16 +1,9 @@ +#!/bin/bash + 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 - -# travis compiles commands in script and then executes in bash. By adding -# set -e we are changing the travis build script's behavior, and the set -# -e lives on past the commands we are providing it. Some of the travis -# commands are supposed to exit with non zero status, but then continue -# executing. set -x makes the travis log files extremely verbose and -# difficult to understand. -# -# see travis-ci/travis-ci#5120 -set +ex diff --git a/.travis/linux/install.sh b/.travis/linux/install.sh index 66bf73cf..a6dc664e 100644 --- a/.travis/linux/install.sh +++ b/.travis/linux/install.sh @@ -4,13 +4,9 @@ set -ex # prior to more specific installation commands for a particular blas library. go get golang.org/x/tools/cmd/cover go get github.com/mattn/goveralls -go get gonum.org/v1/gonum/blas -go get gonum.org/v1/gonum/lapack -go get gonum.org/v1/gonum/floats # Repositories for code generation. -go get github.com/cznic/cc -go get gonum.org/v1/netlib/internal/binding +go get modernc.org/cc # travis compiles commands in script and then executes in bash. By adding # set -e we are changing the travis build script's behavior, and the set diff --git a/.travis/osx/install.sh b/.travis/osx/install.sh index e0363af2..c37ddcce 100644 --- a/.travis/osx/install.sh +++ b/.travis/osx/install.sh @@ -9,7 +9,7 @@ go get gonum.org/v1/gonum/lapack go get gonum.org/v1/gonum/floats # Repositories for code generation. -go get github.com/cznic/cc +go get modernc.org/cc go get gonum.org/v1/netlib/internal/binding # travis compiles commands in script and then executes in bash. By adding diff --git a/.travis/test-coverage.sh b/.travis/test-coverage.sh index 7df8aa6a..e821b9f3 100755 --- a/.travis/test-coverage.sh +++ b/.travis/test-coverage.sh @@ -1,10 +1,11 @@ #!/bin/bash -PROFILE_OUT=$PWD/profile.out -ACC_OUT=$PWD/acc.out +MODE=set +PROFILE_OUT="${PWD}/profile.out" +ACC_OUT="${PWD}/coverage.txt" testCover() { - # set the return value to 0 (succesful) + # set the return value to 0 (successful) retval=0 # get the directory to check from the parameter. Default to '.' d=${1:-.} @@ -13,23 +14,25 @@ testCover() { # switch to the directory to check pushd $d > /dev/null # create the coverage profile - coverageresult=`go test -v -coverprofile=$PROFILE_OUT` + coverageresult=$(go test $TAGS -coverprofile="${PROFILE_OUT}" -covermode=${MODE}) # output the result so we can check the shell output echo ${coverageresult} # append the results to acc.out if coverage didn't fail, else set the retval to 1 (failed) - ( [[ ${coverageresult} == *FAIL* ]] && retval=1 ) || ( [ -f $PROFILE_OUT ] && grep -v "mode: set" $PROFILE_OUT >> $ACC_OUT ) + ( [[ ${coverageresult} == *FAIL* ]] && retval=1 ) || ( [ -f "${PROFILE_OUT}" ] && grep -v "mode: ${MODE}" "${PROFILE_OUT}" >> "${ACC_OUT}" ) # return to our working dir popd > /dev/null # return our return value return $retval } -# Init acc.out -echo "mode: set" > $ACC_OUT +# Init coverage.txt +echo "mode: ${MODE}" > $ACC_OUT -# Run test coverage on all directories containing go files -find . -maxdepth 10 -type d | while read d; do testCover $d || exit; done +# Run test coverage on all directories containing go files. +find . -type d | while read d; do testCover $d || exit; done # Upload the coverage profile to coveralls.io -[ -n "$COVERALLS_TOKEN" ] && goveralls -coverprofile=$ACC_OUT -service=travis-ci -repotoken $COVERALLS_TOKEN +[ -n "$COVERALLS_TOKEN" ] && ( goveralls -coverprofile=$ACC_OUT || echo -e '\n\e[31mCoveralls failed.\n' ) +# Upload to coverage profile to codedov.io +[ -n "$CODECOV_TOKEN" ] && ( bash <(curl -s https://codecov.io/bash) || echo -e '\n\e[31mCodecov failed.\n' ) diff --git a/README.md b/README.md index 4fb32b6b..fe096f54 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Gonum NETLIB [![Build Status](https://travis-ci.org/gonum/netlib.svg?branch=master)](https://travis-ci.org/gonum/netlib) [![Coverage Status](https://coveralls.io/repos/gonum/netlib/badge.svg?branch=master&service=github)](https://coveralls.io/github/gonum/netlib?branch=master) [![GoDoc](https://godoc.org/gonum.org/v1/netlib?status.svg)](https://godoc.org/gonum.org/v1/netlib) +Gonum NETLIB [![Build Status](https://travis-ci.org/gonum/netlib.svg?branch=master)](https://travis-ci.org/gonum/netlib) [![codecov.io](https://codecov.io/gh/gonum/netlib/branch/master/graph/badge.svg)](https://codecov.io/gh/gonum/netlib) [![coveralls.io](https://coveralls.io/repos/gonum/netlib/badge.svg?branch=master&service=github)](https://coveralls.io/github/gonum/netlib?branch=master) [![GoDoc](https://godoc.org/gonum.org/v1/netlib?status.svg)](https://godoc.org/gonum.org/v1/netlib) ====== Wrapper packages providing an interface to the NETLIB C BLAS and LAPACKE implementations. @@ -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) diff --git a/blas/netlib/bench_test.go b/blas/netlib/bench_test.go index c726f45a..6eb888b4 100644 --- a/blas/netlib/bench_test.go +++ b/blas/netlib/bench_test.go @@ -1,3 +1,7 @@ +// Copyright ©2015 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 ( diff --git a/blas/netlib/blas.go b/blas/netlib/blas.go index a27921c5..37cfdeb0 100644 --- a/blas/netlib/blas.go +++ b/blas/netlib/blas.go @@ -1,4 +1,4 @@ -// Do not manually edit this file. It was created by the generate_blas.go from cblas.h. +// Code generated by "go generate gonum.org/v1/netlib/blas/netlib" from cblas.h; DO NOT EDIT. // Copyright ©2014 The Gonum Authors. All rights reserved. // Use of this source code is governed by a BSD-style @@ -26,13 +26,11 @@ var ( _ blas.Complex128 = Implementation{} ) -// Type order is used to specify the matrix storage format. We still interact with -// an API that allows client calls to specify order, so this is here to document that fact. -type order int +// Type layout is used to specify the matrix storage format. We still interact with +// an API that allows client calls to specify layout, so this is here to document that fact. +type layout int -const ( - rowMajor order = 101 + iota -) +const rowMajor layout = C.CblasRowMajor func min(a, b int) int { if a < b { @@ -73,34 +71,38 @@ func (Implementation) Srotmg(d1 float32, d2 float32, b1 float32, b2 float32) (p } func (Implementation) Srotm(n int, x []float32, incX int, y []float32, incY int, p blas.SrotmParams) { if n < 0 { - panic("blas: n < 0") - } - var _x *float32 - if len(x) > 0 { - _x = &x[0] + panic(nLT0) } if incX == 0 { - panic("blas: zero x index increment") - } - var _y *float32 - if len(y) > 0 { - _y = &y[0] + panic(zeroIncX) } if incY == 0 { - panic("blas: zero y index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") + panic(zeroIncY) } if p.Flag < blas.Identity || p.Flag > blas.Diagonal { - panic("blas: illegal blas.Flag value") + panic(badFlag) } + + // Quick return if possible. if n == 0 { return } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) + } + var _x *float32 + if len(x) > 0 { + _x = &x[0] + } + var _y *float32 + if len(y) > 0 { + _y = &y[0] + } pi := srotmParams{ flag: float32(p.Flag), h: p.H, @@ -118,34 +120,38 @@ func (Implementation) Drotmg(d1 float64, d2 float64, b1 float64, b2 float64) (p } func (Implementation) Drotm(n int, x []float64, incX int, y []float64, incY int, p blas.DrotmParams) { if n < 0 { - panic("blas: n < 0") - } - var _x *float64 - if len(x) > 0 { - _x = &x[0] + panic(nLT0) } if incX == 0 { - panic("blas: zero x index increment") - } - var _y *float64 - if len(y) > 0 { - _y = &y[0] + panic(zeroIncX) } if incY == 0 { - panic("blas: zero y index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") + panic(zeroIncY) } if p.Flag < blas.Identity || p.Flag > blas.Diagonal { - panic("blas: illegal blas.Flag value") + panic(badFlag) } + + // Quick return if possible. if n == 0 { return } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) + } + var _x *float64 + if len(x) > 0 { + _x = &x[0] + } + var _y *float64 + if len(y) > 0 { + _y = &y[0] + } pi := drotmParams{ flag: float64(p.Flag), h: p.H, @@ -154,121 +160,137 @@ func (Implementation) Drotm(n int, x []float64, incX int, y []float64, incY int, } func (Implementation) Cdotu(n int, x []complex64, incX int, y []complex64, incY int) (dotu complex64) { if n < 0 { - panic("blas: n < 0") + panic(nLT0) + } + if incX == 0 { + panic(zeroIncX) + } + if incY == 0 { + panic(zeroIncY) + } + + // Quick return if possible. + if n == 0 { + return 0 + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) } var _x *complex64 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *complex64 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") + C.cblas_cdotu_sub(C.int(n), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(_y), C.int(incY), unsafe.Pointer(&dotu)) + return dotu +} +func (Implementation) Cdotc(n int, x []complex64, incX int, y []complex64, incY int) (dotc complex64) { + if n < 0 { + panic(nLT0) } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") + if incX == 0 { + panic(zeroIncX) } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") + if incY == 0 { + panic(zeroIncY) } + + // Quick return if possible. if n == 0 { return 0 } - C.cblas_cdotu_sub(C.int(n), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(_y), C.int(incY), unsafe.Pointer(&dotu)) - return dotu -} -func (Implementation) Cdotc(n int, x []complex64, incX int, y []complex64, incY int) (dotc complex64) { - if n < 0 { - panic("blas: n < 0") + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) } var _x *complex64 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *complex64 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") + C.cblas_cdotc_sub(C.int(n), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(_y), C.int(incY), unsafe.Pointer(&dotc)) + return dotc +} +func (Implementation) Zdotu(n int, x []complex128, incX int, y []complex128, incY int) (dotu complex128) { + if n < 0 { + panic(nLT0) } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") + if incX == 0 { + panic(zeroIncX) } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") + if incY == 0 { + panic(zeroIncY) } + + // Quick return if possible. if n == 0 { return 0 } - C.cblas_cdotc_sub(C.int(n), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(_y), C.int(incY), unsafe.Pointer(&dotc)) - return dotc -} -func (Implementation) Zdotu(n int, x []complex128, incX int, y []complex128, incY int) (dotu complex128) { - if n < 0 { - panic("blas: n < 0") + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) } var _x *complex128 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *complex128 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") + C.cblas_zdotu_sub(C.int(n), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(_y), C.int(incY), unsafe.Pointer(&dotu)) + return dotu +} +func (Implementation) Zdotc(n int, x []complex128, incX int, y []complex128, incY int) (dotc complex128) { + if n < 0 { + panic(nLT0) } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") + if incX == 0 { + panic(zeroIncX) } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") + if incY == 0 { + panic(zeroIncY) } + + // Quick return if possible. if n == 0 { return 0 } - C.cblas_zdotu_sub(C.int(n), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(_y), C.int(incY), unsafe.Pointer(&dotu)) - return dotu -} -func (Implementation) Zdotc(n int, x []complex128, incX int, y []complex128, incY int) (dotc complex128) { - if n < 0 { - panic("blas: n < 0") + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) } var _x *complex128 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *complex128 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") - } - if n == 0 { - return 0 - } C.cblas_zdotc_sub(C.int(n), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(_y), C.int(incY), unsafe.Pointer(&dotc)) return dotc } @@ -276,355 +298,409 @@ func (Implementation) Zdotc(n int, x []complex128, incX int, y []complex128, inc // Generated cases ... // Sdsdot computes the dot product of the two vectors plus a constant -// alpha + \sum_i x[i]*y[i] +// +// alpha + \sum_i x[i]*y[i] func (Implementation) Sdsdot(n int, alpha float32, x []float32, incX int, y []float32, incY int) float32 { - // declared at cblas.h:24:8 float cblas_sdsdot ... + // declared at cblas.h:45:8 float cblas_sdsdot ... if n < 0 { - panic("blas: n < 0") + panic(nLT0) + } + if incX == 0 { + panic(zeroIncX) + } + if incY == 0 { + panic(zeroIncY) + } + + // Quick return if possible. + if n == 0 { + return 0 + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) } var _x *float32 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *float32 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") - } - if n == 0 { - return 0 - } return float32(C.cblas_sdsdot(C.int(n), C.float(alpha), (*C.float)(_x), C.int(incX), (*C.float)(_y), C.int(incY))) } // Dsdot computes the dot product of the two vectors -// \sum_i x[i]*y[i] +// +// \sum_i x[i]*y[i] func (Implementation) Dsdot(n int, x []float32, incX int, y []float32, incY int) float64 { - // declared at cblas.h:26:8 double cblas_dsdot ... + // declared at cblas.h:47:8 double cblas_dsdot ... if n < 0 { - panic("blas: n < 0") + panic(nLT0) + } + if incX == 0 { + panic(zeroIncX) + } + if incY == 0 { + panic(zeroIncY) + } + + // Quick return if possible. + if n == 0 { + return 0 + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) } var _x *float32 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *float32 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") - } - if n == 0 { - return 0 - } return float64(C.cblas_dsdot(C.int(n), (*C.float)(_x), C.int(incX), (*C.float)(_y), C.int(incY))) } // Sdot computes the dot product of the two vectors -// \sum_i x[i]*y[i] +// +// \sum_i x[i]*y[i] func (Implementation) Sdot(n int, x []float32, incX int, y []float32, incY int) float32 { - // declared at cblas.h:28:8 float cblas_sdot ... + // declared at cblas.h:49:8 float cblas_sdot ... if n < 0 { - panic("blas: n < 0") + panic(nLT0) + } + if incX == 0 { + panic(zeroIncX) + } + if incY == 0 { + panic(zeroIncY) + } + + // Quick return if possible. + if n == 0 { + return 0 + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) } var _x *float32 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *float32 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") - } - if n == 0 { - return 0 - } return float32(C.cblas_sdot(C.int(n), (*C.float)(_x), C.int(incX), (*C.float)(_y), C.int(incY))) } // Ddot computes the dot product of the two vectors -// \sum_i x[i]*y[i] +// +// \sum_i x[i]*y[i] func (Implementation) Ddot(n int, x []float64, incX int, y []float64, incY int) float64 { - // declared at cblas.h:30:8 double cblas_ddot ... + // declared at cblas.h:51:8 double cblas_ddot ... if n < 0 { - panic("blas: n < 0") + panic(nLT0) + } + if incX == 0 { + panic(zeroIncX) + } + if incY == 0 { + panic(zeroIncY) + } + + // Quick return if possible. + if n == 0 { + return 0 + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) } var _x *float64 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *float64 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") - } - if n == 0 { - return 0 - } return float64(C.cblas_ddot(C.int(n), (*C.double)(_x), C.int(incX), (*C.double)(_y), C.int(incY))) } // Snrm2 computes the Euclidean norm of a vector, -// sqrt(\sum_i x[i] * x[i]). +// +// sqrt(\sum_i x[i] * x[i]). +// // This function returns 0 if incX is negative. func (Implementation) Snrm2(n int, x []float32, incX int) float32 { - // declared at cblas.h:49:8 float cblas_snrm2 ... + // declared at cblas.h:71:8 float cblas_snrm2 ... if n < 0 { - panic("blas: n < 0") - } - var _x *float32 - if len(x) > 0 { - _x = &x[0] + panic(nLT0) } if incX == 0 { - panic("blas: zero x index increment") + panic(zeroIncX) } - if incX < 0 { + + // Quick return if possible. + if n == 0 || incX < 0 { return 0 } - if incX > 0 && (n-1)*incX >= len(x) { - panic("blas: x index out of range") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(x) <= (n-1)*incX { + panic(shortX) } - if n == 0 { - return 0 + var _x *float32 + if len(x) > 0 { + _x = &x[0] } return float32(C.cblas_snrm2(C.int(n), (*C.float)(_x), C.int(incX))) } // Sasum computes the sum of the absolute values of the elements of x. -// \sum_i |x[i]| +// +// \sum_i |x[i]| +// // Sasum returns 0 if incX is negative. func (Implementation) Sasum(n int, x []float32, incX int) float32 { - // declared at cblas.h:50:8 float cblas_sasum ... + // declared at cblas.h:72:8 float cblas_sasum ... if n < 0 { - panic("blas: n < 0") - } - var _x *float32 - if len(x) > 0 { - _x = &x[0] + panic(nLT0) } if incX == 0 { - panic("blas: zero x index increment") + panic(zeroIncX) } - if incX < 0 { + + // Quick return if possible. + if n == 0 || incX < 0 { return 0 } - if incX > 0 && (n-1)*incX >= len(x) { - panic("blas: x index out of range") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(x) <= (n-1)*incX { + panic(shortX) } - if n == 0 { - return 0 + var _x *float32 + if len(x) > 0 { + _x = &x[0] } return float32(C.cblas_sasum(C.int(n), (*C.float)(_x), C.int(incX))) } // Dnrm2 computes the Euclidean norm of a vector, -// sqrt(\sum_i x[i] * x[i]). +// +// sqrt(\sum_i x[i] * x[i]). +// // This function returns 0 if incX is negative. func (Implementation) Dnrm2(n int, x []float64, incX int) float64 { - // declared at cblas.h:52:8 double cblas_dnrm2 ... + // declared at cblas.h:74:8 double cblas_dnrm2 ... if n < 0 { - panic("blas: n < 0") - } - var _x *float64 - if len(x) > 0 { - _x = &x[0] + panic(nLT0) } if incX == 0 { - panic("blas: zero x index increment") + panic(zeroIncX) } - if incX < 0 { + + // Quick return if possible. + if n == 0 || incX < 0 { return 0 } - if incX > 0 && (n-1)*incX >= len(x) { - panic("blas: x index out of range") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(x) <= (n-1)*incX { + panic(shortX) } - if n == 0 { - return 0 + var _x *float64 + if len(x) > 0 { + _x = &x[0] } return float64(C.cblas_dnrm2(C.int(n), (*C.double)(_x), C.int(incX))) } // Dasum computes the sum of the absolute values of the elements of x. -// \sum_i |x[i]| +// +// \sum_i |x[i]| +// // Dasum returns 0 if incX is negative. func (Implementation) Dasum(n int, x []float64, incX int) float64 { - // declared at cblas.h:53:8 double cblas_dasum ... + // declared at cblas.h:75:8 double cblas_dasum ... if n < 0 { - panic("blas: n < 0") - } - var _x *float64 - if len(x) > 0 { - _x = &x[0] + panic(nLT0) } if incX == 0 { - panic("blas: zero x index increment") + panic(zeroIncX) } - if incX < 0 { + + // Quick return if possible. + if n == 0 || incX < 0 { return 0 } - if incX > 0 && (n-1)*incX >= len(x) { - panic("blas: x index out of range") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(x) <= (n-1)*incX { + panic(shortX) } - if n == 0 { - return 0 + var _x *float64 + if len(x) > 0 { + _x = &x[0] } return float64(C.cblas_dasum(C.int(n), (*C.double)(_x), C.int(incX))) } +// Scnrm2 computes the Euclidean norm of the complex vector x, +// +// ‖x‖_2 = sqrt(\sum_i x[i] * conj(x[i])). +// +// This function returns 0 if incX is negative. +// +// Complex64 implementations are autogenerated and not directly tested. func (Implementation) Scnrm2(n int, x []complex64, incX int) float32 { - // declared at cblas.h:55:8 float cblas_scnrm2 ... + // declared at cblas.h:77:8 float cblas_scnrm2 ... if n < 0 { - panic("blas: n < 0") - } - var _x *complex64 - if len(x) > 0 { - _x = &x[0] + panic(nLT0) } if incX == 0 { - panic("blas: zero x index increment") + panic(zeroIncX) } - if incX < 0 { + + // Quick return if possible. + if n == 0 || incX < 0 { return 0 } - if incX > 0 && (n-1)*incX >= len(x) { - panic("blas: x index out of range") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(x) <= (n-1)*incX { + panic(shortX) } - if n == 0 { - return 0 + var _x *complex64 + if len(x) > 0 { + _x = &x[0] } return float32(C.cblas_scnrm2(C.int(n), unsafe.Pointer(_x), C.int(incX))) } +// Scasum returns the sum of the absolute values of the elements of x +// +// \sum_i |Re(x[i])| + |Im(x[i])| +// +// Scasum returns 0 if incX is negative. +// +// Complex64 implementations are autogenerated and not directly tested. func (Implementation) Scasum(n int, x []complex64, incX int) float32 { - // declared at cblas.h:56:8 float cblas_scasum ... + // declared at cblas.h:78:8 float cblas_scasum ... if n < 0 { - panic("blas: n < 0") - } - var _x *complex64 - if len(x) > 0 { - _x = &x[0] + panic(nLT0) } if incX == 0 { - panic("blas: zero x index increment") + panic(zeroIncX) } - if incX < 0 { + + // Quick return if possible. + if n == 0 || incX < 0 { return 0 } - if incX > 0 && (n-1)*incX >= len(x) { - panic("blas: x index out of range") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(x) <= (n-1)*incX { + panic(shortX) } - if n == 0 { - return 0 + var _x *complex64 + if len(x) > 0 { + _x = &x[0] } return float32(C.cblas_scasum(C.int(n), unsafe.Pointer(_x), C.int(incX))) } // Dznrm2 computes the Euclidean norm of the complex vector x, -// ‖x‖_2 = sqrt(\sum_i x[i] * conj(x[i])). +// +// ‖x‖_2 = sqrt(\sum_i x[i] * conj(x[i])). +// // This function returns 0 if incX is negative. func (Implementation) Dznrm2(n int, x []complex128, incX int) float64 { - // declared at cblas.h:58:8 double cblas_dznrm2 ... + // declared at cblas.h:80:8 double cblas_dznrm2 ... if n < 0 { - panic("blas: n < 0") - } - var _x *complex128 - if len(x) > 0 { - _x = &x[0] + panic(nLT0) } if incX == 0 { - panic("blas: zero x index increment") + panic(zeroIncX) } - if incX < 0 { + + // Quick return if possible. + if n == 0 || incX < 0 { return 0 } - if incX > 0 && (n-1)*incX >= len(x) { - panic("blas: x index out of range") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(x) <= (n-1)*incX { + panic(shortX) } - if n == 0 { - return 0 + var _x *complex128 + if len(x) > 0 { + _x = &x[0] } return float64(C.cblas_dznrm2(C.int(n), unsafe.Pointer(_x), C.int(incX))) } // Dzasum returns the sum of the absolute values of the elements of x -// \sum_i |Re(x[i])| + |Im(x[i])| +// +// \sum_i |Re(x[i])| + |Im(x[i])| +// // Dzasum returns 0 if incX is negative. func (Implementation) Dzasum(n int, x []complex128, incX int) float64 { - // declared at cblas.h:59:8 double cblas_dzasum ... + // declared at cblas.h:81:8 double cblas_dzasum ... if n < 0 { - panic("blas: n < 0") - } - var _x *complex128 - if len(x) > 0 { - _x = &x[0] + panic(nLT0) } if incX == 0 { - panic("blas: zero x index increment") + panic(zeroIncX) } - if incX < 0 { + + // Quick return if possible. + if n == 0 || incX < 0 { return 0 } - if incX > 0 && (n-1)*incX >= len(x) { - panic("blas: x index out of range") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(x) <= (n-1)*incX { + panic(shortX) } - if n == 0 { - return 0 + var _x *complex128 + if len(x) > 0 { + _x = &x[0] } return float64(C.cblas_dzasum(C.int(n), unsafe.Pointer(_x), C.int(incX))) } @@ -633,26 +709,27 @@ func (Implementation) Dzasum(n int, x []complex128, incX int) float64 { // If there are multiple such indices the earliest is returned. // Isamax returns -1 if n == 0. func (Implementation) Isamax(n int, x []float32, incX int) int { - // declared at cblas.h:65:13 int cblas_isamax ... + // declared at cblas.h:87:13 unsigned long cblas_isamax ... if n < 0 { - panic("blas: n < 0") - } - var _x *float32 - if len(x) > 0 { - _x = &x[0] + panic(nLT0) } if incX == 0 { - panic("blas: zero x index increment") + panic(zeroIncX) } + + // Quick return if possible. if n == 0 || incX < 0 { return -1 } - if incX > 0 && (n-1)*incX >= len(x) { - panic("blas: x index out of range") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(x) <= (n-1)*incX { + panic(shortX) } - if n == 0 { - return -1 + var _x *float32 + if len(x) > 0 { + _x = &x[0] } return int(C.cblas_isamax(C.int(n), (*C.float)(_x), C.int(incX))) } @@ -661,51 +738,57 @@ func (Implementation) Isamax(n int, x []float32, incX int) int { // If there are multiple such indices the earliest is returned. // Idamax returns -1 if n == 0. func (Implementation) Idamax(n int, x []float64, incX int) int { - // declared at cblas.h:66:13 int cblas_idamax ... + // declared at cblas.h:88:13 unsigned long cblas_idamax ... if n < 0 { - panic("blas: n < 0") - } - var _x *float64 - if len(x) > 0 { - _x = &x[0] + panic(nLT0) } if incX == 0 { - panic("blas: zero x index increment") + panic(zeroIncX) } + + // Quick return if possible. if n == 0 || incX < 0 { return -1 } - if incX > 0 && (n-1)*incX >= len(x) { - panic("blas: x index out of range") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(x) <= (n-1)*incX { + panic(shortX) } - if n == 0 { - return -1 + var _x *float64 + if len(x) > 0 { + _x = &x[0] } return int(C.cblas_idamax(C.int(n), (*C.double)(_x), C.int(incX))) } +// Icamax returns the index of the first element of x having largest |Re(·)|+|Im(·)|. +// Icamax returns -1 if n is 0 or incX is negative. +// +// Complex64 implementations are autogenerated and not directly tested. func (Implementation) Icamax(n int, x []complex64, incX int) int { - // declared at cblas.h:67:13 int cblas_icamax ... + // declared at cblas.h:89:13 unsigned long cblas_icamax ... if n < 0 { - panic("blas: n < 0") - } - var _x *complex64 - if len(x) > 0 { - _x = &x[0] + panic(nLT0) } if incX == 0 { - panic("blas: zero x index increment") + panic(zeroIncX) } + + // Quick return if possible. if n == 0 || incX < 0 { return -1 } - if incX > 0 && (n-1)*incX >= len(x) { - panic("blas: x index out of range") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(x) <= (n-1)*incX { + panic(shortX) } - if n == 0 { - return -1 + var _x *complex64 + if len(x) > 0 { + _x = &x[0] } return int(C.cblas_icamax(C.int(n), unsafe.Pointer(_x), C.int(incX))) } @@ -713,577 +796,665 @@ func (Implementation) Icamax(n int, x []complex64, incX int) int { // Izamax returns the index of the first element of x having largest |Re(·)|+|Im(·)|. // Izamax returns -1 if n is 0 or incX is negative. func (Implementation) Izamax(n int, x []complex128, incX int) int { - // declared at cblas.h:68:13 int cblas_izamax ... + // declared at cblas.h:90:13 unsigned long cblas_izamax ... if n < 0 { - panic("blas: n < 0") - } - var _x *complex128 - if len(x) > 0 { - _x = &x[0] + panic(nLT0) } if incX == 0 { - panic("blas: zero x index increment") + panic(zeroIncX) } + + // Quick return if possible. if n == 0 || incX < 0 { return -1 } - if incX > 0 && (n-1)*incX >= len(x) { - panic("blas: x index out of range") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(x) <= (n-1)*incX { + panic(shortX) } - if n == 0 { - return -1 + var _x *complex128 + if len(x) > 0 { + _x = &x[0] } return int(C.cblas_izamax(C.int(n), unsafe.Pointer(_x), C.int(incX))) } // Sswap exchanges the elements of two vectors. -// x[i], y[i] = y[i], x[i] for all i +// +// x[i], y[i] = y[i], x[i] for all i func (Implementation) Sswap(n int, x []float32, incX int, y []float32, incY int) { - // declared at cblas.h:79:6 void cblas_sswap ... + // declared at cblas.h:101:6 void cblas_sswap ... if n < 0 { - panic("blas: n < 0") + panic(nLT0) + } + if incX == 0 { + panic(zeroIncX) + } + if incY == 0 { + panic(zeroIncY) + } + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) } var _x *float32 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *float32 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") - } - if n == 0 { - return - } C.cblas_sswap(C.int(n), (*C.float)(_x), C.int(incX), (*C.float)(_y), C.int(incY)) } // Scopy copies the elements of x into the elements of y. -// y[i] = x[i] for all i +// +// y[i] = x[i] for all i func (Implementation) Scopy(n int, x []float32, incX int, y []float32, incY int) { - // declared at cblas.h:81:6 void cblas_scopy ... + // declared at cblas.h:103:6 void cblas_scopy ... if n < 0 { - panic("blas: n < 0") + panic(nLT0) + } + if incX == 0 { + panic(zeroIncX) + } + if incY == 0 { + panic(zeroIncY) + } + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) } var _x *float32 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *float32 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") - } - if n == 0 { - return - } C.cblas_scopy(C.int(n), (*C.float)(_x), C.int(incX), (*C.float)(_y), C.int(incY)) } // Saxpy adds alpha times x to y -// y[i] += alpha * x[i] for all i +// +// y[i] += alpha * x[i] for all i func (Implementation) Saxpy(n int, alpha float32, x []float32, incX int, y []float32, incY int) { - // declared at cblas.h:83:6 void cblas_saxpy ... + // declared at cblas.h:105:6 void cblas_saxpy ... if n < 0 { - panic("blas: n < 0") + panic(nLT0) + } + if incX == 0 { + panic(zeroIncX) + } + if incY == 0 { + panic(zeroIncY) + } + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) } var _x *float32 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *float32 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") - } - if n == 0 { - return - } C.cblas_saxpy(C.int(n), C.float(alpha), (*C.float)(_x), C.int(incX), (*C.float)(_y), C.int(incY)) } // Dswap exchanges the elements of two vectors. -// x[i], y[i] = y[i], x[i] for all i +// +// x[i], y[i] = y[i], x[i] for all i func (Implementation) Dswap(n int, x []float64, incX int, y []float64, incY int) { - // declared at cblas.h:90:6 void cblas_dswap ... + // declared at cblas.h:108:6 void cblas_dswap ... if n < 0 { - panic("blas: n < 0") + panic(nLT0) + } + if incX == 0 { + panic(zeroIncX) + } + if incY == 0 { + panic(zeroIncY) + } + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) } var _x *float64 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *float64 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") - } - if n == 0 { - return - } C.cblas_dswap(C.int(n), (*C.double)(_x), C.int(incX), (*C.double)(_y), C.int(incY)) } // Dcopy copies the elements of x into the elements of y. -// y[i] = x[i] for all i +// +// y[i] = x[i] for all i func (Implementation) Dcopy(n int, x []float64, incX int, y []float64, incY int) { - // declared at cblas.h:92:6 void cblas_dcopy ... + // declared at cblas.h:110:6 void cblas_dcopy ... if n < 0 { - panic("blas: n < 0") + panic(nLT0) + } + if incX == 0 { + panic(zeroIncX) + } + if incY == 0 { + panic(zeroIncY) + } + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) } var _x *float64 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *float64 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") - } - if n == 0 { - return - } C.cblas_dcopy(C.int(n), (*C.double)(_x), C.int(incX), (*C.double)(_y), C.int(incY)) } // Daxpy adds alpha times x to y -// y[i] += alpha * x[i] for all i +// +// y[i] += alpha * x[i] for all i func (Implementation) Daxpy(n int, alpha float64, x []float64, incX int, y []float64, incY int) { - // declared at cblas.h:94:6 void cblas_daxpy ... + // declared at cblas.h:112:6 void cblas_daxpy ... if n < 0 { - panic("blas: n < 0") + panic(nLT0) + } + if incX == 0 { + panic(zeroIncX) + } + if incY == 0 { + panic(zeroIncY) + } + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) } var _x *float64 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *float64 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") - } - if n == 0 { - return - } C.cblas_daxpy(C.int(n), C.double(alpha), (*C.double)(_x), C.int(incX), (*C.double)(_y), C.int(incY)) } +// Cswap exchanges the elements of two complex vectors x and y. +// +// Complex64 implementations are autogenerated and not directly tested. func (Implementation) Cswap(n int, x []complex64, incX int, y []complex64, incY int) { - // declared at cblas.h:101:6 void cblas_cswap ... + // declared at cblas.h:115:6 void cblas_cswap ... if n < 0 { - panic("blas: n < 0") - } - var _x *complex64 - if len(x) > 0 { - _x = &x[0] + panic(nLT0) } if incX == 0 { - panic("blas: zero x index increment") - } - var _y *complex64 - if len(y) > 0 { - _y = &y[0] + panic(zeroIncX) } if incY == 0 { - panic("blas: zero y index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") + panic(zeroIncY) } + + // Quick return if possible. if n == 0 { return } - C.cblas_cswap(C.int(n), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(_y), C.int(incY)) -} - -func (Implementation) Ccopy(n int, x []complex64, incX int, y []complex64, incY int) { - // declared at cblas.h:103:6 void cblas_ccopy ... - if n < 0 { - panic("blas: n < 0") + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) } var _x *complex64 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *complex64 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") + C.cblas_cswap(C.int(n), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(_y), C.int(incY)) +} + +// Ccopy copies the vector x to vector y. +// +// Complex64 implementations are autogenerated and not directly tested. +func (Implementation) Ccopy(n int, x []complex64, incX int, y []complex64, incY int) { + // declared at cblas.h:117:6 void cblas_ccopy ... + + if n < 0 { + panic(nLT0) + } + if incX == 0 { + panic(zeroIncX) + } + if incY == 0 { + panic(zeroIncY) } + + // Quick return if possible. if n == 0 { return } - C.cblas_ccopy(C.int(n), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(_y), C.int(incY)) -} - -func (Implementation) Caxpy(n int, alpha complex64, x []complex64, incX int, y []complex64, incY int) { - // declared at cblas.h:105:6 void cblas_caxpy ... - if n < 0 { - panic("blas: n < 0") + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) } var _x *complex64 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *complex64 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") + C.cblas_ccopy(C.int(n), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(_y), C.int(incY)) +} + +// Caxpy adds alpha times x to y: +// +// y[i] += alpha * x[i] for all i +// +// Complex64 implementations are autogenerated and not directly tested. +func (Implementation) Caxpy(n int, alpha complex64, x []complex64, incX int, y []complex64, incY int) { + // declared at cblas.h:119:6 void cblas_caxpy ... + + if n < 0 { + panic(nLT0) } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") + if incX == 0 { + panic(zeroIncX) } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") + if incY == 0 { + panic(zeroIncY) } + + // Quick return if possible. if n == 0 { return } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) + } + var _x *complex64 + if len(x) > 0 { + _x = &x[0] + } + var _y *complex64 + if len(y) > 0 { + _y = &y[0] + } C.cblas_caxpy(C.int(n), unsafe.Pointer(&alpha), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(_y), C.int(incY)) } // Zswap exchanges the elements of two complex vectors x and y. func (Implementation) Zswap(n int, x []complex128, incX int, y []complex128, incY int) { - // declared at cblas.h:112:6 void cblas_zswap ... + // declared at cblas.h:122:6 void cblas_zswap ... if n < 0 { - panic("blas: n < 0") + panic(nLT0) + } + if incX == 0 { + panic(zeroIncX) + } + if incY == 0 { + panic(zeroIncY) + } + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) } var _x *complex128 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *complex128 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") - } - if n == 0 { - return - } C.cblas_zswap(C.int(n), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(_y), C.int(incY)) } // Zcopy copies the vector x to vector y. func (Implementation) Zcopy(n int, x []complex128, incX int, y []complex128, incY int) { - // declared at cblas.h:114:6 void cblas_zcopy ... + // declared at cblas.h:124:6 void cblas_zcopy ... if n < 0 { - panic("blas: n < 0") + panic(nLT0) + } + if incX == 0 { + panic(zeroIncX) + } + if incY == 0 { + panic(zeroIncY) + } + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) } var _x *complex128 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *complex128 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") - } - if n == 0 { - return - } C.cblas_zcopy(C.int(n), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(_y), C.int(incY)) } // Zaxpy adds alpha times x to y: -// y[i] += alpha * x[i] for all i +// +// y[i] += alpha * x[i] for all i func (Implementation) Zaxpy(n int, alpha complex128, x []complex128, incX int, y []complex128, incY int) { - // declared at cblas.h:116:6 void cblas_zaxpy ... + // declared at cblas.h:126:6 void cblas_zaxpy ... if n < 0 { - panic("blas: n < 0") + panic(nLT0) + } + if incX == 0 { + panic(zeroIncX) + } + if incY == 0 { + panic(zeroIncY) + } + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) } var _x *complex128 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *complex128 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") - } - if n == 0 { - return - } C.cblas_zaxpy(C.int(n), unsafe.Pointer(&alpha), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(_y), C.int(incY)) } // Srot applies a plane transformation. -// x[i] = c * x[i] + s * y[i] -// y[i] = c * y[i] - s * x[i] +// +// x[i] = c * x[i] + s * y[i] +// y[i] = c * y[i] - s * x[i] func (Implementation) Srot(n int, x []float32, incX int, y []float32, incY int, c, s float32) { - // declared at cblas.h:129:6 void cblas_srot ... + // declared at cblas.h:135:6 void cblas_srot ... if n < 0 { - panic("blas: n < 0") + panic(nLT0) + } + if incX == 0 { + panic(zeroIncX) + } + if incY == 0 { + panic(zeroIncY) + } + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) } var _x *float32 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *float32 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") - } - if n == 0 { - return - } C.cblas_srot(C.int(n), (*C.float)(_x), C.int(incX), (*C.float)(_y), C.int(incY), C.float(c), C.float(s)) } // Drot applies a plane transformation. -// x[i] = c * x[i] + s * y[i] -// y[i] = c * y[i] - s * x[i] +// +// x[i] = c * x[i] + s * y[i] +// y[i] = c * y[i] - s * x[i] func (Implementation) Drot(n int, x []float64, incX int, y []float64, incY int, c, s float64) { - // declared at cblas.h:136:6 void cblas_drot ... + // declared at cblas.h:142:6 void cblas_drot ... if n < 0 { - panic("blas: n < 0") + panic(nLT0) + } + if incX == 0 { + panic(zeroIncX) + } + if incY == 0 { + panic(zeroIncY) + } + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) } var _x *float64 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *float64 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") - } - if n == 0 { - return - } C.cblas_drot(C.int(n), (*C.double)(_x), C.int(incX), (*C.double)(_y), C.int(incY), C.double(c), C.double(s)) } // Sscal scales x by alpha. -// x[i] *= alpha +// +// x[i] *= alpha +// // Sscal has no effect if incX < 0. func (Implementation) Sscal(n int, alpha float32, x []float32, incX int) { - // declared at cblas.h:145:6 void cblas_sscal ... + // declared at cblas.h:151:6 void cblas_sscal ... if n < 0 { - panic("blas: n < 0") - } - var _x *float32 - if len(x) > 0 { - _x = &x[0] + panic(nLT0) } if incX == 0 { - panic("blas: zero x index increment") + panic(zeroIncX) } - if incX < 0 { + + // Quick return if possible. + if n == 0 || incX < 0 { return } - if incX > 0 && (n-1)*incX >= len(x) { - panic("blas: x index out of range") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(x) <= (n-1)*incX { + panic(shortX) } - if n == 0 { - return + var _x *float32 + if len(x) > 0 { + _x = &x[0] } C.cblas_sscal(C.int(n), C.float(alpha), (*C.float)(_x), C.int(incX)) } // Dscal scales x by alpha. -// x[i] *= alpha +// +// x[i] *= alpha +// // Dscal has no effect if incX < 0. func (Implementation) Dscal(n int, alpha float64, x []float64, incX int) { - // declared at cblas.h:146:6 void cblas_dscal ... + // declared at cblas.h:152:6 void cblas_dscal ... if n < 0 { - panic("blas: n < 0") - } - var _x *float64 - if len(x) > 0 { - _x = &x[0] + panic(nLT0) } if incX == 0 { - panic("blas: zero x index increment") + panic(zeroIncX) } - if incX < 0 { + + // Quick return if possible. + if n == 0 || incX < 0 { return } - if incX > 0 && (n-1)*incX >= len(x) { - panic("blas: x index out of range") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(x) <= (n-1)*incX { + panic(shortX) } - if n == 0 { - return + var _x *float64 + if len(x) > 0 { + _x = &x[0] } C.cblas_dscal(C.int(n), C.double(alpha), (*C.double)(_x), C.int(incX)) } +// Cscal scales the vector x by a complex scalar alpha. +// Cscal has no effect if incX < 0. +// +// Complex64 implementations are autogenerated and not directly tested. func (Implementation) Cscal(n int, alpha complex64, x []complex64, incX int) { - // declared at cblas.h:147:6 void cblas_cscal ... + // declared at cblas.h:153:6 void cblas_cscal ... if n < 0 { - panic("blas: n < 0") - } - var _x *complex64 - if len(x) > 0 { - _x = &x[0] + panic(nLT0) } if incX == 0 { - panic("blas: zero x index increment") + panic(zeroIncX) } - if incX < 0 { + + // Quick return if possible. + if n == 0 || incX < 0 { return } - if incX > 0 && (n-1)*incX >= len(x) { - panic("blas: x index out of range") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(x) <= (n-1)*incX { + panic(shortX) } - if n == 0 { - return + var _x *complex64 + if len(x) > 0 { + _x = &x[0] } C.cblas_cscal(C.int(n), unsafe.Pointer(&alpha), unsafe.Pointer(_x), C.int(incX)) } @@ -1291,51 +1462,57 @@ func (Implementation) Cscal(n int, alpha complex64, x []complex64, incX int) { // Zscal scales the vector x by a complex scalar alpha. // Zscal has no effect if incX < 0. func (Implementation) Zscal(n int, alpha complex128, x []complex128, incX int) { - // declared at cblas.h:148:6 void cblas_zscal ... + // declared at cblas.h:154:6 void cblas_zscal ... if n < 0 { - panic("blas: n < 0") - } - var _x *complex128 - if len(x) > 0 { - _x = &x[0] + panic(nLT0) } if incX == 0 { - panic("blas: zero x index increment") + panic(zeroIncX) } - if incX < 0 { + + // Quick return if possible. + if n == 0 || incX < 0 { return } - if incX > 0 && (n-1)*incX >= len(x) { - panic("blas: x index out of range") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(x) <= (n-1)*incX { + panic(shortX) } - if n == 0 { - return + var _x *complex128 + if len(x) > 0 { + _x = &x[0] } C.cblas_zscal(C.int(n), unsafe.Pointer(&alpha), unsafe.Pointer(_x), C.int(incX)) } +// Csscal scales the vector x by a real scalar alpha. +// Csscal has no effect if incX < 0. +// +// Complex64 implementations are autogenerated and not directly tested. func (Implementation) Csscal(n int, alpha float32, x []complex64, incX int) { - // declared at cblas.h:149:6 void cblas_csscal ... + // declared at cblas.h:155:6 void cblas_csscal ... if n < 0 { - panic("blas: n < 0") - } - var _x *complex64 - if len(x) > 0 { - _x = &x[0] + panic(nLT0) } if incX == 0 { - panic("blas: zero x index increment") + panic(zeroIncX) } - if incX < 0 { + + // Quick return if possible. + if n == 0 || incX < 0 { return } - if incX > 0 && (n-1)*incX >= len(x) { - panic("blas: x index out of range") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(x) <= (n-1)*incX { + panic(shortX) } - if n == 0 { - return + var _x *complex64 + if len(x) > 0 { + _x = &x[0] } C.cblas_csscal(C.int(n), C.float(alpha), unsafe.Pointer(_x), C.int(incX)) } @@ -1343,157 +1520,236 @@ func (Implementation) Csscal(n int, alpha float32, x []complex64, incX int) { // Zdscal scales the vector x by a real scalar alpha. // Zdscal has no effect if incX < 0. func (Implementation) Zdscal(n int, alpha float64, x []complex128, incX int) { - // declared at cblas.h:150:6 void cblas_zdscal ... + // declared at cblas.h:156:6 void cblas_zdscal ... if n < 0 { - panic("blas: n < 0") - } - var _x *complex128 - if len(x) > 0 { - _x = &x[0] + panic(nLT0) } if incX == 0 { - panic("blas: zero x index increment") + panic(zeroIncX) } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if n == 0 { + + // Quick return if possible. + if n == 0 || incX < 0 { return } + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(x) <= (n-1)*incX { + panic(shortX) + } + var _x *complex128 + if len(x) > 0 { + _x = &x[0] + } C.cblas_zdscal(C.int(n), C.double(alpha), unsafe.Pointer(_x), C.int(incX)) } // 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ᵀ * 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 ... - - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") + // declared at cblas.h:167:6 void cblas_sgemv ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) } if m < 0 { - panic("blas: m < 0") + panic(mLT0) } if n < 0 { - panic("blas: n < 0") - } - var _a *float32 - if len(a) > 0 { - _a = &a[0] + panic(nLT0) } - var _x *float32 - if len(x) > 0 { - _x = &x[0] + if lda < max(1, n) { + panic(badLdA) } if incX == 0 { - panic("blas: zero x index increment") - } - var _y *float32 - if len(y) > 0 { - _y = &y[0] + panic(zeroIncX) } if incY == 0 { - panic("blas: zero y index increment") + panic(zeroIncY) + } + + // Quick return if possible. + if m == 0 || n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(m-1)+n { + panic(shortA) } var lenX, lenY int - if tA == blas.NoTrans { + if tA == C.CblasNoTrans { lenX, lenY = n, m } else { lenX, lenY = m, n } - if (incX > 0 && (lenX-1)*incX >= len(x)) || (incX < 0 && (1-lenX)*incX >= len(x)) { - panic("blas: x index out of range") + if (incX > 0 && len(x) <= (lenX-1)*incX) || (incX < 0 && len(x) <= (1-lenX)*incX) { + panic(shortX) } - if (incY > 0 && (lenY-1)*incY >= len(y)) || (incY < 0 && (1-lenY)*incY >= len(y)) { - panic("blas: y index out of range") + if (incY > 0 && len(y) <= (lenY-1)*incY) || (incY < 0 && len(y) <= (1-lenY)*incY) { + panic(shortY) } - if lda*(m-1)+n > len(a) || lda < max(1, n) { - panic("blas: index of a out of range") - } - C.cblas_sgemv(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_TRANSPOSE(tA), C.int(m), C.int(n), C.float(alpha), (*C.float)(_a), C.int(lda), (*C.float)(_x), C.int(incX), C.float(beta), (*C.float)(_y), C.int(incY)) -} - -// Sgbmv 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 band matrix kL subdiagonals and kU super-diagonals, and -// m and n refer to the size of the full dense matrix it represents. -// x and y are vectors, and alpha and beta are scalars. -func (Implementation) Sgbmv(tA blas.Transpose, m, n, kL, kU int, alpha float32, a []float32, lda int, x []float32, incX int, beta float32, y []float32, incY int) { - // declared at cblas.h:176:6 void cblas_sgbmv ... - - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") + var _a *float32 + if len(a) > 0 { + _a = &a[0] } - if m < 0 { - panic("blas: m < 0") + var _x *float32 + if len(x) > 0 { + _x = &x[0] + } + var _y *float32 + if len(y) > 0 { + _y = &y[0] + } + C.cblas_sgemv(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_TRANSPOSE(tA), C.int(m), C.int(n), C.float(alpha), (*C.float)(_a), C.int(lda), (*C.float)(_x), C.int(incX), C.float(beta), (*C.float)(_y), C.int(incY)) +} + +// Sgbmv performs one of the matrix-vector operations +// +// y = alpha * A * x + beta * y if tA == blas.NoTrans +// y = alpha * Aᵀ * x + beta * y if tA == blas.Trans or blas.ConjTrans +// +// where A is an m×n band matrix with kL sub-diagonals and kU super-diagonals, +// x and y are vectors, and alpha and beta are scalars. +func (Implementation) Sgbmv(tA blas.Transpose, m, n, kL, kU int, alpha float32, a []float32, lda int, x []float32, incX int, beta float32, y []float32, incY int) { + // declared at cblas.h:172:6 void cblas_sgbmv ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) + } + if m < 0 { + panic(mLT0) } if n < 0 { - panic("blas: n < 0") + panic(nLT0) } if kL < 0 { - panic("blas: kL < 0") + panic(kLLT0) } if kU < 0 { - panic("blas: kU < 0") + panic(kULT0) } - var _a *float32 - if len(a) > 0 { - _a = &a[0] - } - var _x *float32 - if len(x) > 0 { - _x = &x[0] + if lda < kL+kU+1 { + panic(badLdA) } if incX == 0 { - panic("blas: zero x index increment") - } - var _y *float32 - if len(y) > 0 { - _y = &y[0] + panic(zeroIncX) } if incY == 0 { - panic("blas: zero y index increment") + panic(zeroIncY) + } + + // Quick return if possible. + if m == 0 || n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(min(m, n+kL)-1)+kL+kU+1 { + panic(shortA) } var lenX, lenY int - if tA == blas.NoTrans { + if tA == C.CblasNoTrans { lenX, lenY = n, m } else { lenX, lenY = m, n } - if (incX > 0 && (lenX-1)*incX >= len(x)) || (incX < 0 && (1-lenX)*incX >= len(x)) { - panic("blas: x index out of range") + if (incX > 0 && len(x) <= (lenX-1)*incX) || (incX < 0 && len(x) <= (1-lenX)*incX) { + panic(shortX) } - if (incY > 0 && (lenY-1)*incY >= len(y)) || (incY < 0 && (1-lenY)*incY >= len(y)) { - panic("blas: y index out of range") + if (incY > 0 && len(y) <= (lenY-1)*incY) || (incY < 0 && len(y) <= (1-lenY)*incY) { + panic(shortY) } - if lda*(min(m, n+kL)-1)+kL+kU+1 > len(a) || lda < kL+kU+1 { - panic("blas: index of a out of range") + var _a *float32 + if len(a) > 0 { + _a = &a[0] + } + var _x *float32 + if len(x) > 0 { + _x = &x[0] + } + var _y *float32 + if len(y) > 0 { + _y = &y[0] } - C.cblas_sgbmv(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_TRANSPOSE(tA), C.int(m), C.int(n), C.int(kL), C.int(kU), C.float(alpha), (*C.float)(_a), C.int(lda), (*C.float)(_x), C.int(incX), C.float(beta), (*C.float)(_y), C.int(incY)) + C.cblas_sgbmv(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_TRANSPOSE(tA), C.int(m), C.int(n), C.int(kL), C.int(kU), C.float(alpha), (*C.float)(_a), C.int(lda), (*C.float)(_x), C.int(incX), C.float(beta), (*C.float)(_y), C.int(incY)) } -// Strmv computes -// x = A * x if tA == blas.NoTrans -// x = A^T * x if tA == blas.Trans or blas.ConjTrans -// A is an n×n Triangular matrix and x is a vector. +// Strmv performs one of the matrix-vector operations +// +// x = A * x if tA == blas.NoTrans +// x = Aᵀ * x if tA == blas.Trans or blas.ConjTrans +// +// where A is an n×n triangular matrix, and x is a vector. func (Implementation) Strmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, a []float32, lda int, x []float32, incX int) { - // declared at cblas.h:181:6 void cblas_strmv ... - - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + // declared at cblas.h:177:6 void cblas_strmv ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + switch d { + case blas.NonUnit: + d = C.CblasNonUnit + case blas.Unit: + d = C.CblasUnit + default: + panic(badDiag) + } + if n < 0 { + panic(nLT0) + } + if lda < max(1, n) { + panic(badLdA) + } + if incX == 0 { + panic(zeroIncX) } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") + + // Quick return if possible. + if n == 0 { + return } - if d != blas.NonUnit && d != blas.Unit { - panic("blas: illegal diagonal") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(n-1)+n { + panic(shortA) } - if n < 0 { - panic("blas: n < 0") + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) } var _a *float32 if len(a) > 0 { @@ -1503,39 +1759,68 @@ func (Implementation) Strmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if lda*(n-1)+n > len(a) || lda < max(1, n) { - panic("blas: index of a out of range") - } - C.cblas_strmv(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.enum_CBLAS_TRANSPOSE(tA), C.enum_CBLAS_DIAG(d), C.int(n), (*C.float)(_a), C.int(lda), (*C.float)(_x), C.int(incX)) + C.cblas_strmv(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(tA), C.CBLAS_DIAG(d), C.int(n), (*C.float)(_a), C.int(lda), (*C.float)(_x), C.int(incX)) } -// Stbmv computes -// x = A * x if tA == blas.NoTrans -// x = A^T * x if tA == blas.Trans or blas.ConjTrans -// where A is an n×n triangular banded matrix with k diagonals, and x is a vector. +// Stbmv performs one of the matrix-vector operations +// +// x = A * x if tA == blas.NoTrans +// x = Aᵀ * x if tA == blas.Trans or blas.ConjTrans +// +// where A is an n×n triangular band matrix with k+1 diagonals, and x is a vector. func (Implementation) Stbmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n, k int, a []float32, lda int, x []float32, incX int) { - // declared at cblas.h:185:6 void cblas_stbmv ... - - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + // declared at cblas.h:181:6 void cblas_stbmv ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + switch d { + case blas.NonUnit: + d = C.CblasNonUnit + case blas.Unit: + d = C.CblasUnit + default: + panic(badDiag) + } + if n < 0 { + panic(nLT0) } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") + if k < 0 { + panic(kLT0) } - if d != blas.NonUnit && d != blas.Unit { - panic("blas: illegal diagonal") + if lda < k+1 { + panic(badLdA) } - if n < 0 { - panic("blas: n < 0") + if incX == 0 { + panic(zeroIncX) } - if k < 0 { - panic("blas: k < 0") + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(n-1)+k+1 { + panic(shortA) + } + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) } var _a *float32 if len(a) > 0 { @@ -1545,39 +1830,62 @@ func (Implementation) Stbmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n, k i if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if lda*(n-1)+k+1 > len(a) || lda < k+1 { - panic("blas: index of a out of range") - } - C.cblas_stbmv(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), (*C.float)(_a), C.int(lda), (*C.float)(_x), C.int(incX)) + C.cblas_stbmv(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(tA), C.CBLAS_DIAG(d), C.int(n), C.int(k), (*C.float)(_a), C.int(lda), (*C.float)(_x), C.int(incX)) } -// Stpmv computes -// x = A * x if tA == blas.NoTrans -// x = A^T * x if tA == blas.Trans or blas.ConjTrans -// where A is an n×n unit triangular matrix in packed format, and x is a vector. +// Stpmv performs one of the matrix-vector operations +// +// x = A * x if tA == blas.NoTrans +// x = Aᵀ * x if tA == blas.Trans or blas.ConjTrans +// +// where A is an n×n triangular matrix in packed format, and x is a vector. func (Implementation) Stpmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, ap, x []float32, incX int) { - // declared at cblas.h:189:6 void cblas_stpmv ... - - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + // declared at cblas.h:185:6 void cblas_stpmv ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + switch d { + case blas.NonUnit: + d = C.CblasNonUnit + case blas.Unit: + d = C.CblasUnit + default: + panic(badDiag) + } + if n < 0 { + panic(nLT0) } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") + if incX == 0 { + panic(zeroIncX) } - if d != blas.NonUnit && d != blas.Unit { - panic("blas: illegal diagonal") + + // Quick return if possible. + if n == 0 { + return } - if n < 0 { - panic("blas: n < 0") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(ap) < n*(n+1)/2 { + panic(shortAP) } - if n*(n+1)/2 > len(ap) { - panic("blas: index of ap out of range") + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) } var _ap *float32 if len(ap) > 0 { @@ -1587,41 +1895,71 @@ func (Implementation) Stpmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if n == 0 { - return - } - C.cblas_stpmv(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.enum_CBLAS_TRANSPOSE(tA), C.enum_CBLAS_DIAG(d), C.int(n), (*C.float)(_ap), (*C.float)(_x), C.int(incX)) + C.cblas_stpmv(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(tA), C.CBLAS_DIAG(d), C.int(n), (*C.float)(_ap), (*C.float)(_x), C.int(incX)) } -// Strsv solves -// A * x = b if tA == blas.NoTrans -// A^T * x = b if tA == blas.Trans or blas.ConjTrans -// A is an n×n triangular matrix and x is a vector. +// Strsv solves one of the systems of equations +// +// A * x = b if tA == blas.NoTrans +// Aᵀ * x = b if tA == blas.Trans or blas.ConjTrans +// +// where A is an n×n triangular matrix, and x and b are vectors. +// // At entry to the function, x contains the values of b, and the result is -// stored in place into x. +// 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) Strsv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, a []float32, lda int, x []float32, incX int) { - // declared at cblas.h:192:6 void cblas_strsv ... - - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + // declared at cblas.h:188:6 void cblas_strsv ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + switch d { + case blas.NonUnit: + d = C.CblasNonUnit + case blas.Unit: + d = C.CblasUnit + default: + panic(badDiag) + } + if n < 0 { + panic(nLT0) + } + if lda < max(1, n) { + panic(badLdA) + } + if incX == 0 { + panic(zeroIncX) } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") + + // Quick return if possible. + if n == 0 { + return } - if d != blas.NonUnit && d != blas.Unit { - panic("blas: illegal diagonal") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(n-1)+n { + panic(shortA) } - if n < 0 { - panic("blas: n < 0") + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) } var _a *float32 if len(a) > 0 { @@ -1631,44 +1969,75 @@ func (Implementation) Strsv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if lda*(n-1)+n > len(a) || lda < max(1, n) { - panic("blas: index of a out of range") - } - C.cblas_strsv(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.enum_CBLAS_TRANSPOSE(tA), C.enum_CBLAS_DIAG(d), C.int(n), (*C.float)(_a), C.int(lda), (*C.float)(_x), C.int(incX)) + C.cblas_strsv(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(tA), C.CBLAS_DIAG(d), C.int(n), (*C.float)(_a), C.int(lda), (*C.float)(_x), C.int(incX)) } -// Stbsv solves -// A * x = b -// where A is an n×n triangular banded matrix with k diagonals in packed format, -// and x is a vector. +// Stbsv solves one of the systems of equations +// +// A * x = b if tA == blas.NoTrans +// Aᵀ * x = b if tA == blas.Trans or tA == blas.ConjTrans +// +// where A is an n×n triangular band matrix with k+1 diagonals, +// and x and b are vectors. +// // At entry to the function, x contains the values of b, and the result is -// stored in place into x. +// 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) Stbsv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n, k int, a []float32, lda int, x []float32, incX int) { - // declared at cblas.h:196:6 void cblas_stbsv ... - - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + // declared at cblas.h:192:6 void cblas_stbsv ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + switch d { + case blas.NonUnit: + d = C.CblasNonUnit + case blas.Unit: + d = C.CblasUnit + default: + panic(badDiag) + } + if n < 0 { + panic(nLT0) } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") + if k < 0 { + panic(kLT0) } - if d != blas.NonUnit && d != blas.Unit { - panic("blas: illegal diagonal") + if lda < k+1 { + panic(badLdA) } - if n < 0 { - panic("blas: n < 0") + if incX == 0 { + panic(zeroIncX) } - if k < 0 { - panic("blas: k < 0") + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(n-1)+k+1 { + panic(shortA) + } + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) } var _a *float32 if len(a) > 0 { @@ -1678,44 +2047,68 @@ func (Implementation) Stbsv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n, k i if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if lda*(n-1)+k+1 > len(a) || lda < k+1 { - panic("blas: index of a out of range") - } - C.cblas_stbsv(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), (*C.float)(_a), C.int(lda), (*C.float)(_x), C.int(incX)) + C.cblas_stbsv(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(tA), C.CBLAS_DIAG(d), C.int(n), C.int(k), (*C.float)(_a), C.int(lda), (*C.float)(_x), C.int(incX)) } -// Stpsv solves -// A * x = b if tA == blas.NoTrans -// A^T * x = b if tA == blas.Trans or blas.ConjTrans -// where A is an n×n triangular matrix in packed format and x is a vector. +// Stpsv solves one of the systems of equations +// +// A * x = b if tA == blas.NoTrans +// Aᵀ * x = b if tA == blas.Trans or blas.ConjTrans +// +// where A is an n×n triangular matrix in packed format, and x and b are vectors. +// // At entry to the function, x contains the values of b, and the result is -// stored in place into x. +// 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) Stpsv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, ap, x []float32, incX int) { - // declared at cblas.h:200:6 void cblas_stpsv ... - - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + // declared at cblas.h:196:6 void cblas_stpsv ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + switch d { + case blas.NonUnit: + d = C.CblasNonUnit + case blas.Unit: + d = C.CblasUnit + default: + panic(badDiag) + } + if n < 0 { + panic(nLT0) } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") + if incX == 0 { + panic(zeroIncX) } - if d != blas.NonUnit && d != blas.Unit { - panic("blas: illegal diagonal") + + // Quick return if possible. + if n == 0 { + return } - if n < 0 { - panic("blas: n < 0") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(ap) < n*(n+1)/2 { + panic(shortAP) } - if n*(n+1)/2 > len(ap) { - panic("blas: index of ap out of range") + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) } var _ap *float32 if len(ap) > 0 { @@ -1725,148 +2118,214 @@ func (Implementation) Stpsv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if n == 0 { - return - } - C.cblas_stpsv(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.enum_CBLAS_TRANSPOSE(tA), C.enum_CBLAS_DIAG(d), C.int(n), (*C.float)(_ap), (*C.float)(_x), C.int(incX)) + C.cblas_stpsv(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(tA), C.CBLAS_DIAG(d), C.int(n), (*C.float)(_ap), (*C.float)(_x), C.int(incX)) } // 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ᵀ * 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 ... - - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") + // declared at cblas.h:200:6 void cblas_dgemv ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) } if m < 0 { - panic("blas: m < 0") + panic(mLT0) } if n < 0 { - panic("blas: n < 0") - } - var _a *float64 - if len(a) > 0 { - _a = &a[0] + panic(nLT0) } - var _x *float64 - if len(x) > 0 { - _x = &x[0] + if lda < max(1, n) { + panic(badLdA) } if incX == 0 { - panic("blas: zero x index increment") - } - var _y *float64 - if len(y) > 0 { - _y = &y[0] + panic(zeroIncX) } if incY == 0 { - panic("blas: zero y index increment") + panic(zeroIncY) + } + + // Quick return if possible. + if m == 0 || n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(m-1)+n { + panic(shortA) } var lenX, lenY int - if tA == blas.NoTrans { + if tA == C.CblasNoTrans { lenX, lenY = n, m } else { lenX, lenY = m, n } - if (incX > 0 && (lenX-1)*incX >= len(x)) || (incX < 0 && (1-lenX)*incX >= len(x)) { - panic("blas: x index out of range") + if (incX > 0 && len(x) <= (lenX-1)*incX) || (incX < 0 && len(x) <= (1-lenX)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (lenY-1)*incY) || (incY < 0 && len(y) <= (1-lenY)*incY) { + panic(shortY) + } + var _a *float64 + if len(a) > 0 { + _a = &a[0] } - if (incY > 0 && (lenY-1)*incY >= len(y)) || (incY < 0 && (1-lenY)*incY >= len(y)) { - panic("blas: y index out of range") + var _x *float64 + if len(x) > 0 { + _x = &x[0] } - if lda*(m-1)+n > len(a) || lda < max(1, n) { - panic("blas: index of a out of range") + var _y *float64 + if len(y) > 0 { + _y = &y[0] } - C.cblas_dgemv(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_TRANSPOSE(tA), C.int(m), C.int(n), C.double(alpha), (*C.double)(_a), C.int(lda), (*C.double)(_x), C.int(incX), C.double(beta), (*C.double)(_y), C.int(incY)) + C.cblas_dgemv(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_TRANSPOSE(tA), C.int(m), C.int(n), C.double(alpha), (*C.double)(_a), C.int(lda), (*C.double)(_x), C.int(incX), C.double(beta), (*C.double)(_y), C.int(incY)) } -// Dgbmv 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 band matrix kL subdiagonals and kU super-diagonals, and -// m and n refer to the size of the full dense matrix it represents. +// Dgbmv performs one of the matrix-vector operations +// +// y = alpha * A * x + beta * y if tA == blas.NoTrans +// y = alpha * Aᵀ * x + beta * y if tA == blas.Trans or blas.ConjTrans +// +// where A is an m×n band matrix with kL sub-diagonals and kU super-diagonals, // x and y are vectors, and alpha and beta are scalars. func (Implementation) Dgbmv(tA blas.Transpose, m, n, kL, kU int, alpha float64, a []float64, lda int, x []float64, incX int, beta float64, y []float64, incY int) { - // declared at cblas.h:209:6 void cblas_dgbmv ... - - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") + // declared at cblas.h:205:6 void cblas_dgbmv ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) } if m < 0 { - panic("blas: m < 0") + panic(mLT0) } if n < 0 { - panic("blas: n < 0") + panic(nLT0) } if kL < 0 { - panic("blas: kL < 0") + panic(kLLT0) } if kU < 0 { - panic("blas: kU < 0") - } - var _a *float64 - if len(a) > 0 { - _a = &a[0] + panic(kULT0) } - var _x *float64 - if len(x) > 0 { - _x = &x[0] + if lda < kL+kU+1 { + panic(badLdA) } if incX == 0 { - panic("blas: zero x index increment") - } - var _y *float64 - if len(y) > 0 { - _y = &y[0] + panic(zeroIncX) } if incY == 0 { - panic("blas: zero y index increment") + panic(zeroIncY) + } + + // Quick return if possible. + if m == 0 || n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(min(m, n+kL)-1)+kL+kU+1 { + panic(shortA) } var lenX, lenY int - if tA == blas.NoTrans { + if tA == C.CblasNoTrans { lenX, lenY = n, m } else { lenX, lenY = m, n } - if (incX > 0 && (lenX-1)*incX >= len(x)) || (incX < 0 && (1-lenX)*incX >= len(x)) { - panic("blas: x index out of range") + if (incX > 0 && len(x) <= (lenX-1)*incX) || (incX < 0 && len(x) <= (1-lenX)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (lenY-1)*incY) || (incY < 0 && len(y) <= (1-lenY)*incY) { + panic(shortY) + } + var _a *float64 + if len(a) > 0 { + _a = &a[0] } - if (incY > 0 && (lenY-1)*incY >= len(y)) || (incY < 0 && (1-lenY)*incY >= len(y)) { - panic("blas: y index out of range") + var _x *float64 + if len(x) > 0 { + _x = &x[0] } - if lda*(min(m, n+kL)-1)+kL+kU+1 > len(a) || lda < kL+kU+1 { - panic("blas: index of a out of range") + var _y *float64 + if len(y) > 0 { + _y = &y[0] } - C.cblas_dgbmv(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_TRANSPOSE(tA), C.int(m), C.int(n), C.int(kL), C.int(kU), C.double(alpha), (*C.double)(_a), C.int(lda), (*C.double)(_x), C.int(incX), C.double(beta), (*C.double)(_y), C.int(incY)) + C.cblas_dgbmv(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_TRANSPOSE(tA), C.int(m), C.int(n), C.int(kL), C.int(kU), C.double(alpha), (*C.double)(_a), C.int(lda), (*C.double)(_x), C.int(incX), C.double(beta), (*C.double)(_y), C.int(incY)) } -// Dtrmv computes -// x = A * x if tA == blas.NoTrans -// x = A^T * x if tA == blas.Trans or blas.ConjTrans -// A is an n×n Triangular matrix and x is a vector. +// Dtrmv performs one of the matrix-vector operations +// +// x = A * x if tA == blas.NoTrans +// x = Aᵀ * x if tA == blas.Trans or blas.ConjTrans +// +// where A is an n×n triangular matrix, and x is a vector. func (Implementation) Dtrmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, a []float64, lda int, x []float64, incX int) { - // declared at cblas.h:214:6 void cblas_dtrmv ... - - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + // declared at cblas.h:210:6 void cblas_dtrmv ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + switch d { + case blas.NonUnit: + d = C.CblasNonUnit + case blas.Unit: + d = C.CblasUnit + default: + panic(badDiag) + } + if n < 0 { + panic(nLT0) + } + if lda < max(1, n) { + panic(badLdA) } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") + if incX == 0 { + panic(zeroIncX) } - if d != blas.NonUnit && d != blas.Unit { - panic("blas: illegal diagonal") + + // Quick return if possible. + if n == 0 { + return } - if n < 0 { - panic("blas: n < 0") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(n-1)+n { + panic(shortA) + } + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) } var _a *float64 if len(a) > 0 { @@ -1876,39 +2335,68 @@ func (Implementation) Dtrmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if lda*(n-1)+n > len(a) || lda < max(1, n) { - panic("blas: index of a out of range") - } - C.cblas_dtrmv(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.enum_CBLAS_TRANSPOSE(tA), C.enum_CBLAS_DIAG(d), C.int(n), (*C.double)(_a), C.int(lda), (*C.double)(_x), C.int(incX)) + C.cblas_dtrmv(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(tA), C.CBLAS_DIAG(d), C.int(n), (*C.double)(_a), C.int(lda), (*C.double)(_x), C.int(incX)) } -// Dtbmv computes -// x = A * x if tA == blas.NoTrans -// x = A^T * x if tA == blas.Trans or blas.ConjTrans -// where A is an n×n triangular banded matrix with k diagonals, and x is a vector. +// Dtbmv performs one of the matrix-vector operations +// +// x = A * x if tA == blas.NoTrans +// x = Aᵀ * x if tA == blas.Trans or blas.ConjTrans +// +// where A is an n×n triangular band matrix with k+1 diagonals, and x is a vector. func (Implementation) Dtbmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n, k int, a []float64, lda int, x []float64, incX int) { - // declared at cblas.h:218:6 void cblas_dtbmv ... - - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + // declared at cblas.h:214:6 void cblas_dtbmv ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + switch d { + case blas.NonUnit: + d = C.CblasNonUnit + case blas.Unit: + d = C.CblasUnit + default: + panic(badDiag) + } + if n < 0 { + panic(nLT0) } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") + if k < 0 { + panic(kLT0) } - if d != blas.NonUnit && d != blas.Unit { - panic("blas: illegal diagonal") + if lda < k+1 { + panic(badLdA) } - if n < 0 { - panic("blas: n < 0") + if incX == 0 { + panic(zeroIncX) } - if k < 0 { - panic("blas: k < 0") + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(n-1)+k+1 { + panic(shortA) + } + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) } var _a *float64 if len(a) > 0 { @@ -1918,39 +2406,62 @@ func (Implementation) Dtbmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n, k i if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if lda*(n-1)+k+1 > len(a) || lda < k+1 { - panic("blas: index of a out of range") - } - C.cblas_dtbmv(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), (*C.double)(_a), C.int(lda), (*C.double)(_x), C.int(incX)) + C.cblas_dtbmv(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(tA), C.CBLAS_DIAG(d), C.int(n), C.int(k), (*C.double)(_a), C.int(lda), (*C.double)(_x), C.int(incX)) } -// Dtpmv computes -// x = A * x if tA == blas.NoTrans -// x = A^T * x if tA == blas.Trans or blas.ConjTrans -// where A is an n×n unit triangular matrix in packed format, and x is a vector. +// Dtpmv performs one of the matrix-vector operations +// +// x = A * x if tA == blas.NoTrans +// x = Aᵀ * x if tA == blas.Trans or blas.ConjTrans +// +// where A is an n×n triangular matrix in packed format, and x is a vector. func (Implementation) Dtpmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, ap, x []float64, incX int) { - // declared at cblas.h:222:6 void cblas_dtpmv ... - - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + // declared at cblas.h:218:6 void cblas_dtpmv ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + switch d { + case blas.NonUnit: + d = C.CblasNonUnit + case blas.Unit: + d = C.CblasUnit + default: + panic(badDiag) + } + if n < 0 { + panic(nLT0) } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") + if incX == 0 { + panic(zeroIncX) } - if d != blas.NonUnit && d != blas.Unit { - panic("blas: illegal diagonal") + + // Quick return if possible. + if n == 0 { + return } - if n < 0 { - panic("blas: n < 0") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(ap) < n*(n+1)/2 { + panic(shortAP) } - if n*(n+1)/2 > len(ap) { - panic("blas: index of ap out of range") + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) } var _ap *float64 if len(ap) > 0 { @@ -1960,41 +2471,71 @@ func (Implementation) Dtpmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if n == 0 { - return - } - C.cblas_dtpmv(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.enum_CBLAS_TRANSPOSE(tA), C.enum_CBLAS_DIAG(d), C.int(n), (*C.double)(_ap), (*C.double)(_x), C.int(incX)) + C.cblas_dtpmv(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(tA), C.CBLAS_DIAG(d), C.int(n), (*C.double)(_ap), (*C.double)(_x), C.int(incX)) } -// Dtrsv solves -// A * x = b if tA == blas.NoTrans -// A^T * x = b if tA == blas.Trans or blas.ConjTrans -// A is an n×n triangular matrix and x is a vector. +// Dtrsv solves one of the systems of equations +// +// A * x = b if tA == blas.NoTrans +// Aᵀ * x = b if tA == blas.Trans or blas.ConjTrans +// +// where A is an n×n triangular matrix, and x and b are vectors. +// // At entry to the function, x contains the values of b, and the result is -// stored in place into x. +// 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) Dtrsv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, a []float64, lda int, x []float64, incX int) { - // declared at cblas.h:225:6 void cblas_dtrsv ... - - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + // declared at cblas.h:221:6 void cblas_dtrsv ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + switch d { + case blas.NonUnit: + d = C.CblasNonUnit + case blas.Unit: + d = C.CblasUnit + default: + panic(badDiag) + } + if n < 0 { + panic(nLT0) + } + if lda < max(1, n) { + panic(badLdA) + } + if incX == 0 { + panic(zeroIncX) } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") + + // Quick return if possible. + if n == 0 { + return } - if d != blas.NonUnit && d != blas.Unit { - panic("blas: illegal diagonal") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(n-1)+n { + panic(shortA) } - if n < 0 { - panic("blas: n < 0") + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) } var _a *float64 if len(a) > 0 { @@ -2004,44 +2545,75 @@ func (Implementation) Dtrsv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if lda*(n-1)+n > len(a) || lda < max(1, n) { - panic("blas: index of a out of range") - } - C.cblas_dtrsv(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.enum_CBLAS_TRANSPOSE(tA), C.enum_CBLAS_DIAG(d), C.int(n), (*C.double)(_a), C.int(lda), (*C.double)(_x), C.int(incX)) + C.cblas_dtrsv(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(tA), C.CBLAS_DIAG(d), C.int(n), (*C.double)(_a), C.int(lda), (*C.double)(_x), C.int(incX)) } -// Dtbsv solves -// A * x = b -// where A is an n×n triangular banded matrix with k diagonals in packed format, -// and x is a vector. +// Dtbsv solves one of the systems of equations +// +// A * x = b if tA == blas.NoTrans +// Aᵀ * x = b if tA == blas.Trans or tA == blas.ConjTrans +// +// where A is an n×n triangular band matrix with k+1 diagonals, +// and x and b are vectors. +// // At entry to the function, x contains the values of b, and the result is -// stored in place into x. +// 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) Dtbsv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n, k int, a []float64, lda int, x []float64, incX int) { - // declared at cblas.h:229:6 void cblas_dtbsv ... - - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + // declared at cblas.h:225:6 void cblas_dtbsv ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + switch d { + case blas.NonUnit: + d = C.CblasNonUnit + case blas.Unit: + d = C.CblasUnit + default: + panic(badDiag) + } + if n < 0 { + panic(nLT0) } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") + if k < 0 { + panic(kLT0) } - if d != blas.NonUnit && d != blas.Unit { - panic("blas: illegal diagonal") + if lda < k+1 { + panic(badLdA) } - if n < 0 { - panic("blas: n < 0") + if incX == 0 { + panic(zeroIncX) } - if k < 0 { - panic("blas: k < 0") + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(n-1)+k+1 { + panic(shortA) + } + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) } var _a *float64 if len(a) > 0 { @@ -2051,44 +2623,68 @@ func (Implementation) Dtbsv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n, k i if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if lda*(n-1)+k+1 > len(a) || lda < k+1 { - panic("blas: index of a out of range") - } - C.cblas_dtbsv(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), (*C.double)(_a), C.int(lda), (*C.double)(_x), C.int(incX)) + C.cblas_dtbsv(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(tA), C.CBLAS_DIAG(d), C.int(n), C.int(k), (*C.double)(_a), C.int(lda), (*C.double)(_x), C.int(incX)) } -// Dtpsv solves -// A * x = b if tA == blas.NoTrans -// A^T * x = b if tA == blas.Trans or blas.ConjTrans -// where A is an n×n triangular matrix in packed format and x is a vector. +// Dtpsv solves one of the systems of equations +// +// A * x = b if tA == blas.NoTrans +// Aᵀ * x = b if tA == blas.Trans or blas.ConjTrans +// +// where A is an n×n triangular matrix in packed format, and x and b are vectors. +// // At entry to the function, x contains the values of b, and the result is -// stored in place into x. +// 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) Dtpsv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, ap, x []float64, incX int) { - // declared at cblas.h:233:6 void cblas_dtpsv ... - - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + // declared at cblas.h:229:6 void cblas_dtpsv ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + switch d { + case blas.NonUnit: + d = C.CblasNonUnit + case blas.Unit: + d = C.CblasUnit + default: + panic(badDiag) + } + if n < 0 { + panic(nLT0) } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") + if incX == 0 { + panic(zeroIncX) } - if d != blas.NonUnit && d != blas.Unit { - panic("blas: illegal diagonal") + + // Quick return if possible. + if n == 0 { + return } - if n < 0 { - panic("blas: n < 0") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(ap) < n*(n+1)/2 { + panic(shortAP) } - if n*(n+1)/2 > len(ap) { - panic("blas: index of ap out of range") + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) } var _ap *float64 if len(ap) > 0 { @@ -2098,134 +2694,223 @@ func (Implementation) Dtpsv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if n == 0 { - return - } - C.cblas_dtpsv(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.enum_CBLAS_TRANSPOSE(tA), C.enum_CBLAS_DIAG(d), C.int(n), (*C.double)(_ap), (*C.double)(_x), C.int(incX)) + C.cblas_dtpsv(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(tA), C.CBLAS_DIAG(d), C.int(n), (*C.double)(_ap), (*C.double)(_x), C.int(incX)) } +// Cgemv performs one of the matrix-vector operations +// +// y = alpha * A * x + beta * y if trans = blas.NoTrans +// y = alpha * Aᵀ * x + beta * y if trans = blas.Trans +// y = alpha * Aᴴ * 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. +// +// Complex64 implementations are autogenerated and not directly tested. func (Implementation) Cgemv(tA blas.Transpose, m, n int, alpha complex64, a []complex64, lda int, x []complex64, incX int, beta complex64, y []complex64, incY int) { - // declared at cblas.h:237:6 void cblas_cgemv ... - - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") + // declared at cblas.h:233:6 void cblas_cgemv ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) } if m < 0 { - panic("blas: m < 0") + panic(mLT0) } if n < 0 { - panic("blas: n < 0") - } - var _a *complex64 - if len(a) > 0 { - _a = &a[0] + panic(nLT0) } - var _x *complex64 - if len(x) > 0 { - _x = &x[0] + if lda < max(1, n) { + panic(badLdA) } if incX == 0 { - panic("blas: zero x index increment") - } - var _y *complex64 - if len(y) > 0 { - _y = &y[0] + panic(zeroIncX) } if incY == 0 { - panic("blas: zero y index increment") + panic(zeroIncY) + } + + // Quick return if possible. + if m == 0 || n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(m-1)+n { + panic(shortA) } var lenX, lenY int - if tA == blas.NoTrans { + if tA == C.CblasNoTrans { lenX, lenY = n, m } else { lenX, lenY = m, n } - if (incX > 0 && (lenX-1)*incX >= len(x)) || (incX < 0 && (1-lenX)*incX >= len(x)) { - panic("blas: x index out of range") + if (incX > 0 && len(x) <= (lenX-1)*incX) || (incX < 0 && len(x) <= (1-lenX)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (lenY-1)*incY) || (incY < 0 && len(y) <= (1-lenY)*incY) { + panic(shortY) + } + var _a *complex64 + if len(a) > 0 { + _a = &a[0] } - if (incY > 0 && (lenY-1)*incY >= len(y)) || (incY < 0 && (1-lenY)*incY >= len(y)) { - panic("blas: y index out of range") + var _x *complex64 + if len(x) > 0 { + _x = &x[0] } - if lda*(m-1)+n > len(a) || lda < max(1, n) { - panic("blas: index of a out of range") + var _y *complex64 + if len(y) > 0 { + _y = &y[0] } - C.cblas_cgemv(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_TRANSPOSE(tA), C.int(m), C.int(n), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(&beta), unsafe.Pointer(_y), C.int(incY)) + C.cblas_cgemv(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_TRANSPOSE(tA), C.int(m), C.int(n), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(&beta), unsafe.Pointer(_y), C.int(incY)) } +// Cgbmv performs one of the matrix-vector operations +// +// y = alpha * A * x + beta * y if trans = blas.NoTrans +// y = alpha * Aᵀ * x + beta * y if trans = blas.Trans +// y = alpha * Aᴴ * x + beta * y if trans = blas.ConjTrans +// +// where alpha and beta are scalars, x and y are vectors, and A is an m×n band matrix +// with kL sub-diagonals and kU super-diagonals. +// +// Complex64 implementations are autogenerated and not directly tested. func (Implementation) Cgbmv(tA blas.Transpose, m, n, kL, kU int, alpha complex64, a []complex64, lda int, x []complex64, incX int, beta complex64, y []complex64, incY int) { - // declared at cblas.h:242:6 void cblas_cgbmv ... - - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") + // declared at cblas.h:238:6 void cblas_cgbmv ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) } if m < 0 { - panic("blas: m < 0") + panic(mLT0) } if n < 0 { - panic("blas: n < 0") + panic(nLT0) } if kL < 0 { - panic("blas: kL < 0") + panic(kLLT0) } if kU < 0 { - panic("blas: kU < 0") - } - var _a *complex64 - if len(a) > 0 { - _a = &a[0] + panic(kULT0) } - var _x *complex64 - if len(x) > 0 { - _x = &x[0] + if lda < kL+kU+1 { + panic(badLdA) } if incX == 0 { - panic("blas: zero x index increment") - } - var _y *complex64 - if len(y) > 0 { - _y = &y[0] + panic(zeroIncX) } if incY == 0 { - panic("blas: zero y index increment") + panic(zeroIncY) + } + + // Quick return if possible. + if m == 0 || n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(min(m, n+kL)-1)+kL+kU+1 { + panic(shortA) } var lenX, lenY int - if tA == blas.NoTrans { + if tA == C.CblasNoTrans { lenX, lenY = n, m } else { lenX, lenY = m, n } - if (incX > 0 && (lenX-1)*incX >= len(x)) || (incX < 0 && (1-lenX)*incX >= len(x)) { - panic("blas: x index out of range") + if (incX > 0 && len(x) <= (lenX-1)*incX) || (incX < 0 && len(x) <= (1-lenX)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (lenY-1)*incY) || (incY < 0 && len(y) <= (1-lenY)*incY) { + panic(shortY) + } + var _a *complex64 + if len(a) > 0 { + _a = &a[0] } - if (incY > 0 && (lenY-1)*incY >= len(y)) || (incY < 0 && (1-lenY)*incY >= len(y)) { - panic("blas: y index out of range") + var _x *complex64 + if len(x) > 0 { + _x = &x[0] } - if lda*(min(m, n+kL)-1)+kL+kU+1 > len(a) || lda < kL+kU+1 { - panic("blas: index of a out of range") + var _y *complex64 + if len(y) > 0 { + _y = &y[0] } - C.cblas_cgbmv(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)) + C.cblas_cgbmv(C.CBLAS_LAYOUT(rowMajor), C.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)) } +// Ctrmv performs one of the matrix-vector operations +// +// x = A * x if trans = blas.NoTrans +// x = Aᵀ * x if trans = blas.Trans +// x = Aᴴ * x if trans = blas.ConjTrans +// +// where x is a vector, and A is an n×n triangular matrix. +// +// Complex64 implementations are autogenerated and not directly tested. func (Implementation) Ctrmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, a []complex64, lda int, x []complex64, incX int) { - // declared at cblas.h:247:6 void cblas_ctrmv ... - - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + // declared at cblas.h:243:6 void cblas_ctrmv ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + switch d { + case blas.NonUnit: + d = C.CblasNonUnit + case blas.Unit: + d = C.CblasUnit + default: + panic(badDiag) + } + if n < 0 { + panic(nLT0) + } + if lda < max(1, n) { + panic(badLdA) } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") + if incX == 0 { + panic(zeroIncX) + } + + // Quick return if possible. + if n == 0 { + return } - if d != blas.NonUnit && d != blas.Unit { - panic("blas: illegal diagonal") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(n-1)+n { + panic(shortA) } - if n < 0 { - panic("blas: n < 0") + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) } var _a *complex64 if len(a) > 0 { @@ -2235,35 +2920,72 @@ func (Implementation) Ctrmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if lda*(n-1)+n > len(a) || lda < max(1, n) { - panic("blas: index of a out of range") - } - C.cblas_ctrmv(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(_a), C.int(lda), unsafe.Pointer(_x), C.int(incX)) + C.cblas_ctrmv(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(tA), C.CBLAS_DIAG(d), C.int(n), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_x), C.int(incX)) } +// Ctbmv performs one of the matrix-vector operations +// +// x = A * x if trans = blas.NoTrans +// x = Aᵀ * x if trans = blas.Trans +// x = Aᴴ * x if trans = blas.ConjTrans +// +// where x is an n element vector and A is an n×n triangular band matrix, with +// (k+1) diagonals. +// +// Complex64 implementations are autogenerated and not directly tested. func (Implementation) Ctbmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n, k int, a []complex64, lda int, x []complex64, incX int) { - // declared at cblas.h:251:6 void cblas_ctbmv ... - - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + // declared at cblas.h:247:6 void cblas_ctbmv ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + switch d { + case blas.NonUnit: + d = C.CblasNonUnit + case blas.Unit: + d = C.CblasUnit + default: + panic(badDiag) + } + if n < 0 { + panic(nLT0) + } + if k < 0 { + panic(kLT0) } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") + if lda < k+1 { + panic(badLdA) } - if d != blas.NonUnit && d != blas.Unit { - panic("blas: illegal diagonal") + if incX == 0 { + panic(zeroIncX) } - if n < 0 { - panic("blas: n < 0") + + // Quick return if possible. + if n == 0 { + return } - if k < 0 { - panic("blas: k < 0") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(n-1)+k+1 { + panic(shortA) + } + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) } var _a *complex64 if len(a) > 0 { @@ -2273,35 +2995,66 @@ func (Implementation) Ctbmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n, k i if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if lda*(n-1)+k+1 > len(a) || lda < k+1 { - panic("blas: index of a out of range") - } - C.cblas_ctbmv(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)) + C.cblas_ctbmv(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(tA), C.CBLAS_DIAG(d), C.int(n), C.int(k), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_x), C.int(incX)) } +// Ctpmv performs one of the matrix-vector operations +// +// x = A * x if trans = blas.NoTrans +// x = Aᵀ * x if trans = blas.Trans +// x = Aᴴ * x if trans = blas.ConjTrans +// +// where x is an n element vector and A is an n×n triangular matrix, supplied in +// packed form. +// +// Complex64 implementations are autogenerated and not directly tested. func (Implementation) Ctpmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, ap, x []complex64, incX int) { - // declared at cblas.h:255:6 void cblas_ctpmv ... - - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + // declared at cblas.h:251:6 void cblas_ctpmv ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + switch d { + case blas.NonUnit: + d = C.CblasNonUnit + case blas.Unit: + d = C.CblasUnit + default: + panic(badDiag) + } + if n < 0 { + panic(nLT0) } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") + if incX == 0 { + panic(zeroIncX) } - if d != blas.NonUnit && d != blas.Unit { - panic("blas: illegal diagonal") + + // Quick return if possible. + if n == 0 { + return } - if n < 0 { - panic("blas: n < 0") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(ap) < n*(n+1)/2 { + panic(shortAP) } - if n*(n+1)/2 > len(ap) { - panic("blas: index of ap out of range") + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) } var _ap *complex64 if len(ap) > 0 { @@ -2311,32 +3064,74 @@ func (Implementation) Ctpmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") + C.cblas_ctpmv(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(tA), C.CBLAS_DIAG(d), C.int(n), unsafe.Pointer(_ap), unsafe.Pointer(_x), C.int(incX)) +} + +// Ctrsv solves one of the systems of equations +// +// A * x = b if trans == blas.NoTrans +// Aᵀ * x = b if trans == blas.Trans +// Aᴴ * 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. +// +// Complex64 implementations are autogenerated and not directly tested. +func (Implementation) Ctrsv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, a []complex64, lda int, x []complex64, incX int) { + // declared at cblas.h:254:6 void cblas_ctrsv ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + switch d { + case blas.NonUnit: + d = C.CblasNonUnit + case blas.Unit: + d = C.CblasUnit + default: + panic(badDiag) + } + if n < 0 { + panic(nLT0) + } + if lda < max(1, n) { + panic(badLdA) } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") + if incX == 0 { + panic(zeroIncX) } + + // Quick return if possible. if n == 0 { return } - C.cblas_ctpmv(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)) -} - -func (Implementation) Ctrsv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, a []complex64, lda int, x []complex64, incX int) { - // declared at cblas.h:258:6 void cblas_ctrsv ... - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") - } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(n-1)+n { + panic(shortA) } - if d != blas.NonUnit && d != blas.Unit { - panic("blas: illegal diagonal") - } - if n < 0 { - panic("blas: n < 0") + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) } var _a *complex64 if len(a) > 0 { @@ -2346,35 +3141,78 @@ func (Implementation) Ctrsv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if lda*(n-1)+n > len(a) || lda < max(1, n) { - panic("blas: index of a out of range") - } - C.cblas_ctrsv(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(_a), C.int(lda), unsafe.Pointer(_x), C.int(incX)) + C.cblas_ctrsv(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(tA), C.CBLAS_DIAG(d), C.int(n), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_x), C.int(incX)) } +// Ctbsv solves one of the systems of equations +// +// A * x = b if trans == blas.NoTrans +// Aᵀ * x = b if trans == blas.Trans +// Aᴴ * x = b if trans == blas.ConjTrans +// +// where b and x are n element vectors and A is an n×n triangular band matrix +// with (k+1) diagonals. +// +// 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. +// +// Complex64 implementations are autogenerated and not directly tested. func (Implementation) Ctbsv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n, k int, a []complex64, lda int, x []complex64, incX int) { - // declared at cblas.h:262:6 void cblas_ctbsv ... - - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + // declared at cblas.h:258:6 void cblas_ctbsv ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + switch d { + case blas.NonUnit: + d = C.CblasNonUnit + case blas.Unit: + d = C.CblasUnit + default: + panic(badDiag) + } + if n < 0 { + panic(nLT0) } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") + if k < 0 { + panic(kLT0) } - if d != blas.NonUnit && d != blas.Unit { - panic("blas: illegal diagonal") + if lda < k+1 { + panic(badLdA) } - if n < 0 { - panic("blas: n < 0") + if incX == 0 { + panic(zeroIncX) } - if k < 0 { - panic("blas: k < 0") + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(n-1)+k+1 { + panic(shortA) + } + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) } var _a *complex64 if len(a) > 0 { @@ -2384,35 +3222,72 @@ func (Implementation) Ctbsv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n, k i if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if lda*(n-1)+k+1 > len(a) || lda < k+1 { - panic("blas: index of a out of range") - } - C.cblas_ctbsv(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)) + C.cblas_ctbsv(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(tA), C.CBLAS_DIAG(d), C.int(n), C.int(k), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_x), C.int(incX)) } +// Ctpsv solves one of the systems of equations +// +// A * x = b if trans == blas.NoTrans +// Aᵀ * x = b if trans == blas.Trans +// Aᴴ * x = b if trans == blas.ConjTrans +// +// where b and x are n element vectors and A is an n×n triangular matrix in +// packed form. +// +// 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. +// +// Complex64 implementations are autogenerated and not directly tested. func (Implementation) Ctpsv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, ap, x []complex64, incX int) { - // declared at cblas.h:266:6 void cblas_ctpsv ... - - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + // declared at cblas.h:262:6 void cblas_ctpsv ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + switch d { + case blas.NonUnit: + d = C.CblasNonUnit + case blas.Unit: + d = C.CblasUnit + default: + panic(badDiag) + } + if n < 0 { + panic(nLT0) } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") + if incX == 0 { + panic(zeroIncX) } - if d != blas.NonUnit && d != blas.Unit { - panic("blas: illegal diagonal") + + // Quick return if possible. + if n == 0 { + return } - if n < 0 { - panic("blas: n < 0") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(ap) < n*(n+1)/2 { + panic(shortAP) } - if n*(n+1)/2 > len(ap) { - panic("blas: index of ap out of range") + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) } var _ap *complex64 if len(ap) > 0 { @@ -2422,134 +3297,217 @@ func (Implementation) Ctpsv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if n == 0 { - return - } - 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)) + C.cblas_ctpsv(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(tA), C.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ᵀ * x + beta * y if trans = blas.Trans +// y = alpha * Aᴴ * 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 ... - - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") + // declared at cblas.h:266:6 void cblas_zgemv ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) } if m < 0 { - panic("blas: m < 0") + panic(mLT0) } if n < 0 { - panic("blas: n < 0") - } - var _a *complex128 - if len(a) > 0 { - _a = &a[0] + panic(nLT0) } - var _x *complex128 - if len(x) > 0 { - _x = &x[0] + if lda < max(1, n) { + panic(badLdA) } if incX == 0 { - panic("blas: zero x index increment") - } - var _y *complex128 - if len(y) > 0 { - _y = &y[0] + panic(zeroIncX) } if incY == 0 { - panic("blas: zero y index increment") + panic(zeroIncY) + } + + // Quick return if possible. + if m == 0 || n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(m-1)+n { + panic(shortA) } var lenX, lenY int - if tA == blas.NoTrans { + if tA == C.CblasNoTrans { lenX, lenY = n, m } else { lenX, lenY = m, n } - if (incX > 0 && (lenX-1)*incX >= len(x)) || (incX < 0 && (1-lenX)*incX >= len(x)) { - panic("blas: x index out of range") + if (incX > 0 && len(x) <= (lenX-1)*incX) || (incX < 0 && len(x) <= (1-lenX)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (lenY-1)*incY) || (incY < 0 && len(y) <= (1-lenY)*incY) { + panic(shortY) + } + var _a *complex128 + if len(a) > 0 { + _a = &a[0] } - if (incY > 0 && (lenY-1)*incY >= len(y)) || (incY < 0 && (1-lenY)*incY >= len(y)) { - panic("blas: y index out of range") + var _x *complex128 + if len(x) > 0 { + _x = &x[0] } - if lda*(m-1)+n > len(a) || lda < max(1, n) { - panic("blas: index of a out of range") + var _y *complex128 + if len(y) > 0 { + _y = &y[0] } - C.cblas_zgemv(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_TRANSPOSE(tA), C.int(m), C.int(n), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(&beta), unsafe.Pointer(_y), C.int(incY)) + C.cblas_zgemv(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_TRANSPOSE(tA), C.int(m), C.int(n), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(&beta), unsafe.Pointer(_y), C.int(incY)) } +// Zgbmv performs one of the matrix-vector operations +// +// y = alpha * A * x + beta * y if trans = blas.NoTrans +// y = alpha * Aᵀ * x + beta * y if trans = blas.Trans +// y = alpha * Aᴴ * x + beta * y if trans = blas.ConjTrans +// +// where alpha and beta are scalars, x and y are vectors, and A is an m×n band matrix +// with kL sub-diagonals and kU super-diagonals. func (Implementation) Zgbmv(tA blas.Transpose, m, n, kL, kU int, alpha complex128, a []complex128, lda int, x []complex128, incX int, beta complex128, y []complex128, incY int) { - // declared at cblas.h:275:6 void cblas_zgbmv ... - - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") + // declared at cblas.h:271:6 void cblas_zgbmv ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) } if m < 0 { - panic("blas: m < 0") + panic(mLT0) } if n < 0 { - panic("blas: n < 0") + panic(nLT0) } if kL < 0 { - panic("blas: kL < 0") + panic(kLLT0) } if kU < 0 { - panic("blas: kU < 0") - } - var _a *complex128 - if len(a) > 0 { - _a = &a[0] + panic(kULT0) } - var _x *complex128 - if len(x) > 0 { - _x = &x[0] + if lda < kL+kU+1 { + panic(badLdA) } if incX == 0 { - panic("blas: zero x index increment") - } - var _y *complex128 - if len(y) > 0 { - _y = &y[0] + panic(zeroIncX) } if incY == 0 { - panic("blas: zero y index increment") + panic(zeroIncY) } - var lenX, lenY int - if tA == blas.NoTrans { - lenX, lenY = n, m - } else { - lenX, lenY = m, n + + // Quick return if possible. + if m == 0 || n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(min(m, n+kL)-1)+kL+kU+1 { + panic(shortA) + } + var lenX, lenY int + if tA == C.CblasNoTrans { + lenX, lenY = n, m + } else { + lenX, lenY = m, n + } + if (incX > 0 && len(x) <= (lenX-1)*incX) || (incX < 0 && len(x) <= (1-lenX)*incX) { + panic(shortX) } - if (incX > 0 && (lenX-1)*incX >= len(x)) || (incX < 0 && (1-lenX)*incX >= len(x)) { - panic("blas: x index out of range") + if (incY > 0 && len(y) <= (lenY-1)*incY) || (incY < 0 && len(y) <= (1-lenY)*incY) { + panic(shortY) + } + var _a *complex128 + if len(a) > 0 { + _a = &a[0] } - if (incY > 0 && (lenY-1)*incY >= len(y)) || (incY < 0 && (1-lenY)*incY >= len(y)) { - panic("blas: y index out of range") + var _x *complex128 + if len(x) > 0 { + _x = &x[0] } - if lda*(min(m, n+kL)-1)+kL+kU+1 > len(a) || lda < kL+kU+1 { - panic("blas: index of a out of range") + var _y *complex128 + if len(y) > 0 { + _y = &y[0] } - 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)) + C.cblas_zgbmv(C.CBLAS_LAYOUT(rowMajor), C.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ᵀ * x if trans = blas.Trans +// x = Aᴴ * 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 ... - - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + // declared at cblas.h:276:6 void cblas_ztrmv ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + switch d { + case blas.NonUnit: + d = C.CblasNonUnit + case blas.Unit: + d = C.CblasUnit + default: + panic(badDiag) + } + if n < 0 { + panic(nLT0) + } + if lda < max(1, n) { + panic(badLdA) + } + if incX == 0 { + panic(zeroIncX) } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") + + // Quick return if possible. + if n == 0 { + return } - if d != blas.NonUnit && d != blas.Unit { - panic("blas: illegal diagonal") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(n-1)+n { + panic(shortA) } - if n < 0 { - panic("blas: n < 0") + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) } var _a *complex128 if len(a) > 0 { @@ -2559,35 +3517,70 @@ func (Implementation) Ztrmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if lda*(n-1)+n > len(a) || lda < max(1, n) { - panic("blas: index of a out of range") - } - C.cblas_ztrmv(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(_a), C.int(lda), unsafe.Pointer(_x), C.int(incX)) + C.cblas_ztrmv(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(tA), C.CBLAS_DIAG(d), C.int(n), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_x), C.int(incX)) } +// Ztbmv performs one of the matrix-vector operations +// +// x = A * x if trans = blas.NoTrans +// x = Aᵀ * x if trans = blas.Trans +// x = Aᴴ * x if trans = blas.ConjTrans +// +// where x is an n element vector and A is an n×n triangular band matrix, with +// (k+1) diagonals. func (Implementation) Ztbmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n, k int, a []complex128, lda int, x []complex128, incX int) { - // declared at cblas.h:284:6 void cblas_ztbmv ... - - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + // declared at cblas.h:280:6 void cblas_ztbmv ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + switch d { + case blas.NonUnit: + d = C.CblasNonUnit + case blas.Unit: + d = C.CblasUnit + default: + panic(badDiag) + } + if n < 0 { + panic(nLT0) } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") + if k < 0 { + panic(kLT0) } - if d != blas.NonUnit && d != blas.Unit { - panic("blas: illegal diagonal") + if lda < k+1 { + panic(badLdA) } - if n < 0 { - panic("blas: n < 0") + if incX == 0 { + panic(zeroIncX) } - if k < 0 { - panic("blas: k < 0") + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(n-1)+k+1 { + panic(shortA) + } + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) } var _a *complex128 if len(a) > 0 { @@ -2597,35 +3590,64 @@ func (Implementation) Ztbmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n, k i if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if lda*(n-1)+k+1 > len(a) || lda < k+1 { - panic("blas: index of a out of range") - } - 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)) + C.cblas_ztbmv(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(tA), C.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ᵀ * x if trans = blas.Trans +// x = Aᴴ * 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 ... - - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + // declared at cblas.h:284:6 void cblas_ztpmv ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + switch d { + case blas.NonUnit: + d = C.CblasNonUnit + case blas.Unit: + d = C.CblasUnit + default: + panic(badDiag) + } + if n < 0 { + panic(nLT0) } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") + if incX == 0 { + panic(zeroIncX) } - if d != blas.NonUnit && d != blas.Unit { - panic("blas: illegal diagonal") + + // Quick return if possible. + if n == 0 { + return } - if n < 0 { - panic("blas: n < 0") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(ap) < n*(n+1)/2 { + panic(shortAP) } - if n*(n+1)/2 > len(ap) { - panic("blas: index of ap out of range") + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) } var _ap *complex128 if len(ap) > 0 { @@ -2635,32 +3657,72 @@ func (Implementation) Ztpmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") + C.cblas_ztpmv(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(tA), C.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ᵀ * x = b if trans == blas.Trans +// Aᴴ * 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:287:6 void cblas_ztrsv ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + switch d { + case blas.NonUnit: + d = C.CblasNonUnit + case blas.Unit: + d = C.CblasUnit + default: + panic(badDiag) + } + if n < 0 { + panic(nLT0) + } + if lda < max(1, n) { + panic(badLdA) } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") + if incX == 0 { + panic(zeroIncX) } + + // Quick return if possible. if n == 0 { return } - 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)) -} - -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 ... - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") - } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(n-1)+n { + panic(shortA) } - if d != blas.NonUnit && d != blas.Unit { - panic("blas: illegal diagonal") - } - if n < 0 { - panic("blas: n < 0") + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) } var _a *complex128 if len(a) > 0 { @@ -2670,35 +3732,76 @@ func (Implementation) Ztrsv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if lda*(n-1)+n > len(a) || lda < max(1, n) { - panic("blas: index of a out of range") - } - C.cblas_ztrsv(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(_a), C.int(lda), unsafe.Pointer(_x), C.int(incX)) + C.cblas_ztrsv(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(tA), C.CBLAS_DIAG(d), C.int(n), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_x), C.int(incX)) } +// Ztbsv solves one of the systems of equations +// +// A * x = b if trans == blas.NoTrans +// Aᵀ * x = b if trans == blas.Trans +// Aᴴ * x = b if trans == blas.ConjTrans +// +// where b and x are n element vectors and A is an n×n triangular band matrix +// with (k+1) diagonals. +// +// 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) Ztbsv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n, k int, a []complex128, lda int, x []complex128, incX int) { - // declared at cblas.h:295:6 void cblas_ztbsv ... - - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + // declared at cblas.h:291:6 void cblas_ztbsv ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + switch d { + case blas.NonUnit: + d = C.CblasNonUnit + case blas.Unit: + d = C.CblasUnit + default: + panic(badDiag) + } + if n < 0 { + panic(nLT0) } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") + if k < 0 { + panic(kLT0) } - if d != blas.NonUnit && d != blas.Unit { - panic("blas: illegal diagonal") + if lda < k+1 { + panic(badLdA) } - if n < 0 { - panic("blas: n < 0") + if incX == 0 { + panic(zeroIncX) } - if k < 0 { - panic("blas: k < 0") + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(n-1)+k+1 { + panic(shortA) + } + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) } var _a *complex128 if len(a) > 0 { @@ -2708,35 +3811,70 @@ func (Implementation) Ztbsv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n, k i if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if lda*(n-1)+k+1 > len(a) || lda < k+1 { - panic("blas: index of a out of range") - } - C.cblas_ztbsv(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)) + C.cblas_ztbsv(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(tA), C.CBLAS_DIAG(d), C.int(n), C.int(k), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_x), C.int(incX)) } +// Ztpsv solves one of the systems of equations +// +// A * x = b if trans == blas.NoTrans +// Aᵀ * x = b if trans == blas.Trans +// Aᴴ * x = b if trans == blas.ConjTrans +// +// where b and x are n element vectors and A is an n×n triangular matrix in +// packed form. +// +// 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) Ztpsv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, ap, x []complex128, incX int) { - // declared at cblas.h:299:6 void cblas_ztpsv ... - - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + // declared at cblas.h:295:6 void cblas_ztpsv ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + switch d { + case blas.NonUnit: + d = C.CblasNonUnit + case blas.Unit: + d = C.CblasUnit + default: + panic(badDiag) + } + if n < 0 { + panic(nLT0) } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") + if incX == 0 { + panic(zeroIncX) } - if d != blas.NonUnit && d != blas.Unit { - panic("blas: illegal diagonal") + + // Quick return if possible. + if n == 0 { + return } - if n < 0 { - panic("blas: n < 0") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(ap) < n*(n+1)/2 { + panic(shortAP) } - if n*(n+1)/2 > len(ap) { - panic("blas: index of ap out of range") + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) } var _ap *complex128 if len(ap) > 0 { @@ -2746,30 +3884,53 @@ func (Implementation) Ztpsv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, if len(x) > 0 { _x = &x[0] } + C.cblas_ztpsv(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(tA), C.CBLAS_DIAG(d), C.int(n), unsafe.Pointer(_ap), unsafe.Pointer(_x), C.int(incX)) +} + +// Ssymv performs the matrix-vector operation +// +// y = alpha * A * x + beta * y +// +// where A is an n×n symmetric matrix, x and y are vectors, and alpha and +// beta are scalars. +func (Implementation) Ssymv(ul blas.Uplo, n int, alpha float32, a []float32, lda int, x []float32, incX int, beta float32, y []float32, incY int) { + // declared at cblas.h:303:6 void cblas_ssymv ... + + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + if n < 0 { + panic(nLT0) + } + if lda < max(1, n) { + panic(badLdA) + } if incX == 0 { - panic("blas: zero x index increment") + panic(zeroIncX) } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") + if incY == 0 { + panic(zeroIncY) } + + // Quick return if possible. if n == 0 { return } - C.cblas_ztpsv(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)) -} - -// Ssymv computes -// y = alpha * A * x + beta * y, -// where a is an n×n symmetric matrix, x and y are vectors, and alpha and -// beta are scalars. -func (Implementation) Ssymv(ul blas.Uplo, n int, alpha float32, a []float32, lda int, x []float32, incX int, beta float32, y []float32, incY int) { - // declared at cblas.h:307:6 void cblas_ssymv ... - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(n-1)+n { + panic(shortA) } - if n < 0 { - panic("blas: n < 0") + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) } var _a *float32 if len(a) > 0 { @@ -2779,43 +3940,60 @@ func (Implementation) Ssymv(ul blas.Uplo, n int, alpha float32, a []float32, lda if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *float32 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") - } - if lda*(n-1)+n > len(a) || lda < max(1, n) { - panic("blas: index of a out of range") - } - C.cblas_ssymv(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.int(n), C.float(alpha), (*C.float)(_a), C.int(lda), (*C.float)(_x), C.int(incX), C.float(beta), (*C.float)(_y), C.int(incY)) + C.cblas_ssymv(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.int(n), C.float(alpha), (*C.float)(_a), C.int(lda), (*C.float)(_x), C.int(incX), C.float(beta), (*C.float)(_y), C.int(incY)) } -// Ssbmv performs -// y = alpha * A * x + beta * y -// where A is an n×n symmetric banded matrix, x and y are vectors, and alpha -// and beta are scalars. +// Ssbmv performs the matrix-vector operation +// +// y = alpha * A * x + beta * y +// +// where A is an n×n symmetric band matrix with k super-diagonals, x and y are +// vectors, and alpha and beta are scalars. func (Implementation) Ssbmv(ul blas.Uplo, n, k int, alpha float32, a []float32, lda int, x []float32, incX int, beta float32, y []float32, incY int) { - // declared at cblas.h:311:6 void cblas_ssbmv ... + // declared at cblas.h:307:6 void cblas_ssbmv ... - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) } if n < 0 { - panic("blas: n < 0") + panic(nLT0) } if k < 0 { - panic("blas: k < 0") + panic(kLT0) + } + if lda < k+1 { + panic(badLdA) + } + if incX == 0 { + panic(zeroIncX) + } + if incY == 0 { + panic(zeroIncY) + } + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(n-1)+k+1 { + panic(shortA) + } + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) } var _a *float32 if len(a) > 0 { @@ -2825,43 +4003,54 @@ func (Implementation) Ssbmv(ul blas.Uplo, n, k int, alpha float32, a []float32, if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *float32 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") - } - if lda*(n-1)+k+1 > len(a) || lda < k+1 { - panic("blas: index of a out of range") - } - C.cblas_ssbmv(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.int(n), C.int(k), C.float(alpha), (*C.float)(_a), C.int(lda), (*C.float)(_x), C.int(incX), C.float(beta), (*C.float)(_y), C.int(incY)) + C.cblas_ssbmv(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.int(n), C.int(k), C.float(alpha), (*C.float)(_a), C.int(lda), (*C.float)(_x), C.int(incX), C.float(beta), (*C.float)(_y), C.int(incY)) } -// Sspmv performs -// y = alpha * A * x + beta * y, -// where A is an n×n symmetric matrix in packed format, x and y are vectors +// Sspmv performs the matrix-vector operation +// +// y = alpha * A * x + beta * y +// +// where A is an n×n symmetric matrix in packed format, x and y are vectors, // and alpha and beta are scalars. func (Implementation) Sspmv(ul blas.Uplo, n int, alpha float32, ap, x []float32, incX int, beta float32, y []float32, incY int) { - // declared at cblas.h:315:6 void cblas_sspmv ... + // declared at cblas.h:311:6 void cblas_sspmv ... - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) } if n < 0 { - panic("blas: n < 0") + panic(nLT0) + } + if incX == 0 { + panic(zeroIncX) + } + if incY == 0 { + panic(zeroIncY) + } + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(ap) < n*(n+1)/2 { + panic(shortAP) + } + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) } - if n*(n+1)/2 > len(ap) { - panic("blas: index of ap out of range") + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) } var _ap *float32 if len(ap) > 0 { @@ -2871,238 +4060,323 @@ func (Implementation) Sspmv(ul blas.Uplo, n int, alpha float32, ap, x []float32, if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *float32 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") - } - if n == 0 { - return - } - C.cblas_sspmv(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.int(n), C.float(alpha), (*C.float)(_ap), (*C.float)(_x), C.int(incX), C.float(beta), (*C.float)(_y), C.int(incY)) + C.cblas_sspmv(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.int(n), C.float(alpha), (*C.float)(_ap), (*C.float)(_x), C.int(incX), C.float(beta), (*C.float)(_y), C.int(incY)) } // Sger performs the rank-one operation -// A += alpha * x * y^T +// +// A += alpha * x * yᵀ +// // where A is an m×n dense matrix, x and y are vectors, and alpha is a scalar. func (Implementation) Sger(m, n int, alpha float32, x []float32, incX int, y []float32, incY int, a []float32, lda int) { - // declared at cblas.h:319:6 void cblas_sger ... + // declared at cblas.h:315:6 void cblas_sger ... if m < 0 { - panic("blas: m < 0") + panic(mLT0) } if n < 0 { - panic("blas: n < 0") + panic(nLT0) + } + if lda < max(1, n) { + panic(badLdA) + } + if incX == 0 { + panic(zeroIncX) + } + if incY == 0 { + panic(zeroIncY) + } + + // Quick return if possible. + if m == 0 || n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (m-1)*incX) || (incX < 0 && len(x) <= (1-m)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) + } + if len(a) < lda*(m-1)+n { + panic(shortA) } var _x *float32 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *float32 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") - } var _a *float32 if len(a) > 0 { _a = &a[0] } - if (incX > 0 && (m-1)*incX >= len(x)) || (incX < 0 && (1-m)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") - } - if lda*(m-1)+n > len(a) || lda < max(1, n) { - panic("blas: index of a out of range") - } - C.cblas_sger(C.enum_CBLAS_ORDER(rowMajor), C.int(m), C.int(n), C.float(alpha), (*C.float)(_x), C.int(incX), (*C.float)(_y), C.int(incY), (*C.float)(_a), C.int(lda)) + C.cblas_sger(C.CBLAS_LAYOUT(rowMajor), C.int(m), C.int(n), C.float(alpha), (*C.float)(_x), C.int(incX), (*C.float)(_y), C.int(incY), (*C.float)(_a), C.int(lda)) } -// Ssyr performs the rank-one update -// a += alpha * x * x^T -// where a is an n×n symmetric matrix, and x is a vector. +// Ssyr performs the symmetric rank-one update +// +// A += alpha * x * xᵀ +// +// where A is an n×n symmetric matrix, and x is a vector. func (Implementation) Ssyr(ul blas.Uplo, n int, alpha float32, x []float32, incX int, a []float32, lda int) { - // declared at cblas.h:322:6 void cblas_ssyr ... + // declared at cblas.h:318:6 void cblas_ssyr ... - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) } if n < 0 { - panic("blas: n < 0") + panic(nLT0) + } + if lda < max(1, n) { + panic(badLdA) + } + if incX == 0 { + panic(zeroIncX) + } + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if len(a) < lda*(n-1)+n { + panic(shortA) } var _x *float32 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _a *float32 if len(a) > 0 { _a = &a[0] } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if lda*(n-1)+n > len(a) || lda < max(1, n) { - panic("blas: index of a out of range") - } - C.cblas_ssyr(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.int(n), C.float(alpha), (*C.float)(_x), C.int(incX), (*C.float)(_a), C.int(lda)) + C.cblas_ssyr(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.int(n), C.float(alpha), (*C.float)(_x), C.int(incX), (*C.float)(_a), C.int(lda)) } -// Sspr computes the rank-one operation -// a += alpha * x * x^T -// where a is an n×n symmetric matrix in packed format, x is a vector, and +// Sspr performs the symmetric rank-one operation +// +// A += alpha * x * xᵀ +// +// where A is an n×n symmetric matrix in packed format, x is a vector, and // alpha is a scalar. func (Implementation) Sspr(ul blas.Uplo, n int, alpha float32, x []float32, incX int, ap []float32) { - // declared at cblas.h:325:6 void cblas_sspr ... + // declared at cblas.h:321:6 void cblas_sspr ... - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) } if n < 0 { - panic("blas: n < 0") - } - var _x *float32 - if len(x) > 0 { - _x = &x[0] + panic(nLT0) } if incX == 0 { - panic("blas: zero x index increment") + panic(zeroIncX) + } + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) } - if n*(n+1)/2 > len(ap) { - panic("blas: index of ap out of range") + if len(ap) < n*(n+1)/2 { + panic(shortAP) } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") + var _x *float32 + if len(x) > 0 { + _x = &x[0] } var _ap *float32 if len(ap) > 0 { _ap = &ap[0] } - if n == 0 { - return - } - C.cblas_sspr(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.int(n), C.float(alpha), (*C.float)(_x), C.int(incX), (*C.float)(_ap)) + C.cblas_sspr(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.int(n), C.float(alpha), (*C.float)(_x), C.int(incX), (*C.float)(_ap)) } // Ssyr2 performs the symmetric rank-two update -// A += alpha * x * y^T + alpha * y * x^T -// where A is a symmetric n×n matrix, x and y are vectors, and alpha is a scalar. +// +// A += alpha * x * yᵀ + alpha * y * xᵀ +// +// where A is an n×n symmetric matrix, x and y are vectors, and alpha is a scalar. func (Implementation) Ssyr2(ul blas.Uplo, n int, alpha float32, x []float32, incX int, y []float32, incY int, a []float32, lda int) { - // declared at cblas.h:328:6 void cblas_ssyr2 ... + // declared at cblas.h:324:6 void cblas_ssyr2 ... - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) } if n < 0 { - panic("blas: n < 0") + panic(nLT0) } - var _x *float32 - if len(x) > 0 { - _x = &x[0] + if lda < max(1, n) { + panic(badLdA) } if incX == 0 { - panic("blas: zero x index increment") - } - var _y *float32 - if len(y) > 0 { - _y = &y[0] + panic(zeroIncX) } if incY == 0 { - panic("blas: zero y index increment") - } - var _a *float32 - if len(a) > 0 { - _a = &a[0] - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") + panic(zeroIncY) } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) + } + if len(a) < lda*(n-1)+n { + panic(shortA) + } + var _x *float32 + if len(x) > 0 { + _x = &x[0] + } + var _y *float32 + if len(y) > 0 { + _y = &y[0] } - if lda*(n-1)+n > len(a) || lda < max(1, n) { - panic("blas: index of a out of range") + var _a *float32 + if len(a) > 0 { + _a = &a[0] } - C.cblas_ssyr2(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.int(n), C.float(alpha), (*C.float)(_x), C.int(incX), (*C.float)(_y), C.int(incY), (*C.float)(_a), C.int(lda)) + C.cblas_ssyr2(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.int(n), C.float(alpha), (*C.float)(_x), C.int(incX), (*C.float)(_y), C.int(incY), (*C.float)(_a), C.int(lda)) } // Sspr2 performs the symmetric rank-2 update -// A += alpha * x * y^T + alpha * y * x^T, +// +// A += alpha * x * yᵀ + alpha * y * xᵀ +// // where A is an n×n symmetric matrix in packed format, x and y are vectors, // and alpha is a scalar. -func (Implementation) Sspr2(ul blas.Uplo, n int, alpha float32, x []float32, incX int, y []float32, incY int, ap []float32) { - // declared at cblas.h:332:6 void cblas_sspr2 ... +func (Implementation) Sspr2(ul blas.Uplo, n int, alpha float32, x []float32, incX int, y []float32, incY int, a []float32) { + // declared at cblas.h:328:6 void cblas_sspr2 ... - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) } if n < 0 { - panic("blas: n < 0") + panic(nLT0) + } + if incX == 0 { + panic(zeroIncX) + } + if incY == 0 { + panic(zeroIncY) + } + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) + } + if len(a) < n*(n+1)/2 { + panic(shortA) } var _x *float32 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *float32 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") + var _a *float32 + if len(a) > 0 { + _a = &a[0] } - if n*(n+1)/2 > len(ap) { - panic("blas: index of ap out of range") + C.cblas_sspr2(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.int(n), C.float(alpha), (*C.float)(_x), C.int(incX), (*C.float)(_y), C.int(incY), (*C.float)(_a)) +} + +// Dsymv performs the matrix-vector operation +// +// y = alpha * A * x + beta * y +// +// where A is an n×n symmetric matrix, x and y are vectors, and alpha and +// beta are scalars. +func (Implementation) Dsymv(ul blas.Uplo, n int, alpha float64, a []float64, lda int, x []float64, incX int, beta float64, y []float64, incY int) { + // declared at cblas.h:332:6 void cblas_dsymv ... + + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") + if n < 0 { + panic(nLT0) } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") + if lda < max(1, n) { + panic(badLdA) } - var _ap *float32 - if len(ap) > 0 { - _ap = &ap[0] + if incX == 0 { + panic(zeroIncX) + } + if incY == 0 { + panic(zeroIncY) } + + // Quick return if possible. if n == 0 { return } - C.cblas_sspr2(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.int(n), C.float(alpha), (*C.float)(_x), C.int(incX), (*C.float)(_y), C.int(incY), (*C.float)(_ap)) -} - -// Dsymv computes -// y = alpha * A * x + beta * y, -// where a is an n×n symmetric matrix, x and y are vectors, and alpha and -// beta are scalars. -func (Implementation) Dsymv(ul blas.Uplo, n int, alpha float64, a []float64, lda int, x []float64, incX int, beta float64, y []float64, incY int) { - // declared at cblas.h:336:6 void cblas_dsymv ... - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(n-1)+n { + panic(shortA) } - if n < 0 { - panic("blas: n < 0") + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) } var _a *float64 if len(a) > 0 { @@ -3112,43 +4386,60 @@ func (Implementation) Dsymv(ul blas.Uplo, n int, alpha float64, a []float64, lda if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *float64 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") - } - if lda*(n-1)+n > len(a) || lda < max(1, n) { - panic("blas: index of a out of range") - } - C.cblas_dsymv(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.int(n), C.double(alpha), (*C.double)(_a), C.int(lda), (*C.double)(_x), C.int(incX), C.double(beta), (*C.double)(_y), C.int(incY)) + C.cblas_dsymv(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.int(n), C.double(alpha), (*C.double)(_a), C.int(lda), (*C.double)(_x), C.int(incX), C.double(beta), (*C.double)(_y), C.int(incY)) } -// Dsbmv performs -// y = alpha * A * x + beta * y -// where A is an n×n symmetric banded matrix, x and y are vectors, and alpha -// and beta are scalars. +// Dsbmv performs the matrix-vector operation +// +// y = alpha * A * x + beta * y +// +// where A is an n×n symmetric band matrix with k super-diagonals, x and y are +// vectors, and alpha and beta are scalars. func (Implementation) Dsbmv(ul blas.Uplo, n, k int, alpha float64, a []float64, lda int, x []float64, incX int, beta float64, y []float64, incY int) { - // declared at cblas.h:340:6 void cblas_dsbmv ... + // declared at cblas.h:336:6 void cblas_dsbmv ... - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) } if n < 0 { - panic("blas: n < 0") + panic(nLT0) } if k < 0 { - panic("blas: k < 0") + panic(kLT0) + } + if lda < k+1 { + panic(badLdA) + } + if incX == 0 { + panic(zeroIncX) + } + if incY == 0 { + panic(zeroIncY) + } + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(n-1)+k+1 { + panic(shortA) + } + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) } var _a *float64 if len(a) > 0 { @@ -3158,43 +4449,54 @@ func (Implementation) Dsbmv(ul blas.Uplo, n, k int, alpha float64, a []float64, if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *float64 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") - } - if lda*(n-1)+k+1 > len(a) || lda < k+1 { - panic("blas: index of a out of range") - } - C.cblas_dsbmv(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.int(n), C.int(k), C.double(alpha), (*C.double)(_a), C.int(lda), (*C.double)(_x), C.int(incX), C.double(beta), (*C.double)(_y), C.int(incY)) + C.cblas_dsbmv(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.int(n), C.int(k), C.double(alpha), (*C.double)(_a), C.int(lda), (*C.double)(_x), C.int(incX), C.double(beta), (*C.double)(_y), C.int(incY)) } -// Dspmv performs -// y = alpha * A * x + beta * y, -// where A is an n×n symmetric matrix in packed format, x and y are vectors +// Dspmv performs the matrix-vector operation +// +// y = alpha * A * x + beta * y +// +// where A is an n×n symmetric matrix in packed format, x and y are vectors, // and alpha and beta are scalars. func (Implementation) Dspmv(ul blas.Uplo, n int, alpha float64, ap, x []float64, incX int, beta float64, y []float64, incY int) { - // declared at cblas.h:344:6 void cblas_dspmv ... + // declared at cblas.h:340:6 void cblas_dspmv ... - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) } if n < 0 { - panic("blas: n < 0") + panic(nLT0) + } + if incX == 0 { + panic(zeroIncX) + } + if incY == 0 { + panic(zeroIncY) + } + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(ap) < n*(n+1)/2 { + panic(shortAP) + } + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) } - if n*(n+1)/2 > len(ap) { - panic("blas: index of ap out of range") + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) } var _ap *float64 if len(ap) > 0 { @@ -3204,234 +4506,326 @@ func (Implementation) Dspmv(ul blas.Uplo, n int, alpha float64, ap, x []float64, if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *float64 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") - } - if n == 0 { - return - } - C.cblas_dspmv(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.int(n), C.double(alpha), (*C.double)(_ap), (*C.double)(_x), C.int(incX), C.double(beta), (*C.double)(_y), C.int(incY)) + C.cblas_dspmv(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.int(n), C.double(alpha), (*C.double)(_ap), (*C.double)(_x), C.int(incX), C.double(beta), (*C.double)(_y), C.int(incY)) } // Dger performs the rank-one operation -// A += alpha * x * y^T +// +// A += alpha * x * yᵀ +// // where A is an m×n dense matrix, x and y are vectors, and alpha is a scalar. func (Implementation) Dger(m, n int, alpha float64, x []float64, incX int, y []float64, incY int, a []float64, lda int) { - // declared at cblas.h:348:6 void cblas_dger ... + // declared at cblas.h:344:6 void cblas_dger ... if m < 0 { - panic("blas: m < 0") + panic(mLT0) } if n < 0 { - panic("blas: n < 0") + panic(nLT0) + } + if lda < max(1, n) { + panic(badLdA) + } + if incX == 0 { + panic(zeroIncX) + } + if incY == 0 { + panic(zeroIncY) + } + + // Quick return if possible. + if m == 0 || n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (m-1)*incX) || (incX < 0 && len(x) <= (1-m)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) + } + if len(a) < lda*(m-1)+n { + panic(shortA) } var _x *float64 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *float64 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") - } var _a *float64 if len(a) > 0 { _a = &a[0] } - if (incX > 0 && (m-1)*incX >= len(x)) || (incX < 0 && (1-m)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") - } - if lda*(m-1)+n > len(a) || lda < max(1, n) { - panic("blas: index of a out of range") - } - C.cblas_dger(C.enum_CBLAS_ORDER(rowMajor), C.int(m), C.int(n), C.double(alpha), (*C.double)(_x), C.int(incX), (*C.double)(_y), C.int(incY), (*C.double)(_a), C.int(lda)) + C.cblas_dger(C.CBLAS_LAYOUT(rowMajor), C.int(m), C.int(n), C.double(alpha), (*C.double)(_x), C.int(incX), (*C.double)(_y), C.int(incY), (*C.double)(_a), C.int(lda)) } -// Dsyr performs the rank-one update -// a += alpha * x * x^T -// where a is an n×n symmetric matrix, and x is a vector. +// Dsyr performs the symmetric rank-one update +// +// A += alpha * x * xᵀ +// +// where A is an n×n symmetric matrix, and x is a vector. func (Implementation) Dsyr(ul blas.Uplo, n int, alpha float64, x []float64, incX int, a []float64, lda int) { - // declared at cblas.h:351:6 void cblas_dsyr ... + // declared at cblas.h:347:6 void cblas_dsyr ... - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) } if n < 0 { - panic("blas: n < 0") + panic(nLT0) + } + if lda < max(1, n) { + panic(badLdA) + } + if incX == 0 { + panic(zeroIncX) + } + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if len(a) < lda*(n-1)+n { + panic(shortA) } var _x *float64 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _a *float64 if len(a) > 0 { _a = &a[0] } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if lda*(n-1)+n > len(a) || lda < max(1, n) { - panic("blas: index of a out of range") - } - C.cblas_dsyr(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.int(n), C.double(alpha), (*C.double)(_x), C.int(incX), (*C.double)(_a), C.int(lda)) + C.cblas_dsyr(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.int(n), C.double(alpha), (*C.double)(_x), C.int(incX), (*C.double)(_a), C.int(lda)) } -// Dspr computes the rank-one operation -// a += alpha * x * x^T -// where a is an n×n symmetric matrix in packed format, x is a vector, and +// Dspr performs the symmetric rank-one operation +// +// A += alpha * x * xᵀ +// +// where A is an n×n symmetric matrix in packed format, x is a vector, and // alpha is a scalar. func (Implementation) Dspr(ul blas.Uplo, n int, alpha float64, x []float64, incX int, ap []float64) { - // declared at cblas.h:354:6 void cblas_dspr ... + // declared at cblas.h:350:6 void cblas_dspr ... - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) } if n < 0 { - panic("blas: n < 0") - } - var _x *float64 - if len(x) > 0 { - _x = &x[0] + panic(nLT0) } if incX == 0 { - panic("blas: zero x index increment") + panic(zeroIncX) + } + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) } - if n*(n+1)/2 > len(ap) { - panic("blas: index of ap out of range") + if len(ap) < n*(n+1)/2 { + panic(shortAP) } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") + var _x *float64 + if len(x) > 0 { + _x = &x[0] } var _ap *float64 if len(ap) > 0 { _ap = &ap[0] } - if n == 0 { - return - } - C.cblas_dspr(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.int(n), C.double(alpha), (*C.double)(_x), C.int(incX), (*C.double)(_ap)) + C.cblas_dspr(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.int(n), C.double(alpha), (*C.double)(_x), C.int(incX), (*C.double)(_ap)) } // Dsyr2 performs the symmetric rank-two update -// A += alpha * x * y^T + alpha * y * x^T -// where A is a symmetric n×n matrix, x and y are vectors, and alpha is a scalar. +// +// A += alpha * x * yᵀ + alpha * y * xᵀ +// +// where A is an n×n symmetric matrix, x and y are vectors, and alpha is a scalar. func (Implementation) Dsyr2(ul blas.Uplo, n int, alpha float64, x []float64, incX int, y []float64, incY int, a []float64, lda int) { - // declared at cblas.h:357:6 void cblas_dsyr2 ... + // declared at cblas.h:353:6 void cblas_dsyr2 ... - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) } if n < 0 { - panic("blas: n < 0") + panic(nLT0) + } + if lda < max(1, n) { + panic(badLdA) + } + if incX == 0 { + panic(zeroIncX) + } + if incY == 0 { + panic(zeroIncY) + } + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) + } + if len(a) < lda*(n-1)+n { + panic(shortA) } var _x *float64 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *float64 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") - } var _a *float64 if len(a) > 0 { _a = &a[0] } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") - } - if lda*(n-1)+n > len(a) || lda < max(1, n) { - panic("blas: index of a out of range") - } - C.cblas_dsyr2(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.int(n), C.double(alpha), (*C.double)(_x), C.int(incX), (*C.double)(_y), C.int(incY), (*C.double)(_a), C.int(lda)) + C.cblas_dsyr2(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.int(n), C.double(alpha), (*C.double)(_x), C.int(incX), (*C.double)(_y), C.int(incY), (*C.double)(_a), C.int(lda)) } // Dspr2 performs the symmetric rank-2 update -// A += alpha * x * y^T + alpha * y * x^T, +// +// A += alpha * x * yᵀ + alpha * y * xᵀ +// // where A is an n×n symmetric matrix in packed format, x and y are vectors, // and alpha is a scalar. -func (Implementation) Dspr2(ul blas.Uplo, n int, alpha float64, x []float64, incX int, y []float64, incY int, ap []float64) { - // declared at cblas.h:361:6 void cblas_dspr2 ... +func (Implementation) Dspr2(ul blas.Uplo, n int, alpha float64, x []float64, incX int, y []float64, incY int, a []float64) { + // declared at cblas.h:357:6 void cblas_dspr2 ... - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) } if n < 0 { - panic("blas: n < 0") + panic(nLT0) + } + if incX == 0 { + panic(zeroIncX) + } + if incY == 0 { + panic(zeroIncY) + } + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) + } + if len(a) < n*(n+1)/2 { + panic(shortA) } var _x *float64 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *float64 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") + var _a *float64 + if len(a) > 0 { + _a = &a[0] } - if n*(n+1)/2 > len(ap) { - panic("blas: index of ap out of range") + C.cblas_dspr2(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.int(n), C.double(alpha), (*C.double)(_x), C.int(incX), (*C.double)(_y), C.int(incY), (*C.double)(_a)) +} + +// Chemv 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. +// +// Complex64 implementations are autogenerated and not directly tested. +func (Implementation) Chemv(ul blas.Uplo, n int, alpha complex64, a []complex64, lda int, x []complex64, incX int, beta complex64, y []complex64, incY int) { + // declared at cblas.h:365:6 void cblas_chemv ... + + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + if n < 0 { + panic(nLT0) } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") + if lda < max(1, n) { + panic(badLdA) } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") + if incX == 0 { + panic(zeroIncX) } - var _ap *float64 - if len(ap) > 0 { - _ap = &ap[0] + if incY == 0 { + panic(zeroIncY) } + + // Quick return if possible. if n == 0 { return } - C.cblas_dspr2(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.int(n), C.double(alpha), (*C.double)(_x), C.int(incX), (*C.double)(_y), C.int(incY), (*C.double)(_ap)) -} -func (Implementation) Chemv(ul blas.Uplo, n int, alpha complex64, a []complex64, lda int, x []complex64, incX int, beta complex64, y []complex64, incY int) { - // declared at cblas.h:369:6 void cblas_chemv ... - - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(n-1)+n { + panic(shortA) } - if n < 0 { - panic("blas: n < 0") + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) } var _a *complex64 if len(a) > 0 { @@ -3441,39 +4835,63 @@ func (Implementation) Chemv(ul blas.Uplo, n int, alpha complex64, a []complex64, if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *complex64 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") - } - if lda*(n-1)+n > len(a) || lda < max(1, n) { - panic("blas: index of a out of range") - } - C.cblas_chemv(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.int(n), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(&beta), unsafe.Pointer(_y), C.int(incY)) + C.cblas_chemv(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.int(n), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(&beta), unsafe.Pointer(_y), C.int(incY)) } +// Chbmv 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 band matrix with k super-diagonals. The imaginary parts of +// the diagonal elements of A are ignored and assumed to be zero. +// +// Complex64 implementations are autogenerated and not directly tested. func (Implementation) Chbmv(ul blas.Uplo, n, k int, alpha complex64, a []complex64, lda int, x []complex64, incX int, beta complex64, y []complex64, incY int) { - // declared at cblas.h:373:6 void cblas_chbmv ... + // declared at cblas.h:369:6 void cblas_chbmv ... - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) } if n < 0 { - panic("blas: n < 0") + panic(nLT0) } if k < 0 { - panic("blas: k < 0") + panic(kLT0) + } + if lda < k+1 { + panic(badLdA) + } + if incX == 0 { + panic(zeroIncX) + } + if incY == 0 { + panic(zeroIncY) + } + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(n-1)+k+1 { + panic(shortA) + } + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) } var _a *complex64 if len(a) > 0 { @@ -3483,39 +4901,57 @@ func (Implementation) Chbmv(ul blas.Uplo, n, k int, alpha complex64, a []complex if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *complex64 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") - } - if lda*(n-1)+k+1 > len(a) || lda < k+1 { - panic("blas: index of a out of range") - } - C.cblas_chbmv(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)) + C.cblas_chbmv(C.CBLAS_LAYOUT(rowMajor), C.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)) } +// Chpmv 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. +// +// Complex64 implementations are autogenerated and not directly tested. func (Implementation) Chpmv(ul blas.Uplo, n int, alpha complex64, ap, x []complex64, incX int, beta complex64, y []complex64, incY int) { - // declared at cblas.h:377:6 void cblas_chpmv ... + // declared at cblas.h:373:6 void cblas_chpmv ... - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) } if n < 0 { - panic("blas: n < 0") + panic(nLT0) + } + if incX == 0 { + panic(zeroIncX) + } + if incY == 0 { + panic(zeroIncY) + } + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(ap) < n*(n+1)/2 { + panic(shortAP) + } + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) } - if n*(n+1)/2 > len(ap) { - panic("blas: index of ap out of range") + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) } var _ap *complex64 if len(ap) > 0 { @@ -3525,256 +4961,398 @@ func (Implementation) Chpmv(ul blas.Uplo, n int, alpha complex64, ap, x []comple if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *complex64 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") - } - if n == 0 { - return - } - C.cblas_chpmv(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)) + C.cblas_chpmv(C.CBLAS_LAYOUT(rowMajor), C.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)) } +// Cgeru performs the rank-one operation +// +// A += alpha * x * yᵀ +// +// 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. +// +// Complex64 implementations are autogenerated and not directly tested. func (Implementation) Cgeru(m, n int, alpha complex64, x []complex64, incX int, y []complex64, incY int, a []complex64, lda int) { - // declared at cblas.h:381:6 void cblas_cgeru ... + // declared at cblas.h:377:6 void cblas_cgeru ... if m < 0 { - panic("blas: m < 0") + panic(mLT0) } if n < 0 { - panic("blas: n < 0") + panic(nLT0) + } + if lda < max(1, n) { + panic(badLdA) + } + if incX == 0 { + panic(zeroIncX) + } + if incY == 0 { + panic(zeroIncY) + } + + // Quick return if possible. + if m == 0 || n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (m-1)*incX) || (incX < 0 && len(x) <= (1-m)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) + } + if len(a) < lda*(m-1)+n { + panic(shortA) } var _x *complex64 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *complex64 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") - } var _a *complex64 if len(a) > 0 { _a = &a[0] } - if (incX > 0 && (m-1)*incX >= len(x)) || (incX < 0 && (1-m)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") - } - if lda*(m-1)+n > len(a) || lda < max(1, n) { - panic("blas: index of a out of range") - } - C.cblas_cgeru(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)) + C.cblas_cgeru(C.CBLAS_LAYOUT(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)) } +// Cgerc performs the rank-one operation +// +// A += alpha * x * yᴴ +// +// 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. +// +// Complex64 implementations are autogenerated and not directly tested. func (Implementation) Cgerc(m, n int, alpha complex64, x []complex64, incX int, y []complex64, incY int, a []complex64, lda int) { - // declared at cblas.h:384:6 void cblas_cgerc ... + // declared at cblas.h:380:6 void cblas_cgerc ... if m < 0 { - panic("blas: m < 0") + panic(mLT0) } if n < 0 { - panic("blas: n < 0") + panic(nLT0) + } + if lda < max(1, n) { + panic(badLdA) + } + if incX == 0 { + panic(zeroIncX) + } + if incY == 0 { + panic(zeroIncY) + } + + // Quick return if possible. + if m == 0 || n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (m-1)*incX) || (incX < 0 && len(x) <= (1-m)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) + } + if len(a) < lda*(m-1)+n { + panic(shortA) } var _x *complex64 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *complex64 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") - } var _a *complex64 if len(a) > 0 { _a = &a[0] } - if (incX > 0 && (m-1)*incX >= len(x)) || (incX < 0 && (1-m)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") - } - if lda*(m-1)+n > len(a) || lda < max(1, n) { - panic("blas: index of a out of range") - } - C.cblas_cgerc(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)) + C.cblas_cgerc(C.CBLAS_LAYOUT(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)) } +// Cher performs the Hermitian rank-one operation +// +// A += alpha * x * xᴴ +// +// 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. +// +// Complex64 implementations are autogenerated and not directly tested. func (Implementation) Cher(ul blas.Uplo, n int, alpha float32, x []complex64, incX int, a []complex64, lda int) { - // declared at cblas.h:387:6 void cblas_cher ... + // declared at cblas.h:383:6 void cblas_cher ... - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) } if n < 0 { - panic("blas: n < 0") + panic(nLT0) + } + if lda < max(1, n) { + panic(badLdA) + } + if incX == 0 { + panic(zeroIncX) + } + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if len(a) < lda*(n-1)+n { + panic(shortA) } var _x *complex64 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _a *complex64 if len(a) > 0 { _a = &a[0] } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if lda*(n-1)+n > len(a) || lda < max(1, n) { - panic("blas: index of a out of range") - } - C.cblas_cher(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.int(n), C.float(alpha), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(_a), C.int(lda)) + C.cblas_cher(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.int(n), C.float(alpha), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(_a), C.int(lda)) } -func (Implementation) Chpr(ul blas.Uplo, n int, alpha float32, x []complex64, incX int, ap []complex64) { - // declared at cblas.h:390:6 void cblas_chpr ... +// Chpr performs the Hermitian rank-1 operation +// +// A += alpha * x * xᴴ +// +// 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. +// +// Complex64 implementations are autogenerated and not directly tested. +func (Implementation) Chpr(ul blas.Uplo, n int, alpha float32, x []complex64, incX int, a []complex64) { + // declared at cblas.h:386:6 void cblas_chpr ... - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) } if n < 0 { - panic("blas: n < 0") + panic(nLT0) + } + if incX == 0 { + panic(zeroIncX) + } + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if len(a) < n*(n+1)/2 { + panic(shortA) } var _x *complex64 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") + var _a *complex64 + if len(a) > 0 { + _a = &a[0] + } + C.cblas_chpr(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.int(n), C.float(alpha), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(_a)) +} + +// Cher2 performs the Hermitian rank-two operation +// +// A += alpha * x * yᴴ + conj(alpha) * y * xᴴ +// +// 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. +// +// Complex64 implementations are autogenerated and not directly tested. +func (Implementation) Cher2(ul blas.Uplo, n int, alpha complex64, x []complex64, incX int, y []complex64, incY int, a []complex64, lda int) { + // declared at cblas.h:389:6 void cblas_cher2 ... + + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) } - if n*(n+1)/2 > len(ap) { - panic("blas: index of ap out of range") + if n < 0 { + panic(nLT0) } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") + if lda < max(1, n) { + panic(badLdA) } - var _ap *complex64 - if len(ap) > 0 { - _ap = &ap[0] + if incX == 0 { + panic(zeroIncX) + } + if incY == 0 { + panic(zeroIncY) } + + // Quick return if possible. if n == 0 { return } - C.cblas_chpr(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.int(n), C.float(alpha), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(_ap)) -} - -func (Implementation) Cher2(ul blas.Uplo, n int, alpha complex64, x []complex64, incX int, y []complex64, incY int, a []complex64, lda int) { - // declared at cblas.h:393:6 void cblas_cher2 ... - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) } - if n < 0 { - panic("blas: n < 0") + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) + } + if len(a) < lda*(n-1)+n { + panic(shortA) } var _x *complex64 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *complex64 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") - } var _a *complex64 if len(a) > 0 { _a = &a[0] } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") - } - if lda*(n-1)+n > len(a) || lda < max(1, n) { - panic("blas: index of a out of range") - } - C.cblas_cher2(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)) + C.cblas_cher2(C.CBLAS_LAYOUT(rowMajor), C.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)) } +// Chpr2 performs the Hermitian rank-2 operation +// +// A += alpha * x * yᴴ + conj(alpha) * y * xᴴ +// +// 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. +// +// Complex64 implementations are autogenerated and not directly tested. func (Implementation) Chpr2(ul blas.Uplo, n int, alpha complex64, x []complex64, incX int, y []complex64, incY int, ap []complex64) { - // declared at cblas.h:396:6 void cblas_chpr2 ... + // declared at cblas.h:392:6 void cblas_chpr2 ... - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) } if n < 0 { - panic("blas: n < 0") + panic(nLT0) + } + if incX == 0 { + panic(zeroIncX) + } + if incY == 0 { + panic(zeroIncY) + } + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) + } + if len(ap) < n*(n+1)/2 { + panic(shortAP) } var _x *complex64 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *complex64 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") - } - if n*(n+1)/2 > len(ap) { - panic("blas: index of ap out of range") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") - } var _ap *complex64 if len(ap) > 0 { _ap = &ap[0] } - if n == 0 { - return - } - 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)) + C.cblas_chpr2(C.CBLAS_LAYOUT(rowMajor), C.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 ... + // declared at cblas.h:396:6 void cblas_zhemv ... - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) } if n < 0 { - panic("blas: n < 0") + panic(nLT0) + } + if lda < max(1, n) { + panic(badLdA) + } + if incX == 0 { + panic(zeroIncX) + } + if incY == 0 { + panic(zeroIncY) + } + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(n-1)+n { + panic(shortA) + } + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) } var _a *complex128 if len(a) > 0 { @@ -3784,39 +5362,61 @@ func (Implementation) Zhemv(ul blas.Uplo, n int, alpha complex128, a []complex12 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *complex128 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") - } - if lda*(n-1)+n > len(a) || lda < max(1, n) { - panic("blas: index of a out of range") - } - C.cblas_zhemv(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.int(n), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(&beta), unsafe.Pointer(_y), C.int(incY)) + C.cblas_zhemv(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.int(n), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(&beta), unsafe.Pointer(_y), C.int(incY)) } +// Zhbmv 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 band matrix with k super-diagonals. The imaginary parts of +// the diagonal elements of A are ignored and assumed to be zero. func (Implementation) Zhbmv(ul blas.Uplo, n, k int, alpha complex128, a []complex128, lda int, x []complex128, incX int, beta complex128, y []complex128, incY int) { - // declared at cblas.h:404:6 void cblas_zhbmv ... + // declared at cblas.h:400:6 void cblas_zhbmv ... - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) } if n < 0 { - panic("blas: n < 0") + panic(nLT0) } if k < 0 { - panic("blas: k < 0") + panic(kLT0) + } + if lda < k+1 { + panic(badLdA) + } + if incX == 0 { + panic(zeroIncX) + } + if incY == 0 { + panic(zeroIncY) + } + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(n-1)+k+1 { + panic(shortA) + } + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) } var _a *complex128 if len(a) > 0 { @@ -3826,39 +5426,55 @@ func (Implementation) Zhbmv(ul blas.Uplo, n, k int, alpha complex128, a []comple if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *complex128 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") + C.cblas_zhbmv(C.CBLAS_LAYOUT(rowMajor), C.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:404:6 void cblas_zhpmv ... + + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") + if n < 0 { + panic(nLT0) } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") + if incX == 0 { + panic(zeroIncX) } - if lda*(n-1)+k+1 > len(a) || lda < k+1 { - panic("blas: index of a out of range") + if incY == 0 { + panic(zeroIncY) } - 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)) -} -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 ... + // Quick return if possible. + if n == 0 { + return + } - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + // For zero matrix size the following slice length checks are trivially satisfied. + if len(ap) < n*(n+1)/2 { + panic(shortAP) } - if n < 0 { - panic("blas: n < 0") + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) } - if n*(n+1)/2 > len(ap) { - panic("blas: index of ap out of range") + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) } var _ap *complex128 if len(ap) > 0 { @@ -3868,328 +5484,418 @@ func (Implementation) Zhpmv(ul blas.Uplo, n int, alpha complex128, ap, x []compl if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *complex128 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") - } - if n == 0 { - return - } - 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)) + C.cblas_zhpmv(C.CBLAS_LAYOUT(rowMajor), C.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ᵀ +// +// 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 ... + // declared at cblas.h:408:6 void cblas_zgeru ... if m < 0 { - panic("blas: m < 0") + panic(mLT0) } if n < 0 { - panic("blas: n < 0") + panic(nLT0) + } + if lda < max(1, n) { + panic(badLdA) + } + if incX == 0 { + panic(zeroIncX) + } + if incY == 0 { + panic(zeroIncY) + } + + // Quick return if possible. + if m == 0 || n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (m-1)*incX) || (incX < 0 && len(x) <= (1-m)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) + } + if len(a) < lda*(m-1)+n { + panic(shortA) } var _x *complex128 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *complex128 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") - } var _a *complex128 if len(a) > 0 { _a = &a[0] } - if (incX > 0 && (m-1)*incX >= len(x)) || (incX < 0 && (1-m)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") - } - if lda*(m-1)+n > len(a) || lda < max(1, n) { - panic("blas: index of a out of range") - } - C.cblas_zgeru(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)) + C.cblas_zgeru(C.CBLAS_LAYOUT(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)) } // Zgerc performs the rank-one operation -// A += alpha * x * y^H +// +// A += alpha * x * yᴴ +// // 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) Zgerc(m, n int, alpha complex128, x []complex128, incX int, y []complex128, incY int, a []complex128, lda int) { - // declared at cblas.h:415:6 void cblas_zgerc ... + // declared at cblas.h:411:6 void cblas_zgerc ... if m < 0 { - panic("blas: m < 0") + panic(mLT0) } if n < 0 { - panic("blas: n < 0") + panic(nLT0) } - var _x *complex128 - if len(x) > 0 { - _x = &x[0] + if lda < max(1, n) { + panic(badLdA) } if incX == 0 { - panic("blas: zero x index increment") - } - var _y *complex128 - if len(y) > 0 { - _y = &y[0] + panic(zeroIncX) } if incY == 0 { - panic("blas: zero y index increment") + panic(zeroIncY) } - var _a *complex128 - if len(a) > 0 { - _a = &a[0] + + // Quick return if possible. + if m == 0 || n == 0 { + return } - if (incX > 0 && (m-1)*incX >= len(x)) || (incX < 0 && (1-m)*incX >= len(x)) { - panic("blas: x index out of range") + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (m-1)*incX) || (incX < 0 && len(x) <= (1-m)*incX) { + panic(shortX) } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) } - if lda*(m-1)+n > len(a) || lda < max(1, n) { - panic("blas: index of a out of range") + if len(a) < lda*(m-1)+n { + panic(shortA) } - 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)) + var _x *complex128 + if len(x) > 0 { + _x = &x[0] + } + var _y *complex128 + if len(y) > 0 { + _y = &y[0] + } + var _a *complex128 + if len(a) > 0 { + _a = &a[0] + } + C.cblas_zgerc(C.CBLAS_LAYOUT(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ᴴ +// +// 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 ... + // declared at cblas.h:414:6 void cblas_zher ... - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) } if n < 0 { - panic("blas: n < 0") + panic(nLT0) + } + if lda < max(1, n) { + panic(badLdA) + } + if incX == 0 { + panic(zeroIncX) + } + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if len(a) < lda*(n-1)+n { + panic(shortA) } var _x *complex128 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _a *complex128 if len(a) > 0 { _a = &a[0] } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if lda*(n-1)+n > len(a) || lda < max(1, n) { - panic("blas: index of a out of range") - } - 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)) + C.cblas_zher(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.int(n), C.double(alpha), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(_a), C.int(lda)) } -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 ... +// Zhpr performs the Hermitian rank-1 operation +// +// A += alpha * x * xᴴ +// +// 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, a []complex128) { + // declared at cblas.h:417:6 void cblas_zhpr ... - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) } if n < 0 { - panic("blas: n < 0") + panic(nLT0) + } + if incX == 0 { + panic(zeroIncX) + } + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if len(a) < n*(n+1)/2 { + panic(shortA) } var _x *complex128 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") + var _a *complex128 + if len(a) > 0 { + _a = &a[0] } - if n*(n+1)/2 > len(ap) { - panic("blas: index of ap out of range") + C.cblas_zhpr(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.int(n), C.double(alpha), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(_a)) +} + +// Zher2 performs the Hermitian rank-two operation +// +// A += alpha * x * yᴴ + conj(alpha) * y * xᴴ +// +// 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:420:6 void cblas_zher2 ... + + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") + if n < 0 { + panic(nLT0) } - var _ap *complex128 - if len(ap) > 0 { - _ap = &ap[0] + if lda < max(1, n) { + panic(badLdA) } + if incX == 0 { + panic(zeroIncX) + } + if incY == 0 { + panic(zeroIncY) + } + + // Quick return if possible. if n == 0 { return } - 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)) -} - -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 ... - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) } - if n < 0 { - panic("blas: n < 0") + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) + } + if len(a) < lda*(n-1)+n { + panic(shortA) } var _x *complex128 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *complex128 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") - } var _a *complex128 if len(a) > 0 { _a = &a[0] } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") - } - if lda*(n-1)+n > len(a) || lda < max(1, n) { - panic("blas: index of a out of range") - } - 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)) + C.cblas_zher2(C.CBLAS_LAYOUT(rowMajor), C.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ᴴ + conj(alpha) * y * xᴴ +// +// 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 ... + // declared at cblas.h:423:6 void cblas_zhpr2 ... - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) } if n < 0 { - panic("blas: n < 0") + panic(nLT0) + } + if incX == 0 { + panic(zeroIncX) + } + if incY == 0 { + panic(zeroIncY) + } + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) + } + if len(ap) < n*(n+1)/2 { + panic(shortAP) } var _x *complex128 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } var _y *complex128 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") - } - if n*(n+1)/2 > len(ap) { - panic("blas: index of ap out of range") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") - } var _ap *complex128 if len(ap) > 0 { _ap = &ap[0] } - if n == 0 { - return - } - C.cblas_zhpr2(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)) + C.cblas_zhpr2(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.int(n), unsafe.Pointer(&alpha), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(_y), C.int(incY), unsafe.Pointer(_ap)) } -// Sgemm computes -// C = beta * C + alpha * A * B, -// where A, B, and C are dense matrices, and alpha and beta are scalars. -// tA and tB specify whether A or B are transposed. +// Sgemm performs one of the matrix-matrix operations +// +// C = alpha * A * B + beta * C +// C = alpha * Aᵀ * B + beta * C +// C = alpha * A * Bᵀ + beta * C +// C = alpha * Aᵀ * Bᵀ + beta * C +// +// where A is an m×k or k×m dense matrix, B is an n×k or k×n dense matrix, C is +// an m×n matrix, and alpha and beta are scalars. tA and tB specify whether A or +// B are transposed. func (Implementation) Sgemm(tA, tB blas.Transpose, m, n, k int, alpha float32, a []float32, lda int, b []float32, ldb int, beta float32, c []float32, ldc int) { - // declared at cblas.h:440:6 void cblas_sgemm ... - - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") - } - if tB != blas.NoTrans && tB != blas.Trans && tB != blas.ConjTrans { - panic("blas: illegal transpose") + // declared at cblas.h:436:6 void cblas_sgemm ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) + } + switch tB { + case blas.NoTrans: + tB = C.CblasNoTrans + case blas.Trans: + tB = C.CblasTrans + case blas.ConjTrans: + tB = C.CblasConjTrans + default: + panic(badTranspose) } if m < 0 { - panic("blas: m < 0") + panic(mLT0) } if n < 0 { - panic("blas: n < 0") + panic(nLT0) } if k < 0 { - panic("blas: k < 0") - } - var _a *float32 - if len(a) > 0 { - _a = &a[0] - } - var _b *float32 - if len(b) > 0 { - _b = &b[0] - } - var _c *float32 - if len(c) > 0 { - _c = &c[0] + panic(kLT0) } var rowA, colA, rowB, colB int - if tA == blas.NoTrans { + if tA == C.CblasNoTrans { rowA, colA = m, k } else { rowA, colA = k, m } - if tB == blas.NoTrans { + if tB == C.CblasNoTrans { rowB, colB = k, n } else { rowB, colB = n, k } - if lda*(rowA-1)+colA > len(a) || lda < max(1, colA) { - panic("blas: index of a out of range") + if lda < max(1, colA) { + panic(badLdA) } - if ldb*(rowB-1)+colB > len(b) || ldb < max(1, colB) { - panic("blas: index of b out of range") + if ldb < max(1, colB) { + panic(badLdB) } - if ldc*(m-1)+n > len(c) || ldc < max(1, n) { - panic("blas: index of c out of range") + if ldc < max(1, n) { + panic(badLdC) } - C.cblas_sgemm(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_TRANSPOSE(tA), C.enum_CBLAS_TRANSPOSE(tB), C.int(m), C.int(n), C.int(k), C.float(alpha), (*C.float)(_a), C.int(lda), (*C.float)(_b), C.int(ldb), C.float(beta), (*C.float)(_c), C.int(ldc)) -} -// Ssymm performs one of -// C = alpha * A * B + beta * C, if side == blas.Left, -// C = alpha * B * A + beta * C, if side == blas.Right, -// where A is an n×n or m×m symmetric matrix, B and C are m×n matrices, and alpha -// is a scalar. -func (Implementation) Ssymm(s blas.Side, ul blas.Uplo, m, n int, alpha float32, a []float32, lda int, b []float32, ldb int, beta float32, c []float32, ldc int) { - // declared at cblas.h:445:6 void cblas_ssymm ... - - if s != blas.Left && s != blas.Right { - panic("blas: illegal side") + // Quick return if possible. + if m == 0 || n == 0 { + return } - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(rowA-1)+colA { + panic(shortA) } - if m < 0 { - panic("blas: m < 0") + if len(b) < ldb*(rowB-1)+colB { + panic(shortB) } - if n < 0 { - panic("blas: n < 0") + if len(c) < ldc*(m-1)+n { + panic(shortC) } var _a *float32 if len(a) > 0 { @@ -4203,141 +5909,221 @@ func (Implementation) Ssymm(s blas.Side, ul blas.Uplo, m, n int, alpha float32, if len(c) > 0 { _c = &c[0] } + C.cblas_sgemm(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_TRANSPOSE(tA), C.CBLAS_TRANSPOSE(tB), C.int(m), C.int(n), C.int(k), C.float(alpha), (*C.float)(_a), C.int(lda), (*C.float)(_b), C.int(ldb), C.float(beta), (*C.float)(_c), C.int(ldc)) +} + +// Ssymm performs one of the matrix-matrix operations +// +// C = alpha * A * B + beta * C if side == blas.Left +// C = alpha * B * A + beta * C if side == blas.Right +// +// where A is an n×n or m×m symmetric matrix, B and C are m×n matrices, and alpha +// is a scalar. +func (Implementation) Ssymm(s blas.Side, ul blas.Uplo, m, n int, alpha float32, a []float32, lda int, b []float32, ldb int, beta float32, c []float32, ldc int) { + // declared at cblas.h:441:6 void cblas_ssymm ... + + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + switch s { + case blas.Left: + s = C.CblasLeft + case blas.Right: + s = C.CblasRight + default: + panic(badSide) + } + if m < 0 { + panic(mLT0) + } + if n < 0 { + panic(nLT0) + } var k int - if s == blas.Left { + if s == C.CblasLeft { k = m } else { k = n } - if lda*(k-1)+k > len(a) || lda < max(1, k) { - panic("blas: index of a out of range") + if lda < max(1, k) { + panic(badLdA) } - if ldb*(m-1)+n > len(b) || ldb < max(1, n) { - panic("blas: index of b out of range") + if ldb < max(1, n) { + panic(badLdB) } - if ldc*(m-1)+n > len(c) || ldc < max(1, n) { - panic("blas: index of c out of range") + if ldc < max(1, n) { + panic(badLdC) } - C.cblas_ssymm(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_SIDE(s), C.enum_CBLAS_UPLO(ul), C.int(m), C.int(n), C.float(alpha), (*C.float)(_a), C.int(lda), (*C.float)(_b), C.int(ldb), C.float(beta), (*C.float)(_c), C.int(ldc)) -} -// Ssyrk performs the symmetric rank-k operation -// C = alpha * A * A^T + beta*C -// C is an n×n symmetric matrix. A is an n×k matrix if tA == blas.NoTrans, and -// a k×n matrix otherwise. alpha and beta are scalars. -func (Implementation) Ssyrk(ul blas.Uplo, t blas.Transpose, n, k int, alpha float32, a []float32, lda int, beta float32, c []float32, ldc int) { - // declared at cblas.h:450:6 void cblas_ssyrk ... - - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + // Quick return if possible. + if m == 0 || n == 0 { + return } - if t != blas.NoTrans && t != blas.Trans && t != blas.ConjTrans { - panic("blas: illegal transpose") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(k-1)+k { + panic(shortA) } - if n < 0 { - panic("blas: n < 0") + if len(b) < ldb*(m-1)+n { + panic(shortB) } - if k < 0 { - panic("blas: k < 0") + if len(c) < ldc*(m-1)+n { + panic(shortC) } var _a *float32 if len(a) > 0 { _a = &a[0] } + var _b *float32 + if len(b) > 0 { + _b = &b[0] + } var _c *float32 if len(c) > 0 { _c = &c[0] } + C.cblas_ssymm(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_SIDE(s), C.CBLAS_UPLO(ul), C.int(m), C.int(n), C.float(alpha), (*C.float)(_a), C.int(lda), (*C.float)(_b), C.int(ldb), C.float(beta), (*C.float)(_c), C.int(ldc)) +} + +// Ssyrk performs one of the symmetric rank-k operations +// +// C = alpha * A * Aᵀ + beta * C if tA == blas.NoTrans +// C = alpha * Aᵀ * A + beta * C if tA == blas.Trans or tA == blas.ConjTrans +// +// where A is an n×k or k×n matrix, C is an n×n symmetric matrix, and alpha and +// beta are scalars. +func (Implementation) Ssyrk(ul blas.Uplo, t blas.Transpose, n, k int, alpha float32, a []float32, lda int, beta float32, c []float32, ldc int) { + // declared at cblas.h:446:6 void cblas_ssyrk ... + + switch t { + case blas.NoTrans: + t = C.CblasNoTrans + case blas.Trans: + t = C.CblasTrans + case blas.ConjTrans: + t = C.CblasConjTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + if n < 0 { + panic(nLT0) + } + if k < 0 { + panic(kLT0) + } var row, col int - if t == blas.NoTrans { + if t == C.CblasNoTrans { row, col = n, k } else { row, col = k, n } - if lda*(row-1)+col > len(a) || lda < max(1, col) { - panic("blas: index of a out of range") + if lda < max(1, col) { + panic(badLdA) } - if ldc*(n-1)+n > len(c) || ldc < max(1, n) { - panic("blas: index of c out of range") + if ldc < max(1, n) { + panic(badLdC) } - C.cblas_ssyrk(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.enum_CBLAS_TRANSPOSE(t), C.int(n), C.int(k), C.float(alpha), (*C.float)(_a), C.int(lda), C.float(beta), (*C.float)(_c), C.int(ldc)) -} - -// Ssyr2k performs the symmetric rank 2k operation -// C = alpha * A * B^T + alpha * B * A^T + beta * C -// where C is an n×n symmetric matrix. A and B are n×k matrices if -// tA == NoTrans and k×n otherwise. alpha and beta are scalars. -func (Implementation) Ssyr2k(ul blas.Uplo, t blas.Transpose, n, k int, alpha float32, a []float32, lda int, b []float32, ldb int, beta float32, c []float32, ldc int) { - // declared at cblas.h:454:6 void cblas_ssyr2k ... - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") - } - if t != blas.NoTrans && t != blas.Trans && t != blas.ConjTrans { - panic("blas: illegal transpose") + // Quick return if possible. + if n == 0 { + return } - if n < 0 { - panic("blas: n < 0") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(row-1)+col { + panic(shortA) } - if k < 0 { - panic("blas: k < 0") + if len(c) < ldc*(n-1)+n { + panic(shortC) } var _a *float32 if len(a) > 0 { _a = &a[0] } - var _b *float32 - if len(b) > 0 { - _b = &b[0] - } var _c *float32 if len(c) > 0 { _c = &c[0] } + C.cblas_ssyrk(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(t), C.int(n), C.int(k), C.float(alpha), (*C.float)(_a), C.int(lda), C.float(beta), (*C.float)(_c), C.int(ldc)) +} + +// Ssyr2k performs one of the symmetric rank 2k operations +// +// C = alpha * A * Bᵀ + alpha * B * Aᵀ + beta * C if tA == blas.NoTrans +// C = alpha * Aᵀ * B + alpha * Bᵀ * A + beta * C if tA == blas.Trans or tA == blas.ConjTrans +// +// where A and B are n×k or k×n matrices, C is an n×n symmetric matrix, and +// alpha and beta are scalars. +func (Implementation) Ssyr2k(ul blas.Uplo, t blas.Transpose, n, k int, alpha float32, a []float32, lda int, b []float32, ldb int, beta float32, c []float32, ldc int) { + // declared at cblas.h:450:6 void cblas_ssyr2k ... + + switch t { + case blas.NoTrans: + t = C.CblasNoTrans + case blas.Trans: + t = C.CblasTrans + case blas.ConjTrans: + t = C.CblasConjTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + if n < 0 { + panic(nLT0) + } + if k < 0 { + panic(kLT0) + } var row, col int - if t == blas.NoTrans { + if t == C.CblasNoTrans { row, col = n, k } else { row, col = k, n } - if lda*(row-1)+col > len(a) || lda < max(1, col) { - panic("blas: index of a out of range") + if lda < max(1, col) { + panic(badLdA) } - if ldb*(row-1)+col > len(b) || ldb < max(1, col) { - panic("blas: index of b out of range") + if ldb < max(1, col) { + panic(badLdB) } - if ldc*(n-1)+n > len(c) || ldc < max(1, n) { - panic("blas: index of c out of range") + if ldc < max(1, n) { + panic(badLdC) } - C.cblas_ssyr2k(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.enum_CBLAS_TRANSPOSE(t), C.int(n), C.int(k), C.float(alpha), (*C.float)(_a), C.int(lda), (*C.float)(_b), C.int(ldb), C.float(beta), (*C.float)(_c), C.int(ldc)) -} -// Strmm performs -// B = alpha * A * B, if tA == blas.NoTrans and side == blas.Left, -// B = alpha * A^T * B, if tA == blas.Trans or blas.ConjTrans, and side == blas.Left, -// B = alpha * B * A, if tA == blas.NoTrans and side == blas.Right, -// B = alpha * B * A^T, if tA == blas.Trans or blas.ConjTrans, and side == blas.Right, -// where A is an n×n or m×m triangular matrix, and B is an m×n matrix. -func (Implementation) Strmm(s blas.Side, ul blas.Uplo, tA blas.Transpose, d blas.Diag, m, n int, alpha float32, a []float32, lda int, b []float32, ldb int) { - // declared at cblas.h:459:6 void cblas_strmm ... - - if s != blas.Left && s != blas.Right { - panic("blas: illegal side") - } - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") - } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") + // Quick return if possible. + if n == 0 { + return } - if d != blas.NonUnit && d != blas.Unit { - panic("blas: illegal diagonal") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(row-1)+col { + panic(shortA) } - if m < 0 { - panic("blas: m < 0") + if len(b) < ldb*(row-1)+col { + panic(shortB) } - if n < 0 { - panic("blas: n < 0") + if len(c) < ldc*(n-1)+n { + panic(shortC) } var _a *float32 if len(a) > 0 { @@ -4347,53 +6133,181 @@ func (Implementation) Strmm(s blas.Side, ul blas.Uplo, tA blas.Transpose, d blas if len(b) > 0 { _b = &b[0] } + var _c *float32 + if len(c) > 0 { + _c = &c[0] + } + C.cblas_ssyr2k(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(t), C.int(n), C.int(k), C.float(alpha), (*C.float)(_a), C.int(lda), (*C.float)(_b), C.int(ldb), C.float(beta), (*C.float)(_c), C.int(ldc)) +} + +// Strmm performs one of the matrix-matrix operations +// +// B = alpha * A * B if tA == blas.NoTrans and side == blas.Left +// B = alpha * Aᵀ * B if tA == blas.Trans or blas.ConjTrans, and side == blas.Left +// B = alpha * B * A if tA == blas.NoTrans and side == blas.Right +// B = alpha * B * Aᵀ if tA == blas.Trans or blas.ConjTrans, and side == blas.Right +// +// where A is an n×n or m×m triangular matrix, B is an m×n matrix, and alpha is a scalar. +func (Implementation) Strmm(s blas.Side, ul blas.Uplo, tA blas.Transpose, d blas.Diag, m, n int, alpha float32, a []float32, lda int, b []float32, ldb int) { + // declared at cblas.h:455:6 void cblas_strmm ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + switch d { + case blas.NonUnit: + d = C.CblasNonUnit + case blas.Unit: + d = C.CblasUnit + default: + panic(badDiag) + } + switch s { + case blas.Left: + s = C.CblasLeft + case blas.Right: + s = C.CblasRight + default: + panic(badSide) + } + if m < 0 { + panic(mLT0) + } + if n < 0 { + panic(nLT0) + } var k int - if s == blas.Left { + if s == C.CblasLeft { k = m } else { k = n } - if lda*(k-1)+k > len(a) || lda < max(1, k) { - panic("blas: index of a out of range") + if lda < max(1, k) { + panic(badLdA) + } + if ldb < max(1, n) { + panic(badLdB) } - if ldb*(m-1)+n > len(b) || ldb < max(1, n) { - panic("blas: index of b out of range") + + // Quick return if possible. + if m == 0 || n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(k-1)+k { + panic(shortA) + } + if len(b) < ldb*(m-1)+n { + panic(shortB) } - C.cblas_strmm(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_SIDE(s), C.enum_CBLAS_UPLO(ul), C.enum_CBLAS_TRANSPOSE(tA), C.enum_CBLAS_DIAG(d), C.int(m), C.int(n), C.float(alpha), (*C.float)(_a), C.int(lda), (*C.float)(_b), C.int(ldb)) + var _a *float32 + if len(a) > 0 { + _a = &a[0] + } + var _b *float32 + if len(b) > 0 { + _b = &b[0] + } + C.cblas_strmm(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_SIDE(s), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(tA), C.CBLAS_DIAG(d), C.int(m), C.int(n), C.float(alpha), (*C.float)(_a), C.int(lda), (*C.float)(_b), C.int(ldb)) } -// Strsm solves -// A * X = alpha * B, if tA == blas.NoTrans side == blas.Left, -// A^T * X = alpha * B, if tA == blas.Trans or blas.ConjTrans, and side == blas.Left, -// X * A = alpha * B, if tA == blas.NoTrans side == blas.Right, -// X * A^T = alpha * B, if tA == blas.Trans or blas.ConjTrans, and side == blas.Right, -// where A is an n×n or m×m triangular matrix, X is an m×n matrix, and alpha is a +// Strsm solves one of the matrix equations +// +// A * X = alpha * B if tA == blas.NoTrans and side == blas.Left +// Aᵀ * X = alpha * B if tA == blas.Trans or blas.ConjTrans, and side == blas.Left +// X * A = alpha * B if tA == blas.NoTrans and side == blas.Right +// X * Aᵀ = alpha * B if tA == blas.Trans or blas.ConjTrans, and side == blas.Right +// +// where A is an n×n or m×m triangular matrix, X and B are m×n matrices, and alpha is a // scalar. // // At entry to the function, X contains the values of B, and the result is -// stored in place into X. +// stored in-place into X. // // No check is made that A is invertible. func (Implementation) Strsm(s blas.Side, ul blas.Uplo, tA blas.Transpose, d blas.Diag, m, n int, alpha float32, a []float32, lda int, b []float32, ldb int) { - // declared at cblas.h:464:6 void cblas_strsm ... - - if s != blas.Left && s != blas.Right { - panic("blas: illegal side") + // declared at cblas.h:460:6 void cblas_strsm ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + switch d { + case blas.NonUnit: + d = C.CblasNonUnit + case blas.Unit: + d = C.CblasUnit + default: + panic(badDiag) + } + switch s { + case blas.Left: + s = C.CblasLeft + case blas.Right: + s = C.CblasRight + default: + panic(badSide) + } + if m < 0 { + panic(mLT0) + } + if n < 0 { + panic(nLT0) + } + var k int + if s == C.CblasLeft { + k = m + } else { + k = n } - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + if lda < max(1, k) { + panic(badLdA) } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") + if ldb < max(1, n) { + panic(badLdB) } - if d != blas.NonUnit && d != blas.Unit { - panic("blas: illegal diagonal") + + // Quick return if possible. + if m == 0 || n == 0 { + return } - if m < 0 { - panic("blas: m < 0") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(k-1)+k { + panic(shortA) } - if n < 0 { - panic("blas: n < 0") + if len(b) < ldb*(m-1)+n { + panic(shortB) } var _a *float32 if len(a) > 0 { @@ -4403,42 +6317,86 @@ func (Implementation) Strsm(s blas.Side, ul blas.Uplo, tA blas.Transpose, d blas if len(b) > 0 { _b = &b[0] } - var k int - if s == blas.Left { - k = m - } else { - k = n - } - if lda*(k-1)+k > len(a) || lda < max(1, k) { - panic("blas: index of a out of range") - } - if ldb*(m-1)+n > len(b) || ldb < max(1, n) { - panic("blas: index of b out of range") - } - C.cblas_strsm(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_SIDE(s), C.enum_CBLAS_UPLO(ul), C.enum_CBLAS_TRANSPOSE(tA), C.enum_CBLAS_DIAG(d), C.int(m), C.int(n), C.float(alpha), (*C.float)(_a), C.int(lda), (*C.float)(_b), C.int(ldb)) + C.cblas_strsm(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_SIDE(s), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(tA), C.CBLAS_DIAG(d), C.int(m), C.int(n), C.float(alpha), (*C.float)(_a), C.int(lda), (*C.float)(_b), C.int(ldb)) } -// Dgemm computes -// C = beta * C + alpha * A * B, -// where A, B, and C are dense matrices, and alpha and beta are scalars. -// tA and tB specify whether A or B are transposed. +// Dgemm performs one of the matrix-matrix operations +// +// C = alpha * A * B + beta * C +// C = alpha * Aᵀ * B + beta * C +// C = alpha * A * Bᵀ + beta * C +// C = alpha * Aᵀ * Bᵀ + beta * C +// +// where A is an m×k or k×m dense matrix, B is an n×k or k×n dense matrix, C is +// an m×n matrix, and alpha and beta are scalars. tA and tB specify whether A or +// B are transposed. func (Implementation) Dgemm(tA, tB blas.Transpose, m, n, k int, alpha float64, a []float64, lda int, b []float64, ldb int, beta float64, c []float64, ldc int) { - // declared at cblas.h:470:6 void cblas_dgemm ... - - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") - } - if tB != blas.NoTrans && tB != blas.Trans && tB != blas.ConjTrans { - panic("blas: illegal transpose") + // declared at cblas.h:466:6 void cblas_dgemm ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) + } + switch tB { + case blas.NoTrans: + tB = C.CblasNoTrans + case blas.Trans: + tB = C.CblasTrans + case blas.ConjTrans: + tB = C.CblasConjTrans + default: + panic(badTranspose) } if m < 0 { - panic("blas: m < 0") + panic(mLT0) } if n < 0 { - panic("blas: n < 0") + panic(nLT0) } if k < 0 { - panic("blas: k < 0") + panic(kLT0) + } + var rowA, colA, rowB, colB int + if tA == C.CblasNoTrans { + rowA, colA = m, k + } else { + rowA, colA = k, m + } + if tB == C.CblasNoTrans { + rowB, colB = k, n + } else { + rowB, colB = n, k + } + if lda < max(1, colA) { + panic(badLdA) + } + if ldb < max(1, colB) { + panic(badLdB) + } + if ldc < max(1, n) { + panic(badLdC) + } + + // Quick return if possible. + if m == 0 || n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(rowA-1)+colA { + panic(shortA) + } + if len(b) < ldb*(rowB-1)+colB { + panic(shortB) + } + if len(c) < ldc*(m-1)+n { + panic(shortC) } var _a *float64 if len(a) > 0 { @@ -4452,48 +6410,71 @@ func (Implementation) Dgemm(tA, tB blas.Transpose, m, n, k int, alpha float64, a if len(c) > 0 { _c = &c[0] } - var rowA, colA, rowB, colB int - if tA == blas.NoTrans { - rowA, colA = m, k - } else { - rowA, colA = k, m + C.cblas_dgemm(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_TRANSPOSE(tA), C.CBLAS_TRANSPOSE(tB), C.int(m), C.int(n), C.int(k), C.double(alpha), (*C.double)(_a), C.int(lda), (*C.double)(_b), C.int(ldb), C.double(beta), (*C.double)(_c), C.int(ldc)) +} + +// Dsymm performs one of the matrix-matrix operations +// +// C = alpha * A * B + beta * C if side == blas.Left +// C = alpha * B * A + beta * C if side == blas.Right +// +// where A is an n×n or m×m symmetric matrix, B and C are m×n matrices, and alpha +// is a scalar. +func (Implementation) Dsymm(s blas.Side, ul blas.Uplo, m, n int, alpha float64, a []float64, lda int, b []float64, ldb int, beta float64, c []float64, ldc int) { + // declared at cblas.h:471:6 void cblas_dsymm ... + + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + switch s { + case blas.Left: + s = C.CblasLeft + case blas.Right: + s = C.CblasRight + default: + panic(badSide) } - if tB == blas.NoTrans { - rowB, colB = k, n + if m < 0 { + panic(mLT0) + } + if n < 0 { + panic(nLT0) + } + var k int + if s == C.CblasLeft { + k = m } else { - rowB, colB = n, k + k = n } - if lda*(rowA-1)+colA > len(a) || lda < max(1, colA) { - panic("blas: index of a out of range") + if lda < max(1, k) { + panic(badLdA) } - if ldb*(rowB-1)+colB > len(b) || ldb < max(1, colB) { - panic("blas: index of b out of range") + if ldb < max(1, n) { + panic(badLdB) } - if ldc*(m-1)+n > len(c) || ldc < max(1, n) { - panic("blas: index of c out of range") + if ldc < max(1, n) { + panic(badLdC) } - C.cblas_dgemm(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_TRANSPOSE(tA), C.enum_CBLAS_TRANSPOSE(tB), C.int(m), C.int(n), C.int(k), C.double(alpha), (*C.double)(_a), C.int(lda), (*C.double)(_b), C.int(ldb), C.double(beta), (*C.double)(_c), C.int(ldc)) -} - -// Dsymm performs one of -// C = alpha * A * B + beta * C, if side == blas.Left, -// C = alpha * B * A + beta * C, if side == blas.Right, -// where A is an n×n or m×m symmetric matrix, B and C are m×n matrices, and alpha -// is a scalar. -func (Implementation) Dsymm(s blas.Side, ul blas.Uplo, m, n int, alpha float64, a []float64, lda int, b []float64, ldb int, beta float64, c []float64, ldc int) { - // declared at cblas.h:475:6 void cblas_dsymm ... - if s != blas.Left && s != blas.Right { - panic("blas: illegal side") + // Quick return if possible. + if m == 0 || n == 0 { + return } - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(k-1)+k { + panic(shortA) } - if m < 0 { - panic("blas: m < 0") + if len(b) < ldb*(m-1)+n { + panic(shortB) } - if n < 0 { - panic("blas: n < 0") + if len(c) < ldc*(m-1)+n { + panic(shortC) } var _a *float64 if len(a) > 0 { @@ -4507,84 +6488,143 @@ func (Implementation) Dsymm(s blas.Side, ul blas.Uplo, m, n int, alpha float64, if len(c) > 0 { _c = &c[0] } - var k int - if s == blas.Left { - k = m + C.cblas_dsymm(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_SIDE(s), C.CBLAS_UPLO(ul), C.int(m), C.int(n), C.double(alpha), (*C.double)(_a), C.int(lda), (*C.double)(_b), C.int(ldb), C.double(beta), (*C.double)(_c), C.int(ldc)) +} + +// Dsyrk performs one of the symmetric rank-k operations +// +// C = alpha * A * Aᵀ + beta * C if tA == blas.NoTrans +// C = alpha * Aᵀ * A + beta * C if tA == blas.Trans or tA == blas.ConjTrans +// +// where A is an n×k or k×n matrix, C is an n×n symmetric matrix, and alpha and +// beta are scalars. +func (Implementation) Dsyrk(ul blas.Uplo, t blas.Transpose, n, k int, alpha float64, a []float64, lda int, beta float64, c []float64, ldc int) { + // declared at cblas.h:476:6 void cblas_dsyrk ... + + switch t { + case blas.NoTrans: + t = C.CblasNoTrans + case blas.Trans: + t = C.CblasTrans + case blas.ConjTrans: + t = C.CblasConjTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + if n < 0 { + panic(nLT0) + } + if k < 0 { + panic(kLT0) + } + var row, col int + if t == C.CblasNoTrans { + row, col = n, k } else { - k = n + row, col = k, n } - if lda*(k-1)+k > len(a) || lda < max(1, k) { - panic("blas: index of a out of range") + if lda < max(1, col) { + panic(badLdA) } - if ldb*(m-1)+n > len(b) || ldb < max(1, n) { - panic("blas: index of b out of range") + if ldc < max(1, n) { + panic(badLdC) } - if ldc*(m-1)+n > len(c) || ldc < max(1, n) { - panic("blas: index of c out of range") + + // Quick return if possible. + if n == 0 { + return } - C.cblas_dsymm(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_SIDE(s), C.enum_CBLAS_UPLO(ul), C.int(m), C.int(n), C.double(alpha), (*C.double)(_a), C.int(lda), (*C.double)(_b), C.int(ldb), C.double(beta), (*C.double)(_c), C.int(ldc)) + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(row-1)+col { + panic(shortA) + } + if len(c) < ldc*(n-1)+n { + panic(shortC) + } + var _a *float64 + if len(a) > 0 { + _a = &a[0] + } + var _c *float64 + if len(c) > 0 { + _c = &c[0] + } + C.cblas_dsyrk(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(t), C.int(n), C.int(k), C.double(alpha), (*C.double)(_a), C.int(lda), C.double(beta), (*C.double)(_c), C.int(ldc)) } -// Dsyrk performs the symmetric rank-k operation -// C = alpha * A * A^T + beta*C -// C is an n×n symmetric matrix. A is an n×k matrix if tA == blas.NoTrans, and -// a k×n matrix otherwise. alpha and beta are scalars. -func (Implementation) Dsyrk(ul blas.Uplo, t blas.Transpose, n, k int, alpha float64, a []float64, lda int, beta float64, c []float64, ldc int) { - // declared at cblas.h:480:6 void cblas_dsyrk ... +// Dsyr2k performs one of the symmetric rank 2k operations +// +// C = alpha * A * Bᵀ + alpha * B * Aᵀ + beta * C if tA == blas.NoTrans +// C = alpha * Aᵀ * B + alpha * Bᵀ * A + beta * C if tA == blas.Trans or tA == blas.ConjTrans +// +// where A and B are n×k or k×n matrices, C is an n×n symmetric matrix, and +// alpha and beta are scalars. +func (Implementation) Dsyr2k(ul blas.Uplo, t blas.Transpose, n, k int, alpha float64, a []float64, lda int, b []float64, ldb int, beta float64, c []float64, ldc int) { + // declared at cblas.h:480:6 void cblas_dsyr2k ... - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + switch t { + case blas.NoTrans: + t = C.CblasNoTrans + case blas.Trans: + t = C.CblasTrans + case blas.ConjTrans: + t = C.CblasConjTrans + default: + panic(badTranspose) } - if t != blas.NoTrans && t != blas.Trans && t != blas.ConjTrans { - panic("blas: illegal transpose") + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) } if n < 0 { - panic("blas: n < 0") + panic(nLT0) } if k < 0 { - panic("blas: k < 0") - } - var _a *float64 - if len(a) > 0 { - _a = &a[0] - } - var _c *float64 - if len(c) > 0 { - _c = &c[0] + panic(kLT0) } var row, col int - if t == blas.NoTrans { + if t == C.CblasNoTrans { row, col = n, k } else { row, col = k, n } - if lda*(row-1)+col > len(a) || lda < max(1, col) { - panic("blas: index of a out of range") + if lda < max(1, col) { + panic(badLdA) } - if ldc*(n-1)+n > len(c) || ldc < max(1, n) { - panic("blas: index of c out of range") + if ldb < max(1, col) { + panic(badLdB) + } + if ldc < max(1, n) { + panic(badLdC) } - C.cblas_dsyrk(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.enum_CBLAS_TRANSPOSE(t), C.int(n), C.int(k), C.double(alpha), (*C.double)(_a), C.int(lda), C.double(beta), (*C.double)(_c), C.int(ldc)) -} - -// Dsyr2k performs the symmetric rank 2k operation -// C = alpha * A * B^T + alpha * B * A^T + beta * C -// where C is an n×n symmetric matrix. A and B are n×k matrices if -// tA == NoTrans and k×n otherwise. alpha and beta are scalars. -func (Implementation) Dsyr2k(ul blas.Uplo, t blas.Transpose, n, k int, alpha float64, a []float64, lda int, b []float64, ldb int, beta float64, c []float64, ldc int) { - // declared at cblas.h:484:6 void cblas_dsyr2k ... - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + // Quick return if possible. + if n == 0 { + return } - if t != blas.NoTrans && t != blas.Trans && t != blas.ConjTrans { - panic("blas: illegal transpose") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(row-1)+col { + panic(shortA) } - if n < 0 { - panic("blas: n < 0") + if len(b) < ldb*(row-1)+col { + panic(shortB) } - if k < 0 { - panic("blas: k < 0") + if len(c) < ldc*(n-1)+n { + panic(shortC) } var _a *float64 if len(a) > 0 { @@ -4598,50 +6638,84 @@ func (Implementation) Dsyr2k(ul blas.Uplo, t blas.Transpose, n, k int, alpha flo if len(c) > 0 { _c = &c[0] } - var row, col int - if t == blas.NoTrans { - row, col = n, k - } else { - row, col = k, n - } - if lda*(row-1)+col > len(a) || lda < max(1, col) { - panic("blas: index of a out of range") - } - if ldb*(row-1)+col > len(b) || ldb < max(1, col) { - panic("blas: index of b out of range") - } - if ldc*(n-1)+n > len(c) || ldc < max(1, n) { - panic("blas: index of c out of range") - } - C.cblas_dsyr2k(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.enum_CBLAS_TRANSPOSE(t), C.int(n), C.int(k), C.double(alpha), (*C.double)(_a), C.int(lda), (*C.double)(_b), C.int(ldb), C.double(beta), (*C.double)(_c), C.int(ldc)) + C.cblas_dsyr2k(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(t), C.int(n), C.int(k), C.double(alpha), (*C.double)(_a), C.int(lda), (*C.double)(_b), C.int(ldb), C.double(beta), (*C.double)(_c), C.int(ldc)) } -// Dtrmm performs -// B = alpha * A * B, if tA == blas.NoTrans and side == blas.Left, -// B = alpha * A^T * B, if tA == blas.Trans or blas.ConjTrans, and side == blas.Left, -// B = alpha * B * A, if tA == blas.NoTrans and side == blas.Right, -// B = alpha * B * A^T, if tA == blas.Trans or blas.ConjTrans, and side == blas.Right, -// where A is an n×n or m×m triangular matrix, and B is an m×n matrix. +// Dtrmm performs one of the matrix-matrix operations +// +// B = alpha * A * B if tA == blas.NoTrans and side == blas.Left +// B = alpha * Aᵀ * B if tA == blas.Trans or blas.ConjTrans, and side == blas.Left +// B = alpha * B * A if tA == blas.NoTrans and side == blas.Right +// B = alpha * B * Aᵀ if tA == blas.Trans or blas.ConjTrans, and side == blas.Right +// +// where A is an n×n or m×m triangular matrix, B is an m×n matrix, and alpha is a scalar. func (Implementation) Dtrmm(s blas.Side, ul blas.Uplo, tA blas.Transpose, d blas.Diag, m, n int, alpha float64, a []float64, lda int, b []float64, ldb int) { - // declared at cblas.h:489:6 void cblas_dtrmm ... - - if s != blas.Left && s != blas.Right { - panic("blas: illegal side") + // declared at cblas.h:485:6 void cblas_dtrmm ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + switch d { + case blas.NonUnit: + d = C.CblasNonUnit + case blas.Unit: + d = C.CblasUnit + default: + panic(badDiag) + } + switch s { + case blas.Left: + s = C.CblasLeft + case blas.Right: + s = C.CblasRight + default: + panic(badSide) + } + if m < 0 { + panic(mLT0) + } + if n < 0 { + panic(nLT0) } - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + var k int + if s == C.CblasLeft { + k = m + } else { + k = n } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") + if lda < max(1, k) { + panic(badLdA) } - if d != blas.NonUnit && d != blas.Unit { - panic("blas: illegal diagonal") + if ldb < max(1, n) { + panic(badLdB) } - if m < 0 { - panic("blas: m < 0") + + // Quick return if possible. + if m == 0 || n == 0 { + return } - if n < 0 { - panic("blas: n < 0") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(k-1)+k { + panic(shortA) + } + if len(b) < ldb*(m-1)+n { + panic(shortB) } var _a *float64 if len(a) > 0 { @@ -4651,53 +6725,90 @@ func (Implementation) Dtrmm(s blas.Side, ul blas.Uplo, tA blas.Transpose, d blas if len(b) > 0 { _b = &b[0] } - var k int - if s == blas.Left { - k = m - } else { - k = n - } - if lda*(k-1)+k > len(a) || lda < max(1, k) { - panic("blas: index of a out of range") - } - if ldb*(m-1)+n > len(b) || ldb < max(1, n) { - panic("blas: index of b out of range") - } - C.cblas_dtrmm(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_SIDE(s), C.enum_CBLAS_UPLO(ul), C.enum_CBLAS_TRANSPOSE(tA), C.enum_CBLAS_DIAG(d), C.int(m), C.int(n), C.double(alpha), (*C.double)(_a), C.int(lda), (*C.double)(_b), C.int(ldb)) + C.cblas_dtrmm(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_SIDE(s), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(tA), C.CBLAS_DIAG(d), C.int(m), C.int(n), C.double(alpha), (*C.double)(_a), C.int(lda), (*C.double)(_b), C.int(ldb)) } -// Dtrsm solves -// A * X = alpha * B, if tA == blas.NoTrans side == blas.Left, -// A^T * X = alpha * B, if tA == blas.Trans or blas.ConjTrans, and side == blas.Left, -// X * A = alpha * B, if tA == blas.NoTrans side == blas.Right, -// X * A^T = alpha * B, if tA == blas.Trans or blas.ConjTrans, and side == blas.Right, -// where A is an n×n or m×m triangular matrix, X is an m×n matrix, and alpha is a +// Dtrsm solves one of the matrix equations +// +// A * X = alpha * B if tA == blas.NoTrans and side == blas.Left +// Aᵀ * X = alpha * B if tA == blas.Trans or blas.ConjTrans, and side == blas.Left +// X * A = alpha * B if tA == blas.NoTrans and side == blas.Right +// X * Aᵀ = alpha * B if tA == blas.Trans or blas.ConjTrans, and side == blas.Right +// +// where A is an n×n or m×m triangular matrix, X and B are m×n matrices, and alpha is a // scalar. // // At entry to the function, X contains the values of B, and the result is -// stored in place into X. +// stored in-place into X. // // No check is made that A is invertible. func (Implementation) Dtrsm(s blas.Side, ul blas.Uplo, tA blas.Transpose, d blas.Diag, m, n int, alpha float64, a []float64, lda int, b []float64, ldb int) { - // declared at cblas.h:494:6 void cblas_dtrsm ... - - if s != blas.Left && s != blas.Right { - panic("blas: illegal side") + // declared at cblas.h:490:6 void cblas_dtrsm ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + switch d { + case blas.NonUnit: + d = C.CblasNonUnit + case blas.Unit: + d = C.CblasUnit + default: + panic(badDiag) + } + switch s { + case blas.Left: + s = C.CblasLeft + case blas.Right: + s = C.CblasRight + default: + panic(badSide) + } + if m < 0 { + panic(mLT0) + } + if n < 0 { + panic(nLT0) } - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + var k int + if s == C.CblasLeft { + k = m + } else { + k = n } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") + if lda < max(1, k) { + panic(badLdA) } - if d != blas.NonUnit && d != blas.Unit { - panic("blas: illegal diagonal") + if ldb < max(1, n) { + panic(badLdB) } - if m < 0 { - panic("blas: m < 0") + + // Quick return if possible. + if m == 0 || n == 0 { + return } - if n < 0 { - panic("blas: n < 0") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(k-1)+k { + panic(shortA) + } + if len(b) < ldb*(m-1)+n { + panic(shortB) } var _a *float64 if len(a) > 0 { @@ -4707,88 +6818,88 @@ func (Implementation) Dtrsm(s blas.Side, ul blas.Uplo, tA blas.Transpose, d blas if len(b) > 0 { _b = &b[0] } - var k int - if s == blas.Left { - k = m - } else { - k = n - } - if lda*(k-1)+k > len(a) || lda < max(1, k) { - panic("blas: index of a out of range") - } - if ldb*(m-1)+n > len(b) || ldb < max(1, n) { - panic("blas: index of b out of range") - } - C.cblas_dtrsm(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_SIDE(s), C.enum_CBLAS_UPLO(ul), C.enum_CBLAS_TRANSPOSE(tA), C.enum_CBLAS_DIAG(d), C.int(m), C.int(n), C.double(alpha), (*C.double)(_a), C.int(lda), (*C.double)(_b), C.int(ldb)) + C.cblas_dtrsm(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_SIDE(s), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(tA), C.CBLAS_DIAG(d), C.int(m), C.int(n), C.double(alpha), (*C.double)(_a), C.int(lda), (*C.double)(_b), C.int(ldb)) } +// Cgemm performs one of the matrix-matrix operations +// +// C = alpha * op(A) * op(B) + beta * C +// +// where op(X) is one of +// +// op(X) = X or op(X) = Xᵀ or op(X) = Xᴴ, +// +// alpha and beta are scalars, and A, B and C are matrices, with op(A) an m×k matrix, +// op(B) a k×n matrix and C an m×n matrix. +// +// Complex64 implementations are autogenerated and not directly tested. func (Implementation) Cgemm(tA, tB blas.Transpose, m, n, k int, alpha complex64, a []complex64, lda int, b []complex64, ldb int, beta complex64, c []complex64, ldc int) { - // declared at cblas.h:500:6 void cblas_cgemm ... - - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") - } - if tB != blas.NoTrans && tB != blas.Trans && tB != blas.ConjTrans { - panic("blas: illegal transpose") + // declared at cblas.h:496:6 void cblas_cgemm ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) + } + switch tB { + case blas.NoTrans: + tB = C.CblasNoTrans + case blas.Trans: + tB = C.CblasTrans + case blas.ConjTrans: + tB = C.CblasConjTrans + default: + panic(badTranspose) } if m < 0 { - panic("blas: m < 0") + panic(mLT0) } if n < 0 { - panic("blas: n < 0") + panic(nLT0) } if k < 0 { - panic("blas: k < 0") - } - var _a *complex64 - if len(a) > 0 { - _a = &a[0] - } - var _b *complex64 - if len(b) > 0 { - _b = &b[0] - } - var _c *complex64 - if len(c) > 0 { - _c = &c[0] + panic(kLT0) } var rowA, colA, rowB, colB int - if tA == blas.NoTrans { + if tA == C.CblasNoTrans { rowA, colA = m, k } else { rowA, colA = k, m } - if tB == blas.NoTrans { + if tB == C.CblasNoTrans { rowB, colB = k, n } else { rowB, colB = n, k } - if lda*(rowA-1)+colA > len(a) || lda < max(1, colA) { - panic("blas: index of a out of range") + if lda < max(1, colA) { + panic(badLdA) } - if ldb*(rowB-1)+colB > len(b) || ldb < max(1, colB) { - panic("blas: index of b out of range") + if ldb < max(1, colB) { + panic(badLdB) } - if ldc*(m-1)+n > len(c) || ldc < max(1, n) { - panic("blas: index of c out of range") + if ldc < max(1, n) { + panic(badLdC) } - C.cblas_cgemm(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_TRANSPOSE(tA), C.enum_CBLAS_TRANSPOSE(tB), C.int(m), C.int(n), C.int(k), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_b), C.int(ldb), unsafe.Pointer(&beta), unsafe.Pointer(_c), C.int(ldc)) -} - -func (Implementation) Csymm(s blas.Side, ul blas.Uplo, m, n int, alpha complex64, a []complex64, lda int, b []complex64, ldb int, beta complex64, c []complex64, ldc int) { - // declared at cblas.h:505:6 void cblas_csymm ... - if s != blas.Left && s != blas.Right { - panic("blas: illegal side") + // Quick return if possible. + if m == 0 || n == 0 { + return } - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(rowA-1)+colA { + panic(shortA) } - if m < 0 { - panic("blas: m < 0") + if len(b) < ldb*(rowB-1)+colB { + panic(shortB) } - if n < 0 { - panic("blas: n < 0") + if len(c) < ldc*(m-1)+n { + panic(shortC) } var _a *complex64 if len(a) > 0 { @@ -4802,127 +6913,223 @@ func (Implementation) Csymm(s blas.Side, ul blas.Uplo, m, n int, alpha complex64 if len(c) > 0 { _c = &c[0] } + C.cblas_cgemm(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_TRANSPOSE(tA), C.CBLAS_TRANSPOSE(tB), C.int(m), C.int(n), C.int(k), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_b), C.int(ldb), unsafe.Pointer(&beta), unsafe.Pointer(_c), C.int(ldc)) +} + +// Csymm performs one of the matrix-matrix operations +// +// C = alpha*A*B + beta*C if side == blas.Left +// C = alpha*B*A + beta*C if side == blas.Right +// +// where alpha and beta are scalars, A is an m×m or n×n symmetric matrix and B +// and C are m×n matrices. +// +// Complex64 implementations are autogenerated and not directly tested. +func (Implementation) Csymm(s blas.Side, ul blas.Uplo, m, n int, alpha complex64, a []complex64, lda int, b []complex64, ldb int, beta complex64, c []complex64, ldc int) { + // declared at cblas.h:501:6 void cblas_csymm ... + + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + switch s { + case blas.Left: + s = C.CblasLeft + case blas.Right: + s = C.CblasRight + default: + panic(badSide) + } + if m < 0 { + panic(mLT0) + } + if n < 0 { + panic(nLT0) + } var k int - if s == blas.Left { + if s == C.CblasLeft { k = m } else { k = n } - if lda*(k-1)+k > len(a) || lda < max(1, k) { - panic("blas: index of a out of range") + if lda < max(1, k) { + panic(badLdA) } - if ldb*(m-1)+n > len(b) || ldb < max(1, n) { - panic("blas: index of b out of range") + if ldb < max(1, n) { + panic(badLdB) } - if ldc*(m-1)+n > len(c) || ldc < max(1, n) { - panic("blas: index of c out of range") + if ldc < max(1, n) { + panic(badLdC) } - C.cblas_csymm(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_SIDE(s), C.enum_CBLAS_UPLO(ul), C.int(m), C.int(n), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_b), C.int(ldb), unsafe.Pointer(&beta), unsafe.Pointer(_c), C.int(ldc)) -} - -func (Implementation) Csyrk(ul blas.Uplo, t blas.Transpose, n, k int, alpha complex64, a []complex64, lda int, beta complex64, c []complex64, ldc int) { - // declared at cblas.h:510:6 void cblas_csyrk ... - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + // Quick return if possible. + if m == 0 || n == 0 { + return } - if t != blas.NoTrans && t != blas.Trans { - panic("blas: illegal transpose") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(k-1)+k { + panic(shortA) } - if n < 0 { - panic("blas: n < 0") + if len(b) < ldb*(m-1)+n { + panic(shortB) } - if k < 0 { - panic("blas: k < 0") + if len(c) < ldc*(m-1)+n { + panic(shortC) } var _a *complex64 if len(a) > 0 { _a = &a[0] } + var _b *complex64 + if len(b) > 0 { + _b = &b[0] + } var _c *complex64 if len(c) > 0 { _c = &c[0] } + C.cblas_csymm(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_SIDE(s), C.CBLAS_UPLO(ul), C.int(m), C.int(n), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_b), C.int(ldb), unsafe.Pointer(&beta), unsafe.Pointer(_c), C.int(ldc)) +} + +// Csyrk performs one of the symmetric rank-k operations +// +// C = alpha*A*Aᵀ + beta*C if trans == blas.NoTrans +// C = alpha*Aᵀ*A + beta*C if trans == blas.Trans +// +// where alpha and beta are scalars, C is an n×n symmetric matrix and A is +// an n×k matrix in the first case and a k×n matrix in the second case. +// +// Complex64 implementations are autogenerated and not directly tested. +func (Implementation) Csyrk(ul blas.Uplo, t blas.Transpose, n, k int, alpha complex64, a []complex64, lda int, beta complex64, c []complex64, ldc int) { + // declared at cblas.h:506:6 void cblas_csyrk ... + + switch t { + case blas.NoTrans: + t = C.CblasNoTrans + case blas.Trans: + t = C.CblasTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + if n < 0 { + panic(nLT0) + } + if k < 0 { + panic(kLT0) + } var row, col int - if t == blas.NoTrans { + if t == C.CblasNoTrans { row, col = n, k } else { row, col = k, n } - if lda*(row-1)+col > len(a) || lda < max(1, col) { - panic("blas: index of a out of range") + if lda < max(1, col) { + panic(badLdA) } - if ldc*(n-1)+n > len(c) || ldc < max(1, n) { - panic("blas: index of c out of range") + if ldc < max(1, n) { + panic(badLdC) } - C.cblas_csyrk(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.enum_CBLAS_TRANSPOSE(t), C.int(n), C.int(k), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(&beta), unsafe.Pointer(_c), C.int(ldc)) -} - -func (Implementation) Csyr2k(ul blas.Uplo, t blas.Transpose, n, k int, alpha complex64, a []complex64, lda int, b []complex64, ldb int, beta complex64, c []complex64, ldc int) { - // declared at cblas.h:514:6 void cblas_csyr2k ... - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") - } - if t != blas.NoTrans && t != blas.Trans { - panic("blas: illegal transpose") + // Quick return if possible. + if n == 0 { + return } - if n < 0 { - panic("blas: n < 0") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(row-1)+col { + panic(shortA) } - if k < 0 { - panic("blas: k < 0") + if len(c) < ldc*(n-1)+n { + panic(shortC) } var _a *complex64 if len(a) > 0 { _a = &a[0] } - var _b *complex64 - if len(b) > 0 { - _b = &b[0] - } var _c *complex64 if len(c) > 0 { _c = &c[0] } + C.cblas_csyrk(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(t), C.int(n), C.int(k), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(&beta), unsafe.Pointer(_c), C.int(ldc)) +} + +// Csyr2k performs one of the symmetric rank-2k operations +// +// C = alpha*A*Bᵀ + alpha*B*Aᵀ + beta*C if trans == blas.NoTrans +// C = alpha*Aᵀ*B + alpha*Bᵀ*A + beta*C if trans == blas.Trans +// +// where alpha and beta are scalars, C is an n×n symmetric matrix and A and B +// are n×k matrices in the first case and k×n matrices in the second case. +// +// Complex64 implementations are autogenerated and not directly tested. +func (Implementation) Csyr2k(ul blas.Uplo, t blas.Transpose, n, k int, alpha complex64, a []complex64, lda int, b []complex64, ldb int, beta complex64, c []complex64, ldc int) { + // declared at cblas.h:510:6 void cblas_csyr2k ... + + switch t { + case blas.NoTrans: + t = C.CblasNoTrans + case blas.Trans: + t = C.CblasTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + if n < 0 { + panic(nLT0) + } + if k < 0 { + panic(kLT0) + } var row, col int - if t == blas.NoTrans { + if t == C.CblasNoTrans { row, col = n, k } else { row, col = k, n } - if lda*(row-1)+col > len(a) || lda < max(1, col) { - panic("blas: index of a out of range") + if lda < max(1, col) { + panic(badLdA) } - if ldb*(row-1)+col > len(b) || ldb < max(1, col) { - panic("blas: index of b out of range") + if ldb < max(1, col) { + panic(badLdB) } - if ldc*(n-1)+n > len(c) || ldc < max(1, n) { - panic("blas: index of c out of range") + if ldc < max(1, n) { + panic(badLdC) } - C.cblas_csyr2k(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.enum_CBLAS_TRANSPOSE(t), C.int(n), C.int(k), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_b), C.int(ldb), unsafe.Pointer(&beta), unsafe.Pointer(_c), C.int(ldc)) -} - -func (Implementation) Ctrmm(s blas.Side, ul blas.Uplo, tA blas.Transpose, d blas.Diag, m, n int, alpha complex64, a []complex64, lda int, b []complex64, ldb int) { - // declared at cblas.h:519:6 void cblas_ctrmm ... - if s != blas.Left && s != blas.Right { - panic("blas: illegal side") - } - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") - } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") + // Quick return if possible. + if n == 0 { + return } - if d != blas.NonUnit && d != blas.Unit { - panic("blas: illegal diagonal") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(row-1)+col { + panic(shortA) } - if m < 0 { - panic("blas: m < 0") + if len(b) < ldb*(row-1)+col { + panic(shortB) } - if n < 0 { - panic("blas: n < 0") + if len(c) < ldc*(n-1)+n { + panic(shortC) } var _a *complex64 if len(a) > 0 { @@ -4932,41 +7139,93 @@ func (Implementation) Ctrmm(s blas.Side, ul blas.Uplo, tA blas.Transpose, d blas if len(b) > 0 { _b = &b[0] } + var _c *complex64 + if len(c) > 0 { + _c = &c[0] + } + C.cblas_csyr2k(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(t), C.int(n), C.int(k), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_b), C.int(ldb), unsafe.Pointer(&beta), unsafe.Pointer(_c), C.int(ldc)) +} + +// Ctrmm performs one of the matrix-matrix operations +// +// B = alpha * op(A) * B if side == blas.Left, +// B = alpha * B * op(A) if side == blas.Right, +// +// where alpha is a scalar, B is an m×n matrix, A is a unit, or non-unit, +// upper or lower triangular matrix and op(A) is one of +// +// op(A) = A if trans == blas.NoTrans, +// op(A) = Aᵀ if trans == blas.Trans, +// op(A) = Aᴴ if trans == blas.ConjTrans. +// +// Complex64 implementations are autogenerated and not directly tested. +func (Implementation) Ctrmm(s blas.Side, ul blas.Uplo, tA blas.Transpose, d blas.Diag, m, n int, alpha complex64, a []complex64, lda int, b []complex64, ldb int) { + // declared at cblas.h:515:6 void cblas_ctrmm ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + switch d { + case blas.NonUnit: + d = C.CblasNonUnit + case blas.Unit: + d = C.CblasUnit + default: + panic(badDiag) + } + switch s { + case blas.Left: + s = C.CblasLeft + case blas.Right: + s = C.CblasRight + default: + panic(badSide) + } + if m < 0 { + panic(mLT0) + } + if n < 0 { + panic(nLT0) + } var k int - if s == blas.Left { + if s == C.CblasLeft { k = m } else { k = n } - if lda*(k-1)+k > len(a) || lda < max(1, k) { - panic("blas: index of a out of range") + if lda < max(1, k) { + panic(badLdA) } - if ldb*(m-1)+n > len(b) || ldb < max(1, n) { - panic("blas: index of b out of range") + if ldb < max(1, n) { + panic(badLdB) } - C.cblas_ctrmm(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_SIDE(s), C.enum_CBLAS_UPLO(ul), C.enum_CBLAS_TRANSPOSE(tA), C.enum_CBLAS_DIAG(d), C.int(m), C.int(n), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_b), C.int(ldb)) -} - -func (Implementation) Ctrsm(s blas.Side, ul blas.Uplo, tA blas.Transpose, d blas.Diag, m, n int, alpha complex64, a []complex64, lda int, b []complex64, ldb int) { - // declared at cblas.h:524:6 void cblas_ctrsm ... - if s != blas.Left && s != blas.Right { - panic("blas: illegal side") - } - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") - } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") - } - if d != blas.NonUnit && d != blas.Unit { - panic("blas: illegal diagonal") + // Quick return if possible. + if m == 0 || n == 0 { + return } - if m < 0 { - panic("blas: m < 0") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(k-1)+k { + panic(shortA) } - if n < 0 { - panic("blas: n < 0") + if len(b) < ldb*(m-1)+n { + panic(shortB) } var _a *complex64 if len(a) > 0 { @@ -4976,38 +7235,180 @@ func (Implementation) Ctrsm(s blas.Side, ul blas.Uplo, tA blas.Transpose, d blas if len(b) > 0 { _b = &b[0] } + C.cblas_ctrmm(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_SIDE(s), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(tA), C.CBLAS_DIAG(d), C.int(m), C.int(n), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_b), C.int(ldb)) +} + +// Ctrsm solves one of the matrix equations +// +// op(A) * X = alpha * B if side == blas.Left, +// X * op(A) = alpha * B if side == blas.Right, +// +// where alpha is a scalar, X and B are m×n matrices, A is a unit or +// non-unit, upper or lower triangular matrix and op(A) is one of +// +// op(A) = A if transA == blas.NoTrans, +// op(A) = Aᵀ if transA == blas.Trans, +// op(A) = Aᴴ if transA == blas.ConjTrans. +// +// On return the matrix X is overwritten on B. +// +// Complex64 implementations are autogenerated and not directly tested. +func (Implementation) Ctrsm(s blas.Side, ul blas.Uplo, tA blas.Transpose, d blas.Diag, m, n int, alpha complex64, a []complex64, lda int, b []complex64, ldb int) { + // declared at cblas.h:520:6 void cblas_ctrsm ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + switch d { + case blas.NonUnit: + d = C.CblasNonUnit + case blas.Unit: + d = C.CblasUnit + default: + panic(badDiag) + } + switch s { + case blas.Left: + s = C.CblasLeft + case blas.Right: + s = C.CblasRight + default: + panic(badSide) + } + if m < 0 { + panic(mLT0) + } + if n < 0 { + panic(nLT0) + } var k int - if s == blas.Left { + if s == C.CblasLeft { k = m } else { k = n } - if lda*(k-1)+k > len(a) || lda < max(1, k) { - panic("blas: index of a out of range") + if lda < max(1, k) { + panic(badLdA) } - if ldb*(m-1)+n > len(b) || ldb < max(1, n) { - panic("blas: index of b out of range") + if ldb < max(1, n) { + panic(badLdB) } - C.cblas_ctrsm(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_SIDE(s), C.enum_CBLAS_UPLO(ul), C.enum_CBLAS_TRANSPOSE(tA), C.enum_CBLAS_DIAG(d), C.int(m), C.int(n), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_b), C.int(ldb)) -} -func (Implementation) Zgemm(tA, tB blas.Transpose, m, n, k int, alpha complex128, a []complex128, lda int, b []complex128, ldb int, beta complex128, c []complex128, ldc int) { - // declared at cblas.h:530:6 void cblas_zgemm ... + // Quick return if possible. + if m == 0 || n == 0 { + return + } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(k-1)+k { + panic(shortA) + } + if len(b) < ldb*(m-1)+n { + panic(shortB) + } + var _a *complex64 + if len(a) > 0 { + _a = &a[0] + } + var _b *complex64 + if len(b) > 0 { + _b = &b[0] } - if tB != blas.NoTrans && tB != blas.Trans && tB != blas.ConjTrans { - panic("blas: illegal transpose") + C.cblas_ctrsm(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_SIDE(s), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(tA), C.CBLAS_DIAG(d), C.int(m), C.int(n), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_b), C.int(ldb)) +} + +// Zgemm performs one of the matrix-matrix operations +// +// C = alpha * op(A) * op(B) + beta * C +// +// where op(X) is one of +// +// op(X) = X or op(X) = Xᵀ or op(X) = Xᴴ, +// +// alpha and beta are scalars, and A, B and C are matrices, with op(A) an m×k matrix, +// op(B) a k×n matrix and C an m×n matrix. +func (Implementation) Zgemm(tA, tB blas.Transpose, m, n, k int, alpha complex128, a []complex128, lda int, b []complex128, ldb int, beta complex128, c []complex128, ldc int) { + // declared at cblas.h:526:6 void cblas_zgemm ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) + } + switch tB { + case blas.NoTrans: + tB = C.CblasNoTrans + case blas.Trans: + tB = C.CblasTrans + case blas.ConjTrans: + tB = C.CblasConjTrans + default: + panic(badTranspose) } if m < 0 { - panic("blas: m < 0") + panic(mLT0) } if n < 0 { - panic("blas: n < 0") + panic(nLT0) } if k < 0 { - panic("blas: k < 0") + panic(kLT0) + } + var rowA, colA, rowB, colB int + if tA == C.CblasNoTrans { + rowA, colA = m, k + } else { + rowA, colA = k, m + } + if tB == C.CblasNoTrans { + rowB, colB = k, n + } else { + rowB, colB = n, k + } + if lda < max(1, colA) { + panic(badLdA) + } + if ldb < max(1, colB) { + panic(badLdB) + } + if ldc < max(1, n) { + panic(badLdC) + } + + // Quick return if possible. + if m == 0 || n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(rowA-1)+colA { + panic(shortA) + } + if len(b) < ldb*(rowB-1)+colB { + panic(shortB) + } + if len(c) < ldc*(m-1)+n { + panic(shortC) } var _a *complex128 if len(a) > 0 { @@ -5021,43 +7422,71 @@ func (Implementation) Zgemm(tA, tB blas.Transpose, m, n, k int, alpha complex128 if len(c) > 0 { _c = &c[0] } - var rowA, colA, rowB, colB int - if tA == blas.NoTrans { - rowA, colA = m, k - } else { - rowA, colA = k, m + C.cblas_zgemm(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_TRANSPOSE(tA), C.CBLAS_TRANSPOSE(tB), C.int(m), C.int(n), C.int(k), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_b), C.int(ldb), unsafe.Pointer(&beta), unsafe.Pointer(_c), C.int(ldc)) +} + +// Zsymm performs one of the matrix-matrix operations +// +// C = alpha*A*B + beta*C if side == blas.Left +// C = alpha*B*A + beta*C if side == blas.Right +// +// where alpha and beta are scalars, A is an m×m or n×n symmetric matrix and B +// and C are m×n matrices. +func (Implementation) Zsymm(s blas.Side, ul blas.Uplo, m, n int, alpha complex128, a []complex128, lda int, b []complex128, ldb int, beta complex128, c []complex128, ldc int) { + // declared at cblas.h:531:6 void cblas_zsymm ... + + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + switch s { + case blas.Left: + s = C.CblasLeft + case blas.Right: + s = C.CblasRight + default: + panic(badSide) + } + if m < 0 { + panic(mLT0) + } + if n < 0 { + panic(nLT0) } - if tB == blas.NoTrans { - rowB, colB = k, n + var k int + if s == C.CblasLeft { + k = m } else { - rowB, colB = n, k + k = n } - if lda*(rowA-1)+colA > len(a) || lda < max(1, colA) { - panic("blas: index of a out of range") + if lda < max(1, k) { + panic(badLdA) } - if ldb*(rowB-1)+colB > len(b) || ldb < max(1, colB) { - panic("blas: index of b out of range") + if ldb < max(1, n) { + panic(badLdB) } - if ldc*(m-1)+n > len(c) || ldc < max(1, n) { - panic("blas: index of c out of range") + if ldc < max(1, n) { + panic(badLdC) } - C.cblas_zgemm(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_TRANSPOSE(tA), C.enum_CBLAS_TRANSPOSE(tB), C.int(m), C.int(n), C.int(k), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_b), C.int(ldb), unsafe.Pointer(&beta), unsafe.Pointer(_c), C.int(ldc)) -} - -func (Implementation) Zsymm(s blas.Side, ul blas.Uplo, m, n int, alpha complex128, a []complex128, lda int, b []complex128, ldb int, beta complex128, c []complex128, ldc int) { - // declared at cblas.h:535:6 void cblas_zsymm ... - if s != blas.Left && s != blas.Right { - panic("blas: illegal side") + // Quick return if possible. + if m == 0 || n == 0 { + return } - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(k-1)+k { + panic(shortA) } - if m < 0 { - panic("blas: m < 0") + if len(b) < ldb*(m-1)+n { + panic(shortB) } - if n < 0 { - panic("blas: n < 0") + if len(c) < ldc*(m-1)+n { + panic(shortC) } var _a *complex128 if len(a) > 0 { @@ -5071,38 +7500,65 @@ func (Implementation) Zsymm(s blas.Side, ul blas.Uplo, m, n int, alpha complex12 if len(c) > 0 { _c = &c[0] } - var k int - if s == blas.Left { - k = m - } else { - k = n - } - if lda*(k-1)+k > len(a) || lda < max(1, k) { - panic("blas: index of a out of range") - } - if ldb*(m-1)+n > len(b) || ldb < max(1, n) { - panic("blas: index of b out of range") - } - if ldc*(m-1)+n > len(c) || ldc < max(1, n) { - panic("blas: index of c out of range") - } - C.cblas_zsymm(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_SIDE(s), C.enum_CBLAS_UPLO(ul), C.int(m), C.int(n), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_b), C.int(ldb), unsafe.Pointer(&beta), unsafe.Pointer(_c), C.int(ldc)) + C.cblas_zsymm(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_SIDE(s), C.CBLAS_UPLO(ul), C.int(m), C.int(n), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_b), C.int(ldb), unsafe.Pointer(&beta), unsafe.Pointer(_c), C.int(ldc)) } +// Zsyrk performs one of the symmetric rank-k operations +// +// C = alpha*A*Aᵀ + beta*C if trans == blas.NoTrans +// C = alpha*Aᵀ*A + beta*C if trans == blas.Trans +// +// where alpha and beta are scalars, C is an n×n symmetric matrix and A is +// an n×k matrix in the first case and a k×n matrix in the second case. func (Implementation) Zsyrk(ul blas.Uplo, t blas.Transpose, n, k int, alpha complex128, a []complex128, lda int, beta complex128, c []complex128, ldc int) { - // declared at cblas.h:540:6 void cblas_zsyrk ... + // declared at cblas.h:536:6 void cblas_zsyrk ... - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + switch t { + case blas.NoTrans: + t = C.CblasNoTrans + case blas.Trans: + t = C.CblasTrans + default: + panic(badTranspose) } - if t != blas.NoTrans && t != blas.Trans { - panic("blas: illegal transpose") + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) } if n < 0 { - panic("blas: n < 0") + panic(nLT0) } if k < 0 { - panic("blas: k < 0") + panic(kLT0) + } + var row, col int + if t == C.CblasNoTrans { + row, col = n, k + } else { + row, col = k, n + } + if lda < max(1, col) { + panic(badLdA) + } + if ldc < max(1, n) { + panic(badLdC) + } + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(row-1)+col { + panic(shortA) + } + if len(c) < ldc*(n-1)+n { + panic(shortC) } var _a *complex128 if len(a) > 0 { @@ -5112,35 +7568,71 @@ func (Implementation) Zsyrk(ul blas.Uplo, t blas.Transpose, n, k int, alpha comp if len(c) > 0 { _c = &c[0] } + C.cblas_zsyrk(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(t), C.int(n), C.int(k), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(&beta), unsafe.Pointer(_c), C.int(ldc)) +} + +// Zsyr2k performs one of the symmetric rank-2k operations +// +// C = alpha*A*Bᵀ + alpha*B*Aᵀ + beta*C if trans == blas.NoTrans +// C = alpha*Aᵀ*B + alpha*Bᵀ*A + beta*C if trans == blas.Trans +// +// where alpha and beta are scalars, C is an n×n symmetric matrix and A and B +// are n×k matrices in the first case and k×n matrices in the second case. +func (Implementation) Zsyr2k(ul blas.Uplo, t blas.Transpose, n, k int, alpha complex128, a []complex128, lda int, b []complex128, ldb int, beta complex128, c []complex128, ldc int) { + // declared at cblas.h:540:6 void cblas_zsyr2k ... + + switch t { + case blas.NoTrans: + t = C.CblasNoTrans + case blas.Trans: + t = C.CblasTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + if n < 0 { + panic(nLT0) + } + if k < 0 { + panic(kLT0) + } var row, col int - if t == blas.NoTrans { + if t == C.CblasNoTrans { row, col = n, k } else { row, col = k, n } - if lda*(row-1)+col > len(a) || lda < max(1, col) { - panic("blas: index of a out of range") + if lda < max(1, col) { + panic(badLdA) } - if ldc*(n-1)+n > len(c) || ldc < max(1, n) { - panic("blas: index of c out of range") + if ldb < max(1, col) { + panic(badLdB) + } + if ldc < max(1, n) { + panic(badLdC) } - C.cblas_zsyrk(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.enum_CBLAS_TRANSPOSE(t), C.int(n), C.int(k), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(&beta), unsafe.Pointer(_c), C.int(ldc)) -} - -func (Implementation) Zsyr2k(ul blas.Uplo, t blas.Transpose, n, k int, alpha complex128, a []complex128, lda int, b []complex128, ldb int, beta complex128, c []complex128, ldc int) { - // declared at cblas.h:544:6 void cblas_zsyr2k ... - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + // Quick return if possible. + if n == 0 { + return } - if t != blas.NoTrans && t != blas.Trans { - panic("blas: illegal transpose") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(row-1)+col { + panic(shortA) } - if n < 0 { - panic("blas: n < 0") + if len(b) < ldb*(row-1)+col { + panic(shortB) } - if k < 0 { - panic("blas: k < 0") + if len(c) < ldc*(n-1)+n { + panic(shortC) } var _a *complex128 if len(a) > 0 { @@ -5154,44 +7646,87 @@ func (Implementation) Zsyr2k(ul blas.Uplo, t blas.Transpose, n, k int, alpha com if len(c) > 0 { _c = &c[0] } - var row, col int - if t == blas.NoTrans { - row, col = n, k - } else { - row, col = k, n - } - if lda*(row-1)+col > len(a) || lda < max(1, col) { - panic("blas: index of a out of range") - } - if ldb*(row-1)+col > len(b) || ldb < max(1, col) { - panic("blas: index of b out of range") - } - if ldc*(n-1)+n > len(c) || ldc < max(1, n) { - panic("blas: index of c out of range") - } - C.cblas_zsyr2k(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.enum_CBLAS_TRANSPOSE(t), C.int(n), C.int(k), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_b), C.int(ldb), unsafe.Pointer(&beta), unsafe.Pointer(_c), C.int(ldc)) + C.cblas_zsyr2k(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(t), C.int(n), C.int(k), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_b), C.int(ldb), unsafe.Pointer(&beta), unsafe.Pointer(_c), C.int(ldc)) } +// Ztrmm performs one of the matrix-matrix operations +// +// B = alpha * op(A) * B if side == blas.Left, +// B = alpha * B * op(A) if side == blas.Right, +// +// where alpha is a scalar, B is an m×n matrix, A is a unit, or non-unit, +// upper or lower triangular matrix and op(A) is one of +// +// op(A) = A if trans == blas.NoTrans, +// op(A) = Aᵀ if trans == blas.Trans, +// op(A) = Aᴴ if trans == blas.ConjTrans. func (Implementation) Ztrmm(s blas.Side, ul blas.Uplo, tA blas.Transpose, d blas.Diag, m, n int, alpha complex128, a []complex128, lda int, b []complex128, ldb int) { - // declared at cblas.h:549:6 void cblas_ztrmm ... - - if s != blas.Left && s != blas.Right { - panic("blas: illegal side") + // declared at cblas.h:545:6 void cblas_ztrmm ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + switch d { + case blas.NonUnit: + d = C.CblasNonUnit + case blas.Unit: + d = C.CblasUnit + default: + panic(badDiag) + } + switch s { + case blas.Left: + s = C.CblasLeft + case blas.Right: + s = C.CblasRight + default: + panic(badSide) + } + if m < 0 { + panic(mLT0) + } + if n < 0 { + panic(nLT0) + } + var k int + if s == C.CblasLeft { + k = m + } else { + k = n } - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + if lda < max(1, k) { + panic(badLdA) } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") + if ldb < max(1, n) { + panic(badLdB) } - if d != blas.NonUnit && d != blas.Unit { - panic("blas: illegal diagonal") + + // Quick return if possible. + if m == 0 || n == 0 { + return } - if m < 0 { - panic("blas: m < 0") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(k-1)+k { + panic(shortA) } - if n < 0 { - panic("blas: n < 0") + if len(b) < ldb*(m-1)+n { + panic(shortB) } var _a *complex128 if len(a) > 0 { @@ -5201,41 +7736,89 @@ func (Implementation) Ztrmm(s blas.Side, ul blas.Uplo, tA blas.Transpose, d blas if len(b) > 0 { _b = &b[0] } + C.cblas_ztrmm(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_SIDE(s), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(tA), C.CBLAS_DIAG(d), C.int(m), C.int(n), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_b), C.int(ldb)) +} + +// Ztrsm solves one of the matrix equations +// +// op(A) * X = alpha * B if side == blas.Left, +// X * op(A) = alpha * B if side == blas.Right, +// +// where alpha is a scalar, X and B are m×n matrices, A is a unit or +// non-unit, upper or lower triangular matrix and op(A) is one of +// +// op(A) = A if transA == blas.NoTrans, +// op(A) = Aᵀ if transA == blas.Trans, +// op(A) = Aᴴ if transA == blas.ConjTrans. +// +// On return the matrix X is overwritten on B. +func (Implementation) Ztrsm(s blas.Side, ul blas.Uplo, tA blas.Transpose, d blas.Diag, m, n int, alpha complex128, a []complex128, lda int, b []complex128, ldb int) { + // declared at cblas.h:550:6 void cblas_ztrsm ... + + switch tA { + case blas.NoTrans: + tA = C.CblasNoTrans + case blas.Trans: + tA = C.CblasTrans + case blas.ConjTrans: + tA = C.CblasConjTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + switch d { + case blas.NonUnit: + d = C.CblasNonUnit + case blas.Unit: + d = C.CblasUnit + default: + panic(badDiag) + } + switch s { + case blas.Left: + s = C.CblasLeft + case blas.Right: + s = C.CblasRight + default: + panic(badSide) + } + if m < 0 { + panic(mLT0) + } + if n < 0 { + panic(nLT0) + } var k int - if s == blas.Left { + if s == C.CblasLeft { k = m } else { k = n } - if lda*(k-1)+k > len(a) || lda < max(1, k) { - panic("blas: index of a out of range") + if lda < max(1, k) { + panic(badLdA) } - if ldb*(m-1)+n > len(b) || ldb < max(1, n) { - panic("blas: index of b out of range") + if ldb < max(1, n) { + panic(badLdB) } - C.cblas_ztrmm(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_SIDE(s), C.enum_CBLAS_UPLO(ul), C.enum_CBLAS_TRANSPOSE(tA), C.enum_CBLAS_DIAG(d), C.int(m), C.int(n), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_b), C.int(ldb)) -} - -func (Implementation) Ztrsm(s blas.Side, ul blas.Uplo, tA blas.Transpose, d blas.Diag, m, n int, alpha complex128, a []complex128, lda int, b []complex128, ldb int) { - // declared at cblas.h:554:6 void cblas_ztrsm ... - if s != blas.Left && s != blas.Right { - panic("blas: illegal side") - } - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") - } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic("blas: illegal transpose") - } - if d != blas.NonUnit && d != blas.Unit { - panic("blas: illegal diagonal") + // Quick return if possible. + if m == 0 || n == 0 { + return } - if m < 0 { - panic("blas: m < 0") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(k-1)+k { + panic(shortA) } - if n < 0 { - panic("blas: n < 0") + if len(b) < ldb*(m-1)+n { + panic(shortB) } var _a *complex128 if len(a) > 0 { @@ -5245,35 +7828,74 @@ func (Implementation) Ztrsm(s blas.Side, ul blas.Uplo, tA blas.Transpose, d blas if len(b) > 0 { _b = &b[0] } + C.cblas_ztrsm(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_SIDE(s), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(tA), C.CBLAS_DIAG(d), C.int(m), C.int(n), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_b), C.int(ldb)) +} + +// Chemm performs one of the matrix-matrix operations +// +// C = alpha*A*B + beta*C if side == blas.Left +// C = alpha*B*A + beta*C if side == blas.Right +// +// where alpha and beta are scalars, A is an m×m or n×n hermitian matrix and B +// and C are m×n matrices. The imaginary parts of the diagonal elements of A are +// assumed to be zero. +// +// Complex64 implementations are autogenerated and not directly tested. +func (Implementation) Chemm(s blas.Side, ul blas.Uplo, m, n int, alpha complex64, a []complex64, lda int, b []complex64, ldb int, beta complex64, c []complex64, ldc int) { + // declared at cblas.h:560:6 void cblas_chemm ... + + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + switch s { + case blas.Left: + s = C.CblasLeft + case blas.Right: + s = C.CblasRight + default: + panic(badSide) + } + if m < 0 { + panic(mLT0) + } + if n < 0 { + panic(nLT0) + } var k int - if s == blas.Left { + if s == C.CblasLeft { k = m } else { k = n } - if lda*(k-1)+k > len(a) || lda < max(1, k) { - panic("blas: index of a out of range") + if lda < max(1, k) { + panic(badLdA) } - if ldb*(m-1)+n > len(b) || ldb < max(1, n) { - panic("blas: index of b out of range") + if ldb < max(1, n) { + panic(badLdB) + } + if ldc < max(1, n) { + panic(badLdC) } - C.cblas_ztrsm(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_SIDE(s), C.enum_CBLAS_UPLO(ul), C.enum_CBLAS_TRANSPOSE(tA), C.enum_CBLAS_DIAG(d), C.int(m), C.int(n), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_b), C.int(ldb)) -} - -func (Implementation) Chemm(s blas.Side, ul blas.Uplo, m, n int, alpha complex64, a []complex64, lda int, b []complex64, ldb int, beta complex64, c []complex64, ldc int) { - // declared at cblas.h:564:6 void cblas_chemm ... - if s != blas.Left && s != blas.Right { - panic("blas: illegal side") + // Quick return if possible. + if m == 0 || n == 0 { + return } - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(k-1)+k { + panic(shortA) } - if m < 0 { - panic("blas: m < 0") + if len(b) < ldb*(m-1)+n { + panic(shortB) } - if n < 0 { - panic("blas: n < 0") + if len(c) < ldc*(m-1)+n { + panic(shortC) } var _a *complex64 if len(a) > 0 { @@ -5287,38 +7909,70 @@ func (Implementation) Chemm(s blas.Side, ul blas.Uplo, m, n int, alpha complex64 if len(c) > 0 { _c = &c[0] } - var k int - if s == blas.Left { - k = m - } else { - k = n - } - if lda*(k-1)+k > len(a) || lda < max(1, k) { - panic("blas: index of a out of range") - } - if ldb*(m-1)+n > len(b) || ldb < max(1, n) { - panic("blas: index of b out of range") - } - if ldc*(m-1)+n > len(c) || ldc < max(1, n) { - panic("blas: index of c out of range") - } - C.cblas_chemm(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_SIDE(s), C.enum_CBLAS_UPLO(ul), C.int(m), C.int(n), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_b), C.int(ldb), unsafe.Pointer(&beta), unsafe.Pointer(_c), C.int(ldc)) + C.cblas_chemm(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_SIDE(s), C.CBLAS_UPLO(ul), C.int(m), C.int(n), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_b), C.int(ldb), unsafe.Pointer(&beta), unsafe.Pointer(_c), C.int(ldc)) } +// Cherk performs one of the hermitian rank-k operations +// +// C = alpha*A*Aᴴ + beta*C if trans == blas.NoTrans +// C = alpha*Aᴴ*A + beta*C if trans == blas.ConjTrans +// +// where alpha and beta are real scalars, C is an n×n hermitian matrix and A is +// an n×k matrix in the first case and a k×n matrix in the second case. +// +// The imaginary parts of the diagonal elements of C are assumed to be zero, and +// on return they will be set to zero. +// +// Complex64 implementations are autogenerated and not directly tested. func (Implementation) Cherk(ul blas.Uplo, t blas.Transpose, n, k int, alpha float32, a []complex64, lda int, beta float32, c []complex64, ldc int) { - // declared at cblas.h:569:6 void cblas_cherk ... + // declared at cblas.h:565:6 void cblas_cherk ... - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + switch t { + case blas.NoTrans: + t = C.CblasNoTrans + case blas.ConjTrans: + t = C.CblasConjTrans + default: + panic(badTranspose) } - if t != blas.NoTrans && t != blas.ConjTrans { - panic("blas: illegal transpose") + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) } if n < 0 { - panic("blas: n < 0") + panic(nLT0) } if k < 0 { - panic("blas: k < 0") + panic(kLT0) + } + var row, col int + if t == C.CblasNoTrans { + row, col = n, k + } else { + row, col = k, n + } + if lda < max(1, col) { + panic(badLdA) + } + if ldc < max(1, n) { + panic(badLdC) + } + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(row-1)+col { + panic(shortA) + } + if len(c) < ldc*(n-1)+n { + panic(shortC) } var _a *complex64 if len(a) > 0 { @@ -5328,35 +7982,76 @@ func (Implementation) Cherk(ul blas.Uplo, t blas.Transpose, n, k int, alpha floa if len(c) > 0 { _c = &c[0] } + C.cblas_cherk(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(t), C.int(n), C.int(k), C.float(alpha), unsafe.Pointer(_a), C.int(lda), C.float(beta), unsafe.Pointer(_c), C.int(ldc)) +} + +// Cher2k performs one of the hermitian rank-2k operations +// +// C = alpha*A*Bᴴ + conj(alpha)*B*Aᴴ + beta*C if trans == blas.NoTrans +// C = alpha*Aᴴ*B + conj(alpha)*Bᴴ*A + beta*C if trans == blas.ConjTrans +// +// where alpha and beta are scalars with beta real, C is an n×n hermitian matrix +// and A and B are n×k matrices in the first case and k×n matrices in the second case. +// +// The imaginary parts of the diagonal elements of C are assumed to be zero, and +// on return they will be set to zero. +// +// Complex64 implementations are autogenerated and not directly tested. +func (Implementation) Cher2k(ul blas.Uplo, t blas.Transpose, n, k int, alpha complex64, a []complex64, lda int, b []complex64, ldb int, beta float32, c []complex64, ldc int) { + // declared at cblas.h:569:6 void cblas_cher2k ... + + switch t { + case blas.NoTrans: + t = C.CblasNoTrans + case blas.ConjTrans: + t = C.CblasConjTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + if n < 0 { + panic(nLT0) + } + if k < 0 { + panic(kLT0) + } var row, col int - if t == blas.NoTrans { + if t == C.CblasNoTrans { row, col = n, k } else { row, col = k, n } - if lda*(row-1)+col > len(a) || lda < max(1, col) { - panic("blas: index of a out of range") + if lda < max(1, col) { + panic(badLdA) } - if ldc*(n-1)+n > len(c) || ldc < max(1, n) { - panic("blas: index of c out of range") + if ldb < max(1, col) { + panic(badLdB) + } + if ldc < max(1, n) { + panic(badLdC) } - C.cblas_cherk(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.enum_CBLAS_TRANSPOSE(t), C.int(n), C.int(k), C.float(alpha), unsafe.Pointer(_a), C.int(lda), C.float(beta), unsafe.Pointer(_c), C.int(ldc)) -} - -func (Implementation) Cher2k(ul blas.Uplo, t blas.Transpose, n, k int, alpha complex64, a []complex64, lda int, b []complex64, ldb int, beta float32, c []complex64, ldc int) { - // declared at cblas.h:573:6 void cblas_cher2k ... - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + // Quick return if possible. + if n == 0 { + return } - if t != blas.NoTrans && t != blas.ConjTrans { - panic("blas: illegal transpose") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(row-1)+col { + panic(shortA) } - if n < 0 { - panic("blas: n < 0") + if len(b) < ldb*(row-1)+col { + panic(shortB) } - if k < 0 { - panic("blas: k < 0") + if len(c) < ldc*(n-1)+n { + panic(shortC) } var _a *complex64 if len(a) > 0 { @@ -5370,38 +8065,72 @@ func (Implementation) Cher2k(ul blas.Uplo, t blas.Transpose, n, k int, alpha com if len(c) > 0 { _c = &c[0] } - var row, col int - if t == blas.NoTrans { - row, col = n, k + C.cblas_cher2k(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(t), C.int(n), C.int(k), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_b), C.int(ldb), C.float(beta), unsafe.Pointer(_c), C.int(ldc)) +} + +// Zhemm performs one of the matrix-matrix operations +// +// C = alpha*A*B + beta*C if side == blas.Left +// C = alpha*B*A + beta*C if side == blas.Right +// +// where alpha and beta are scalars, A is an m×m or n×n hermitian matrix and B +// and C are m×n matrices. The imaginary parts of the diagonal elements of A are +// assumed to be zero. +func (Implementation) Zhemm(s blas.Side, ul blas.Uplo, m, n int, alpha complex128, a []complex128, lda int, b []complex128, ldb int, beta complex128, c []complex128, ldc int) { + // declared at cblas.h:575:6 void cblas_zhemm ... + + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + switch s { + case blas.Left: + s = C.CblasLeft + case blas.Right: + s = C.CblasRight + default: + panic(badSide) + } + if m < 0 { + panic(mLT0) + } + if n < 0 { + panic(nLT0) + } + var k int + if s == C.CblasLeft { + k = m } else { - row, col = k, n + k = n } - if lda*(row-1)+col > len(a) || lda < max(1, col) { - panic("blas: index of a out of range") + if lda < max(1, k) { + panic(badLdA) } - if ldb*(row-1)+col > len(b) || ldb < max(1, col) { - panic("blas: index of b out of range") + if ldb < max(1, n) { + panic(badLdB) } - if ldc*(n-1)+n > len(c) || ldc < max(1, n) { - panic("blas: index of c out of range") + if ldc < max(1, n) { + panic(badLdC) } - C.cblas_cher2k(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.enum_CBLAS_TRANSPOSE(t), C.int(n), C.int(k), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_b), C.int(ldb), C.float(beta), unsafe.Pointer(_c), C.int(ldc)) -} - -func (Implementation) Zhemm(s blas.Side, ul blas.Uplo, m, n int, alpha complex128, a []complex128, lda int, b []complex128, ldb int, beta complex128, c []complex128, ldc int) { - // declared at cblas.h:578:6 void cblas_zhemm ... - if s != blas.Left && s != blas.Right { - panic("blas: illegal side") + // Quick return if possible. + if m == 0 || n == 0 { + return } - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(k-1)+k { + panic(shortA) } - if m < 0 { - panic("blas: m < 0") + if len(b) < ldb*(m-1)+n { + panic(shortB) } - if n < 0 { - panic("blas: n < 0") + if len(c) < ldc*(m-1)+n { + panic(shortC) } var _a *complex128 if len(a) > 0 { @@ -5415,38 +8144,68 @@ func (Implementation) Zhemm(s blas.Side, ul blas.Uplo, m, n int, alpha complex12 if len(c) > 0 { _c = &c[0] } - var k int - if s == blas.Left { - k = m - } else { - k = n - } - if lda*(k-1)+k > len(a) || lda < max(1, k) { - panic("blas: index of a out of range") - } - if ldb*(m-1)+n > len(b) || ldb < max(1, n) { - panic("blas: index of b out of range") - } - if ldc*(m-1)+n > len(c) || ldc < max(1, n) { - panic("blas: index of c out of range") - } - C.cblas_zhemm(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_SIDE(s), C.enum_CBLAS_UPLO(ul), C.int(m), C.int(n), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_b), C.int(ldb), unsafe.Pointer(&beta), unsafe.Pointer(_c), C.int(ldc)) + C.cblas_zhemm(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_SIDE(s), C.CBLAS_UPLO(ul), C.int(m), C.int(n), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_b), C.int(ldb), unsafe.Pointer(&beta), unsafe.Pointer(_c), C.int(ldc)) } +// Zherk performs one of the hermitian rank-k operations +// +// C = alpha*A*Aᴴ + beta*C if trans == blas.NoTrans +// C = alpha*Aᴴ*A + beta*C if trans == blas.ConjTrans +// +// where alpha and beta are real scalars, C is an n×n hermitian matrix and A is +// an n×k matrix in the first case and a k×n matrix in the second case. +// +// The imaginary parts of the diagonal elements of C are assumed to be zero, and +// on return they will be set to zero. func (Implementation) Zherk(ul blas.Uplo, t blas.Transpose, n, k int, alpha float64, a []complex128, lda int, beta float64, c []complex128, ldc int) { - // declared at cblas.h:583:6 void cblas_zherk ... + // declared at cblas.h:580:6 void cblas_zherk ... - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + switch t { + case blas.NoTrans: + t = C.CblasNoTrans + case blas.ConjTrans: + t = C.CblasConjTrans + default: + panic(badTranspose) } - if t != blas.NoTrans && t != blas.ConjTrans { - panic("blas: illegal transpose") + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) } if n < 0 { - panic("blas: n < 0") + panic(nLT0) } if k < 0 { - panic("blas: k < 0") + panic(kLT0) + } + var row, col int + if t == C.CblasNoTrans { + row, col = n, k + } else { + row, col = k, n + } + if lda < max(1, col) { + panic(badLdA) + } + if ldc < max(1, n) { + panic(badLdC) + } + + // Quick return if possible. + if n == 0 { + return + } + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(row-1)+col { + panic(shortA) + } + if len(c) < ldc*(n-1)+n { + panic(shortC) } var _a *complex128 if len(a) > 0 { @@ -5456,35 +8215,74 @@ func (Implementation) Zherk(ul blas.Uplo, t blas.Transpose, n, k int, alpha floa if len(c) > 0 { _c = &c[0] } + C.cblas_zherk(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(t), C.int(n), C.int(k), C.double(alpha), unsafe.Pointer(_a), C.int(lda), C.double(beta), unsafe.Pointer(_c), C.int(ldc)) +} + +// Zher2k performs one of the hermitian rank-2k operations +// +// C = alpha*A*Bᴴ + conj(alpha)*B*Aᴴ + beta*C if trans == blas.NoTrans +// C = alpha*Aᴴ*B + conj(alpha)*Bᴴ*A + beta*C if trans == blas.ConjTrans +// +// where alpha and beta are scalars with beta real, C is an n×n hermitian matrix +// and A and B are n×k matrices in the first case and k×n matrices in the second case. +// +// The imaginary parts of the diagonal elements of C are assumed to be zero, and +// on return they will be set to zero. +func (Implementation) Zher2k(ul blas.Uplo, t blas.Transpose, n, k int, alpha complex128, a []complex128, lda int, b []complex128, ldb int, beta float64, c []complex128, ldc int) { + // declared at cblas.h:584:6 void cblas_zher2k ... + + switch t { + case blas.NoTrans: + t = C.CblasNoTrans + case blas.ConjTrans: + t = C.CblasConjTrans + default: + panic(badTranspose) + } + switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) + } + if n < 0 { + panic(nLT0) + } + if k < 0 { + panic(kLT0) + } var row, col int - if t == blas.NoTrans { + if t == C.CblasNoTrans { row, col = n, k } else { row, col = k, n } - if lda*(row-1)+col > len(a) || lda < max(1, col) { - panic("blas: index of a out of range") + if lda < max(1, col) { + panic(badLdA) } - if ldc*(n-1)+n > len(c) || ldc < max(1, n) { - panic("blas: index of c out of range") + if ldb < max(1, col) { + panic(badLdB) + } + if ldc < max(1, n) { + panic(badLdC) } - C.cblas_zherk(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.enum_CBLAS_TRANSPOSE(t), C.int(n), C.int(k), C.double(alpha), unsafe.Pointer(_a), C.int(lda), C.double(beta), unsafe.Pointer(_c), C.int(ldc)) -} - -func (Implementation) Zher2k(ul blas.Uplo, t blas.Transpose, n, k int, alpha complex128, a []complex128, lda int, b []complex128, ldb int, beta float64, c []complex128, ldc int) { - // declared at cblas.h:587:6 void cblas_zher2k ... - if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + // Quick return if possible. + if n == 0 { + return } - if t != blas.NoTrans && t != blas.ConjTrans { - panic("blas: illegal transpose") + + // For zero matrix size the following slice length checks are trivially satisfied. + if len(a) < lda*(row-1)+col { + panic(shortA) } - if n < 0 { - panic("blas: n < 0") + if len(b) < ldb*(row-1)+col { + panic(shortB) } - if k < 0 { - panic("blas: k < 0") + if len(c) < ldc*(n-1)+n { + panic(shortC) } var _a *complex128 if len(a) > 0 { @@ -5498,20 +8296,5 @@ func (Implementation) Zher2k(ul blas.Uplo, t blas.Transpose, n, k int, alpha com if len(c) > 0 { _c = &c[0] } - var row, col int - if t == blas.NoTrans { - row, col = n, k - } else { - row, col = k, n - } - if lda*(row-1)+col > len(a) || lda < max(1, col) { - panic("blas: index of a out of range") - } - if ldb*(row-1)+col > len(b) || ldb < max(1, col) { - panic("blas: index of b out of range") - } - if ldc*(n-1)+n > len(c) || ldc < max(1, n) { - panic("blas: index of c out of range") - } - C.cblas_zher2k(C.enum_CBLAS_ORDER(rowMajor), C.enum_CBLAS_UPLO(ul), C.enum_CBLAS_TRANSPOSE(t), C.int(n), C.int(k), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_b), C.int(ldb), C.double(beta), unsafe.Pointer(_c), C.int(ldc)) + C.cblas_zher2k(C.CBLAS_LAYOUT(rowMajor), C.CBLAS_UPLO(ul), C.CBLAS_TRANSPOSE(t), C.int(n), C.int(k), unsafe.Pointer(&alpha), unsafe.Pointer(_a), C.int(lda), unsafe.Pointer(_b), C.int(ldb), C.double(beta), unsafe.Pointer(_c), C.int(ldc)) } diff --git a/blas/netlib/cblas.h b/blas/netlib/cblas.h index b8ac9a5f..f768792f 100644 --- a/blas/netlib/cblas.h +++ b/blas/netlib/cblas.h @@ -1,71 +1,93 @@ #ifndef CBLAS_H +#define CBLAS_H +#include + + +#ifdef __cplusplus +extern "C" { /* Assume C declarations for C++ */ +#endif /* __cplusplus */ -#ifndef CBLAS_ENUM_DEFINED_H - #define CBLAS_ENUM_DEFINED_H - enum CBLAS_ORDER {CblasRowMajor=101, CblasColMajor=102 }; - enum CBLAS_TRANSPOSE {CblasNoTrans=111, CblasTrans=112, CblasConjTrans=113, - AtlasConj=114}; - enum CBLAS_UPLO {CblasUpper=121, CblasLower=122}; - enum CBLAS_DIAG {CblasNonUnit=131, CblasUnit=132}; - enum CBLAS_SIDE {CblasLeft=141, CblasRight=142}; +/* + * Enumerated and derived types + */ +#define CBLAS_INDEX size_t /* this may vary between platforms */ + +/* + * Integer type + */ +#ifdef WeirdNEC + #define CBLAS_INT long +#else + #define CBLAS_INT int #endif -#ifndef CBLAS_ENUM_ONLY -#define CBLAS_H -#define CBLAS_INDEX int +typedef enum CBLAS_LAYOUT {CblasRowMajor=101, CblasColMajor=102} CBLAS_LAYOUT; +typedef enum CBLAS_TRANSPOSE {CblasNoTrans=111, CblasTrans=112, CblasConjTrans=113} CBLAS_TRANSPOSE; +typedef enum CBLAS_UPLO {CblasUpper=121, CblasLower=122} CBLAS_UPLO; +typedef enum CBLAS_DIAG {CblasNonUnit=131, CblasUnit=132} CBLAS_DIAG; +typedef enum CBLAS_SIDE {CblasLeft=141, CblasRight=142} CBLAS_SIDE; -int cblas_errprn(int ierr, int info, char *form, ...); +#define CBLAS_ORDER CBLAS_LAYOUT /* this for backward compatibility with CBLAS_ORDER */ + +/* NOTE(vladimir-ch): Commented out to avoid the need to have cblas_mangling.h. +We don't need the defines because we don't call into Fortran directly. */ +/* #include "cblas_mangling.h" */ /* * =========================================================================== * Prototypes for level 1 BLAS functions (complex are recast as routines) * =========================================================================== */ -float cblas_sdsdot(const int N, const float alpha, const float *X, - const int incX, const float *Y, const int incY); -double cblas_dsdot(const int N, const float *X, const int incX, const float *Y, - const int incY); -float cblas_sdot(const int N, const float *X, const int incX, - const float *Y, const int incY); -double cblas_ddot(const int N, const double *X, const int incX, - const double *Y, const int incY); + +double cblas_dcabs1(const void *z); +float cblas_scabs1(const void *c); + +float cblas_sdsdot(const CBLAS_INT N, const float alpha, const float *X, + const CBLAS_INT incX, const float *Y, const CBLAS_INT incY); +double cblas_dsdot(const CBLAS_INT N, const float *X, const CBLAS_INT incX, const float *Y, + const CBLAS_INT incY); +float cblas_sdot(const CBLAS_INT N, const float *X, const CBLAS_INT incX, + const float *Y, const CBLAS_INT incY); +double cblas_ddot(const CBLAS_INT N, const double *X, const CBLAS_INT incX, + const double *Y, const CBLAS_INT incY); + /* * Functions having prefixes Z and C only */ -void cblas_cdotu_sub(const int N, const void *X, const int incX, - const void *Y, const int incY, void *dotu); -void cblas_cdotc_sub(const int N, const void *X, const int incX, - const void *Y, const int incY, void *dotc); +void cblas_cdotu_sub(const CBLAS_INT N, const void *X, const CBLAS_INT incX, + const void *Y, const CBLAS_INT incY, void *dotu); +void cblas_cdotc_sub(const CBLAS_INT N, const void *X, const CBLAS_INT incX, + const void *Y, const CBLAS_INT incY, void *dotc); -void cblas_zdotu_sub(const int N, const void *X, const int incX, - const void *Y, const int incY, void *dotu); -void cblas_zdotc_sub(const int N, const void *X, const int incX, - const void *Y, const int incY, void *dotc); +void cblas_zdotu_sub(const CBLAS_INT N, const void *X, const CBLAS_INT incX, + const void *Y, const CBLAS_INT incY, void *dotu); +void cblas_zdotc_sub(const CBLAS_INT N, const void *X, const CBLAS_INT incX, + const void *Y, const CBLAS_INT incY, void *dotc); /* * Functions having prefixes S D SC DZ */ -float cblas_snrm2(const int N, const float *X, const int incX); -float cblas_sasum(const int N, const float *X, const int incX); +float cblas_snrm2(const CBLAS_INT N, const float *X, const CBLAS_INT incX); +float cblas_sasum(const CBLAS_INT N, const float *X, const CBLAS_INT incX); -double cblas_dnrm2(const int N, const double *X, const int incX); -double cblas_dasum(const int N, const double *X, const int incX); +double cblas_dnrm2(const CBLAS_INT N, const double *X, const CBLAS_INT incX); +double cblas_dasum(const CBLAS_INT N, const double *X, const CBLAS_INT incX); -float cblas_scnrm2(const int N, const void *X, const int incX); -float cblas_scasum(const int N, const void *X, const int incX); +float cblas_scnrm2(const CBLAS_INT N, const void *X, const CBLAS_INT incX); +float cblas_scasum(const CBLAS_INT N, const void *X, const CBLAS_INT incX); -double cblas_dznrm2(const int N, const void *X, const int incX); -double cblas_dzasum(const int N, const void *X, const int incX); +double cblas_dznrm2(const CBLAS_INT N, const void *X, const CBLAS_INT incX); +double cblas_dzasum(const CBLAS_INT N, const void *X, const CBLAS_INT incX); /* * Functions having standard 4 prefixes (S D C Z) */ -CBLAS_INDEX cblas_isamax(const int N, const float *X, const int incX); -CBLAS_INDEX cblas_idamax(const int N, const double *X, const int incX); -CBLAS_INDEX cblas_icamax(const int N, const void *X, const int incX); -CBLAS_INDEX cblas_izamax(const int N, const void *X, const int incX); +CBLAS_INDEX cblas_isamax(const CBLAS_INT N, const float *X, const CBLAS_INT incX); +CBLAS_INDEX cblas_idamax(const CBLAS_INT N, const double *X, const CBLAS_INT incX); +CBLAS_INDEX cblas_icamax(const CBLAS_INT N, const void *X, const CBLAS_INT incX); +CBLAS_INDEX cblas_izamax(const CBLAS_INT N, const void *X, const CBLAS_INT incX); /* * =========================================================================== @@ -76,49 +98,33 @@ CBLAS_INDEX cblas_izamax(const int N, const void *X, const int incX); /* * Routines with standard 4 prefixes (s, d, c, z) */ -void cblas_sswap(const int N, float *X, const int incX, - float *Y, const int incY); -void cblas_scopy(const int N, const float *X, const int incX, - float *Y, const int incY); -void cblas_saxpy(const int N, const float alpha, const float *X, - const int incX, float *Y, const int incY); -void catlas_saxpby(const int N, const float alpha, const float *X, - const int incX, const float beta, float *Y, const int incY); -void catlas_sset - (const int N, const float alpha, float *X, const int incX); - -void cblas_dswap(const int N, double *X, const int incX, - double *Y, const int incY); -void cblas_dcopy(const int N, const double *X, const int incX, - double *Y, const int incY); -void cblas_daxpy(const int N, const double alpha, const double *X, - const int incX, double *Y, const int incY); -void catlas_daxpby(const int N, const double alpha, const double *X, - const int incX, const double beta, double *Y, const int incY); -void catlas_dset - (const int N, const double alpha, double *X, const int incX); - -void cblas_cswap(const int N, void *X, const int incX, - void *Y, const int incY); -void cblas_ccopy(const int N, const void *X, const int incX, - void *Y, const int incY); -void cblas_caxpy(const int N, const void *alpha, const void *X, - const int incX, void *Y, const int incY); -void catlas_caxpby(const int N, const void *alpha, const void *X, - const int incX, const void *beta, void *Y, const int incY); -void catlas_cset - (const int N, const void *alpha, void *X, const int incX); - -void cblas_zswap(const int N, void *X, const int incX, - void *Y, const int incY); -void cblas_zcopy(const int N, const void *X, const int incX, - void *Y, const int incY); -void cblas_zaxpy(const int N, const void *alpha, const void *X, - const int incX, void *Y, const int incY); -void catlas_zaxpby(const int N, const void *alpha, const void *X, - const int incX, const void *beta, void *Y, const int incY); -void catlas_zset - (const int N, const void *alpha, void *X, const int incX); +void cblas_sswap(const CBLAS_INT N, float *X, const CBLAS_INT incX, + float *Y, const CBLAS_INT incY); +void cblas_scopy(const CBLAS_INT N, const float *X, const CBLAS_INT incX, + float *Y, const CBLAS_INT incY); +void cblas_saxpy(const CBLAS_INT N, const float alpha, const float *X, + const CBLAS_INT incX, float *Y, const CBLAS_INT incY); + +void cblas_dswap(const CBLAS_INT N, double *X, const CBLAS_INT incX, + double *Y, const CBLAS_INT incY); +void cblas_dcopy(const CBLAS_INT N, const double *X, const CBLAS_INT incX, + double *Y, const CBLAS_INT incY); +void cblas_daxpy(const CBLAS_INT N, const double alpha, const double *X, + const CBLAS_INT incX, double *Y, const CBLAS_INT incY); + +void cblas_cswap(const CBLAS_INT N, void *X, const CBLAS_INT incX, + void *Y, const CBLAS_INT incY); +void cblas_ccopy(const CBLAS_INT N, const void *X, const CBLAS_INT incX, + void *Y, const CBLAS_INT incY); +void cblas_caxpy(const CBLAS_INT N, const void *alpha, const void *X, + const CBLAS_INT incX, void *Y, const CBLAS_INT incY); + +void cblas_zswap(const CBLAS_INT N, void *X, const CBLAS_INT incX, + void *Y, const CBLAS_INT incY); +void cblas_zcopy(const CBLAS_INT N, const void *X, const CBLAS_INT incX, + void *Y, const CBLAS_INT incY); +void cblas_zaxpy(const CBLAS_INT N, const void *alpha, const void *X, + const CBLAS_INT incX, void *Y, const CBLAS_INT incY); /* @@ -126,38 +132,28 @@ void catlas_zset */ void cblas_srotg(float *a, float *b, float *c, float *s); void cblas_srotmg(float *d1, float *d2, float *b1, const float b2, float *P); -void cblas_srot(const int N, float *X, const int incX, - float *Y, const int incY, const float c, const float s); -void cblas_srotm(const int N, float *X, const int incX, - float *Y, const int incY, const float *P); +void cblas_srot(const CBLAS_INT N, float *X, const CBLAS_INT incX, + float *Y, const CBLAS_INT incY, const float c, const float s); +void cblas_srotm(const CBLAS_INT N, float *X, const CBLAS_INT incX, + float *Y, const CBLAS_INT incY, const float *P); void cblas_drotg(double *a, double *b, double *c, double *s); void cblas_drotmg(double *d1, double *d2, double *b1, const double b2, double *P); -void cblas_drot(const int N, double *X, const int incX, - double *Y, const int incY, const double c, const double s); -void cblas_drotm(const int N, double *X, const int incX, - double *Y, const int incY, const double *P); +void cblas_drot(const CBLAS_INT N, double *X, const CBLAS_INT incX, + double *Y, const CBLAS_INT incY, const double c, const double s); +void cblas_drotm(const CBLAS_INT N, double *X, const CBLAS_INT incX, + double *Y, const CBLAS_INT incY, const double *P); /* * Routines with S D C Z CS and ZD prefixes */ -void cblas_sscal(const int N, const float alpha, float *X, const int incX); -void cblas_dscal(const int N, const double alpha, double *X, const int incX); -void cblas_cscal(const int N, const void *alpha, void *X, const int incX); -void cblas_zscal(const int N, const void *alpha, void *X, const int incX); -void cblas_csscal(const int N, const float alpha, void *X, const int incX); -void cblas_zdscal(const int N, const double alpha, void *X, const int incX); - -/* - * Extra reference routines provided by ATLAS, but not mandated by the standard - */ -void cblas_crotg(void *a, void *b, void *c, void *s); -void cblas_zrotg(void *a, void *b, void *c, void *s); -void cblas_csrot(const int N, void *X, const int incX, void *Y, const int incY, - const float c, const float s); -void cblas_zdrot(const int N, void *X, const int incX, void *Y, const int incY, - const double c, const double s); +void cblas_sscal(const CBLAS_INT N, const float alpha, float *X, const CBLAS_INT incX); +void cblas_dscal(const CBLAS_INT N, const double alpha, double *X, const CBLAS_INT incX); +void cblas_cscal(const CBLAS_INT N, const void *alpha, void *X, const CBLAS_INT incX); +void cblas_zscal(const CBLAS_INT N, const void *alpha, void *X, const CBLAS_INT incX); +void cblas_csscal(const CBLAS_INT N, const float alpha, void *X, const CBLAS_INT incX); +void cblas_zdscal(const CBLAS_INT N, const double alpha, void *X, const CBLAS_INT incX); /* * =========================================================================== @@ -168,265 +164,265 @@ void cblas_zdrot(const int N, void *X, const int incX, void *Y, const int incY, /* * Routines with standard 4 prefixes (S, D, C, Z) */ -void cblas_sgemv(const enum CBLAS_ORDER Order, - const enum CBLAS_TRANSPOSE TransA, const int M, const int N, - const float alpha, const float *A, const int lda, - const float *X, const int incX, const float beta, - float *Y, const int incY); -void cblas_sgbmv(const enum CBLAS_ORDER Order, - const enum CBLAS_TRANSPOSE TransA, const int M, const int N, - const int KL, const int KU, const float alpha, - const float *A, const int lda, const float *X, - const int incX, const float beta, float *Y, const int incY); -void cblas_strmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, - const int N, const float *A, const int lda, - float *X, const int incX); -void cblas_stbmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, - const int N, const int K, const float *A, const int lda, - float *X, const int incX); -void cblas_stpmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, - const int N, const float *Ap, float *X, const int incX); -void cblas_strsv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, - const int N, const float *A, const int lda, float *X, - const int incX); -void cblas_stbsv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, - const int N, const int K, const float *A, const int lda, - float *X, const int incX); -void cblas_stpsv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, - const int N, const float *Ap, float *X, const int incX); - -void cblas_dgemv(const enum CBLAS_ORDER Order, - const enum CBLAS_TRANSPOSE TransA, const int M, const int N, - const double alpha, const double *A, const int lda, - const double *X, const int incX, const double beta, - double *Y, const int incY); -void cblas_dgbmv(const enum CBLAS_ORDER Order, - const enum CBLAS_TRANSPOSE TransA, const int M, const int N, - const int KL, const int KU, const double alpha, - const double *A, const int lda, const double *X, - const int incX, const double beta, double *Y, const int incY); -void cblas_dtrmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, - const int N, const double *A, const int lda, - double *X, const int incX); -void cblas_dtbmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, - const int N, const int K, const double *A, const int lda, - double *X, const int incX); -void cblas_dtpmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, - const int N, const double *Ap, double *X, const int incX); -void cblas_dtrsv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, - const int N, const double *A, const int lda, double *X, - const int incX); -void cblas_dtbsv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, - const int N, const int K, const double *A, const int lda, - double *X, const int incX); -void cblas_dtpsv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, - const int N, const double *Ap, double *X, const int incX); - -void cblas_cgemv(const enum CBLAS_ORDER Order, - const enum CBLAS_TRANSPOSE TransA, const int M, const int N, - const void *alpha, const void *A, const int lda, - const void *X, const int incX, const void *beta, - void *Y, const int incY); -void cblas_cgbmv(const enum CBLAS_ORDER Order, - const enum CBLAS_TRANSPOSE TransA, const int M, const int N, - const int KL, const int KU, const void *alpha, - const void *A, const int lda, const void *X, - const int incX, const void *beta, void *Y, const int incY); -void cblas_ctrmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, - const int N, const void *A, const int lda, - void *X, const int incX); -void cblas_ctbmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, - const int N, const int K, const void *A, const int lda, - void *X, const int incX); -void cblas_ctpmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, - const int N, const void *Ap, void *X, const int incX); -void cblas_ctrsv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, - const int N, const void *A, const int lda, void *X, - const int incX); -void cblas_ctbsv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, - const int N, const int K, const void *A, const int lda, - void *X, const int incX); -void cblas_ctpsv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, - const int N, const void *Ap, void *X, const int incX); - -void cblas_zgemv(const enum CBLAS_ORDER Order, - const enum CBLAS_TRANSPOSE TransA, const int M, const int N, - const void *alpha, const void *A, const int lda, - const void *X, const int incX, const void *beta, - void *Y, const int incY); -void cblas_zgbmv(const enum CBLAS_ORDER Order, - const enum CBLAS_TRANSPOSE TransA, const int M, const int N, - const int KL, const int KU, const void *alpha, - const void *A, const int lda, const void *X, - const int incX, const void *beta, void *Y, const int incY); -void cblas_ztrmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, - const int N, const void *A, const int lda, - void *X, const int incX); -void cblas_ztbmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, - const int N, const int K, const void *A, const int lda, - void *X, const int incX); -void cblas_ztpmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, - const int N, const void *Ap, void *X, const int incX); -void cblas_ztrsv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, - const int N, const void *A, const int lda, void *X, - const int incX); -void cblas_ztbsv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, - const int N, const int K, const void *A, const int lda, - void *X, const int incX); -void cblas_ztpsv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, - const int N, const void *Ap, void *X, const int incX); +void cblas_sgemv(const CBLAS_LAYOUT layout, + const CBLAS_TRANSPOSE TransA, const CBLAS_INT M, const CBLAS_INT N, + const float alpha, const float *A, const CBLAS_INT lda, + const float *X, const CBLAS_INT incX, const float beta, + float *Y, const CBLAS_INT incY); +void cblas_sgbmv(CBLAS_LAYOUT layout, + CBLAS_TRANSPOSE TransA, const CBLAS_INT M, const CBLAS_INT N, + const CBLAS_INT KL, const CBLAS_INT KU, const float alpha, + const float *A, const CBLAS_INT lda, const float *X, + const CBLAS_INT incX, const float beta, float *Y, const CBLAS_INT incY); +void cblas_strmv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + CBLAS_TRANSPOSE TransA, CBLAS_DIAG Diag, + const CBLAS_INT N, const float *A, const CBLAS_INT lda, + float *X, const CBLAS_INT incX); +void cblas_stbmv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + CBLAS_TRANSPOSE TransA, CBLAS_DIAG Diag, + const CBLAS_INT N, const CBLAS_INT K, const float *A, const CBLAS_INT lda, + float *X, const CBLAS_INT incX); +void cblas_stpmv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + CBLAS_TRANSPOSE TransA, CBLAS_DIAG Diag, + const CBLAS_INT N, const float *Ap, float *X, const CBLAS_INT incX); +void cblas_strsv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + CBLAS_TRANSPOSE TransA, CBLAS_DIAG Diag, + const CBLAS_INT N, const float *A, const CBLAS_INT lda, float *X, + const CBLAS_INT incX); +void cblas_stbsv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + CBLAS_TRANSPOSE TransA, CBLAS_DIAG Diag, + const CBLAS_INT N, const CBLAS_INT K, const float *A, const CBLAS_INT lda, + float *X, const CBLAS_INT incX); +void cblas_stpsv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + CBLAS_TRANSPOSE TransA, CBLAS_DIAG Diag, + const CBLAS_INT N, const float *Ap, float *X, const CBLAS_INT incX); + +void cblas_dgemv(CBLAS_LAYOUT layout, + CBLAS_TRANSPOSE TransA, const CBLAS_INT M, const CBLAS_INT N, + const double alpha, const double *A, const CBLAS_INT lda, + const double *X, const CBLAS_INT incX, const double beta, + double *Y, const CBLAS_INT incY); +void cblas_dgbmv(CBLAS_LAYOUT layout, + CBLAS_TRANSPOSE TransA, const CBLAS_INT M, const CBLAS_INT N, + const CBLAS_INT KL, const CBLAS_INT KU, const double alpha, + const double *A, const CBLAS_INT lda, const double *X, + const CBLAS_INT incX, const double beta, double *Y, const CBLAS_INT incY); +void cblas_dtrmv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + CBLAS_TRANSPOSE TransA, CBLAS_DIAG Diag, + const CBLAS_INT N, const double *A, const CBLAS_INT lda, + double *X, const CBLAS_INT incX); +void cblas_dtbmv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + CBLAS_TRANSPOSE TransA, CBLAS_DIAG Diag, + const CBLAS_INT N, const CBLAS_INT K, const double *A, const CBLAS_INT lda, + double *X, const CBLAS_INT incX); +void cblas_dtpmv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + CBLAS_TRANSPOSE TransA, CBLAS_DIAG Diag, + const CBLAS_INT N, const double *Ap, double *X, const CBLAS_INT incX); +void cblas_dtrsv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + CBLAS_TRANSPOSE TransA, CBLAS_DIAG Diag, + const CBLAS_INT N, const double *A, const CBLAS_INT lda, double *X, + const CBLAS_INT incX); +void cblas_dtbsv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + CBLAS_TRANSPOSE TransA, CBLAS_DIAG Diag, + const CBLAS_INT N, const CBLAS_INT K, const double *A, const CBLAS_INT lda, + double *X, const CBLAS_INT incX); +void cblas_dtpsv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + CBLAS_TRANSPOSE TransA, CBLAS_DIAG Diag, + const CBLAS_INT N, const double *Ap, double *X, const CBLAS_INT incX); + +void cblas_cgemv(CBLAS_LAYOUT layout, + CBLAS_TRANSPOSE TransA, const CBLAS_INT M, const CBLAS_INT N, + const void *alpha, const void *A, const CBLAS_INT lda, + const void *X, const CBLAS_INT incX, const void *beta, + void *Y, const CBLAS_INT incY); +void cblas_cgbmv(CBLAS_LAYOUT layout, + CBLAS_TRANSPOSE TransA, const CBLAS_INT M, const CBLAS_INT N, + const CBLAS_INT KL, const CBLAS_INT KU, const void *alpha, + const void *A, const CBLAS_INT lda, const void *X, + const CBLAS_INT incX, const void *beta, void *Y, const CBLAS_INT incY); +void cblas_ctrmv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + CBLAS_TRANSPOSE TransA, CBLAS_DIAG Diag, + const CBLAS_INT N, const void *A, const CBLAS_INT lda, + void *X, const CBLAS_INT incX); +void cblas_ctbmv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + CBLAS_TRANSPOSE TransA, CBLAS_DIAG Diag, + const CBLAS_INT N, const CBLAS_INT K, const void *A, const CBLAS_INT lda, + void *X, const CBLAS_INT incX); +void cblas_ctpmv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + CBLAS_TRANSPOSE TransA, CBLAS_DIAG Diag, + const CBLAS_INT N, const void *Ap, void *X, const CBLAS_INT incX); +void cblas_ctrsv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + CBLAS_TRANSPOSE TransA, CBLAS_DIAG Diag, + const CBLAS_INT N, const void *A, const CBLAS_INT lda, void *X, + const CBLAS_INT incX); +void cblas_ctbsv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + CBLAS_TRANSPOSE TransA, CBLAS_DIAG Diag, + const CBLAS_INT N, const CBLAS_INT K, const void *A, const CBLAS_INT lda, + void *X, const CBLAS_INT incX); +void cblas_ctpsv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + CBLAS_TRANSPOSE TransA, CBLAS_DIAG Diag, + const CBLAS_INT N, const void *Ap, void *X, const CBLAS_INT incX); + +void cblas_zgemv(CBLAS_LAYOUT layout, + CBLAS_TRANSPOSE TransA, const CBLAS_INT M, const CBLAS_INT N, + const void *alpha, const void *A, const CBLAS_INT lda, + const void *X, const CBLAS_INT incX, const void *beta, + void *Y, const CBLAS_INT incY); +void cblas_zgbmv(CBLAS_LAYOUT layout, + CBLAS_TRANSPOSE TransA, const CBLAS_INT M, const CBLAS_INT N, + const CBLAS_INT KL, const CBLAS_INT KU, const void *alpha, + const void *A, const CBLAS_INT lda, const void *X, + const CBLAS_INT incX, const void *beta, void *Y, const CBLAS_INT incY); +void cblas_ztrmv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + CBLAS_TRANSPOSE TransA, CBLAS_DIAG Diag, + const CBLAS_INT N, const void *A, const CBLAS_INT lda, + void *X, const CBLAS_INT incX); +void cblas_ztbmv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + CBLAS_TRANSPOSE TransA, CBLAS_DIAG Diag, + const CBLAS_INT N, const CBLAS_INT K, const void *A, const CBLAS_INT lda, + void *X, const CBLAS_INT incX); +void cblas_ztpmv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + CBLAS_TRANSPOSE TransA, CBLAS_DIAG Diag, + const CBLAS_INT N, const void *Ap, void *X, const CBLAS_INT incX); +void cblas_ztrsv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + CBLAS_TRANSPOSE TransA, CBLAS_DIAG Diag, + const CBLAS_INT N, const void *A, const CBLAS_INT lda, void *X, + const CBLAS_INT incX); +void cblas_ztbsv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + CBLAS_TRANSPOSE TransA, CBLAS_DIAG Diag, + const CBLAS_INT N, const CBLAS_INT K, const void *A, const CBLAS_INT lda, + void *X, const CBLAS_INT incX); +void cblas_ztpsv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + CBLAS_TRANSPOSE TransA, CBLAS_DIAG Diag, + const CBLAS_INT N, const void *Ap, void *X, const CBLAS_INT incX); /* * Routines with S and D prefixes only */ -void cblas_ssymv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const int N, const float alpha, const float *A, - const int lda, const float *X, const int incX, - const float beta, float *Y, const int incY); -void cblas_ssbmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const int N, const int K, const float alpha, const float *A, - const int lda, const float *X, const int incX, - const float beta, float *Y, const int incY); -void cblas_sspmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const int N, const float alpha, const float *Ap, - const float *X, const int incX, - const float beta, float *Y, const int incY); -void cblas_sger(const enum CBLAS_ORDER Order, const int M, const int N, - const float alpha, const float *X, const int incX, - const float *Y, const int incY, float *A, const int lda); -void cblas_ssyr(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const int N, const float alpha, const float *X, - const int incX, float *A, const int lda); -void cblas_sspr(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const int N, const float alpha, const float *X, - const int incX, float *Ap); -void cblas_ssyr2(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const int N, const float alpha, const float *X, - const int incX, const float *Y, const int incY, float *A, - const int lda); -void cblas_sspr2(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const int N, const float alpha, const float *X, - const int incX, const float *Y, const int incY, float *Ap); - -void cblas_dsymv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const int N, const double alpha, const double *A, - const int lda, const double *X, const int incX, - const double beta, double *Y, const int incY); -void cblas_dsbmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const int N, const int K, const double alpha, const double *A, - const int lda, const double *X, const int incX, - const double beta, double *Y, const int incY); -void cblas_dspmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const int N, const double alpha, const double *Ap, - const double *X, const int incX, - const double beta, double *Y, const int incY); -void cblas_dger(const enum CBLAS_ORDER Order, const int M, const int N, - const double alpha, const double *X, const int incX, - const double *Y, const int incY, double *A, const int lda); -void cblas_dsyr(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const int N, const double alpha, const double *X, - const int incX, double *A, const int lda); -void cblas_dspr(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const int N, const double alpha, const double *X, - const int incX, double *Ap); -void cblas_dsyr2(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const int N, const double alpha, const double *X, - const int incX, const double *Y, const int incY, double *A, - const int lda); -void cblas_dspr2(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const int N, const double alpha, const double *X, - const int incX, const double *Y, const int incY, double *Ap); +void cblas_ssymv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + const CBLAS_INT N, const float alpha, const float *A, + const CBLAS_INT lda, const float *X, const CBLAS_INT incX, + const float beta, float *Y, const CBLAS_INT incY); +void cblas_ssbmv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + const CBLAS_INT N, const CBLAS_INT K, const float alpha, const float *A, + const CBLAS_INT lda, const float *X, const CBLAS_INT incX, + const float beta, float *Y, const CBLAS_INT incY); +void cblas_sspmv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + const CBLAS_INT N, const float alpha, const float *Ap, + const float *X, const CBLAS_INT incX, + const float beta, float *Y, const CBLAS_INT incY); +void cblas_sger(CBLAS_LAYOUT layout, const CBLAS_INT M, const CBLAS_INT N, + const float alpha, const float *X, const CBLAS_INT incX, + const float *Y, const CBLAS_INT incY, float *A, const CBLAS_INT lda); +void cblas_ssyr(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + const CBLAS_INT N, const float alpha, const float *X, + const CBLAS_INT incX, float *A, const CBLAS_INT lda); +void cblas_sspr(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + const CBLAS_INT N, const float alpha, const float *X, + const CBLAS_INT incX, float *Ap); +void cblas_ssyr2(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + const CBLAS_INT N, const float alpha, const float *X, + const CBLAS_INT incX, const float *Y, const CBLAS_INT incY, float *A, + const CBLAS_INT lda); +void cblas_sspr2(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + const CBLAS_INT N, const float alpha, const float *X, + const CBLAS_INT incX, const float *Y, const CBLAS_INT incY, float *A); + +void cblas_dsymv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + const CBLAS_INT N, const double alpha, const double *A, + const CBLAS_INT lda, const double *X, const CBLAS_INT incX, + const double beta, double *Y, const CBLAS_INT incY); +void cblas_dsbmv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + const CBLAS_INT N, const CBLAS_INT K, const double alpha, const double *A, + const CBLAS_INT lda, const double *X, const CBLAS_INT incX, + const double beta, double *Y, const CBLAS_INT incY); +void cblas_dspmv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + const CBLAS_INT N, const double alpha, const double *Ap, + const double *X, const CBLAS_INT incX, + const double beta, double *Y, const CBLAS_INT incY); +void cblas_dger(CBLAS_LAYOUT layout, const CBLAS_INT M, const CBLAS_INT N, + const double alpha, const double *X, const CBLAS_INT incX, + const double *Y, const CBLAS_INT incY, double *A, const CBLAS_INT lda); +void cblas_dsyr(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + const CBLAS_INT N, const double alpha, const double *X, + const CBLAS_INT incX, double *A, const CBLAS_INT lda); +void cblas_dspr(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + const CBLAS_INT N, const double alpha, const double *X, + const CBLAS_INT incX, double *Ap); +void cblas_dsyr2(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + const CBLAS_INT N, const double alpha, const double *X, + const CBLAS_INT incX, const double *Y, const CBLAS_INT incY, double *A, + const CBLAS_INT lda); +void cblas_dspr2(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + const CBLAS_INT N, const double alpha, const double *X, + const CBLAS_INT incX, const double *Y, const CBLAS_INT incY, double *A); /* * Routines with C and Z prefixes only */ -void cblas_chemv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const int N, const void *alpha, const void *A, - const int lda, const void *X, const int incX, - const void *beta, void *Y, const int incY); -void cblas_chbmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const int N, const int K, const void *alpha, const void *A, - const int lda, const void *X, const int incX, - const void *beta, void *Y, const int incY); -void cblas_chpmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const int N, const void *alpha, const void *Ap, - const void *X, const int incX, - const void *beta, void *Y, const int incY); -void cblas_cgeru(const enum CBLAS_ORDER Order, const int M, const int N, - const void *alpha, const void *X, const int incX, - const void *Y, const int incY, void *A, const int lda); -void cblas_cgerc(const enum CBLAS_ORDER Order, const int M, const int N, - const void *alpha, const void *X, const int incX, - const void *Y, const int incY, void *A, const int lda); -void cblas_cher(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const int N, const float alpha, const void *X, const int incX, - void *A, const int lda); -void cblas_chpr(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const int N, const float alpha, const void *X, - const int incX, void *Ap); -void cblas_cher2(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const int N, - const void *alpha, const void *X, const int incX, - const void *Y, const int incY, void *A, const int lda); -void cblas_chpr2(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const int N, - const void *alpha, const void *X, const int incX, - const void *Y, const int incY, void *Ap); - -void cblas_zhemv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const int N, const void *alpha, const void *A, - const int lda, const void *X, const int incX, - const void *beta, void *Y, const int incY); -void cblas_zhbmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const int N, const int K, const void *alpha, const void *A, - const int lda, const void *X, const int incX, - const void *beta, void *Y, const int incY); -void cblas_zhpmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const int N, const void *alpha, const void *Ap, - const void *X, const int incX, - const void *beta, void *Y, const int incY); -void cblas_zgeru(const enum CBLAS_ORDER Order, const int M, const int N, - const void *alpha, const void *X, const int incX, - const void *Y, const int incY, void *A, const int lda); -void cblas_zgerc(const enum CBLAS_ORDER Order, const int M, const int N, - const void *alpha, const void *X, const int incX, - const void *Y, const int incY, void *A, const int lda); -void cblas_zher(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const int N, const double alpha, const void *X, const int incX, - void *A, const int lda); -void cblas_zhpr(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const int N, const double alpha, const void *X, - const int incX, void *Ap); -void cblas_zher2(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const int N, - const void *alpha, const void *X, const int incX, - const void *Y, const int incY, void *A, const int lda); -void cblas_zhpr2(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const int N, - const void *alpha, const void *X, const int incX, - const void *Y, const int incY, void *Ap); +void cblas_chemv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + const CBLAS_INT N, const void *alpha, const void *A, + const CBLAS_INT lda, const void *X, const CBLAS_INT incX, + const void *beta, void *Y, const CBLAS_INT incY); +void cblas_chbmv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + const CBLAS_INT N, const CBLAS_INT K, const void *alpha, const void *A, + const CBLAS_INT lda, const void *X, const CBLAS_INT incX, + const void *beta, void *Y, const CBLAS_INT incY); +void cblas_chpmv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + const CBLAS_INT N, const void *alpha, const void *Ap, + const void *X, const CBLAS_INT incX, + const void *beta, void *Y, const CBLAS_INT incY); +void cblas_cgeru(CBLAS_LAYOUT layout, const CBLAS_INT M, const CBLAS_INT N, + const void *alpha, const void *X, const CBLAS_INT incX, + const void *Y, const CBLAS_INT incY, void *A, const CBLAS_INT lda); +void cblas_cgerc(CBLAS_LAYOUT layout, const CBLAS_INT M, const CBLAS_INT N, + const void *alpha, const void *X, const CBLAS_INT incX, + const void *Y, const CBLAS_INT incY, void *A, const CBLAS_INT lda); +void cblas_cher(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + const CBLAS_INT N, const float alpha, const void *X, const CBLAS_INT incX, + void *A, const CBLAS_INT lda); +void cblas_chpr(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + const CBLAS_INT N, const float alpha, const void *X, + const CBLAS_INT incX, void *A); +void cblas_cher2(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, const CBLAS_INT N, + const void *alpha, const void *X, const CBLAS_INT incX, + const void *Y, const CBLAS_INT incY, void *A, const CBLAS_INT lda); +void cblas_chpr2(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, const CBLAS_INT N, + const void *alpha, const void *X, const CBLAS_INT incX, + const void *Y, const CBLAS_INT incY, void *Ap); + +void cblas_zhemv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + const CBLAS_INT N, const void *alpha, const void *A, + const CBLAS_INT lda, const void *X, const CBLAS_INT incX, + const void *beta, void *Y, const CBLAS_INT incY); +void cblas_zhbmv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + const CBLAS_INT N, const CBLAS_INT K, const void *alpha, const void *A, + const CBLAS_INT lda, const void *X, const CBLAS_INT incX, + const void *beta, void *Y, const CBLAS_INT incY); +void cblas_zhpmv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + const CBLAS_INT N, const void *alpha, const void *Ap, + const void *X, const CBLAS_INT incX, + const void *beta, void *Y, const CBLAS_INT incY); +void cblas_zgeru(CBLAS_LAYOUT layout, const CBLAS_INT M, const CBLAS_INT N, + const void *alpha, const void *X, const CBLAS_INT incX, + const void *Y, const CBLAS_INT incY, void *A, const CBLAS_INT lda); +void cblas_zgerc(CBLAS_LAYOUT layout, const CBLAS_INT M, const CBLAS_INT N, + const void *alpha, const void *X, const CBLAS_INT incX, + const void *Y, const CBLAS_INT incY, void *A, const CBLAS_INT lda); +void cblas_zher(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + const CBLAS_INT N, const double alpha, const void *X, const CBLAS_INT incX, + void *A, const CBLAS_INT lda); +void cblas_zhpr(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + const CBLAS_INT N, const double alpha, const void *X, + const CBLAS_INT incX, void *A); +void cblas_zher2(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, const CBLAS_INT N, + const void *alpha, const void *X, const CBLAS_INT incX, + const void *Y, const CBLAS_INT incY, void *A, const CBLAS_INT lda); +void cblas_zhpr2(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, const CBLAS_INT N, + const void *alpha, const void *X, const CBLAS_INT incX, + const void *Y, const CBLAS_INT incY, void *Ap); /* * =========================================================================== @@ -437,160 +433,163 @@ void cblas_zhpr2(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const /* * Routines with standard 4 prefixes (S, D, C, Z) */ -void cblas_sgemm(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, - const enum CBLAS_TRANSPOSE TransB, const int M, const int N, - const int K, const float alpha, const float *A, - const int lda, const float *B, const int ldb, - const float beta, float *C, const int ldc); -void cblas_ssymm(const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side, - const enum CBLAS_UPLO Uplo, const int M, const int N, - const float alpha, const float *A, const int lda, - const float *B, const int ldb, const float beta, - float *C, const int ldc); -void cblas_ssyrk(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const enum CBLAS_TRANSPOSE Trans, const int N, const int K, - const float alpha, const float *A, const int lda, - const float beta, float *C, const int ldc); -void cblas_ssyr2k(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const enum CBLAS_TRANSPOSE Trans, const int N, const int K, - const float alpha, const float *A, const int lda, - const float *B, const int ldb, const float beta, - float *C, const int ldc); -void cblas_strmm(const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side, - const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA, - const enum CBLAS_DIAG Diag, const int M, const int N, - const float alpha, const float *A, const int lda, - float *B, const int ldb); -void cblas_strsm(const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side, - const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA, - const enum CBLAS_DIAG Diag, const int M, const int N, - const float alpha, const float *A, const int lda, - float *B, const int ldb); - -void cblas_dgemm(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, - const enum CBLAS_TRANSPOSE TransB, const int M, const int N, - const int K, const double alpha, const double *A, - const int lda, const double *B, const int ldb, - const double beta, double *C, const int ldc); -void cblas_dsymm(const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side, - const enum CBLAS_UPLO Uplo, const int M, const int N, - const double alpha, const double *A, const int lda, - const double *B, const int ldb, const double beta, - double *C, const int ldc); -void cblas_dsyrk(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const enum CBLAS_TRANSPOSE Trans, const int N, const int K, - const double alpha, const double *A, const int lda, - const double beta, double *C, const int ldc); -void cblas_dsyr2k(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const enum CBLAS_TRANSPOSE Trans, const int N, const int K, - const double alpha, const double *A, const int lda, - const double *B, const int ldb, const double beta, - double *C, const int ldc); -void cblas_dtrmm(const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side, - const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA, - const enum CBLAS_DIAG Diag, const int M, const int N, - const double alpha, const double *A, const int lda, - double *B, const int ldb); -void cblas_dtrsm(const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side, - const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA, - const enum CBLAS_DIAG Diag, const int M, const int N, - const double alpha, const double *A, const int lda, - double *B, const int ldb); - -void cblas_cgemm(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, - const enum CBLAS_TRANSPOSE TransB, const int M, const int N, - const int K, const void *alpha, const void *A, - const int lda, const void *B, const int ldb, - const void *beta, void *C, const int ldc); -void cblas_csymm(const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side, - const enum CBLAS_UPLO Uplo, const int M, const int N, - const void *alpha, const void *A, const int lda, - const void *B, const int ldb, const void *beta, - void *C, const int ldc); -void cblas_csyrk(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const enum CBLAS_TRANSPOSE Trans, const int N, const int K, - const void *alpha, const void *A, const int lda, - const void *beta, void *C, const int ldc); -void cblas_csyr2k(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const enum CBLAS_TRANSPOSE Trans, const int N, const int K, - const void *alpha, const void *A, const int lda, - const void *B, const int ldb, const void *beta, - void *C, const int ldc); -void cblas_ctrmm(const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side, - const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA, - const enum CBLAS_DIAG Diag, const int M, const int N, - const void *alpha, const void *A, const int lda, - void *B, const int ldb); -void cblas_ctrsm(const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side, - const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA, - const enum CBLAS_DIAG Diag, const int M, const int N, - const void *alpha, const void *A, const int lda, - void *B, const int ldb); - -void cblas_zgemm(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, - const enum CBLAS_TRANSPOSE TransB, const int M, const int N, - const int K, const void *alpha, const void *A, - const int lda, const void *B, const int ldb, - const void *beta, void *C, const int ldc); -void cblas_zsymm(const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side, - const enum CBLAS_UPLO Uplo, const int M, const int N, - const void *alpha, const void *A, const int lda, - const void *B, const int ldb, const void *beta, - void *C, const int ldc); -void cblas_zsyrk(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const enum CBLAS_TRANSPOSE Trans, const int N, const int K, - const void *alpha, const void *A, const int lda, - const void *beta, void *C, const int ldc); -void cblas_zsyr2k(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const enum CBLAS_TRANSPOSE Trans, const int N, const int K, - const void *alpha, const void *A, const int lda, - const void *B, const int ldb, const void *beta, - void *C, const int ldc); -void cblas_ztrmm(const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side, - const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA, - const enum CBLAS_DIAG Diag, const int M, const int N, - const void *alpha, const void *A, const int lda, - void *B, const int ldb); -void cblas_ztrsm(const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side, - const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA, - const enum CBLAS_DIAG Diag, const int M, const int N, - const void *alpha, const void *A, const int lda, - void *B, const int ldb); +void cblas_sgemm(CBLAS_LAYOUT layout, CBLAS_TRANSPOSE TransA, + CBLAS_TRANSPOSE TransB, const CBLAS_INT M, const CBLAS_INT N, + const CBLAS_INT K, const float alpha, const float *A, + const CBLAS_INT lda, const float *B, const CBLAS_INT ldb, + const float beta, float *C, const CBLAS_INT ldc); +void cblas_ssymm(CBLAS_LAYOUT layout, CBLAS_SIDE Side, + CBLAS_UPLO Uplo, const CBLAS_INT M, const CBLAS_INT N, + const float alpha, const float *A, const CBLAS_INT lda, + const float *B, const CBLAS_INT ldb, const float beta, + float *C, const CBLAS_INT ldc); +void cblas_ssyrk(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + CBLAS_TRANSPOSE Trans, const CBLAS_INT N, const CBLAS_INT K, + const float alpha, const float *A, const CBLAS_INT lda, + const float beta, float *C, const CBLAS_INT ldc); +void cblas_ssyr2k(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + CBLAS_TRANSPOSE Trans, const CBLAS_INT N, const CBLAS_INT K, + const float alpha, const float *A, const CBLAS_INT lda, + const float *B, const CBLAS_INT ldb, const float beta, + float *C, const CBLAS_INT ldc); +void cblas_strmm(CBLAS_LAYOUT layout, CBLAS_SIDE Side, + CBLAS_UPLO Uplo, CBLAS_TRANSPOSE TransA, + CBLAS_DIAG Diag, const CBLAS_INT M, const CBLAS_INT N, + const float alpha, const float *A, const CBLAS_INT lda, + float *B, const CBLAS_INT ldb); +void cblas_strsm(CBLAS_LAYOUT layout, CBLAS_SIDE Side, + CBLAS_UPLO Uplo, CBLAS_TRANSPOSE TransA, + CBLAS_DIAG Diag, const CBLAS_INT M, const CBLAS_INT N, + const float alpha, const float *A, const CBLAS_INT lda, + float *B, const CBLAS_INT ldb); + +void cblas_dgemm(CBLAS_LAYOUT layout, CBLAS_TRANSPOSE TransA, + CBLAS_TRANSPOSE TransB, const CBLAS_INT M, const CBLAS_INT N, + const CBLAS_INT K, const double alpha, const double *A, + const CBLAS_INT lda, const double *B, const CBLAS_INT ldb, + const double beta, double *C, const CBLAS_INT ldc); +void cblas_dsymm(CBLAS_LAYOUT layout, CBLAS_SIDE Side, + CBLAS_UPLO Uplo, const CBLAS_INT M, const CBLAS_INT N, + const double alpha, const double *A, const CBLAS_INT lda, + const double *B, const CBLAS_INT ldb, const double beta, + double *C, const CBLAS_INT ldc); +void cblas_dsyrk(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + CBLAS_TRANSPOSE Trans, const CBLAS_INT N, const CBLAS_INT K, + const double alpha, const double *A, const CBLAS_INT lda, + const double beta, double *C, const CBLAS_INT ldc); +void cblas_dsyr2k(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + CBLAS_TRANSPOSE Trans, const CBLAS_INT N, const CBLAS_INT K, + const double alpha, const double *A, const CBLAS_INT lda, + const double *B, const CBLAS_INT ldb, const double beta, + double *C, const CBLAS_INT ldc); +void cblas_dtrmm(CBLAS_LAYOUT layout, CBLAS_SIDE Side, + CBLAS_UPLO Uplo, CBLAS_TRANSPOSE TransA, + CBLAS_DIAG Diag, const CBLAS_INT M, const CBLAS_INT N, + const double alpha, const double *A, const CBLAS_INT lda, + double *B, const CBLAS_INT ldb); +void cblas_dtrsm(CBLAS_LAYOUT layout, CBLAS_SIDE Side, + CBLAS_UPLO Uplo, CBLAS_TRANSPOSE TransA, + CBLAS_DIAG Diag, const CBLAS_INT M, const CBLAS_INT N, + const double alpha, const double *A, const CBLAS_INT lda, + double *B, const CBLAS_INT ldb); + +void cblas_cgemm(CBLAS_LAYOUT layout, CBLAS_TRANSPOSE TransA, + CBLAS_TRANSPOSE TransB, const CBLAS_INT M, const CBLAS_INT N, + const CBLAS_INT K, const void *alpha, const void *A, + const CBLAS_INT lda, const void *B, const CBLAS_INT ldb, + const void *beta, void *C, const CBLAS_INT ldc); +void cblas_csymm(CBLAS_LAYOUT layout, CBLAS_SIDE Side, + CBLAS_UPLO Uplo, const CBLAS_INT M, const CBLAS_INT N, + const void *alpha, const void *A, const CBLAS_INT lda, + const void *B, const CBLAS_INT ldb, const void *beta, + void *C, const CBLAS_INT ldc); +void cblas_csyrk(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + CBLAS_TRANSPOSE Trans, const CBLAS_INT N, const CBLAS_INT K, + const void *alpha, const void *A, const CBLAS_INT lda, + const void *beta, void *C, const CBLAS_INT ldc); +void cblas_csyr2k(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + CBLAS_TRANSPOSE Trans, const CBLAS_INT N, const CBLAS_INT K, + const void *alpha, const void *A, const CBLAS_INT lda, + const void *B, const CBLAS_INT ldb, const void *beta, + void *C, const CBLAS_INT ldc); +void cblas_ctrmm(CBLAS_LAYOUT layout, CBLAS_SIDE Side, + CBLAS_UPLO Uplo, CBLAS_TRANSPOSE TransA, + CBLAS_DIAG Diag, const CBLAS_INT M, const CBLAS_INT N, + const void *alpha, const void *A, const CBLAS_INT lda, + void *B, const CBLAS_INT ldb); +void cblas_ctrsm(CBLAS_LAYOUT layout, CBLAS_SIDE Side, + CBLAS_UPLO Uplo, CBLAS_TRANSPOSE TransA, + CBLAS_DIAG Diag, const CBLAS_INT M, const CBLAS_INT N, + const void *alpha, const void *A, const CBLAS_INT lda, + void *B, const CBLAS_INT ldb); + +void cblas_zgemm(CBLAS_LAYOUT layout, CBLAS_TRANSPOSE TransA, + CBLAS_TRANSPOSE TransB, const CBLAS_INT M, const CBLAS_INT N, + const CBLAS_INT K, const void *alpha, const void *A, + const CBLAS_INT lda, const void *B, const CBLAS_INT ldb, + const void *beta, void *C, const CBLAS_INT ldc); +void cblas_zsymm(CBLAS_LAYOUT layout, CBLAS_SIDE Side, + CBLAS_UPLO Uplo, const CBLAS_INT M, const CBLAS_INT N, + const void *alpha, const void *A, const CBLAS_INT lda, + const void *B, const CBLAS_INT ldb, const void *beta, + void *C, const CBLAS_INT ldc); +void cblas_zsyrk(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + CBLAS_TRANSPOSE Trans, const CBLAS_INT N, const CBLAS_INT K, + const void *alpha, const void *A, const CBLAS_INT lda, + const void *beta, void *C, const CBLAS_INT ldc); +void cblas_zsyr2k(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + CBLAS_TRANSPOSE Trans, const CBLAS_INT N, const CBLAS_INT K, + const void *alpha, const void *A, const CBLAS_INT lda, + const void *B, const CBLAS_INT ldb, const void *beta, + void *C, const CBLAS_INT ldc); +void cblas_ztrmm(CBLAS_LAYOUT layout, CBLAS_SIDE Side, + CBLAS_UPLO Uplo, CBLAS_TRANSPOSE TransA, + CBLAS_DIAG Diag, const CBLAS_INT M, const CBLAS_INT N, + const void *alpha, const void *A, const CBLAS_INT lda, + void *B, const CBLAS_INT ldb); +void cblas_ztrsm(CBLAS_LAYOUT layout, CBLAS_SIDE Side, + CBLAS_UPLO Uplo, CBLAS_TRANSPOSE TransA, + CBLAS_DIAG Diag, const CBLAS_INT M, const CBLAS_INT N, + const void *alpha, const void *A, const CBLAS_INT lda, + void *B, const CBLAS_INT ldb); /* * Routines with prefixes C and Z only */ -void cblas_chemm(const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side, - const enum CBLAS_UPLO Uplo, const int M, const int N, - const void *alpha, const void *A, const int lda, - const void *B, const int ldb, const void *beta, - void *C, const int ldc); -void cblas_cherk(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const enum CBLAS_TRANSPOSE Trans, const int N, const int K, - const float alpha, const void *A, const int lda, - const float beta, void *C, const int ldc); -void cblas_cher2k(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const enum CBLAS_TRANSPOSE Trans, const int N, const int K, - const void *alpha, const void *A, const int lda, - const void *B, const int ldb, const float beta, - void *C, const int ldc); -void cblas_zhemm(const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side, - const enum CBLAS_UPLO Uplo, const int M, const int N, - const void *alpha, const void *A, const int lda, - const void *B, const int ldb, const void *beta, - void *C, const int ldc); -void cblas_zherk(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const enum CBLAS_TRANSPOSE Trans, const int N, const int K, - const double alpha, const void *A, const int lda, - const double beta, void *C, const int ldc); -void cblas_zher2k(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, - const enum CBLAS_TRANSPOSE Trans, const int N, const int K, - const void *alpha, const void *A, const int lda, - const void *B, const int ldb, const double beta, - void *C, const int ldc); - -int cblas_errprn(int ierr, int info, char *form, ...); - -#endif /* end #ifdef CBLAS_ENUM_ONLY */ +void cblas_chemm(CBLAS_LAYOUT layout, CBLAS_SIDE Side, + CBLAS_UPLO Uplo, const CBLAS_INT M, const CBLAS_INT N, + const void *alpha, const void *A, const CBLAS_INT lda, + const void *B, const CBLAS_INT ldb, const void *beta, + void *C, const CBLAS_INT ldc); +void cblas_cherk(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + CBLAS_TRANSPOSE Trans, const CBLAS_INT N, const CBLAS_INT K, + const float alpha, const void *A, const CBLAS_INT lda, + const float beta, void *C, const CBLAS_INT ldc); +void cblas_cher2k(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + CBLAS_TRANSPOSE Trans, const CBLAS_INT N, const CBLAS_INT K, + const void *alpha, const void *A, const CBLAS_INT lda, + const void *B, const CBLAS_INT ldb, const float beta, + void *C, const CBLAS_INT ldc); + +void cblas_zhemm(CBLAS_LAYOUT layout, CBLAS_SIDE Side, + CBLAS_UPLO Uplo, const CBLAS_INT M, const CBLAS_INT N, + const void *alpha, const void *A, const CBLAS_INT lda, + const void *B, const CBLAS_INT ldb, const void *beta, + void *C, const CBLAS_INT ldc); +void cblas_zherk(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + CBLAS_TRANSPOSE Trans, const CBLAS_INT N, const CBLAS_INT K, + const double alpha, const void *A, const CBLAS_INT lda, + const double beta, void *C, const CBLAS_INT ldc); +void cblas_zher2k(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, + CBLAS_TRANSPOSE Trans, const CBLAS_INT N, const CBLAS_INT K, + const void *alpha, const void *A, const CBLAS_INT lda, + const void *B, const CBLAS_INT ldb, const double beta, + void *C, const CBLAS_INT ldc); + +void cblas_xerbla(CBLAS_INT p, const char *rout, const char *form, ...); + +#ifdef __cplusplus +} +#endif #endif diff --git a/blas/netlib/dgemmbench_test.go b/blas/netlib/dgemmbench_test.go index 462b9eea..20643a25 100644 --- a/blas/netlib/dgemmbench_test.go +++ b/blas/netlib/dgemmbench_test.go @@ -1,3 +1,7 @@ +// Copyright ©2014 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 ( diff --git a/blas/netlib/dgemvbench_test.go b/blas/netlib/dgemvbench_test.go index 2c830e46..89de6ffe 100644 --- a/blas/netlib/dgemvbench_test.go +++ b/blas/netlib/dgemvbench_test.go @@ -1,3 +1,7 @@ +// Copyright ©2015 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 ( diff --git a/blas/netlib/dgerbench_test.go b/blas/netlib/dgerbench_test.go index 955cd085..8ba427b4 100644 --- a/blas/netlib/dgerbench_test.go +++ b/blas/netlib/dgerbench_test.go @@ -1,3 +1,7 @@ +// Copyright ©2015 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 ( diff --git a/blas/netlib/doc.go b/blas/netlib/doc.go index 6d6779b3..62075c22 100644 --- a/blas/netlib/doc.go +++ b/blas/netlib/doc.go @@ -3,18 +3,17 @@ // license that can be found in the LICENSE file. //go:generate go run generate_blas.go - -// Ensure changes made to netlib/blas are reflected in gonum/blas/native where relevant. +//go:generate go run generate_errors.go /* Package netlib provides bindings to a C BLAS library. This wrapper interface panics when the input arguments are invalid as per the standard, for example -if a vector increment is zero. Please note that the treatment of NaN values +if a vector increment is zero. Note that the treatment of NaN values is not specified, and differs among the BLAS implementations. -github.com/gonum/blas/blas64 provides helpful wrapper functions to the BLAS +gonum.org/v1/gonum/blas/blas64 provides helpful wrapper functions to the BLAS interface. The rest of this text describes the layout of the data for the input types. -Please note that in the function documentation, x[i] refers to the i^th element +Note that in the function documentation, x[i] refers to the i^th element of the vector, which will be different from the i^th element of the slice if incX != 1. diff --git a/blas/netlib/dtrmvbench_test.go b/blas/netlib/dtrmvbench_test.go index 8ef77ad6..06234e5d 100644 --- a/blas/netlib/dtrmvbench_test.go +++ b/blas/netlib/dtrmvbench_test.go @@ -1,9 +1,7 @@ -// Copyright ©2017 The gonum Authors. All rights reserved. +// 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. -// +build go1.7 - package netlib import ( diff --git a/blas/netlib/errors.go b/blas/netlib/errors.go new file mode 100644 index 00000000..19062995 --- /dev/null +++ b/blas/netlib/errors.go @@ -0,0 +1,36 @@ +// Code generated by "go generate gonum.org/v1/netlib/blas/netlib”; DO NOT EDIT. + +// Copyright ©2015 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 + +// Copied from gonum/blas/gonum. Keep in sync. +const ( + zeroIncX = "blas: zero x index increment" + zeroIncY = "blas: zero y index increment" + + mLT0 = "blas: m < 0" + nLT0 = "blas: n < 0" + kLT0 = "blas: k < 0" + kLLT0 = "blas: kL < 0" + kULT0 = "blas: kU < 0" + + badUplo = "blas: illegal triangle" + badTranspose = "blas: illegal transpose" + badDiag = "blas: illegal diagonal" + badSide = "blas: illegal side" + badFlag = "blas: illegal rotm flag" + + badLdA = "blas: bad leading dimension of A" + badLdB = "blas: bad leading dimension of B" + badLdC = "blas: bad leading dimension of C" + + shortX = "blas: insufficient length of x" + shortY = "blas: insufficient length of y" + shortAP = "blas: insufficient length of ap" + shortA = "blas: insufficient length of a" + shortB = "blas: insufficient length of b" + shortC = "blas: insufficient length of c" +) diff --git a/blas/netlib/generate_blas.go b/blas/netlib/generate_blas.go index 4784d887..93175ad2 100644 --- a/blas/netlib/generate_blas.go +++ b/blas/netlib/generate_blas.go @@ -15,17 +15,21 @@ import ( "go/format" "io/ioutil" "log" + "os" + "os/exec" + "path/filepath" "strings" "text/template" - "github.com/cznic/cc" + "modernc.org/cc" "gonum.org/v1/netlib/internal/binding" ) const ( header = "cblas.h" - documentation = "../../../gonum/blas/gonum" + srcModule = "gonum.org/v1/gonum" + documentation = "blas/gonum" target = "blas.go" typ = "Implementation" @@ -43,7 +47,7 @@ const ( ) var skip = map[string]bool{ - "cblas_errprn": true, + "cblas_xerbla": true, "cblas_srotg": true, "cblas_srotmg": true, "cblas_srotm": true, @@ -56,6 +60,8 @@ var skip = map[string]bool{ "cblas_cdotc_sub": true, "cblas_zdotu_sub": true, "cblas_zdotc_sub": true, + "cblas_scabs1": true, + "cblas_dcabs1": true, // ATLAS extensions. "cblas_csrot": true, @@ -63,13 +69,14 @@ var skip = map[string]bool{ } var cToGoType = map[string]string{ - "int": "int", - "float": "float32", - "double": "float64", + "int": "int", + "unsigned long": "int", // For I?amax routines that return CBLAS_INDEX as size_t. + "float": "float32", + "double": "float64", } var blasEnums = map[string]*template.Template{ - "CBLAS_ORDER": template.Must(template.New("order").Parse("order")), + "CBLAS_LAYOUT": template.Must(template.New("layout").Parse("layout")), "CBLAS_DIAG": template.Must(template.New("diag").Parse("blas.Diag")), "CBLAS_TRANSPOSE": template.Must(template.New("trans").Parse("blas.Transpose")), "CBLAS_UPLO": template.Must(template.New("uplo").Parse("blas.Uplo")), @@ -77,11 +84,11 @@ var blasEnums = map[string]*template.Template{ } var cgoEnums = map[string]*template.Template{ - "CBLAS_ORDER": template.Must(template.New("order").Parse("C.enum_CBLAS_ORDER(rowMajor)")), - "CBLAS_DIAG": template.Must(template.New("diag").Parse("C.enum_CBLAS_DIAG({{.}})")), - "CBLAS_TRANSPOSE": template.Must(template.New("trans").Parse("C.enum_CBLAS_TRANSPOSE({{.}})")), - "CBLAS_UPLO": template.Must(template.New("uplo").Parse("C.enum_CBLAS_UPLO({{.}})")), - "CBLAS_SIDE": template.Must(template.New("side").Parse("C.enum_CBLAS_SIDE({{.}})")), + "CBLAS_LAYOUT": template.Must(template.New("layout").Parse("C.CBLAS_LAYOUT(rowMajor)")), + "CBLAS_DIAG": template.Must(template.New("diag").Parse("C.CBLAS_DIAG({{.}})")), + "CBLAS_TRANSPOSE": template.Must(template.New("trans").Parse("C.CBLAS_TRANSPOSE({{.}})")), + "CBLAS_UPLO": template.Must(template.New("uplo").Parse("C.CBLAS_UPLO({{.}})")), + "CBLAS_SIDE": template.Must(template.New("side").Parse("C.CBLAS_SIDE({{.}})")), } var cgoTypes = map[binding.TypeKey]*template.Template{ @@ -132,7 +139,7 @@ func main() { } var docs map[string]map[string][]*ast.Comment if cribDocs { - docs, err = binding.DocComments(documentation) + docs, err = binding.DocComments(pathTo(srcModule, documentation)) if err != nil { log.Fatal(err) } @@ -212,7 +219,7 @@ func goSignature(buf *bytes.Buffer, d binding.Declaration, docs map[string][]*as fmt.Fprintf(buf, "func (%s) %s(", typ, goName) c := 0 for i, p := range parameters { - if p.Kind() == cc.Enum && binding.GoTypeForEnum(p.Type(), "", blasEnums) == "order" { + if p.Kind() == cc.Enum && binding.GoTypeForEnum(p.Type(), "", blasEnums) == "layout" { continue } if c != 0 { @@ -245,27 +252,31 @@ func goSignature(buf *bytes.Buffer, d binding.Declaration, docs map[string][]*as } } if d.Return.Kind() != cc.Void { - fmt.Fprintf(buf, ") %s {\n", cToGoType[d.Return.String()]) + goType, ok := cToGoType[d.Return.String()] + if !ok { + panic(fmt.Sprintf("Unexpected C type \"%s\"", d.Return.String())) + } + fmt.Fprintf(buf, ") %s {\n", goType) } else { buf.WriteString(") {\n") } } -func parameterChecks(buf *bytes.Buffer, d binding.Declaration, rules []func(*bytes.Buffer, binding.Declaration, binding.Parameter) bool) { - done := make(map[int]bool) - for _, p := range d.Parameters() { - for i, r := range rules { - if done[i] { - continue - } - done[i] = r(buf, d, p) +func parameterChecks(buf *bytes.Buffer, d binding.Declaration, rules []func(*bytes.Buffer, binding.Declaration, binding.Parameter)) { + for _, r := range rules { + for _, p := range d.Parameters() { + r(buf, d, p) } } } func cgoCall(buf *bytes.Buffer, d binding.Declaration) { if d.Return.Kind() != cc.Void { - fmt.Fprintf(buf, "return %s(", cToGoType[d.Return.String()]) + goType, ok := cToGoType[d.Return.String()] + if !ok { + panic(fmt.Sprintf("Unexpected C type \"%s\"", d.Return.String())) + } + fmt.Fprintf(buf, "return %s(", goType) } fmt.Fprintf(buf, "C.%s(", d.Name) for i, p := range d.Parameters() { @@ -284,481 +295,489 @@ func cgoCall(buf *bytes.Buffer, d binding.Declaration) { buf.WriteString(")\n") } -var parameterCheckRules = []func(*bytes.Buffer, binding.Declaration, binding.Parameter) bool{ +var parameterCheckRules = []func(*bytes.Buffer, binding.Declaration, binding.Parameter){ trans, uplo, diag, side, - shape, - apShape, + leadingDim, zeroInc, - sidedShape, - mvShape, - rkShape, - gemmShape, - scalShape, - amaxShape, - nrmSumShape, - vectorShape, - othersShape, - - address, - noWork, + sliceLength, + address, } -func amaxShape(buf *bytes.Buffer, d binding.Declaration, p binding.Parameter) bool { - switch d.Name { - case "cblas_isamax", "cblas_idamax", "cblas_icamax", "cblas_izamax": +func trans(buf *bytes.Buffer, d binding.Declaration, p binding.Parameter) { + switch n := shorten(binding.LowerCaseFirst(p.Name())); n { + case "t", "tA", "tB": + switch { + case strings.HasPrefix(d.Name, "cblas_ch"), strings.HasPrefix(d.Name, "cblas_zh"): + fmt.Fprintf(buf, ` switch %[1]s { + case blas.NoTrans: + %[1]s = C.CblasNoTrans + case blas.ConjTrans: + %[1]s = C.CblasConjTrans default: - return true + panic(badTranspose) } - - if d.CParameters[len(d.CParameters)-1] != p.Parameter { - return false // Come back later. +`, n) + case strings.HasPrefix(d.Name, "cblas_cs"), strings.HasPrefix(d.Name, "cblas_zs"): + fmt.Fprintf(buf, ` switch %[1]s { + case blas.NoTrans: + %[1]s = C.CblasNoTrans + case blas.Trans: + %[1]s = C.CblasTrans + default: + panic(badTranspose) } - - fmt.Fprint(buf, ` if n == 0 || incX < 0 { - return -1 +`, n) + default: + fmt.Fprintf(buf, ` switch %[1]s { + case blas.NoTrans: + %[1]s = C.CblasNoTrans + case blas.Trans: + %[1]s = C.CblasTrans + case blas.ConjTrans: + %[1]s = C.CblasConjTrans + default: + panic(badTranspose) } - if incX > 0 && (n-1)*incX >= len(x) { - panic("blas: x index out of range") +`, n) + } } -`) - return true } -func apShape(buf *bytes.Buffer, _ binding.Declaration, p binding.Parameter) bool { - n := binding.LowerCaseFirst(p.Name()) - if n != "ap" { - return false +func uplo(buf *bytes.Buffer, _ binding.Declaration, p binding.Parameter) { + if p.Name() != "Uplo" { + return } - fmt.Fprint(buf, ` if n*(n+1)/2 > len(ap) { - panic("blas: index of ap out of range") + fmt.Fprint(buf, ` switch ul { + case blas.Upper: + ul = C.CblasUpper + case blas.Lower: + ul = C.CblasLower + default: + panic(badUplo) } `) - return true } -func diag(buf *bytes.Buffer, _ binding.Declaration, p binding.Parameter) bool { +func diag(buf *bytes.Buffer, _ binding.Declaration, p binding.Parameter) { if p.Name() != "Diag" { - return false + return } - fmt.Fprint(buf, ` if d != blas.NonUnit && d != blas.Unit { - panic("blas: illegal diagonal") + fmt.Fprint(buf, ` switch d { + case blas.NonUnit: + d = C.CblasNonUnit + case blas.Unit: + d = C.CblasUnit + default: + panic(badDiag) } `) - return true + return } -func gemmShape(buf *bytes.Buffer, d binding.Declaration, p binding.Parameter) bool { - switch d.Name { - case "cblas_sgemm", "cblas_dgemm", "cblas_cgemm", "cblas_zgemm": +func side(buf *bytes.Buffer, _ binding.Declaration, p binding.Parameter) { + if p.Name() != "Side" { + return + } + fmt.Fprint(buf, ` switch s { + case blas.Left: + s = C.CblasLeft + case blas.Right: + s = C.CblasRight default: - return true + panic(badSide) } +`) +} - if d.CParameters[len(d.CParameters)-1] != p.Parameter { - return false // Come back later. +func shape(buf *bytes.Buffer, _ binding.Declaration, p binding.Parameter) { + switch n := binding.LowerCaseFirst(p.Name()); n { + case "m", "n", "k", "kL", "kU": + fmt.Fprintf(buf, ` if %[1]s < 0 { + panic(%[1]sLT0) + } +`, n) + } +} + +func leadingDim(buf *bytes.Buffer, d binding.Declaration, p binding.Parameter) { + pname := binding.LowerCaseFirst(p.Name()) + if !strings.HasPrefix(pname, "ld") { + return } - fmt.Fprint(buf, ` var rowA, colA, rowB, colB int - if tA == blas.NoTrans { + if pname == "ldc" { + // C matrix has always n columns. + fmt.Fprintf(buf, ` if ldc < max(1, n) { + panic(badLdC) + } +`) + return + } + + has := make(map[string]bool) + for _, p := range d.Parameters() { + has[shorten(binding.LowerCaseFirst(p.Name()))] = true + } + + switch d.Name { + case "cblas_sgemm", "cblas_dgemm", "cblas_cgemm", "cblas_zgemm": + if pname == "lda" { + fmt.Fprint(buf, ` var rowA, colA, rowB, colB int + if tA == C.CblasNoTrans { rowA, colA = m, k } else { rowA, colA = k, m } - if tB == blas.NoTrans { + if tB == C.CblasNoTrans { rowB, colB = k, n } else { rowB, colB = n, k } - if lda*(rowA-1)+colA > len(a) || lda < max(1, colA) { - panic("blas: index of a out of range") - } - if ldb*(rowB-1)+colB > len(b) || ldb < max(1, colB) { - panic("blas: index of b out of range") + if lda < max(1, colA) { + panic(badLdA) } - if ldc*(m-1)+n > len(c) || ldc < max(1, n) { - panic("blas: index of c out of range") +`) + } else { + fmt.Fprint(buf, ` if ldb < max(1, colB) { + panic(badLdB) } `) - return true -} + } + return -func mvShape(buf *bytes.Buffer, d binding.Declaration, p binding.Parameter) bool { - switch d.Name { - case "cblas_sgbmv", "cblas_dgbmv", "cblas_cgbmv", "cblas_zgbmv", - "cblas_sgemv", "cblas_dgemv", "cblas_cgemv", "cblas_zgemv": - default: - return true + case "cblas_ssyrk", "cblas_dsyrk", "cblas_csyrk", "cblas_zsyrk", + "cblas_ssyr2k", "cblas_dsyr2k", "cblas_csyr2k", "cblas_zsyr2k", + "cblas_cherk", "cblas_zherk", "cblas_cher2k", "cblas_zher2k": + if pname == "lda" { + fmt.Fprint(buf, ` var row, col int + if t == C.CblasNoTrans { + row, col = n, k + } else { + row, col = k, n + } +`) + } + fmt.Fprintf(buf, ` if %s < max(1, col) { + panic(bad%s) } +`, pname, ldToPanicString(pname)) + return - if d.CParameters[len(d.CParameters)-1] != p.Parameter { - return false // Come back later. + case "cblas_sgbmv", "cblas_dgbmv", "cblas_cgbmv", "cblas_zgbmv": + fmt.Fprintf(buf, ` if lda < kL+kU+1 { + panic(badLdA) + } +`) + return } - fmt.Fprint(buf, ` var lenX, lenY int - if tA == blas.NoTrans { - lenX, lenY = n, m - } else { - lenX, lenY = m, n + switch { + case has["k"]: + // cblas_stbmv cblas_dtbmv cblas_ctbmv cblas_ztbmv + // cblas_stbsv cblas_dtbsv cblas_ctbsv cblas_ztbsv + // cblas_ssbmv cblas_dsbmv cblas_chbmv cblas_zhbmv + fmt.Fprintf(buf, ` if lda < k+1 { + panic(badLdA) } - if (incX > 0 && (lenX-1)*incX >= len(x)) || (incX < 0 && (1-lenX)*incX >= len(x)) { - panic("blas: x index out of range") +`) + case has["s"] && pname == "lda": + // cblas_ssymm cblas_dsymm cblas_csymm cblas_zsymm + // cblas_strmm cblas_dtrmm cblas_ctrmm cblas_ztrmm + // cblas_strsm cblas_dtrsm cblas_ctrsm cblas_ztrsm + // cblas_chemm cblas_zhemm + fmt.Fprintf(buf, ` var k int + if s == C.CblasLeft { + k = m + } else { + k = n } - if (incY > 0 && (lenY-1)*incY >= len(y)) || (incY < 0 && (1-lenY)*incY >= len(y)) { - panic("blas: y index out of range") + if lda < max(1, k) { + panic(badLdA) } `) - return true -} - -func noWork(buf *bytes.Buffer, d binding.Declaration, p binding.Parameter) bool { - var hasN, hasLda, hasLdb bool - for _, p := range d.Parameters() { - switch shorten(binding.LowerCaseFirst(p.Name())) { - case "n": - hasN = true - case "lda": - hasLda = true - case "ldb": - hasLdb = true - } + default: + fmt.Fprintf(buf, ` if %s < max(1, n) { + panic(bad%s) } - if !hasN || hasLda || hasLdb { - return true +`, pname, ldToPanicString(pname)) } +} - if d.CParameters[len(d.CParameters)-1] != p.Parameter { - return false // Come back later. +func zeroInc(buf *bytes.Buffer, _ binding.Declaration, p binding.Parameter) { + switch n := binding.LowerCaseFirst(p.Name()); n { + case "incX": + fmt.Fprintf(buf, ` if incX == 0 { + panic(zeroIncX) } - - var value string - switch d.Return.String() { - case "int": - value = " -1" - case "float", "double": - value = " 0" +`) + case "incY": + fmt.Fprintf(buf, ` if incY == 0 { + panic(zeroIncY) } - fmt.Fprintf(buf, ` if n == 0 { - return%s +`) } -`, value) - return true + return } -func nrmSumShape(buf *bytes.Buffer, d binding.Declaration, p binding.Parameter) bool { +func noWork(buf *bytes.Buffer, d binding.Declaration, p binding.Parameter) { + if d.CParameters[len(d.CParameters)-1] != p.Parameter { + return // Come back later. + } + switch d.Name { case "cblas_snrm2", "cblas_dnrm2", "cblas_scnrm2", "cblas_dznrm2", "cblas_sasum", "cblas_dasum", "cblas_scasum", "cblas_dzasum": - default: - return true + fmt.Fprint(buf, ` + // Quick return if possible. + if n == 0 || incX < 0 { + return 0 } - if d.CParameters[len(d.CParameters)-1] != p.Parameter { - return false // Come back later. - } + // For zero matrix size the following slice length checks are trivially satisfied. +`) + return - fmt.Fprint(buf, ` if incX < 0 { - return 0 - } - if incX > 0 && (n-1)*incX >= len(x) { - panic("blas: x index out of range") + case "cblas_sscal", "cblas_dscal", "cblas_cscal", "cblas_zscal", "cblas_csscal", "cblas_zdscal": + fmt.Fprint(buf, ` + // Quick return if possible. + if n == 0 || incX < 0 { + return } + + // For zero matrix size the following slice length checks are trivially satisfied. `) - return true -} + return -func rkShape(buf *bytes.Buffer, d binding.Declaration, p binding.Parameter) bool { - switch d.Name { - case "cblas_ssyrk", "cblas_dsyrk", "cblas_csyrk", "cblas_zsyrk", - "cblas_ssyr2k", "cblas_dsyr2k", "cblas_csyr2k", "cblas_zsyr2k", - "cblas_cherk", "cblas_zherk", "cblas_cher2k", "cblas_zher2k": - default: - return true + case "cblas_isamax", "cblas_idamax", "cblas_icamax", "cblas_izamax": + fmt.Fprint(buf, ` + // Quick return if possible. + if n == 0 || incX < 0 { + return -1 } - if d.CParameters[len(d.CParameters)-1] != p.Parameter { - return false // Come back later. + // For zero matrix size the following slice length checks are trivially satisfied. +`) + return } - fmt.Fprint(buf, ` var row, col int - if t == blas.NoTrans { - row, col = n, k - } else { - row, col = k, n + var value string + switch d.Return.String() { + case "float", "double": + value = " 0" } -`) - has := make(map[string]bool) + var hasM bool for _, p := range d.Parameters() { - if p.Kind() != cc.Ptr { - continue + if shorten(binding.LowerCaseFirst(p.Name())) == "m" { + hasM = true } - has[shorten(binding.LowerCaseFirst(p.Name()))] = true } - for _, label := range []string{"a", "b"} { - if has[label] { - fmt.Fprintf(buf, ` if ld%[1]s*(row-1)+col > len(%[1]s) || ld%[1]s < max(1, col) { - panic("blas: index of %[1]s out of range") - } -`, label) - } + if !hasM { + fmt.Fprintf(buf, ` + // Quick return if possible. + if n == 0 { + return%s } - if has["c"] { - fmt.Fprint(buf, ` if ldc*(n-1)+n > len(c) || ldc < max(1, n) { - panic("blas: index of c out of range") + + // For zero matrix size the following slice length checks are trivially satisfied. +`, value) + } else { + fmt.Fprintf(buf, ` + // Quick return if possible. + if m == 0 || n == 0 { + return } + + // For zero matrix size the following slice length checks are trivially satisfied. `) } - - return true } -func scalShape(buf *bytes.Buffer, d binding.Declaration, p binding.Parameter) bool { - switch d.Name { - case "cblas_sscal", "cblas_dscal", "cblas_cscal", "cblas_zscal", "cblas_csscal": +func sliceLength(buf *bytes.Buffer, d binding.Declaration, p binding.Parameter) { + pname := shorten(binding.LowerCaseFirst(p.Name())) + switch pname { + case "a", "b", "c", "ap", "x", "y": default: - return true + return } - if d.CParameters[len(d.CParameters)-1] != p.Parameter { - return false // Come back later. + if pname == "ap" { + fmt.Fprint(buf, ` if len(ap) < n*(n+1)/2 { + panic(shortAP) } - - fmt.Fprint(buf, ` if incX < 0 { +`) return } - if incX > 0 && (n-1)*incX >= len(x) { - panic("blas: x index out of range") - } -`) - return true -} -func shape(buf *bytes.Buffer, _ binding.Declaration, p binding.Parameter) bool { - switch n := binding.LowerCaseFirst(p.Name()); n { - case "m", "n", "k", "kL", "kU": - fmt.Fprintf(buf, ` if %[1]s < 0 { - panic("blas: %[1]s < 0") - } -`, n) - return false + has := make(map[string]bool) + for _, p := range d.Parameters() { + has[shorten(binding.LowerCaseFirst(p.Name()))] = true } - return false -} -func side(buf *bytes.Buffer, _ binding.Declaration, p binding.Parameter) bool { - if p.Name() != "Side" { - return false - } - fmt.Fprint(buf, ` if s != blas.Left && s != blas.Right { - panic("blas: illegal side") + if pname == "c" { + if p.Type().Kind() != cc.Ptr { + // srot or drot + return + } + if has["m"] { + fmt.Fprint(buf, ` if len(c) < ldc*(m-1)+n { + panic(shortC) } `) - return true -} - -func sidedShape(buf *bytes.Buffer, d binding.Declaration, p binding.Parameter) bool { - var hasS, hasA, hasB, hasC bool - for _, p := range d.Parameters() { - switch shorten(binding.LowerCaseFirst(p.Name())) { - case "s": - hasS = true - case "a": - hasA = true - case "b": - hasB = true - case "c": - hasC = true + return } + fmt.Fprint(buf, ` if len(c) < ldc*(n-1)+n { + panic(shortC) } - if !hasS { - return true +`) + return } - if d.CParameters[len(d.CParameters)-1] != p.Parameter { - return false // Come back later. + switch d.Name { + case "cblas_snrm2", "cblas_dnrm2", "cblas_scnrm2", "cblas_dznrm2", + "cblas_sasum", "cblas_dasum", "cblas_scasum", "cblas_dzasum", + "cblas_sscal", "cblas_dscal", "cblas_cscal", "cblas_zscal", "cblas_csscal", "cblas_zdscal", + "cblas_isamax", "cblas_idamax", "cblas_icamax", "cblas_izamax": + fmt.Fprint(buf, ` if len(x) <= (n-1)*incX { + panic(shortX) } +`) + return - if hasA && hasB { - fmt.Fprint(buf, ` var k int - if s == blas.Left { - k = m - } else { - k = n - } - if lda*(k-1)+k > len(a) || lda < max(1, k) { - panic("blas: index of a out of range") - } - if ldb*(m-1)+n > len(b) || ldb < max(1, n) { - panic("blas: index of b out of range") + case "cblas_ssyrk", "cblas_dsyrk", "cblas_csyrk", "cblas_zsyrk", + "cblas_ssyr2k", "cblas_dsyr2k", "cblas_csyr2k", "cblas_zsyr2k", + "cblas_cherk", "cblas_zherk", "cblas_cher2k", "cblas_zher2k": + switch pname { + case "a": + // row and col have already been declared in leadingDim. + fmt.Fprintf(buf, ` if len(a) < lda*(row-1)+col { + panic(shortA) } `) - } else { - return true - } - if hasC { - fmt.Fprint(buf, ` if ldc*(m-1)+n > len(c) || ldc < max(1, n) { - panic("blas: index of c out of range") + case "b": + fmt.Fprintf(buf, ` if len(b) < ldb*(row-1)+col { + panic(shortB) } `) - } - - return true -} - -func trans(buf *bytes.Buffer, d binding.Declaration, p binding.Parameter) bool { - switch n := shorten(binding.LowerCaseFirst(p.Name())); n { - case "t", "tA", "tB": - switch { - case strings.HasPrefix(d.Name, "cblas_ch"), strings.HasPrefix(d.Name, "cblas_zh"): - fmt.Fprintf(buf, ` if %[1]s != blas.NoTrans && %[1]s != blas.ConjTrans { - panic("blas: illegal transpose") - } -`, n) - case strings.HasPrefix(d.Name, "cblas_cs"), strings.HasPrefix(d.Name, "cblas_zs"): - fmt.Fprintf(buf, ` if %[1]s != blas.NoTrans && %[1]s != blas.Trans { - panic("blas: illegal transpose") - } -`, n) - default: - fmt.Fprintf(buf, ` if %[1]s != blas.NoTrans && %[1]s != blas.Trans && %[1]s != blas.ConjTrans { - panic("blas: illegal transpose") - } -`, n) } - } - return false -} + return -func uplo(buf *bytes.Buffer, _ binding.Declaration, p binding.Parameter) bool { - if p.Name() != "Uplo" { - return false - } - fmt.Fprint(buf, ` if ul != blas.Upper && ul != blas.Lower { - panic("blas: illegal triangle") + case "cblas_sgemm", "cblas_dgemm", "cblas_cgemm", "cblas_zgemm": + switch pname { + case "a": + // rowA and colA have already been declared in leadingDim. + fmt.Fprint(buf, ` if len(a) < lda*(rowA-1)+colA { + panic(shortA) } `) - return true -} - -func vectorShape(buf *bytes.Buffer, d binding.Declaration, p binding.Parameter) bool { - switch d.Name { - case "cblas_sgbmv", "cblas_dgbmv", "cblas_cgbmv", "cblas_zgbmv", - "cblas_sgemv", "cblas_dgemv", "cblas_cgemv", "cblas_zgemv", - "cblas_sscal", "cblas_dscal", "cblas_cscal", "cblas_zscal", "cblas_csscal", - "cblas_isamax", "cblas_idamax", "cblas_icamax", "cblas_izamax", - "cblas_snrm2", "cblas_dnrm2", "cblas_scnrm2", "cblas_dznrm2", - "cblas_sasum", "cblas_dasum", "cblas_scasum", "cblas_dzasum": - return true + case "b": + fmt.Fprint(buf, ` if len(b) < ldb*(rowB-1)+colB { + panic(shortB) } - - var hasN, hasM, hasIncX, hasIncY bool - for _, p := range d.Parameters() { - switch shorten(binding.LowerCaseFirst(p.Name())) { - case "n": - hasN = true - case "m": - hasM = true - case "incX": - hasIncX = true - case "incY": - hasIncY = true +`) } - } - if !hasN && !hasM { - return true - } - - if d.CParameters[len(d.CParameters)-1] != p.Parameter { - return false // Come back later. - } + return - var label string - if hasM { - label = "m" + case "cblas_sgbmv", "cblas_dgbmv", "cblas_cgbmv", "cblas_zgbmv", + "cblas_sgemv", "cblas_dgemv", "cblas_cgemv", "cblas_zgemv": + switch pname { + case "x": + fmt.Fprint(buf, ` var lenX, lenY int + if tA == C.CblasNoTrans { + lenX, lenY = n, m } else { - label = "n" - } - if hasIncX { - fmt.Fprintf(buf, ` if (incX > 0 && (%[1]s-1)*incX >= len(x)) || (incX < 0 && (1-%[1]s)*incX >= len(x)) { - panic("blas: x index out of range") + lenX, lenY = m, n } -`, label) + if (incX > 0 && len(x) <= (lenX-1)*incX) || (incX < 0 && len(x) <= (1-lenX)*incX) { + panic(shortX) } - if hasIncY { - fmt.Fprint(buf, ` if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") +`) + case "y": + fmt.Fprint(buf, ` if (incY > 0 && len(y) <= (lenY-1)*incY) || (incY < 0 && len(y) <= (1-lenY)*incY) { + panic(shortY) } `) + case "a": + if has["kL"] { + fmt.Fprintf(buf, ` if len(a) < lda*(min(m, n+kL)-1)+kL+kU+1 { + panic(shortA) } - return true -} - -func zeroInc(buf *bytes.Buffer, _ binding.Declaration, p binding.Parameter) bool { - switch n := binding.LowerCaseFirst(p.Name()); n { - case "incX": - fmt.Fprintf(buf, ` if incX == 0 { - panic("blas: zero x index increment") +`) + } else { + fmt.Fprint(buf, ` if len(a) < lda*(m-1)+n { + panic(shortA) } `) - case "incY": - fmt.Fprintf(buf, ` if incY == 0 { - panic("blas: zero y index increment") + } + } + return + + case "cblas_sspr2", "cblas_dspr2", "cblas_chpr", "cblas_zhpr": + switch pname { + case "a": + fmt.Fprint(buf, ` if len(a) < n*(n+1)/2 { + panic(shortA) } `) - return true + return + } } - return false -} -func othersShape(buf *bytes.Buffer, d binding.Declaration, p binding.Parameter) bool { - switch d.Name { - case "cblas_sgemm", "cblas_dgemm", "cblas_cgemm", "cblas_zgemm", - "cblas_ssyrk", "cblas_dsyrk", "cblas_csyrk", "cblas_zsyrk", - "cblas_ssyr2k", "cblas_dsyr2k", "cblas_csyr2k", "cblas_zsyr2k", - "cblas_cherk", "cblas_zherk", "cblas_cher2k", "cblas_zher2k": - return true + switch pname { + case "x": + var label string + if has["m"] { + label = "m" + } else { + label = "n" + } + fmt.Fprintf(buf, ` if (incX > 0 && len(x) <= (%[1]s-1)*incX) || (incX < 0 && len(x) <= (1-%[1]s)*incX) { + panic(shortX) } +`, label) - has := make(map[string]bool) - for _, p := range d.Parameters() { - has[shorten(binding.LowerCaseFirst(p.Name()))] = true - } - if !has["a"] || has["s"] { - return true + case "y": + fmt.Fprint(buf, ` if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) } +`) - if d.CParameters[len(d.CParameters)-1] != p.Parameter { - return false // Come back later. + case "a": + switch { + case has["s"]: + fmt.Fprintf(buf, ` if len(a) < lda*(k-1)+k { + panic(shortA) } - - switch { - case has["kL"] && has["kU"]: - fmt.Fprintf(buf, ` if lda*(min(m, n+kL)-1)+kL+kU+1 > len(a) || lda < kL+kU+1 { - panic("blas: index of a out of range") +`) + case has["k"]: + fmt.Fprintf(buf, ` if len(a) < lda*(n-1)+k+1 { + panic(shortA) } `) - case has["m"]: - fmt.Fprintf(buf, ` if lda*(m-1)+n > len(a) || lda < max(1, n) { - panic("blas: index of a out of range") + case has["m"]: + fmt.Fprint(buf, ` if len(a) < lda*(m-1)+n { + panic(shortA) } `) - case has["k"]: - fmt.Fprintf(buf, ` if lda*(n-1)+k+1 > len(a) || lda < k+1 { - panic("blas: index of a out of range") + default: + fmt.Fprint(buf, ` if len(a) < lda*(n-1)+n { + panic(shortA) } `) - default: - fmt.Fprintf(buf, ` if lda*(n-1)+n > len(a) || lda < max(1, n) { - panic("blas: index of a out of range") + } + + case "b": + fmt.Fprint(buf, ` if len(b) < ldb*(m-1)+n { + panic(shortB) } `) } - return true + return } var addrTypes = map[string]string{ @@ -768,13 +787,13 @@ var addrTypes = map[string]string{ "double": "float64", } -func address(buf *bytes.Buffer, d binding.Declaration, p binding.Parameter) bool { +func address(buf *bytes.Buffer, d binding.Declaration, p binding.Parameter) { n := shorten(binding.LowerCaseFirst(p.Name())) blasName := strings.TrimPrefix(d.Name, prefix) switch n { case "a", "b", "c", "ap", "x", "y": default: - return false + return } if p.Type().Kind() == cc.Ptr { t := addrTypes[strings.TrimPrefix(p.Type().Element().String(), "const ")] @@ -787,15 +806,55 @@ func address(buf *bytes.Buffer, d binding.Declaration, p binding.Parameter) bool } } fmt.Fprintf(buf, ` var _%[1]s *%[2]s - if len(%[1]s) > 0 { - _%[1]s = &%[1]s[0] - } + if len(%[1]s) > 0 { + _%[1]s = &%[1]s[0] + } `, n, t) } - return false + return +} + +func ldToPanicString(ld string) string { + switch ld { + case "lda": + return "LdA" + case "ldb": + return "LdB" + case "ldc": + return "LdC" + default: + panic("unexpected ld") + } +} + +// pathTo returns the path to package within the given module. If running +// in module mode, this will look within the module in $GOPATH/pkg/mod +// at the correct version, otherwise it will find the version installed +// at $GOPATH/src/module/pkg. +func pathTo(module, pkg string) string { + gopath, ok := os.LookupEnv("GOPATH") + if !ok { + var err error + gopath, err = os.UserHomeDir() + if err != nil { + log.Fatal(err) + } + gopath = filepath.Join(gopath, "go") + } + + cmd := exec.Command("go", "list", "-m", module) + var buf, stderr bytes.Buffer + cmd.Stdout = &buf + cmd.Stderr = &stderr + err := cmd.Run() + if err != nil { + log.Fatalf("module aware go list failed with stderr output %q: %v", stderr.String(), err) + } + version := strings.TrimSpace(strings.Join(strings.Split(buf.String(), " "), "@")) + return filepath.Join(gopath, "pkg", "mod", version, pkg) } -const handwritten = `// Do not manually edit this file. It was created by the generate_blas.go from {{.}}. +const handwritten = `// Code generated by "go generate gonum.org/v1/netlib/blas/netlib" from {{.}}; DO NOT EDIT. // Copyright ©2014 The Gonum Authors. All rights reserved. // Use of this source code is governed by a BSD-style @@ -823,13 +882,11 @@ var ( _ blas.Complex128 = Implementation{} ) -// Type order is used to specify the matrix storage format. We still interact with -// an API that allows client calls to specify order, so this is here to document that fact. -type order int +// Type layout is used to specify the matrix storage format. We still interact with +// an API that allows client calls to specify layout, so this is here to document that fact. +type layout int -const ( - rowMajor order = 101 + iota -) +const rowMajor layout = C.CblasRowMajor func min(a, b int) int { if a < b { @@ -870,34 +927,38 @@ func (Implementation) Srotmg(d1 float32, d2 float32, b1 float32, b2 float32) (p } func (Implementation) Srotm(n int, x []float32, incX int, y []float32, incY int, p blas.SrotmParams) { if n < 0 { - panic("blas: n < 0") - } - var _x *float32 - if len(x) > 0 { - _x = &x[0] + panic(nLT0) } if incX == 0 { - panic("blas: zero x index increment") - } - var _y *float32 - if len(y) > 0 { - _y = &y[0] + panic(zeroIncX) } if incY == 0 { - panic("blas: zero y index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") + panic(zeroIncY) } if p.Flag < blas.Identity || p.Flag > blas.Diagonal { - panic("blas: illegal blas.Flag value") + panic(badFlag) } + + // Quick return if possible. if n == 0 { return } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) + } + var _x *float32 + if len(x) > 0 { + _x = &x[0] + } + var _y *float32 + if len(y) > 0 { + _y = &y[0] + } pi := srotmParams{ flag: float32(p.Flag), h: p.H, @@ -915,34 +976,38 @@ func (Implementation) Drotmg(d1 float64, d2 float64, b1 float64, b2 float64) (p } func (Implementation) Drotm(n int, x []float64, incX int, y []float64, incY int, p blas.DrotmParams) { if n < 0 { - panic("blas: n < 0") - } - var _x *float64 - if len(x) > 0 { - _x = &x[0] + panic(nLT0) } if incX == 0 { - panic("blas: zero x index increment") - } - var _y *float64 - if len(y) > 0 { - _y = &y[0] + panic(zeroIncX) } if incY == 0 { - panic("blas: zero y index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") + panic(zeroIncY) } if p.Flag < blas.Identity || p.Flag > blas.Diagonal { - panic("blas: illegal blas.Flag value") + panic(badFlag) } + + // Quick return if possible. if n == 0 { return } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) + } + var _x *float64 + if len(x) > 0 { + _x = &x[0] + } + var _y *float64 + if len(y) > 0 { + _y = &y[0] + } pi := drotmParams{ flag: float64(p.Flag), h: p.H, @@ -951,121 +1016,137 @@ func (Implementation) Drotm(n int, x []float64, incX int, y []float64, incY int, } func (Implementation) Cdotu(n int, x []complex64, incX int, y []complex64, incY int) (dotu complex64) { if n < 0 { - panic("blas: n < 0") - } - var _x *complex64 - if len(x) > 0 { - _x = &x[0] + panic(nLT0) } if incX == 0 { - panic("blas: zero x index increment") - } - var _y *complex64 - if len(y) > 0 { - _y = &y[0] + panic(zeroIncX) } if incY == 0 { - panic("blas: zero y index increment") - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") + panic(zeroIncY) } + + // Quick return if possible. if n == 0 { return 0 } - C.cblas_cdotu_sub(C.int(n), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(_y), C.int(incY), unsafe.Pointer(&dotu)) - return dotu -} -func (Implementation) Cdotc(n int, x []complex64, incX int, y []complex64, incY int) (dotc complex64) { - if n < 0 { - panic("blas: n < 0") + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) } - var _x *complex64 + var _x *complex64 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } - var _y *complex64 + var _y *complex64 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") + C.cblas_cdotu_sub(C.int(n), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(_y), C.int(incY), unsafe.Pointer(&dotu)) + return dotu +} +func (Implementation) Cdotc(n int, x []complex64, incX int, y []complex64, incY int) (dotc complex64) { + if n < 0 { + panic(nLT0) } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") + if incX == 0 { + panic(zeroIncX) } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") + if incY == 0 { + panic(zeroIncY) } + + // Quick return if possible. if n == 0 { return 0 } - C.cblas_cdotc_sub(C.int(n), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(_y), C.int(incY), unsafe.Pointer(&dotc)) - return dotc -} -func (Implementation) Zdotu(n int, x []complex128, incX int, y []complex128, incY int) (dotu complex128) { - if n < 0 { - panic("blas: n < 0") + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) } - var _x *complex128 + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) + } + var _x *complex64 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } - var _y *complex128 + var _y *complex64 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") + C.cblas_cdotc_sub(C.int(n), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(_y), C.int(incY), unsafe.Pointer(&dotc)) + return dotc +} +func (Implementation) Zdotu(n int, x []complex128, incX int, y []complex128, incY int) (dotu complex128) { + if n < 0 { + panic(nLT0) } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") + if incX == 0 { + panic(zeroIncX) } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") + if incY == 0 { + panic(zeroIncY) } + + // Quick return if possible. if n == 0 { return 0 } - C.cblas_zdotu_sub(C.int(n), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(_y), C.int(incY), unsafe.Pointer(&dotu)) - return dotu -} -func (Implementation) Zdotc(n int, x []complex128, incX int, y []complex128, incY int) (dotc complex128) { - if n < 0 { - panic("blas: n < 0") + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) } - var _x *complex128 + var _x *complex128 if len(x) > 0 { _x = &x[0] } - if incX == 0 { - panic("blas: zero x index increment") - } - var _y *complex128 + var _y *complex128 if len(y) > 0 { _y = &y[0] } - if incY == 0 { - panic("blas: zero y index increment") + C.cblas_zdotu_sub(C.int(n), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(_y), C.int(incY), unsafe.Pointer(&dotu)) + return dotu +} +func (Implementation) Zdotc(n int, x []complex128, incX int, y []complex128, incY int) (dotc complex128) { + if n < 0 { + panic(nLT0) } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic("blas: x index out of range") + if incX == 0 { + panic(zeroIncX) } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic("blas: y index out of range") + if incY == 0 { + panic(zeroIncY) } + + // Quick return if possible. if n == 0 { return 0 } + + // For zero matrix size the following slice length checks are trivially satisfied. + if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { + panic(shortX) + } + if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { + panic(shortY) + } + var _x *complex128 + if len(x) > 0 { + _x = &x[0] + } + var _y *complex128 + if len(y) > 0 { + _y = &y[0] + } C.cblas_zdotc_sub(C.int(n), unsafe.Pointer(_x), C.int(incX), unsafe.Pointer(_y), C.int(incY), unsafe.Pointer(&dotc)) return dotc } diff --git a/blas/netlib/generate_errors.go b/blas/netlib/generate_errors.go new file mode 100644 index 00000000..af0144bd --- /dev/null +++ b/blas/netlib/generate_errors.go @@ -0,0 +1,105 @@ +// Copyright ©2018 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. + +// +build ignore + +package main + +import ( + "bytes" + "fmt" + "go/ast" + "go/parser" + "go/printer" + "go/token" + "log" + "os" + "os/exec" + "path/filepath" + "strings" +) + +const ( + srcModule = "gonum.org/v1/gonum" + errorFile = "blas/gonum/errors.go" +) + +func main() { + path, err := pathTo(srcModule, errorFile) + if err != nil { + log.Fatalf("no source for %q: %v", errorFile, err) + } + + fset := token.NewFileSet() + f, err := parser.ParseFile(fset, path, nil, parser.ParseComments) + if err != nil { + log.Fatalf("failed to parse %q: %v", path, err) + } + + dst := filepath.Base(errorFile) + o, err := os.Create(dst) + if err != nil { + log.Fatalf("failed to create %q: %v", dst, err) + } + defer o.Close() + + fmt.Fprintln(o, header) + for _, cg := range f.Comments { + for _, c := range cg.List { + fmt.Fprintln(o, c.Text) + } + break + } + fmt.Fprintln(o, pkg) + p := printer.Config{ + Mode: printer.UseSpaces | printer.TabIndent, + Tabwidth: 8, + } + // Remove comment associated with the const block. + for _, d := range f.Decls { + if d, ok := d.(*ast.GenDecl); ok { + d.Doc = nil + } + } + p.Fprint(o, fset, f.Decls) + fmt.Fprintln(o) +} + +// pathTo returns the path to file within the given module. If running +// in module mode, this will look within the module in $GOPATH/pkg/mod +// at the correct version, otherwise it will find the version installed +// at $GOPATH/src/module/file. +func pathTo(module, file string) (string, error) { + gopath, ok := os.LookupEnv("GOPATH") + if !ok { + var err error + gopath, err = os.UserHomeDir() + if err != nil { + return "", err + } + gopath = filepath.Join(gopath, "go") + } + + cmd := exec.Command("go", "list", "-m", module) + var buf, stderr bytes.Buffer + cmd.Stdout = &buf + cmd.Stderr = &stderr + err := cmd.Run() + if err != nil { + // TODO(kortschak): Make this an error when go1.10 support is dropped. + log.Printf("module aware go list failed with stderr output %q: %v", stderr.String(), err) + return filepath.Join(gopath, "src", module, file), nil + } + version := strings.TrimSpace(strings.Join(strings.Split(buf.String(), " "), "@")) + return filepath.Join(gopath, "pkg", "mod", version, file), nil +} + +const ( + header = `// Code generated by "go generate gonum.org/v1/netlib/blas/netlib”; DO NOT EDIT. +` + pkg = ` +package netlib + +// Copied from gonum/blas/gonum. Keep in sync.` +) 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) +} diff --git a/blas/netlib/level1doubleBench_auto_test.go b/blas/netlib/level1doubleBench_auto_test.go index 72995bf3..32dd4644 100644 --- a/blas/netlib/level1doubleBench_auto_test.go +++ b/blas/netlib/level1doubleBench_auto_test.go @@ -1,15 +1,16 @@ -// Code generated by "go run github.com/gonum/blas/testblas/benchautogen/autogen_bench_level1double.go"; DO NOT EDIT. +// Code generated by "go run gonum.org/v1/gonum/blas/testblas/benchautogen/autogen_bench_level1double.go"; DO NOT EDIT. -// Copyright 2014 The Gonum Authors. All rights reserved. +// Copyright ©2014 The Gonum Authors. All rights reserved. // Use of this code is governed by a BSD-style // license that can be found in the LICENSE file package netlib import ( - "math/rand" "testing" + "golang.org/x/exp/rand" + "gonum.org/v1/gonum/blas" ) diff --git a/blas/netlib/level1double_test.go b/blas/netlib/level1double_test.go index 3d606ced..3738bb6b 100644 --- a/blas/netlib/level1double_test.go +++ b/blas/netlib/level1double_test.go @@ -41,7 +41,7 @@ func TestDcopy(t *testing.T) { } func TestDrotg(t *testing.T) { - testblas.DrotgTest(t, impl) + testblas.DrotgTest(t, impl, true) } func TestDrotmg(t *testing.T) { diff --git a/blas/netlib/level2cmplx128_test.go b/blas/netlib/level2cmplx128_test.go new file mode 100644 index 00000000..3eec0304 --- /dev/null +++ b/blas/netlib/level2cmplx128_test.go @@ -0,0 +1,79 @@ +// 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 TestZgbmv(t *testing.T) { + testblas.ZgbmvTest(t, impl) +} + +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 TestZhbmv(t *testing.T) { + testblas.ZhbmvTest(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 TestZhpmv(t *testing.T) { + testblas.ZhpmvTest(t, impl) +} + +func TestZhpr(t *testing.T) { + testblas.ZhprTest(t, impl) +} + +func TestZhpr2(t *testing.T) { + testblas.Zhpr2Test(t, impl) +} + +func TestZtbmv(t *testing.T) { + testblas.ZtbmvTest(t, impl) +} + +func TestZtbsv(t *testing.T) { + testblas.ZtbsvTest(t, impl) +} + +func TestZtpmv(t *testing.T) { + testblas.ZtpmvTest(t, impl) +} + +func TestZtpsv(t *testing.T) { + testblas.ZtpsvTest(t, impl) +} + +func TestZtrmv(t *testing.T) { + testblas.ZtrmvTest(t, impl) +} + +func TestZtrsv(t *testing.T) { + testblas.ZtrsvTest(t, impl) +} diff --git a/blas/netlib/level3cmplx128_test.go b/blas/netlib/level3cmplx128_test.go new file mode 100644 index 00000000..12c0cac0 --- /dev/null +++ b/blas/netlib/level3cmplx128_test.go @@ -0,0 +1,21 @@ +// Copyright ©2019 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 TestZgemm(t *testing.T) { testblas.ZgemmTest(t, impl) } +func TestZhemm(t *testing.T) { testblas.ZhemmTest(t, impl) } +func TestZherk(t *testing.T) { testblas.ZherkTest(t, impl) } +func TestZher2k(t *testing.T) { testblas.Zher2kTest(t, impl) } +func TestZsymm(t *testing.T) { testblas.ZsymmTest(t, impl) } +func TestZsyrk(t *testing.T) { testblas.ZsyrkTest(t, impl) } +func TestZsyr2k(t *testing.T) { testblas.Zsyr2kTest(t, impl) } +func TestZtrmm(t *testing.T) { testblas.ZtrmmTest(t, impl) } +func TestZtrsm(t *testing.T) { testblas.ZtrsmTest(t, impl) } diff --git a/go.mod b/go.mod new file mode 100644 index 00000000..f45ad63d --- /dev/null +++ b/go.mod @@ -0,0 +1,17 @@ +module gonum.org/v1/netlib + +go 1.17 + +require ( + golang.org/x/exp v0.0.0-20230321023759-10a507213a29 + gonum.org/v1/gonum v0.13.1-0.20230729095443-194082cf5ba1 + modernc.org/cc v1.0.0 + modernc.org/xc v1.0.0 +) + +require ( + github.com/remyoudompheng/bigfft v0.0.0-20190728182440-6a916e37a237 // indirect + modernc.org/golex v1.0.0 // indirect + modernc.org/mathutil v1.0.0 // indirect + modernc.org/strutil v1.1.0 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 00000000..c858270f --- /dev/null +++ b/go.sum @@ -0,0 +1,152 @@ +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8= +git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/ajstarks/deck v0.0.0-20200831202436-30c9fc6549a9/go.mod h1:JynElWSGnm/4RlzPXRlREEwqTHAN3T56Bv2ITsFT3gY= +github.com/ajstarks/deck/generate v0.0.0-20210309230005-c3f852c02e19/go.mod h1:T13YZdzov6OU0A1+RfKZiZN9ca6VeKdBdyDV+BY97Tk= +github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= +github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGWcpt8ov532z81sp/kMMUG485J2InIOyADM= +github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= +github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= +github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= +github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g= +github.com/go-fonts/latin-modern v0.2.0/go.mod h1:rQVLdDMK+mK1xscDwsqM5J8U2jrRa3T0ecnM9pNujks= +github.com/go-fonts/latin-modern v0.3.0/go.mod h1:ysEQXnuT/sCDOAONxC7ImeEDVINbltClhasMAqEtRK0= +github.com/go-fonts/liberation v0.1.1/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY= +github.com/go-fonts/liberation v0.2.0/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY= +github.com/go-fonts/liberation v0.3.0/go.mod h1:jdJ+cqF+F4SUL2V+qxBth8fvBpBDS7yloUL5Fi8GTGY= +github.com/go-fonts/stix v0.1.0/go.mod h1:w/c1f0ldAUlJmLBvlbkvVXLAD+tAMqobIIQpmnUIzUY= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-latex/latex v0.0.0-20210118124228-b3d85cf34e07/go.mod h1:CO1AlKB2CSIqUrmQPqA0gdRIlnLEY0gK5JGjh37zN5U= +github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81/go.mod h1:SX0U8uGpxhq9o2S/CELCSUxEWWAuoCUcVCQWv7G2OCk= +github.com/go-latex/latex v0.0.0-20230307184459-12ec69307ad9/go.mod h1:gWuR/CrFDDeVRFQwHPvsv9soJVB/iqymhuZQuJ3a9OM= +github.com/go-pdf/fpdf v0.5.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= +github.com/go-pdf/fpdf v0.6.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= +github.com/goccmack/gocc v0.0.0-20230228185258-2292f9e40198/go.mod h1:DTh/Y2+NbnOVVoypCCQrovMPDKUGp4yZpSbWg5D0XIM= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= +github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2dXMnm1mY= +github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= +github.com/phpdave11/gofpdi v1.0.13/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/remyoudompheng/bigfft v0.0.0-20190728182440-6a916e37a237 h1:HQagqIiBmr8YXawX/le3+O26N+vPPC1PtjaF3mwnook= +github.com/remyoudompheng/bigfft v0.0.0-20190728182440-6a916e37a237/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w= +github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZKsJ8yyVxGRWYNEm9oFB8ieLgKFnamEyDmSA0BRk= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= +golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3/go.mod h1:NOZ3BPKG0ec/BKJQgnvsSFpcKLM5xXVWnvZS97DWHgE= +golang.org/x/exp v0.0.0-20230321023759-10a507213a29 h1:ooxPy7fPvB4kwsA2h+iBNHkAbp/4JxTSwCmvdjEYmug= +golang.org/x/exp v0.0.0-20230321023759-10a507213a29/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20200618115811-c13761719519/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20201208152932-35266b937fa6/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20210216034530-4410531fe030/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= +golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= +golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= +golang.org/x/image v0.5.0/go.mod h1:FVC7BI/5Ym8R25iw5OLsgshdUBbT1h5jZTpA+mvAdZ4= +golang.org/x/image v0.6.0/go.mod h1:MXLdDR43H7cDJq5GEGXEVeeNhPgi+YYEQ2pC1byI1x0= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210304124612-50617c2ba197/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= +gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= +gonum.org/v1/gonum v0.9.3/go.mod h1:TZumC3NeyVQskjXqmyWt4S3bINhy7B4eYwW69EbyX+0= +gonum.org/v1/gonum v0.13.1-0.20230729095443-194082cf5ba1 h1:aJsuJW1HKpB/bJqnt4kuUfy9WABagWCV/e/EQyPKt1Y= +gonum.org/v1/gonum v0.13.1-0.20230729095443-194082cf5ba1/go.mod h1:ppQyMDTW6evXNiTZGYPPo4bJltmVNrKFeCnOhp1cbSQ= +gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= +gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= +gonum.org/v1/plot v0.9.0/go.mod h1:3Pcqqmp6RHvJI72kgb8fThyUnav364FOsdDo2aGW5lY= +gonum.org/v1/plot v0.10.1/go.mod h1:VZW5OlhkL1mysU9vaqNHnsy86inf6Ot+jB3r+BczCEo= +honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= +modernc.org/cc v1.0.0 h1:nPibNuDEx6tvYrUAtvDTTw98rx5juGsa5zuDnKwEEQQ= +modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= +modernc.org/golex v1.0.0 h1:wWpDlbK8ejRfSyi0frMyhilD3JBvtcx2AdGDnU+JtsE= +modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= +modernc.org/mathutil v1.0.0 h1:93vKjrJopTPrtTNpZ8XIovER7iCIH1QU7wNbOQXC60I= +modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= +modernc.org/strutil v1.1.0 h1:+1/yCzZxY2pZwwrsbH+4T7BQMoLQ9QiBshRC9eicYsc= +modernc.org/strutil v1.1.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= +modernc.org/xc v1.0.0 h1:7ccXrupWZIS3twbUGrtKmHS2DXY6xegFua+6O3xgAFU= +modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= diff --git a/internal/binding/binding.go b/internal/binding/binding.go index 1b02a4bb..746df9ba 100644 --- a/internal/binding/binding.go +++ b/internal/binding/binding.go @@ -15,8 +15,8 @@ import ( "text/template" "unsafe" - "github.com/cznic/cc" - "github.com/cznic/xc" + "modernc.org/cc" + "modernc.org/xc" ) func model() *cc.Model { @@ -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 { @@ -335,12 +335,14 @@ func Declarations(paths ...string) ([]Declaration, error) { #define __inline #define __restrict unsigned __builtin_bswap32 (unsigned x); +unsigned __builtin_bswap16 (unsigned x); unsigned long long __builtin_bswap64 (unsigned long long x); `, paths, model(), cc.IncludePaths(includePaths), cc.SysIncludePaths(sysIncludePaths), + cc.EnableAnonymousStructFields(), ) if err != nil { return nil, fmt.Errorf("binding: failed to parse %q: %v", paths, err) diff --git a/lapack/lapacke/generate.go b/lapack/lapacke/generate.go index e50c2da1..9942302f 100644 --- a/lapack/lapacke/generate.go +++ b/lapack/lapacke/generate.go @@ -1,4 +1,4 @@ -// Copyright ©2016 The gonum Authors. All rights reserved. +// Copyright ©2016 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. diff --git a/lapack/lapacke/generate_lapacke.go b/lapack/lapacke/generate_lapacke.go index bc45f0e0..c03b2adb 100644 --- a/lapack/lapacke/generate_lapacke.go +++ b/lapack/lapacke/generate_lapacke.go @@ -18,7 +18,7 @@ import ( "strings" "text/template" - "github.com/cznic/cc" + "modernc.org/cc" "gonum.org/v1/netlib/internal/binding" ) @@ -60,7 +60,7 @@ var needsInt = map[string]bool{ "geevx": true, } -// allUplo is a list of routines that allow 'A' for their uplo argument. +// allUplo is a list of routines that allow any value for their uplo argument. // The list keys are truncated by one character to cover all four numeric types. var allUplo = map[string]bool{ "lacpy": true, @@ -89,73 +89,10 @@ var cToGoTypeConv = map[string]string{ var cgoEnums = map[string]*template.Template{} -var byteTypes = map[string]string{ - "compq": "lapack.Comp", - "compz": "lapack.Comp", - - "d": "blas.Diag", - - "job": "lapack.Job", - "joba": "lapack.Job", - "jobr": "lapack.Job", - "jobp": "lapack.Job", - "jobq": "lapack.Job", - "jobt": "lapack.Job", - "jobu": "lapack.Job", - "jobu1": "lapack.Job", - "jobu2": "lapack.Job", - "jobv": "lapack.Job", - "jobv1t": "lapack.Job", - "jobv2t": "lapack.Job", - "jobvl": "lapack.Job", - "jobvr": "lapack.Job", - "jobvt": "lapack.Job", - "jobz": "lapack.Job", - - "side": "blas.Side", - - "trans": "blas.Transpose", - "trana": "blas.Transpose", - "tranb": "blas.Transpose", - "transr": "blas.Transpose", - - "ul": "blas.Uplo", - - "balanc": "byte", - "cmach": "byte", - "direct": "byte", - "dist": "byte", - "equed": "byte", - "eigsrc": "byte", - "fact": "byte", - "howmny": "byte", - "id": "byte", - "initv": "byte", - "norm": "byte", - "order": "byte", - "pack": "byte", - "sense": "byte", - "signs": "byte", - "storev": "byte", - "sym": "byte", - "typ": "byte", - "rng": "byte", - "vect": "byte", - "way": "byte", -} - -func typeForByte(n string) string { - t, ok := byteTypes[n] - if !ok { - return fmt.Sprintf("", n) - } - return t -} - var intTypes = map[string]string{ "forwrd": "int32", - "ijob": "lapack.Job", + "ijob": "byte", "wantq": "int32", "wantz": "int32", @@ -193,8 +130,8 @@ func convForIntSlice(n string) string { } var goTypes = map[binding.TypeKey]*template.Template{ - {Kind: cc.Char}: template.Must(template.New("byte").Funcs(map[string]interface{}{"typefor": typeForByte}).Parse("{{typefor .}}")), {Kind: cc.Int}: template.Must(template.New("int").Funcs(map[string]interface{}{"typefor": typeForInt}).Parse("{{typefor .}}")), + {Kind: cc.Char}: template.Must(template.New("byte").Parse("byte")), {Kind: cc.Char, IsPointer: true}: template.Must(template.New("[]byte").Parse("[]byte")), {Kind: cc.Int, IsPointer: true}: template.Must(template.New("[]int32").Parse("[]int32")), {Kind: cc.FloatComplex, IsPointer: true}: template.Must(template.New("[]complex64").Parse("[]complex64")), @@ -416,24 +353,11 @@ func uplo(buf *bytes.Buffer, d binding.Declaration, p binding.Parameter) bool { return false } lapackeName := strings.TrimSuffix(strings.TrimPrefix(d.Name, prefix), suffix) - if allUplo[lapackeName[1:]] { + if !allUplo[lapackeName[1:]] { fmt.Fprint(buf, ` switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - ul = 'A' - } -`) - } else { - fmt.Fprint(buf, ` switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' - default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } `) } @@ -445,12 +369,9 @@ func diag(buf *bytes.Buffer, d binding.Declaration, p binding.Parameter) bool { return false } fmt.Fprint(buf, ` switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } `) return true @@ -461,10 +382,7 @@ func side(buf *bytes.Buffer, d binding.Declaration, p binding.Parameter) bool { return false } fmt.Fprint(buf, ` switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } @@ -478,14 +396,9 @@ func trans(buf *bytes.Buffer, d binding.Declaration, p binding.Parameter) bool { return false } fmt.Fprintf(buf, ` switch %[1]s { - case blas.NoTrans: - %[1]s = 'N' - case blas.Trans: - %[1]s = 'T' - case blas.ConjTrans: - %[1]s = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad %[1]s") } `, n) return false @@ -515,7 +428,7 @@ func address(buf *bytes.Buffer, d binding.Declaration, p binding.Parameter) bool const handwritten = `// Code generated by "go generate gonum.org/v1/netlib/lapack/lapacke" from {{.Header}}; DO NOT EDIT. -// Copyright ©2014 The gonum Authors. All rights reserved. +// Copyright ©2014 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. @@ -531,12 +444,7 @@ package lapacke */ import "C" -import ( - "unsafe" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/lapack" -) +import "unsafe" // Type order is used to specify the matrix storage format. We still interact with // an API that allows client calls to specify order, so this is here to document that fact. diff --git a/lapack/lapacke/lapacke.go b/lapack/lapacke/lapacke.go index c7bed466..7c97baed 100644 --- a/lapack/lapacke/lapacke.go +++ b/lapack/lapacke/lapacke.go @@ -1,6 +1,6 @@ // Code generated by "go generate gonum.org/v1/netlib/lapack/lapacke" from lapacke.h; DO NOT EDIT. -// Copyright ©2014 The gonum Authors. All rights reserved. +// Copyright ©2014 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. @@ -15,12 +15,7 @@ package lapacke */ import "C" -import ( - "unsafe" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/lapack" -) +import "unsafe" // Type order is used to specify the matrix storage format. We still interact with // an API that allows client calls to specify order, so this is here to document that fact. @@ -34,14 +29,11 @@ const ( func isZero(ret C.int) bool { return ret == 0 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sbdsdc.f. -func Sbdsdc(ul blas.Uplo, compq lapack.Comp, n int, d, e, u []float32, ldu int, vt []float32, ldvt int, q []float32, iq []int32, work []float32, iwork []int32) bool { +func Sbdsdc(ul, compq byte, n int, d, e, u []float32, ldu int, vt []float32, ldvt int, q []float32, iq []int32, work []float32, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _d *float32 if len(d) > 0 { @@ -79,14 +71,11 @@ func Sbdsdc(ul blas.Uplo, compq lapack.Comp, n int, d, e, u []float32, ldu int, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dbdsdc.f. -func Dbdsdc(ul blas.Uplo, compq lapack.Comp, n int, d, e, u []float64, ldu int, vt []float64, ldvt int, q []float64, iq []int32, work []float64, iwork []int32) bool { +func Dbdsdc(ul, compq byte, n int, d, e, u []float64, ldu int, vt []float64, ldvt int, q []float64, iq []int32, work []float64, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _d *float64 if len(d) > 0 { @@ -124,14 +113,11 @@ func Dbdsdc(ul blas.Uplo, compq lapack.Comp, n int, d, e, u []float64, ldu int, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sbdsvdx.f. -func Sbdsvdx(ul blas.Uplo, jobz lapack.Job, rng byte, n int, d, e []float32, vl, vu, il, iu, ns int, s, z []float32, ldz int, work []float32, iwork []int32) bool { +func Sbdsvdx(ul, jobz, rng byte, n int, d, e []float32, vl, vu, il, iu, ns int, s, z []float32, ldz int, work []float32, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _d *float32 if len(d) > 0 { @@ -161,14 +147,11 @@ func Sbdsvdx(ul blas.Uplo, jobz lapack.Job, rng byte, n int, d, e []float32, vl, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dbdsvdx.f. -func Dbdsvdx(ul blas.Uplo, jobz lapack.Job, rng byte, n int, d, e []float64, vl, vu, il, iu, ns int, s, z []float64, ldz int, work []float64, iwork []int32) bool { +func Dbdsvdx(ul, jobz, rng byte, n int, d, e []float64, vl, vu, il, iu, ns int, s, z []float64, ldz int, work []float64, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _d *float64 if len(d) > 0 { @@ -198,14 +181,11 @@ func Dbdsvdx(ul blas.Uplo, jobz lapack.Job, rng byte, n int, d, e []float64, vl, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sbdsqr.f. -func Sbdsqr(ul blas.Uplo, n, ncvt, nru, ncc int, d, e, vt []float32, ldvt int, u []float32, ldu int, c []float32, ldc int, work []float32) bool { +func Sbdsqr(ul byte, n, ncvt, nru, ncc int, d, e, vt []float32, ldvt int, u []float32, ldu int, c []float32, ldc int, work []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _d *float32 if len(d) > 0 { @@ -235,14 +215,11 @@ func Sbdsqr(ul blas.Uplo, n, ncvt, nru, ncc int, d, e, vt []float32, ldvt int, u } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dbdsqr.f. -func Dbdsqr(ul blas.Uplo, n, ncvt, nru, ncc int, d, e, vt []float64, ldvt int, u []float64, ldu int, c []float64, ldc int, work []float64) bool { +func Dbdsqr(ul byte, n, ncvt, nru, ncc int, d, e, vt []float64, ldvt int, u []float64, ldu int, c []float64, ldc int, work []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _d *float64 if len(d) > 0 { @@ -272,14 +249,11 @@ func Dbdsqr(ul blas.Uplo, n, ncvt, nru, ncc int, d, e, vt []float64, ldvt int, u } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cbdsqr.f. -func Cbdsqr(ul blas.Uplo, n, ncvt, nru, ncc int, d, e []float32, vt []complex64, ldvt int, u []complex64, ldu int, c []complex64, ldc int, work []float32) bool { +func Cbdsqr(ul byte, n, ncvt, nru, ncc int, d, e []float32, vt []complex64, ldvt int, u []complex64, ldu int, c []complex64, ldc int, work []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _d *float32 if len(d) > 0 { @@ -309,14 +283,11 @@ func Cbdsqr(ul blas.Uplo, n, ncvt, nru, ncc int, d, e []float32, vt []complex64, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zbdsqr.f. -func Zbdsqr(ul blas.Uplo, n, ncvt, nru, ncc int, d, e []float64, vt []complex128, ldvt int, u []complex128, ldu int, c []complex128, ldc int, work []float64) bool { +func Zbdsqr(ul byte, n, ncvt, nru, ncc int, d, e []float64, vt []complex128, ldvt int, u []complex128, ldu int, c []complex128, ldc int, work []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _d *float64 if len(d) > 0 { @@ -346,7 +317,7 @@ func Zbdsqr(ul blas.Uplo, n, ncvt, nru, ncc int, d, e []float64, vt []complex128 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sdisna.f. -func Sdisna(job lapack.Job, m, n int, d, sep []float32) bool { +func Sdisna(job byte, m, n int, d, sep []float32) bool { var _d *float32 if len(d) > 0 { _d = &d[0] @@ -359,7 +330,7 @@ func Sdisna(job lapack.Job, m, n int, d, sep []float32) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ddisna.f. -func Ddisna(job lapack.Job, m, n int, d, sep []float64) bool { +func Ddisna(job byte, m, n int, d, sep []float64) bool { var _d *float64 if len(d) > 0 { _d = &d[0] @@ -844,14 +815,9 @@ func Zgbequb(m, n, kl, ku int, ab []complex128, ldab int, r, c, rowcnd, colcnd, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sgbrfs.f. -func Sgbrfs(trans blas.Transpose, n, kl, ku, nrhs int, ab []float32, ldab int, afb []float32, ldafb int, ipiv []int32, b []float32, ldb int, x []float32, ldx int, ferr, berr, work []float32, iwork []int32) bool { +func Sgbrfs(trans byte, n, kl, ku, nrhs int, ab []float32, ldab int, afb []float32, ldafb int, ipiv []int32, b []float32, ldb int, x []float32, ldx int, ferr, berr, work []float32, iwork []int32) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -895,14 +861,9 @@ func Sgbrfs(trans blas.Transpose, n, kl, ku, nrhs int, ab []float32, ldab int, a } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dgbrfs.f. -func Dgbrfs(trans blas.Transpose, n, kl, ku, nrhs int, ab []float64, ldab int, afb []float64, ldafb int, ipiv []int32, b []float64, ldb int, x []float64, ldx int, ferr, berr, work []float64, iwork []int32) bool { +func Dgbrfs(trans byte, n, kl, ku, nrhs int, ab []float64, ldab int, afb []float64, ldafb int, ipiv []int32, b []float64, ldb int, x []float64, ldx int, ferr, berr, work []float64, iwork []int32) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -946,14 +907,9 @@ func Dgbrfs(trans blas.Transpose, n, kl, ku, nrhs int, ab []float64, ldab int, a } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cgbrfs.f. -func Cgbrfs(trans blas.Transpose, n, kl, ku, nrhs int, ab []complex64, ldab int, afb []complex64, ldafb int, ipiv []int32, b []complex64, ldb int, x []complex64, ldx int, ferr, berr []float32, work []complex64, rwork []float32) bool { +func Cgbrfs(trans byte, n, kl, ku, nrhs int, ab []complex64, ldab int, afb []complex64, ldafb int, ipiv []int32, b []complex64, ldb int, x []complex64, ldx int, ferr, berr []float32, work []complex64, rwork []float32) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -997,14 +953,9 @@ func Cgbrfs(trans blas.Transpose, n, kl, ku, nrhs int, ab []complex64, ldab int, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zgbrfs.f. -func Zgbrfs(trans blas.Transpose, n, kl, ku, nrhs int, ab []complex128, ldab int, afb []complex128, ldafb int, ipiv []int32, b []complex128, ldb int, x []complex128, ldx int, ferr, berr []float64, work []complex128, rwork []float64) bool { +func Zgbrfs(trans byte, n, kl, ku, nrhs int, ab []complex128, ldab int, afb []complex128, ldafb int, ipiv []int32, b []complex128, ldb int, x []complex128, ldx int, ferr, berr []float64, work []complex128, rwork []float64) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -1116,14 +1067,9 @@ func Zgbsv(n, kl, ku, nrhs int, ab []complex128, ldab int, ipiv []int32, b []com } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sgbsvx.f. -func Sgbsvx(fact byte, trans blas.Transpose, n, kl, ku, nrhs int, ab []float32, ldab int, afb []float32, ldafb int, ipiv []int32, equed []byte, r, c, b []float32, ldb int, x []float32, ldx int, rcond, ferr, berr, work []float32, iwork []int32) bool { +func Sgbsvx(fact, trans byte, n, kl, ku, nrhs int, ab []float32, ldab int, afb []float32, ldafb int, ipiv []int32, equed []byte, r, c, b []float32, ldb int, x []float32, ldx int, rcond, ferr, berr, work []float32, iwork []int32) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -1183,14 +1129,9 @@ func Sgbsvx(fact byte, trans blas.Transpose, n, kl, ku, nrhs int, ab []float32, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dgbsvx.f. -func Dgbsvx(fact byte, trans blas.Transpose, n, kl, ku, nrhs int, ab []float64, ldab int, afb []float64, ldafb int, ipiv []int32, equed []byte, r, c, b []float64, ldb int, x []float64, ldx int, rcond, ferr, berr, work []float64, iwork []int32) bool { +func Dgbsvx(fact, trans byte, n, kl, ku, nrhs int, ab []float64, ldab int, afb []float64, ldafb int, ipiv []int32, equed []byte, r, c, b []float64, ldb int, x []float64, ldx int, rcond, ferr, berr, work []float64, iwork []int32) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -1250,14 +1191,9 @@ func Dgbsvx(fact byte, trans blas.Transpose, n, kl, ku, nrhs int, ab []float64, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cgbsvx.f. -func Cgbsvx(fact byte, trans blas.Transpose, n, kl, ku, nrhs int, ab []complex64, ldab int, afb []complex64, ldafb int, ipiv []int32, equed []byte, r, c []float32, b []complex64, ldb int, x []complex64, ldx int, rcond, ferr, berr []float32, work []complex64, rwork []float32) bool { +func Cgbsvx(fact, trans byte, n, kl, ku, nrhs int, ab []complex64, ldab int, afb []complex64, ldafb int, ipiv []int32, equed []byte, r, c []float32, b []complex64, ldb int, x []complex64, ldx int, rcond, ferr, berr []float32, work []complex64, rwork []float32) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -1317,14 +1253,9 @@ func Cgbsvx(fact byte, trans blas.Transpose, n, kl, ku, nrhs int, ab []complex64 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zgbsvx.f. -func Zgbsvx(fact byte, trans blas.Transpose, n, kl, ku, nrhs int, ab []complex128, ldab int, afb []complex128, ldafb int, ipiv []int32, equed []byte, r, c []float64, b []complex128, ldb int, x []complex128, ldx int, rcond, ferr, berr []float64, work []complex128, rwork []float64) bool { +func Zgbsvx(fact, trans byte, n, kl, ku, nrhs int, ab []complex128, ldab int, afb []complex128, ldafb int, ipiv []int32, equed []byte, r, c []float64, b []complex128, ldb int, x []complex128, ldx int, rcond, ferr, berr []float64, work []complex128, rwork []float64) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -1436,14 +1367,9 @@ func Zgbtrf(m, n, kl, ku int, ab []complex128, ldab int, ipiv []int32) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sgbtrs.f. -func Sgbtrs(trans blas.Transpose, n, kl, ku, nrhs int, ab []float32, ldab int, ipiv []int32, b []float32, ldb int) bool { +func Sgbtrs(trans byte, n, kl, ku, nrhs int, ab []float32, ldab int, ipiv []int32, b []float32, ldb int) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -1463,14 +1389,9 @@ func Sgbtrs(trans blas.Transpose, n, kl, ku, nrhs int, ab []float32, ldab int, i } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dgbtrs.f. -func Dgbtrs(trans blas.Transpose, n, kl, ku, nrhs int, ab []float64, ldab int, ipiv []int32, b []float64, ldb int) bool { +func Dgbtrs(trans byte, n, kl, ku, nrhs int, ab []float64, ldab int, ipiv []int32, b []float64, ldb int) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -1490,14 +1411,9 @@ func Dgbtrs(trans blas.Transpose, n, kl, ku, nrhs int, ab []float64, ldab int, i } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cgbtrs.f. -func Cgbtrs(trans blas.Transpose, n, kl, ku, nrhs int, ab []complex64, ldab int, ipiv []int32, b []complex64, ldb int) bool { +func Cgbtrs(trans byte, n, kl, ku, nrhs int, ab []complex64, ldab int, ipiv []int32, b []complex64, ldb int) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -1517,14 +1433,9 @@ func Cgbtrs(trans blas.Transpose, n, kl, ku, nrhs int, ab []complex64, ldab int, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zgbtrs.f. -func Zgbtrs(trans blas.Transpose, n, kl, ku, nrhs int, ab []complex128, ldab int, ipiv []int32, b []complex128, ldb int) bool { +func Zgbtrs(trans byte, n, kl, ku, nrhs int, ab []complex128, ldab int, ipiv []int32, b []complex128, ldb int) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -1544,12 +1455,9 @@ func Zgbtrs(trans blas.Transpose, n, kl, ku, nrhs int, ab []complex128, ldab int } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sgebak.f. -func Sgebak(job lapack.Job, side blas.Side, n, ilo, ihi int, scale []float32, m int, v []float32, ldv int) bool { +func Sgebak(job, side byte, n, ilo, ihi int, scale []float32, m int, v []float32, ldv int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } @@ -1565,12 +1473,9 @@ func Sgebak(job lapack.Job, side blas.Side, n, ilo, ihi int, scale []float32, m } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dgebak.f. -func Dgebak(job lapack.Job, side blas.Side, n, ilo, ihi int, scale []float64, m int, v []float64, ldv int) bool { +func Dgebak(job, side byte, n, ilo, ihi int, scale []float64, m int, v []float64, ldv int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } @@ -1586,12 +1491,9 @@ func Dgebak(job lapack.Job, side blas.Side, n, ilo, ihi int, scale []float64, m } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cgebak.f. -func Cgebak(job lapack.Job, side blas.Side, n, ilo, ihi int, scale []float32, m int, v []complex64, ldv int) bool { +func Cgebak(job, side byte, n, ilo, ihi int, scale []float32, m int, v []complex64, ldv int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } @@ -1607,12 +1509,9 @@ func Cgebak(job lapack.Job, side blas.Side, n, ilo, ihi int, scale []float32, m } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zgebak.f. -func Zgebak(job lapack.Job, side blas.Side, n, ilo, ihi int, scale []float64, m int, v []complex128, ldv int) bool { +func Zgebak(job, side byte, n, ilo, ihi int, scale []float64, m int, v []complex128, ldv int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } @@ -1628,7 +1527,7 @@ func Zgebak(job lapack.Job, side blas.Side, n, ilo, ihi int, scale []float64, m } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sgebal.f. -func Sgebal(job lapack.Job, n int, a []float32, lda int, ilo, ihi []int32, scale []float32) bool { +func Sgebal(job byte, n int, a []float32, lda int, ilo, ihi []int32, scale []float32) bool { var _a *float32 if len(a) > 0 { _a = &a[0] @@ -1649,7 +1548,7 @@ func Sgebal(job lapack.Job, n int, a []float32, lda int, ilo, ihi []int32, scale } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dgebal.f. -func Dgebal(job lapack.Job, n int, a []float64, lda int, ilo, ihi []int32, scale []float64) bool { +func Dgebal(job byte, n int, a []float64, lda int, ilo, ihi []int32, scale []float64) bool { var _a *float64 if len(a) > 0 { _a = &a[0] @@ -1670,7 +1569,7 @@ func Dgebal(job lapack.Job, n int, a []float64, lda int, ilo, ihi []int32, scale } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cgebal.f. -func Cgebal(job lapack.Job, n int, a []complex64, lda int, ilo, ihi []int32, scale []float32) bool { +func Cgebal(job byte, n int, a []complex64, lda int, ilo, ihi []int32, scale []float32) bool { var _a *complex64 if len(a) > 0 { _a = &a[0] @@ -1691,7 +1590,7 @@ func Cgebal(job lapack.Job, n int, a []complex64, lda int, ilo, ihi []int32, sca } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zgebal.f. -func Zgebal(job lapack.Job, n int, a []complex128, lda int, ilo, ihi []int32, scale []float64) bool { +func Zgebal(job byte, n int, a []complex128, lda int, ilo, ihi []int32, scale []float64) bool { var _a *complex128 if len(a) > 0 { _a = &a[0] @@ -2144,7 +2043,7 @@ func Zgeequb(m, n int, a []complex128, lda int, r, c, rowcnd, colcnd, amax []flo } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sgeev.f. -func Sgeev(jobvl, jobvr lapack.Job, n int, a []float32, lda int, wr, wi, vl []float32, ldvl int, vr []float32, ldvr int, work []float32, lwork int) int { +func Sgeev(jobvl, jobvr byte, n int, a []float32, lda int, wr, wi, vl []float32, ldvl int, vr []float32, ldvr int, work []float32, lwork int) int { var _a *float32 if len(a) > 0 { _a = &a[0] @@ -2173,7 +2072,7 @@ func Sgeev(jobvl, jobvr lapack.Job, n int, a []float32, lda int, wr, wi, vl []fl } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dgeev.f. -func Dgeev(jobvl, jobvr lapack.Job, n int, a []float64, lda int, wr, wi, vl []float64, ldvl int, vr []float64, ldvr int, work []float64, lwork int) int { +func Dgeev(jobvl, jobvr byte, n int, a []float64, lda int, wr, wi, vl []float64, ldvl int, vr []float64, ldvr int, work []float64, lwork int) int { var _a *float64 if len(a) > 0 { _a = &a[0] @@ -2202,7 +2101,7 @@ func Dgeev(jobvl, jobvr lapack.Job, n int, a []float64, lda int, wr, wi, vl []fl } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cgeev.f. -func Cgeev(jobvl, jobvr lapack.Job, n int, a []complex64, lda int, w, vl []complex64, ldvl int, vr []complex64, ldvr int, work []complex64, lwork int, rwork []float32) int { +func Cgeev(jobvl, jobvr byte, n int, a []complex64, lda int, w, vl []complex64, ldvl int, vr []complex64, ldvr int, work []complex64, lwork int, rwork []float32) int { var _a *complex64 if len(a) > 0 { _a = &a[0] @@ -2231,7 +2130,7 @@ func Cgeev(jobvl, jobvr lapack.Job, n int, a []complex64, lda int, w, vl []compl } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zgeev.f. -func Zgeev(jobvl, jobvr lapack.Job, n int, a []complex128, lda int, w, vl []complex128, ldvl int, vr []complex128, ldvr int, work []complex128, lwork int, rwork []float64) int { +func Zgeev(jobvl, jobvr byte, n int, a []complex128, lda int, w, vl []complex128, ldvl int, vr []complex128, ldvr int, work []complex128, lwork int, rwork []float64) int { var _a *complex128 if len(a) > 0 { _a = &a[0] @@ -2260,7 +2159,7 @@ func Zgeev(jobvl, jobvr lapack.Job, n int, a []complex128, lda int, w, vl []comp } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sgeevx.f. -func Sgeevx(balanc byte, jobvl, jobvr lapack.Job, sense byte, n int, a []float32, lda int, wr, wi, vl []float32, ldvl int, vr []float32, ldvr int, ilo, ihi []int32, scale, abnrm, rconde, rcondv, work []float32, lwork int, iwork []int32) int { +func Sgeevx(balanc, jobvl, jobvr, sense byte, n int, a []float32, lda int, wr, wi, vl []float32, ldvl int, vr []float32, ldvr int, ilo, ihi []int32, scale, abnrm, rconde, rcondv, work []float32, lwork int, iwork []int32) int { var _a *float32 if len(a) > 0 { _a = &a[0] @@ -2317,7 +2216,7 @@ func Sgeevx(balanc byte, jobvl, jobvr lapack.Job, sense byte, n int, a []float32 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dgeevx.f. -func Dgeevx(balanc byte, jobvl, jobvr lapack.Job, sense byte, n int, a []float64, lda int, wr, wi, vl []float64, ldvl int, vr []float64, ldvr int, ilo, ihi []int32, scale, abnrm, rconde, rcondv, work []float64, lwork int, iwork []int32) int { +func Dgeevx(balanc, jobvl, jobvr, sense byte, n int, a []float64, lda int, wr, wi, vl []float64, ldvl int, vr []float64, ldvr int, ilo, ihi []int32, scale, abnrm, rconde, rcondv, work []float64, lwork int, iwork []int32) int { var _a *float64 if len(a) > 0 { _a = &a[0] @@ -2374,7 +2273,7 @@ func Dgeevx(balanc byte, jobvl, jobvr lapack.Job, sense byte, n int, a []float64 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cgeevx.f. -func Cgeevx(balanc byte, jobvl, jobvr lapack.Job, sense byte, n int, a []complex64, lda int, w, vl []complex64, ldvl int, vr []complex64, ldvr int, ilo, ihi []int32, scale, abnrm, rconde, rcondv []float32, work []complex64, lwork int, rwork []float32) int { +func Cgeevx(balanc, jobvl, jobvr, sense byte, n int, a []complex64, lda int, w, vl []complex64, ldvl int, vr []complex64, ldvr int, ilo, ihi []int32, scale, abnrm, rconde, rcondv []float32, work []complex64, lwork int, rwork []float32) int { var _a *complex64 if len(a) > 0 { _a = &a[0] @@ -2427,7 +2326,7 @@ func Cgeevx(balanc byte, jobvl, jobvr lapack.Job, sense byte, n int, a []complex } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zgeevx.f. -func Zgeevx(balanc byte, jobvl, jobvr lapack.Job, sense byte, n int, a []complex128, lda int, w, vl []complex128, ldvl int, vr []complex128, ldvr int, ilo, ihi []int32, scale, abnrm, rconde, rcondv []float64, work []complex128, lwork int, rwork []float64) int { +func Zgeevx(balanc, jobvl, jobvr, sense byte, n int, a []complex128, lda int, w, vl []complex128, ldvl int, vr []complex128, ldvr int, ilo, ihi []int32, scale, abnrm, rconde, rcondv []float64, work []complex128, lwork int, rwork []float64) int { var _a *complex128 if len(a) > 0 { _a = &a[0] @@ -2548,7 +2447,7 @@ func Zgehrd(n, ilo, ihi int, a []complex128, lda int, tau, work []complex128, lw } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sgejsv.f. -func Sgejsv(joba, jobu, jobv, jobr, jobt, jobp lapack.Job, m, n int, a []float32, lda int, sva, u []float32, ldu int, v []float32, ldv int, work []float32, lwork int, iwork []int32) bool { +func Sgejsv(joba, jobu, jobv, jobr, jobt, jobp byte, m, n int, a []float32, lda int, sva, u []float32, ldu int, v []float32, ldv int, work []float32, lwork int, iwork []int32) bool { var _a *float32 if len(a) > 0 { _a = &a[0] @@ -2577,7 +2476,7 @@ func Sgejsv(joba, jobu, jobv, jobr, jobt, jobp lapack.Job, m, n int, a []float32 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dgejsv.f. -func Dgejsv(joba, jobu, jobv, jobr, jobt, jobp lapack.Job, m, n int, a []float64, lda int, sva, u []float64, ldu int, v []float64, ldv int, work []float64, lwork int, iwork []int32) bool { +func Dgejsv(joba, jobu, jobv, jobr, jobt, jobp byte, m, n int, a []float64, lda int, sva, u []float64, ldu int, v []float64, ldv int, work []float64, lwork int, iwork []int32) bool { var _a *float64 if len(a) > 0 { _a = &a[0] @@ -2606,7 +2505,7 @@ func Dgejsv(joba, jobu, jobv, jobr, jobt, jobp lapack.Job, m, n int, a []float64 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cgejsv.f. -func Cgejsv(joba, jobu, jobv, jobr, jobt, jobp lapack.Job, m, n int, a []complex64, lda int, sva []float32, u []complex64, ldu int, v []complex64, ldv int, cwork []complex64, lwork int, work []float32, lrwork int, iwork []int32) bool { +func Cgejsv(joba, jobu, jobv, jobr, jobt, jobp byte, m, n int, a []complex64, lda int, sva []float32, u []complex64, ldu int, v []complex64, ldv int, cwork []complex64, lwork int, work []float32, lrwork int, iwork []int32) bool { var _a *complex64 if len(a) > 0 { _a = &a[0] @@ -2639,7 +2538,7 @@ func Cgejsv(joba, jobu, jobv, jobr, jobt, jobp lapack.Job, m, n int, a []complex } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zgejsv.f. -func Zgejsv(joba, jobu, jobv, jobr, jobt, jobp lapack.Job, m, n int, a []complex128, lda int, sva []float64, u []complex128, ldu int, v []complex128, ldv int, cwork []complex128, lwork int, work []float64, lrwork int, iwork []int32) bool { +func Zgejsv(joba, jobu, jobv, jobr, jobt, jobp byte, m, n int, a []complex128, lda int, sva []float64, u []complex128, ldu int, v []complex128, ldv int, cwork []complex128, lwork int, work []float64, lrwork int, iwork []int32) bool { var _a *complex128 if len(a) > 0 { _a = &a[0] @@ -2808,14 +2707,9 @@ func Zgelqf(m, n int, a []complex128, lda int, tau, work []complex128, lwork int } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sgels.f. -func Sgels(trans blas.Transpose, m, n, nrhs int, a []float32, lda int, b []float32, ldb int, work []float32, lwork int) bool { +func Sgels(trans byte, m, n, nrhs int, a []float32, lda int, b []float32, ldb int, work []float32, lwork int) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -2835,14 +2729,9 @@ func Sgels(trans blas.Transpose, m, n, nrhs int, a []float32, lda int, b []float } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dgels.f. -func Dgels(trans blas.Transpose, m, n, nrhs int, a []float64, lda int, b []float64, ldb int, work []float64, lwork int) bool { +func Dgels(trans byte, m, n, nrhs int, a []float64, lda int, b []float64, ldb int, work []float64, lwork int) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -2862,14 +2751,9 @@ func Dgels(trans blas.Transpose, m, n, nrhs int, a []float64, lda int, b []float } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cgels.f. -func Cgels(trans blas.Transpose, m, n, nrhs int, a []complex64, lda int, b []complex64, ldb int, work []complex64, lwork int) bool { +func Cgels(trans byte, m, n, nrhs int, a []complex64, lda int, b []complex64, ldb int, work []complex64, lwork int) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -2889,14 +2773,9 @@ func Cgels(trans blas.Transpose, m, n, nrhs int, a []complex64, lda int, b []com } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zgels.f. -func Zgels(trans blas.Transpose, m, n, nrhs int, a []complex128, lda int, b []complex128, ldb int, work []complex128, lwork int) bool { +func Zgels(trans byte, m, n, nrhs int, a []complex128, lda int, b []complex128, ldb int, work []complex128, lwork int) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -3620,14 +3499,9 @@ func Zgeqrfp(m, n int, a []complex128, lda int, tau, work []complex128, lwork in } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sgerfs.f. -func Sgerfs(trans blas.Transpose, n, nrhs int, a []float32, lda int, af []float32, ldaf int, ipiv []int32, b []float32, ldb int, x []float32, ldx int, ferr, berr, work []float32, iwork []int32) bool { +func Sgerfs(trans byte, n, nrhs int, a []float32, lda int, af []float32, ldaf int, ipiv []int32, b []float32, ldb int, x []float32, ldx int, ferr, berr, work []float32, iwork []int32) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -3671,14 +3545,9 @@ func Sgerfs(trans blas.Transpose, n, nrhs int, a []float32, lda int, af []float3 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dgerfs.f. -func Dgerfs(trans blas.Transpose, n, nrhs int, a []float64, lda int, af []float64, ldaf int, ipiv []int32, b []float64, ldb int, x []float64, ldx int, ferr, berr, work []float64, iwork []int32) bool { +func Dgerfs(trans byte, n, nrhs int, a []float64, lda int, af []float64, ldaf int, ipiv []int32, b []float64, ldb int, x []float64, ldx int, ferr, berr, work []float64, iwork []int32) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -3722,14 +3591,9 @@ func Dgerfs(trans blas.Transpose, n, nrhs int, a []float64, lda int, af []float6 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cgerfs.f. -func Cgerfs(trans blas.Transpose, n, nrhs int, a []complex64, lda int, af []complex64, ldaf int, ipiv []int32, b []complex64, ldb int, x []complex64, ldx int, ferr, berr []float32, work []complex64, rwork []float32) bool { +func Cgerfs(trans byte, n, nrhs int, a []complex64, lda int, af []complex64, ldaf int, ipiv []int32, b []complex64, ldb int, x []complex64, ldx int, ferr, berr []float32, work []complex64, rwork []float32) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -3773,14 +3637,9 @@ func Cgerfs(trans blas.Transpose, n, nrhs int, a []complex64, lda int, af []comp } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zgerfs.f. -func Zgerfs(trans blas.Transpose, n, nrhs int, a []complex128, lda int, af []complex128, ldaf int, ipiv []int32, b []complex128, ldb int, x []complex128, ldx int, ferr, berr []float64, work []complex128, rwork []float64) bool { +func Zgerfs(trans byte, n, nrhs int, a []complex128, lda int, af []complex128, ldaf int, ipiv []int32, b []complex128, ldb int, x []complex128, ldx int, ferr, berr []float64, work []complex128, rwork []float64) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -3892,7 +3751,7 @@ func Zgerqf(m, n int, a []complex128, lda int, tau, work []complex128, lwork int } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sgesdd.f. -func Sgesdd(jobz lapack.Job, m, n int, a []float32, lda int, s, u []float32, ldu int, vt []float32, ldvt int, work []float32, lwork int, iwork []int32) bool { +func Sgesdd(jobz byte, m, n int, a []float32, lda int, s, u []float32, ldu int, vt []float32, ldvt int, work []float32, lwork int, iwork []int32) bool { var _a *float32 if len(a) > 0 { _a = &a[0] @@ -3921,7 +3780,7 @@ func Sgesdd(jobz lapack.Job, m, n int, a []float32, lda int, s, u []float32, ldu } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dgesdd.f. -func Dgesdd(jobz lapack.Job, m, n int, a []float64, lda int, s, u []float64, ldu int, vt []float64, ldvt int, work []float64, lwork int, iwork []int32) bool { +func Dgesdd(jobz byte, m, n int, a []float64, lda int, s, u []float64, ldu int, vt []float64, ldvt int, work []float64, lwork int, iwork []int32) bool { var _a *float64 if len(a) > 0 { _a = &a[0] @@ -3950,7 +3809,7 @@ func Dgesdd(jobz lapack.Job, m, n int, a []float64, lda int, s, u []float64, ldu } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cgesdd.f. -func Cgesdd(jobz lapack.Job, m, n int, a []complex64, lda int, s []float32, u []complex64, ldu int, vt []complex64, ldvt int, work []complex64, lwork int, rwork []float32, iwork []int32) bool { +func Cgesdd(jobz byte, m, n int, a []complex64, lda int, s []float32, u []complex64, ldu int, vt []complex64, ldvt int, work []complex64, lwork int, rwork []float32, iwork []int32) bool { var _a *complex64 if len(a) > 0 { _a = &a[0] @@ -3983,7 +3842,7 @@ func Cgesdd(jobz lapack.Job, m, n int, a []complex64, lda int, s []float32, u [] } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zgesdd.f. -func Zgesdd(jobz lapack.Job, m, n int, a []complex128, lda int, s []float64, u []complex128, ldu int, vt []complex128, ldvt int, work []complex128, lwork int, rwork []float64, iwork []int32) bool { +func Zgesdd(jobz byte, m, n int, a []complex128, lda int, s []float64, u []complex128, ldu int, vt []complex128, ldvt int, work []complex128, lwork int, rwork []float64, iwork []int32) bool { var _a *complex128 if len(a) > 0 { _a = &a[0] @@ -4154,7 +4013,7 @@ func Zcgesv(n, nrhs int, a []complex128, lda int, ipiv []int32, b []complex128, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sgesvd.f. -func Sgesvd(jobu, jobvt lapack.Job, m, n int, a []float32, lda int, s, u []float32, ldu int, vt []float32, ldvt int, work []float32, lwork int) bool { +func Sgesvd(jobu, jobvt byte, m, n int, a []float32, lda int, s, u []float32, ldu int, vt []float32, ldvt int, work []float32, lwork int) bool { var _a *float32 if len(a) > 0 { _a = &a[0] @@ -4179,7 +4038,7 @@ func Sgesvd(jobu, jobvt lapack.Job, m, n int, a []float32, lda int, s, u []float } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dgesvd.f. -func Dgesvd(jobu, jobvt lapack.Job, m, n int, a []float64, lda int, s, u []float64, ldu int, vt []float64, ldvt int, work []float64, lwork int) bool { +func Dgesvd(jobu, jobvt byte, m, n int, a []float64, lda int, s, u []float64, ldu int, vt []float64, ldvt int, work []float64, lwork int) bool { var _a *float64 if len(a) > 0 { _a = &a[0] @@ -4204,7 +4063,7 @@ func Dgesvd(jobu, jobvt lapack.Job, m, n int, a []float64, lda int, s, u []float } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cgesvd.f. -func Cgesvd(jobu, jobvt lapack.Job, m, n int, a []complex64, lda int, s []float32, u []complex64, ldu int, vt []complex64, ldvt int, work []complex64, lwork int, rwork []float32) bool { +func Cgesvd(jobu, jobvt byte, m, n int, a []complex64, lda int, s []float32, u []complex64, ldu int, vt []complex64, ldvt int, work []complex64, lwork int, rwork []float32) bool { var _a *complex64 if len(a) > 0 { _a = &a[0] @@ -4233,7 +4092,7 @@ func Cgesvd(jobu, jobvt lapack.Job, m, n int, a []complex64, lda int, s []float3 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zgesvd.f. -func Zgesvd(jobu, jobvt lapack.Job, m, n int, a []complex128, lda int, s []float64, u []complex128, ldu int, vt []complex128, ldvt int, work []complex128, lwork int, rwork []float64) bool { +func Zgesvd(jobu, jobvt byte, m, n int, a []complex128, lda int, s []float64, u []complex128, ldu int, vt []complex128, ldvt int, work []complex128, lwork int, rwork []float64) bool { var _a *complex128 if len(a) > 0 { _a = &a[0] @@ -4262,7 +4121,7 @@ func Zgesvd(jobu, jobvt lapack.Job, m, n int, a []complex128, lda int, s []float } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sgesvdx.f. -func Sgesvdx(jobu, jobvt lapack.Job, rng byte, m, n int, a []float32, lda, vl, vu, il, iu, ns int, s, u []float32, ldu int, vt []float32, ldvt int, work []float32, lwork int, iwork []int32) bool { +func Sgesvdx(jobu, jobvt, rng byte, m, n int, a []float32, lda, vl, vu, il, iu, ns int, s, u []float32, ldu int, vt []float32, ldvt int, work []float32, lwork int, iwork []int32) bool { var _a *float32 if len(a) > 0 { _a = &a[0] @@ -4291,7 +4150,7 @@ func Sgesvdx(jobu, jobvt lapack.Job, rng byte, m, n int, a []float32, lda, vl, v } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dgesvdx.f. -func Dgesvdx(jobu, jobvt lapack.Job, rng byte, m, n int, a []float64, lda, vl, vu, il, iu, ns int, s, u []float64, ldu int, vt []float64, ldvt int, work []float64, lwork int, iwork []int32) bool { +func Dgesvdx(jobu, jobvt, rng byte, m, n int, a []float64, lda, vl, vu, il, iu, ns int, s, u []float64, ldu int, vt []float64, ldvt int, work []float64, lwork int, iwork []int32) bool { var _a *float64 if len(a) > 0 { _a = &a[0] @@ -4320,7 +4179,7 @@ func Dgesvdx(jobu, jobvt lapack.Job, rng byte, m, n int, a []float64, lda, vl, v } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cgesvdx.f. -func Cgesvdx(jobu, jobvt lapack.Job, rng byte, m, n int, a []complex64, lda, vl, vu, il, iu, ns int, s []float32, u []complex64, ldu int, vt []complex64, ldvt int, work []complex64, lwork int, rwork []float32, iwork []int32) bool { +func Cgesvdx(jobu, jobvt, rng byte, m, n int, a []complex64, lda, vl, vu, il, iu, ns int, s []float32, u []complex64, ldu int, vt []complex64, ldvt int, work []complex64, lwork int, rwork []float32, iwork []int32) bool { var _a *complex64 if len(a) > 0 { _a = &a[0] @@ -4353,7 +4212,7 @@ func Cgesvdx(jobu, jobvt lapack.Job, rng byte, m, n int, a []complex64, lda, vl, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zgesvdx.f. -func Zgesvdx(jobu, jobvt lapack.Job, rng byte, m, n int, a []complex128, lda, vl, vu, il, iu, ns int, s []float64, u []complex128, ldu int, vt []complex128, ldvt int, work []complex128, lwork int, rwork []float64, iwork []int32) bool { +func Zgesvdx(jobu, jobvt, rng byte, m, n int, a []complex128, lda, vl, vu, il, iu, ns int, s []float64, u []complex128, ldu int, vt []complex128, ldvt int, work []complex128, lwork int, rwork []float64, iwork []int32) bool { var _a *complex128 if len(a) > 0 { _a = &a[0] @@ -4386,7 +4245,7 @@ func Zgesvdx(jobu, jobvt lapack.Job, rng byte, m, n int, a []complex128, lda, vl } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sgesvj.f. -func Sgesvj(joba, jobu, jobv lapack.Job, m, n int, a []float32, lda int, sva []float32, mv int, v []float32, ldv int, work []float32, lwork int) bool { +func Sgesvj(joba, jobu, jobv byte, m, n int, a []float32, lda int, sva []float32, mv int, v []float32, ldv int, work []float32, lwork int) bool { var _a *float32 if len(a) > 0 { _a = &a[0] @@ -4407,7 +4266,7 @@ func Sgesvj(joba, jobu, jobv lapack.Job, m, n int, a []float32, lda int, sva []f } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dgesvj.f. -func Dgesvj(joba, jobu, jobv lapack.Job, m, n int, a []float64, lda int, sva []float64, mv int, v []float64, ldv int, work []float64, lwork int) bool { +func Dgesvj(joba, jobu, jobv byte, m, n int, a []float64, lda int, sva []float64, mv int, v []float64, ldv int, work []float64, lwork int) bool { var _a *float64 if len(a) > 0 { _a = &a[0] @@ -4428,7 +4287,7 @@ func Dgesvj(joba, jobu, jobv lapack.Job, m, n int, a []float64, lda int, sva []f } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cgesvj.f. -func Cgesvj(joba, jobu, jobv lapack.Job, m, n int, a []complex64, lda int, sva []float32, mv int, v []complex64, ldv int, cwork []complex64, lwork int, rwork []float32, lrwork int) bool { +func Cgesvj(joba, jobu, jobv byte, m, n int, a []complex64, lda int, sva []float32, mv int, v []complex64, ldv int, cwork []complex64, lwork int, rwork []float32, lrwork int) bool { var _a *complex64 if len(a) > 0 { _a = &a[0] @@ -4453,7 +4312,7 @@ func Cgesvj(joba, jobu, jobv lapack.Job, m, n int, a []complex64, lda int, sva [ } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zgesvj.f. -func Zgesvj(joba, jobu, jobv lapack.Job, m, n int, a []complex128, lda int, sva []float64, mv int, v []complex128, ldv int, cwork []complex128, lwork int, rwork []float64, lrwork int) bool { +func Zgesvj(joba, jobu, jobv byte, m, n int, a []complex128, lda int, sva []float64, mv int, v []complex128, ldv int, cwork []complex128, lwork int, rwork []float64, lrwork int) bool { var _a *complex128 if len(a) > 0 { _a = &a[0] @@ -4478,14 +4337,9 @@ func Zgesvj(joba, jobu, jobv lapack.Job, m, n int, a []complex128, lda int, sva } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sgesvx.f. -func Sgesvx(fact byte, trans blas.Transpose, n, nrhs int, a []float32, lda int, af []float32, ldaf int, ipiv []int32, equed []byte, r, c, b []float32, ldb int, x []float32, ldx int, rcond, ferr, berr, work []float32, iwork []int32) bool { +func Sgesvx(fact, trans byte, n, nrhs int, a []float32, lda int, af []float32, ldaf int, ipiv []int32, equed []byte, r, c, b []float32, ldb int, x []float32, ldx int, rcond, ferr, berr, work []float32, iwork []int32) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -4545,14 +4399,9 @@ func Sgesvx(fact byte, trans blas.Transpose, n, nrhs int, a []float32, lda int, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dgesvx.f. -func Dgesvx(fact byte, trans blas.Transpose, n, nrhs int, a []float64, lda int, af []float64, ldaf int, ipiv []int32, equed []byte, r, c, b []float64, ldb int, x []float64, ldx int, rcond, ferr, berr, work []float64, iwork []int32) bool { +func Dgesvx(fact, trans byte, n, nrhs int, a []float64, lda int, af []float64, ldaf int, ipiv []int32, equed []byte, r, c, b []float64, ldb int, x []float64, ldx int, rcond, ferr, berr, work []float64, iwork []int32) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -4612,14 +4461,9 @@ func Dgesvx(fact byte, trans blas.Transpose, n, nrhs int, a []float64, lda int, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cgesvx.f. -func Cgesvx(fact byte, trans blas.Transpose, n, nrhs int, a []complex64, lda int, af []complex64, ldaf int, ipiv []int32, equed []byte, r, c []float32, b []complex64, ldb int, x []complex64, ldx int, rcond, ferr, berr []float32, work []complex64, rwork []float32) bool { +func Cgesvx(fact, trans byte, n, nrhs int, a []complex64, lda int, af []complex64, ldaf int, ipiv []int32, equed []byte, r, c []float32, b []complex64, ldb int, x []complex64, ldx int, rcond, ferr, berr []float32, work []complex64, rwork []float32) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -4679,14 +4523,9 @@ func Cgesvx(fact byte, trans blas.Transpose, n, nrhs int, a []complex64, lda int } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zgesvx.f. -func Zgesvx(fact byte, trans blas.Transpose, n, nrhs int, a []complex128, lda int, af []complex128, ldaf int, ipiv []int32, equed []byte, r, c []float64, b []complex128, ldb int, x []complex128, ldx int, rcond, ferr, berr []float64, work []complex128, rwork []float64) bool { +func Zgesvx(fact, trans byte, n, nrhs int, a []complex128, lda int, af []complex128, ldaf int, ipiv []int32, equed []byte, r, c []float64, b []complex128, ldb int, x []complex128, ldx int, rcond, ferr, berr []float64, work []complex128, rwork []float64) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -4970,14 +4809,9 @@ func Zgetri(n int, a []complex128, lda int, ipiv []int32, work []complex128, lwo } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sgetrs.f. -func Sgetrs(trans blas.Transpose, n, nrhs int, a []float32, lda int, ipiv []int32, b []float32, ldb int) bool { +func Sgetrs(trans byte, n, nrhs int, a []float32, lda int, ipiv []int32, b []float32, ldb int) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -4997,14 +4831,9 @@ func Sgetrs(trans blas.Transpose, n, nrhs int, a []float32, lda int, ipiv []int3 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dgetrs.f. -func Dgetrs(trans blas.Transpose, n, nrhs int, a []float64, lda int, ipiv []int32, b []float64, ldb int) bool { +func Dgetrs(trans byte, n, nrhs int, a []float64, lda int, ipiv []int32, b []float64, ldb int) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -5024,14 +4853,9 @@ func Dgetrs(trans blas.Transpose, n, nrhs int, a []float64, lda int, ipiv []int3 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cgetrs.f. -func Cgetrs(trans blas.Transpose, n, nrhs int, a []complex64, lda int, ipiv []int32, b []complex64, ldb int) bool { +func Cgetrs(trans byte, n, nrhs int, a []complex64, lda int, ipiv []int32, b []complex64, ldb int) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -5051,14 +4875,9 @@ func Cgetrs(trans blas.Transpose, n, nrhs int, a []complex64, lda int, ipiv []in } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zgetrs.f. -func Zgetrs(trans blas.Transpose, n, nrhs int, a []complex128, lda int, ipiv []int32, b []complex128, ldb int) bool { +func Zgetrs(trans byte, n, nrhs int, a []complex128, lda int, ipiv []int32, b []complex128, ldb int) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -5078,12 +4897,9 @@ func Zgetrs(trans blas.Transpose, n, nrhs int, a []complex128, lda int, ipiv []i } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sggbak.f. -func Sggbak(job lapack.Job, side blas.Side, n, ilo, ihi int, lscale, rscale []float32, m int, v []float32, ldv int) bool { +func Sggbak(job, side byte, n, ilo, ihi int, lscale, rscale []float32, m int, v []float32, ldv int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } @@ -5103,12 +4919,9 @@ func Sggbak(job lapack.Job, side blas.Side, n, ilo, ihi int, lscale, rscale []fl } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dggbak.f. -func Dggbak(job lapack.Job, side blas.Side, n, ilo, ihi int, lscale, rscale []float64, m int, v []float64, ldv int) bool { +func Dggbak(job, side byte, n, ilo, ihi int, lscale, rscale []float64, m int, v []float64, ldv int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } @@ -5128,12 +4941,9 @@ func Dggbak(job lapack.Job, side blas.Side, n, ilo, ihi int, lscale, rscale []fl } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cggbak.f. -func Cggbak(job lapack.Job, side blas.Side, n, ilo, ihi int, lscale, rscale []float32, m int, v []complex64, ldv int) bool { +func Cggbak(job, side byte, n, ilo, ihi int, lscale, rscale []float32, m int, v []complex64, ldv int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } @@ -5153,12 +4963,9 @@ func Cggbak(job lapack.Job, side blas.Side, n, ilo, ihi int, lscale, rscale []fl } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zggbak.f. -func Zggbak(job lapack.Job, side blas.Side, n, ilo, ihi int, lscale, rscale []float64, m int, v []complex128, ldv int) bool { +func Zggbak(job, side byte, n, ilo, ihi int, lscale, rscale []float64, m int, v []complex128, ldv int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } @@ -5178,7 +4985,7 @@ func Zggbak(job lapack.Job, side blas.Side, n, ilo, ihi int, lscale, rscale []fl } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sggbal.f. -func Sggbal(job lapack.Job, n int, a []float32, lda int, b []float32, ldb int, ilo, ihi []int32, lscale, rscale, work []float32) bool { +func Sggbal(job byte, n int, a []float32, lda int, b []float32, ldb int, ilo, ihi []int32, lscale, rscale, work []float32) bool { var _a *float32 if len(a) > 0 { _a = &a[0] @@ -5211,7 +5018,7 @@ func Sggbal(job lapack.Job, n int, a []float32, lda int, b []float32, ldb int, i } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dggbal.f. -func Dggbal(job lapack.Job, n int, a []float64, lda int, b []float64, ldb int, ilo, ihi []int32, lscale, rscale, work []float64) bool { +func Dggbal(job byte, n int, a []float64, lda int, b []float64, ldb int, ilo, ihi []int32, lscale, rscale, work []float64) bool { var _a *float64 if len(a) > 0 { _a = &a[0] @@ -5244,7 +5051,7 @@ func Dggbal(job lapack.Job, n int, a []float64, lda int, b []float64, ldb int, i } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cggbal.f. -func Cggbal(job lapack.Job, n int, a []complex64, lda int, b []complex64, ldb int, ilo, ihi []int32, lscale, rscale, work []float32) bool { +func Cggbal(job byte, n int, a []complex64, lda int, b []complex64, ldb int, ilo, ihi []int32, lscale, rscale, work []float32) bool { var _a *complex64 if len(a) > 0 { _a = &a[0] @@ -5277,7 +5084,7 @@ func Cggbal(job lapack.Job, n int, a []complex64, lda int, b []complex64, ldb in } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zggbal.f. -func Zggbal(job lapack.Job, n int, a []complex128, lda int, b []complex128, ldb int, ilo, ihi []int32, lscale, rscale, work []float64) bool { +func Zggbal(job byte, n int, a []complex128, lda int, b []complex128, ldb int, ilo, ihi []int32, lscale, rscale, work []float64) bool { var _a *complex128 if len(a) > 0 { _a = &a[0] @@ -5310,7 +5117,7 @@ func Zggbal(job lapack.Job, n int, a []complex128, lda int, b []complex128, ldb } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sggev.f. -func Sggev(jobvl, jobvr lapack.Job, n int, a []float32, lda int, b []float32, ldb int, alphar, alphai, beta, vl []float32, ldvl int, vr []float32, ldvr int, work []float32, lwork int) bool { +func Sggev(jobvl, jobvr byte, n int, a []float32, lda int, b []float32, ldb int, alphar, alphai, beta, vl []float32, ldvl int, vr []float32, ldvr int, work []float32, lwork int) bool { var _a *float32 if len(a) > 0 { _a = &a[0] @@ -5347,7 +5154,7 @@ func Sggev(jobvl, jobvr lapack.Job, n int, a []float32, lda int, b []float32, ld } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dggev.f. -func Dggev(jobvl, jobvr lapack.Job, n int, a []float64, lda int, b []float64, ldb int, alphar, alphai, beta, vl []float64, ldvl int, vr []float64, ldvr int, work []float64, lwork int) bool { +func Dggev(jobvl, jobvr byte, n int, a []float64, lda int, b []float64, ldb int, alphar, alphai, beta, vl []float64, ldvl int, vr []float64, ldvr int, work []float64, lwork int) bool { var _a *float64 if len(a) > 0 { _a = &a[0] @@ -5384,7 +5191,7 @@ func Dggev(jobvl, jobvr lapack.Job, n int, a []float64, lda int, b []float64, ld } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cggev.f. -func Cggev(jobvl, jobvr lapack.Job, n int, a []complex64, lda int, b []complex64, ldb int, alpha, beta, vl []complex64, ldvl int, vr []complex64, ldvr int, work []complex64, lwork int, rwork []float32) bool { +func Cggev(jobvl, jobvr byte, n int, a []complex64, lda int, b []complex64, ldb int, alpha, beta, vl []complex64, ldvl int, vr []complex64, ldvr int, work []complex64, lwork int, rwork []float32) bool { var _a *complex64 if len(a) > 0 { _a = &a[0] @@ -5421,7 +5228,7 @@ func Cggev(jobvl, jobvr lapack.Job, n int, a []complex64, lda int, b []complex64 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zggev.f. -func Zggev(jobvl, jobvr lapack.Job, n int, a []complex128, lda int, b []complex128, ldb int, alpha, beta, vl []complex128, ldvl int, vr []complex128, ldvr int, work []complex128, lwork int, rwork []float64) bool { +func Zggev(jobvl, jobvr byte, n int, a []complex128, lda int, b []complex128, ldb int, alpha, beta, vl []complex128, ldvl int, vr []complex128, ldvr int, work []complex128, lwork int, rwork []float64) bool { var _a *complex128 if len(a) > 0 { _a = &a[0] @@ -5458,7 +5265,7 @@ func Zggev(jobvl, jobvr lapack.Job, n int, a []complex128, lda int, b []complex1 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sggev3.f. -func Sggev3(jobvl, jobvr lapack.Job, n int, a []float32, lda int, b []float32, ldb int, alphar, alphai, beta, vl []float32, ldvl int, vr []float32, ldvr int, work []float32, lwork int) bool { +func Sggev3(jobvl, jobvr byte, n int, a []float32, lda int, b []float32, ldb int, alphar, alphai, beta, vl []float32, ldvl int, vr []float32, ldvr int, work []float32, lwork int) bool { var _a *float32 if len(a) > 0 { _a = &a[0] @@ -5495,7 +5302,7 @@ func Sggev3(jobvl, jobvr lapack.Job, n int, a []float32, lda int, b []float32, l } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dggev3.f. -func Dggev3(jobvl, jobvr lapack.Job, n int, a []float64, lda int, b []float64, ldb int, alphar, alphai, beta, vl []float64, ldvl int, vr []float64, ldvr int, work []float64, lwork int) bool { +func Dggev3(jobvl, jobvr byte, n int, a []float64, lda int, b []float64, ldb int, alphar, alphai, beta, vl []float64, ldvl int, vr []float64, ldvr int, work []float64, lwork int) bool { var _a *float64 if len(a) > 0 { _a = &a[0] @@ -5532,7 +5339,7 @@ func Dggev3(jobvl, jobvr lapack.Job, n int, a []float64, lda int, b []float64, l } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cggev3.f. -func Cggev3(jobvl, jobvr lapack.Job, n int, a []complex64, lda int, b []complex64, ldb int, alpha, beta, vl []complex64, ldvl int, vr []complex64, ldvr int, work []complex64, lwork int, rwork []float32) bool { +func Cggev3(jobvl, jobvr byte, n int, a []complex64, lda int, b []complex64, ldb int, alpha, beta, vl []complex64, ldvl int, vr []complex64, ldvr int, work []complex64, lwork int, rwork []float32) bool { var _a *complex64 if len(a) > 0 { _a = &a[0] @@ -5569,7 +5376,7 @@ func Cggev3(jobvl, jobvr lapack.Job, n int, a []complex64, lda int, b []complex6 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zggev3.f. -func Zggev3(jobvl, jobvr lapack.Job, n int, a []complex128, lda int, b []complex128, ldb int, alpha, beta, vl []complex128, ldvl int, vr []complex128, ldvr int, work []complex128, lwork int, rwork []float64) bool { +func Zggev3(jobvl, jobvr byte, n int, a []complex128, lda int, b []complex128, ldb int, alpha, beta, vl []complex128, ldvl int, vr []complex128, ldvr int, work []complex128, lwork int, rwork []float64) bool { var _a *complex128 if len(a) > 0 { _a = &a[0] @@ -5606,7 +5413,7 @@ func Zggev3(jobvl, jobvr lapack.Job, n int, a []complex128, lda int, b []complex } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sggevx.f. -func Sggevx(balanc byte, jobvl, jobvr lapack.Job, sense byte, n int, a []float32, lda int, b []float32, ldb int, alphar, alphai, beta, vl []float32, ldvl int, vr []float32, ldvr int, ilo, ihi []int32, lscale, rscale, abnrm, bbnrm, rconde, rcondv, work []float32, lwork int, iwork, bwork []int32) bool { +func Sggevx(balanc, jobvl, jobvr, sense byte, n int, a []float32, lda int, b []float32, ldb int, alphar, alphai, beta, vl []float32, ldvl int, vr []float32, ldvr int, ilo, ihi []int32, lscale, rscale, abnrm, bbnrm, rconde, rcondv, work []float32, lwork int, iwork, bwork []int32) bool { var _a *float32 if len(a) > 0 { _a = &a[0] @@ -5683,7 +5490,7 @@ func Sggevx(balanc byte, jobvl, jobvr lapack.Job, sense byte, n int, a []float32 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dggevx.f. -func Dggevx(balanc byte, jobvl, jobvr lapack.Job, sense byte, n int, a []float64, lda int, b []float64, ldb int, alphar, alphai, beta, vl []float64, ldvl int, vr []float64, ldvr int, ilo, ihi []int32, lscale, rscale, abnrm, bbnrm, rconde, rcondv, work []float64, lwork int, iwork, bwork []int32) bool { +func Dggevx(balanc, jobvl, jobvr, sense byte, n int, a []float64, lda int, b []float64, ldb int, alphar, alphai, beta, vl []float64, ldvl int, vr []float64, ldvr int, ilo, ihi []int32, lscale, rscale, abnrm, bbnrm, rconde, rcondv, work []float64, lwork int, iwork, bwork []int32) bool { var _a *float64 if len(a) > 0 { _a = &a[0] @@ -5760,7 +5567,7 @@ func Dggevx(balanc byte, jobvl, jobvr lapack.Job, sense byte, n int, a []float64 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cggevx.f. -func Cggevx(balanc byte, jobvl, jobvr lapack.Job, sense byte, n int, a []complex64, lda int, b []complex64, ldb int, alpha, beta, vl []complex64, ldvl int, vr []complex64, ldvr int, ilo, ihi []int32, lscale, rscale, abnrm, bbnrm, rconde, rcondv []float32, work []complex64, lwork int, rwork []float32, iwork, bwork []int32) bool { +func Cggevx(balanc, jobvl, jobvr, sense byte, n int, a []complex64, lda int, b []complex64, ldb int, alpha, beta, vl []complex64, ldvl int, vr []complex64, ldvr int, ilo, ihi []int32, lscale, rscale, abnrm, bbnrm, rconde, rcondv []float32, work []complex64, lwork int, rwork []float32, iwork, bwork []int32) bool { var _a *complex64 if len(a) > 0 { _a = &a[0] @@ -5837,7 +5644,7 @@ func Cggevx(balanc byte, jobvl, jobvr lapack.Job, sense byte, n int, a []complex } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zggevx.f. -func Zggevx(balanc byte, jobvl, jobvr lapack.Job, sense byte, n int, a []complex128, lda int, b []complex128, ldb int, alpha, beta, vl []complex128, ldvl int, vr []complex128, ldvr int, ilo, ihi []int32, lscale, rscale, abnrm, bbnrm, rconde, rcondv []float64, work []complex128, lwork int, rwork []float64, iwork, bwork []int32) bool { +func Zggevx(balanc, jobvl, jobvr, sense byte, n int, a []complex128, lda int, b []complex128, ldb int, alpha, beta, vl []complex128, ldvl int, vr []complex128, ldvr int, ilo, ihi []int32, lscale, rscale, abnrm, bbnrm, rconde, rcondv []float64, work []complex128, lwork int, rwork []float64, iwork, bwork []int32) bool { var _a *complex128 if len(a) > 0 { _a = &a[0] @@ -6030,7 +5837,7 @@ func Zggglm(n, m, p int, a []complex128, lda int, b []complex128, ldb int, d, x, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sgghrd.f. -func Sgghrd(compq, compz lapack.Comp, n, ilo, ihi int, a []float32, lda int, b []float32, ldb int, q []float32, ldq int, z []float32, ldz int) bool { +func Sgghrd(compq, compz byte, n, ilo, ihi int, a []float32, lda int, b []float32, ldb int, q []float32, ldq int, z []float32, ldz int) bool { var _a *float32 if len(a) > 0 { _a = &a[0] @@ -6051,7 +5858,7 @@ func Sgghrd(compq, compz lapack.Comp, n, ilo, ihi int, a []float32, lda int, b [ } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dgghrd.f. -func Dgghrd(compq, compz lapack.Comp, n, ilo, ihi int, a []float64, lda int, b []float64, ldb int, q []float64, ldq int, z []float64, ldz int) bool { +func Dgghrd(compq, compz byte, n, ilo, ihi int, a []float64, lda int, b []float64, ldb int, q []float64, ldq int, z []float64, ldz int) bool { var _a *float64 if len(a) > 0 { _a = &a[0] @@ -6072,7 +5879,7 @@ func Dgghrd(compq, compz lapack.Comp, n, ilo, ihi int, a []float64, lda int, b [ } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cgghrd.f. -func Cgghrd(compq, compz lapack.Comp, n, ilo, ihi int, a []complex64, lda int, b []complex64, ldb int, q []complex64, ldq int, z []complex64, ldz int) bool { +func Cgghrd(compq, compz byte, n, ilo, ihi int, a []complex64, lda int, b []complex64, ldb int, q []complex64, ldq int, z []complex64, ldz int) bool { var _a *complex64 if len(a) > 0 { _a = &a[0] @@ -6093,7 +5900,7 @@ func Cgghrd(compq, compz lapack.Comp, n, ilo, ihi int, a []complex64, lda int, b } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zgghrd.f. -func Zgghrd(compq, compz lapack.Comp, n, ilo, ihi int, a []complex128, lda int, b []complex128, ldb int, q []complex128, ldq int, z []complex128, ldz int) bool { +func Zgghrd(compq, compz byte, n, ilo, ihi int, a []complex128, lda int, b []complex128, ldb int, q []complex128, ldq int, z []complex128, ldz int) bool { var _a *complex128 if len(a) > 0 { _a = &a[0] @@ -6114,7 +5921,7 @@ func Zgghrd(compq, compz lapack.Comp, n, ilo, ihi int, a []complex128, lda int, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sgghd3.f. -func Sgghd3(compq, compz lapack.Comp, n, ilo, ihi int, a []float32, lda int, b []float32, ldb int, q []float32, ldq int, z []float32, ldz int, work []float32, lwork int) bool { +func Sgghd3(compq, compz byte, n, ilo, ihi int, a []float32, lda int, b []float32, ldb int, q []float32, ldq int, z []float32, ldz int, work []float32, lwork int) bool { var _a *float32 if len(a) > 0 { _a = &a[0] @@ -6139,7 +5946,7 @@ func Sgghd3(compq, compz lapack.Comp, n, ilo, ihi int, a []float32, lda int, b [ } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dgghd3.f. -func Dgghd3(compq, compz lapack.Comp, n, ilo, ihi int, a []float64, lda int, b []float64, ldb int, q []float64, ldq int, z []float64, ldz int, work []float64, lwork int) bool { +func Dgghd3(compq, compz byte, n, ilo, ihi int, a []float64, lda int, b []float64, ldb int, q []float64, ldq int, z []float64, ldz int, work []float64, lwork int) bool { var _a *float64 if len(a) > 0 { _a = &a[0] @@ -6164,7 +5971,7 @@ func Dgghd3(compq, compz lapack.Comp, n, ilo, ihi int, a []float64, lda int, b [ } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cgghd3.f. -func Cgghd3(compq, compz lapack.Comp, n, ilo, ihi int, a []complex64, lda int, b []complex64, ldb int, q []complex64, ldq int, z []complex64, ldz int, work []complex64, lwork int) bool { +func Cgghd3(compq, compz byte, n, ilo, ihi int, a []complex64, lda int, b []complex64, ldb int, q []complex64, ldq int, z []complex64, ldz int, work []complex64, lwork int) bool { var _a *complex64 if len(a) > 0 { _a = &a[0] @@ -6189,7 +5996,7 @@ func Cgghd3(compq, compz lapack.Comp, n, ilo, ihi int, a []complex64, lda int, b } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zgghd3.f. -func Zgghd3(compq, compz lapack.Comp, n, ilo, ihi int, a []complex128, lda int, b []complex128, ldb int, q []complex128, ldq int, z []complex128, ldz int, work []complex128, lwork int) bool { +func Zgghd3(compq, compz byte, n, ilo, ihi int, a []complex128, lda int, b []complex128, ldb int, q []complex128, ldq int, z []complex128, ldz int, work []complex128, lwork int) bool { var _a *complex128 if len(a) > 0 { _a = &a[0] @@ -6530,7 +6337,7 @@ func Zggrqf(m, p, n int, a []complex128, lda int, taua, b []complex128, ldb int, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sggsvd3.f. -func Sggsvd3(jobu, jobv, jobq lapack.Job, m, n, p int, k, l []int32, a []float32, lda int, b []float32, ldb int, alpha, beta, u []float32, ldu int, v []float32, ldv int, q []float32, ldq int, work []float32, lwork int, iwork []int32) bool { +func Sggsvd3(jobu, jobv, jobq byte, m, n, p int, k, l []int32, a []float32, lda int, b []float32, ldb int, alpha, beta, u []float32, ldu int, v []float32, ldv int, q []float32, ldq int, work []float32, lwork int, iwork []int32) bool { var _k *int32 if len(k) > 0 { _k = &k[0] @@ -6579,7 +6386,7 @@ func Sggsvd3(jobu, jobv, jobq lapack.Job, m, n, p int, k, l []int32, a []float32 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dggsvd3.f. -func Dggsvd3(jobu, jobv, jobq lapack.Job, m, n, p int, k, l []int32, a []float64, lda int, b []float64, ldb int, alpha, beta, u []float64, ldu int, v []float64, ldv int, q []float64, ldq int, work []float64, lwork int, iwork []int32) bool { +func Dggsvd3(jobu, jobv, jobq byte, m, n, p int, k, l []int32, a []float64, lda int, b []float64, ldb int, alpha, beta, u []float64, ldu int, v []float64, ldv int, q []float64, ldq int, work []float64, lwork int, iwork []int32) bool { var _k *int32 if len(k) > 0 { _k = &k[0] @@ -6628,7 +6435,7 @@ func Dggsvd3(jobu, jobv, jobq lapack.Job, m, n, p int, k, l []int32, a []float64 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cggsvd3.f. -func Cggsvd3(jobu, jobv, jobq lapack.Job, m, n, p int, k, l []int32, a []complex64, lda int, b []complex64, ldb int, alpha, beta []float32, u []complex64, ldu int, v []complex64, ldv int, q []complex64, ldq int, work []complex64, lwork int, rwork []float32, iwork []int32) bool { +func Cggsvd3(jobu, jobv, jobq byte, m, n, p int, k, l []int32, a []complex64, lda int, b []complex64, ldb int, alpha, beta []float32, u []complex64, ldu int, v []complex64, ldv int, q []complex64, ldq int, work []complex64, lwork int, rwork []float32, iwork []int32) bool { var _k *int32 if len(k) > 0 { _k = &k[0] @@ -6681,7 +6488,7 @@ func Cggsvd3(jobu, jobv, jobq lapack.Job, m, n, p int, k, l []int32, a []complex } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zggsvd3.f. -func Zggsvd3(jobu, jobv, jobq lapack.Job, m, n, p int, k, l []int32, a []complex128, lda int, b []complex128, ldb int, alpha, beta []float64, u []complex128, ldu int, v []complex128, ldv int, q []complex128, ldq int, work []complex128, lwork int, rwork []float64, iwork []int32) bool { +func Zggsvd3(jobu, jobv, jobq byte, m, n, p int, k, l []int32, a []complex128, lda int, b []complex128, ldb int, alpha, beta []float64, u []complex128, ldu int, v []complex128, ldv int, q []complex128, ldq int, work []complex128, lwork int, rwork []float64, iwork []int32) bool { var _k *int32 if len(k) > 0 { _k = &k[0] @@ -6734,7 +6541,7 @@ func Zggsvd3(jobu, jobv, jobq lapack.Job, m, n, p int, k, l []int32, a []complex } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sggsvp3.f. -func Sggsvp3(jobu, jobv, jobq lapack.Job, m, p, n int, a []float32, lda int, b []float32, ldb int, tola, tolb float32, k, l []int32, u []float32, ldu int, v []float32, ldv int, q []float32, ldq int, iwork []int32, tau, work []float32, lwork int) bool { +func Sggsvp3(jobu, jobv, jobq byte, m, p, n int, a []float32, lda int, b []float32, ldb int, tola, tolb float32, k, l []int32, u []float32, ldu int, v []float32, ldv int, q []float32, ldq int, iwork []int32, tau, work []float32, lwork int) bool { var _a *float32 if len(a) > 0 { _a = &a[0] @@ -6779,7 +6586,7 @@ func Sggsvp3(jobu, jobv, jobq lapack.Job, m, p, n int, a []float32, lda int, b [ } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dggsvp3.f. -func Dggsvp3(jobu, jobv, jobq lapack.Job, m, p, n int, a []float64, lda int, b []float64, ldb int, tola, tolb float64, k, l []int32, u []float64, ldu int, v []float64, ldv int, q []float64, ldq int, iwork []int32, tau, work []float64, lwork int) bool { +func Dggsvp3(jobu, jobv, jobq byte, m, p, n int, a []float64, lda int, b []float64, ldb int, tola, tolb float64, k, l []int32, u []float64, ldu int, v []float64, ldv int, q []float64, ldq int, iwork []int32, tau, work []float64, lwork int) bool { var _a *float64 if len(a) > 0 { _a = &a[0] @@ -6824,7 +6631,7 @@ func Dggsvp3(jobu, jobv, jobq lapack.Job, m, p, n int, a []float64, lda int, b [ } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cggsvp3.f. -func Cggsvp3(jobu, jobv, jobq lapack.Job, m, p, n int, a []complex64, lda int, b []complex64, ldb int, tola, tolb float32, k, l []int32, u []complex64, ldu int, v []complex64, ldv int, q []complex64, ldq int, iwork []int32, rwork []float32, tau, work []complex64, lwork int) bool { +func Cggsvp3(jobu, jobv, jobq byte, m, p, n int, a []complex64, lda int, b []complex64, ldb int, tola, tolb float32, k, l []int32, u []complex64, ldu int, v []complex64, ldv int, q []complex64, ldq int, iwork []int32, rwork []float32, tau, work []complex64, lwork int) bool { var _a *complex64 if len(a) > 0 { _a = &a[0] @@ -6873,7 +6680,7 @@ func Cggsvp3(jobu, jobv, jobq lapack.Job, m, p, n int, a []complex64, lda int, b } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zggsvp3.f. -func Zggsvp3(jobu, jobv, jobq lapack.Job, m, p, n int, a []complex128, lda int, b []complex128, ldb int, tola, tolb float64, k, l []int32, u []complex128, ldu int, v []complex128, ldv int, q []complex128, ldq int, iwork []int32, rwork []float64, tau, work []complex128, lwork int) bool { +func Zggsvp3(jobu, jobv, jobq byte, m, p, n int, a []complex128, lda int, b []complex128, ldb int, tola, tolb float64, k, l []int32, u []complex128, ldu int, v []complex128, ldv int, q []complex128, ldq int, iwork []int32, rwork []float64, tau, work []complex128, lwork int) bool { var _a *complex128 if len(a) > 0 { _a = &a[0] @@ -7062,14 +6869,9 @@ func Zgtcon(norm byte, n int, dl, d, du, du2 []complex128, ipiv []int32, anorm f } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sgtrfs.f. -func Sgtrfs(trans blas.Transpose, n, nrhs int, dl, d, du, dlf, df, duf, du2 []float32, ipiv []int32, b []float32, ldb int, x []float32, ldx int, ferr, berr, work []float32, iwork []int32) bool { +func Sgtrfs(trans byte, n, nrhs int, dl, d, du, dlf, df, duf, du2 []float32, ipiv []int32, b []float32, ldb int, x []float32, ldx int, ferr, berr, work []float32, iwork []int32) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -7133,14 +6935,9 @@ func Sgtrfs(trans blas.Transpose, n, nrhs int, dl, d, du, dlf, df, duf, du2 []fl } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dgtrfs.f. -func Dgtrfs(trans blas.Transpose, n, nrhs int, dl, d, du, dlf, df, duf, du2 []float64, ipiv []int32, b []float64, ldb int, x []float64, ldx int, ferr, berr, work []float64, iwork []int32) bool { +func Dgtrfs(trans byte, n, nrhs int, dl, d, du, dlf, df, duf, du2 []float64, ipiv []int32, b []float64, ldb int, x []float64, ldx int, ferr, berr, work []float64, iwork []int32) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -7204,14 +7001,9 @@ func Dgtrfs(trans blas.Transpose, n, nrhs int, dl, d, du, dlf, df, duf, du2 []fl } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cgtrfs.f. -func Cgtrfs(trans blas.Transpose, n, nrhs int, dl, d, du, dlf, df, duf, du2 []complex64, ipiv []int32, b []complex64, ldb int, x []complex64, ldx int, ferr, berr []float32, work []complex64, rwork []float32) bool { +func Cgtrfs(trans byte, n, nrhs int, dl, d, du, dlf, df, duf, du2 []complex64, ipiv []int32, b []complex64, ldb int, x []complex64, ldx int, ferr, berr []float32, work []complex64, rwork []float32) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -7275,14 +7067,9 @@ func Cgtrfs(trans blas.Transpose, n, nrhs int, dl, d, du, dlf, df, duf, du2 []co } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zgtrfs.f. -func Zgtrfs(trans blas.Transpose, n, nrhs int, dl, d, du, dlf, df, duf, du2 []complex128, ipiv []int32, b []complex128, ldb int, x []complex128, ldx int, ferr, berr []float64, work []complex128, rwork []float64) bool { +func Zgtrfs(trans byte, n, nrhs int, dl, d, du, dlf, df, duf, du2 []complex128, ipiv []int32, b []complex128, ldb int, x []complex128, ldx int, ferr, berr []float64, work []complex128, rwork []float64) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -7430,14 +7217,9 @@ func Zgtsv(n, nrhs int, dl, d, du, b []complex128, ldb int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sgtsvx.f. -func Sgtsvx(fact byte, trans blas.Transpose, n, nrhs int, dl, d, du, dlf, df, duf, du2 []float32, ipiv []int32, b []float32, ldb int, x []float32, ldx int, rcond, ferr, berr, work []float32, iwork []int32) bool { +func Sgtsvx(fact, trans byte, n, nrhs int, dl, d, du, dlf, df, duf, du2 []float32, ipiv []int32, b []float32, ldb int, x []float32, ldx int, rcond, ferr, berr, work []float32, iwork []int32) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -7505,14 +7287,9 @@ func Sgtsvx(fact byte, trans blas.Transpose, n, nrhs int, dl, d, du, dlf, df, du } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dgtsvx.f. -func Dgtsvx(fact byte, trans blas.Transpose, n, nrhs int, dl, d, du, dlf, df, duf, du2 []float64, ipiv []int32, b []float64, ldb int, x []float64, ldx int, rcond, ferr, berr, work []float64, iwork []int32) bool { +func Dgtsvx(fact, trans byte, n, nrhs int, dl, d, du, dlf, df, duf, du2 []float64, ipiv []int32, b []float64, ldb int, x []float64, ldx int, rcond, ferr, berr, work []float64, iwork []int32) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -7580,14 +7357,9 @@ func Dgtsvx(fact byte, trans blas.Transpose, n, nrhs int, dl, d, du, dlf, df, du } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cgtsvx.f. -func Cgtsvx(fact byte, trans blas.Transpose, n, nrhs int, dl, d, du, dlf, df, duf, du2 []complex64, ipiv []int32, b []complex64, ldb int, x []complex64, ldx int, rcond, ferr, berr []float32, work []complex64, rwork []float32) bool { +func Cgtsvx(fact, trans byte, n, nrhs int, dl, d, du, dlf, df, duf, du2 []complex64, ipiv []int32, b []complex64, ldb int, x []complex64, ldx int, rcond, ferr, berr []float32, work []complex64, rwork []float32) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -7655,14 +7427,9 @@ func Cgtsvx(fact byte, trans blas.Transpose, n, nrhs int, dl, d, du, dlf, df, du } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zgtsvx.f. -func Zgtsvx(fact byte, trans blas.Transpose, n, nrhs int, dl, d, du, dlf, df, duf, du2 []complex128, ipiv []int32, b []complex128, ldb int, x []complex128, ldx int, rcond, ferr, berr []float64, work []complex128, rwork []float64) bool { +func Zgtsvx(fact, trans byte, n, nrhs int, dl, d, du, dlf, df, duf, du2 []complex128, ipiv []int32, b []complex128, ldb int, x []complex128, ldx int, rcond, ferr, berr []float64, work []complex128, rwork []float64) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -7830,14 +7597,9 @@ func Zgttrf(n int, dl, d, du, du2 []complex128, ipiv []int32) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sgttrs.f. -func Sgttrs(trans blas.Transpose, n, nrhs int, dl, d, du, du2 []float32, ipiv []int32, b []float32, ldb int) bool { +func Sgttrs(trans byte, n, nrhs int, dl, d, du, du2 []float32, ipiv []int32, b []float32, ldb int) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -7869,14 +7631,9 @@ func Sgttrs(trans blas.Transpose, n, nrhs int, dl, d, du, du2 []float32, ipiv [] } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dgttrs.f. -func Dgttrs(trans blas.Transpose, n, nrhs int, dl, d, du, du2 []float64, ipiv []int32, b []float64, ldb int) bool { +func Dgttrs(trans byte, n, nrhs int, dl, d, du, du2 []float64, ipiv []int32, b []float64, ldb int) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -7908,14 +7665,9 @@ func Dgttrs(trans blas.Transpose, n, nrhs int, dl, d, du, du2 []float64, ipiv [] } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cgttrs.f. -func Cgttrs(trans blas.Transpose, n, nrhs int, dl, d, du, du2 []complex64, ipiv []int32, b []complex64, ldb int) bool { +func Cgttrs(trans byte, n, nrhs int, dl, d, du, du2 []complex64, ipiv []int32, b []complex64, ldb int) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -7947,14 +7699,9 @@ func Cgttrs(trans blas.Transpose, n, nrhs int, dl, d, du, du2 []complex64, ipiv } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zgttrs.f. -func Zgttrs(trans blas.Transpose, n, nrhs int, dl, d, du, du2 []complex128, ipiv []int32, b []complex128, ldb int) bool { +func Zgttrs(trans byte, n, nrhs int, dl, d, du, du2 []complex128, ipiv []int32, b []complex128, ldb int) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -7986,14 +7733,11 @@ func Zgttrs(trans blas.Transpose, n, nrhs int, dl, d, du, du2 []complex128, ipiv } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chbev.f. -func Chbev(jobz lapack.Job, ul blas.Uplo, n, kd int, ab []complex64, ldab int, w []float32, z []complex64, ldz int, work []complex64, rwork []float32) bool { +func Chbev(jobz, ul byte, n, kd int, ab []complex64, ldab int, w []float32, z []complex64, ldz int, work []complex64, rwork []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *complex64 if len(ab) > 0 { @@ -8019,14 +7763,11 @@ func Chbev(jobz lapack.Job, ul blas.Uplo, n, kd int, ab []complex64, ldab int, w } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhbev.f. -func Zhbev(jobz lapack.Job, ul blas.Uplo, n, kd int, ab []complex128, ldab int, w []float64, z []complex128, ldz int, work []complex128, rwork []float64) bool { +func Zhbev(jobz, ul byte, n, kd int, ab []complex128, ldab int, w []float64, z []complex128, ldz int, work []complex128, rwork []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *complex128 if len(ab) > 0 { @@ -8052,14 +7793,11 @@ func Zhbev(jobz lapack.Job, ul blas.Uplo, n, kd int, ab []complex128, ldab int, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chbevd.f. -func Chbevd(jobz lapack.Job, ul blas.Uplo, n, kd int, ab []complex64, ldab int, w []float32, z []complex64, ldz int, work []complex64, lwork int, rwork []float32, lrwork int, iwork []int32, liwork int) bool { +func Chbevd(jobz, ul byte, n, kd int, ab []complex64, ldab int, w []float32, z []complex64, ldz int, work []complex64, lwork int, rwork []float32, lrwork int, iwork []int32, liwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *complex64 if len(ab) > 0 { @@ -8089,14 +7827,11 @@ func Chbevd(jobz lapack.Job, ul blas.Uplo, n, kd int, ab []complex64, ldab int, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhbevd.f. -func Zhbevd(jobz lapack.Job, ul blas.Uplo, n, kd int, ab []complex128, ldab int, w []float64, z []complex128, ldz int, work []complex128, lwork int, rwork []float64, lrwork int, iwork []int32, liwork int) bool { +func Zhbevd(jobz, ul byte, n, kd int, ab []complex128, ldab int, w []float64, z []complex128, ldz int, work []complex128, lwork int, rwork []float64, lrwork int, iwork []int32, liwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *complex128 if len(ab) > 0 { @@ -8126,14 +7861,11 @@ func Zhbevd(jobz lapack.Job, ul blas.Uplo, n, kd int, ab []complex128, ldab int, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chbevx.f. -func Chbevx(jobz lapack.Job, rng byte, ul blas.Uplo, n, kd int, ab []complex64, ldab int, q []complex64, ldq int, vl, vu float32, il, iu int, abstol float32, m []int32, w []float32, z []complex64, ldz int, work []complex64, rwork []float32, iwork, ifail []int32) bool { +func Chbevx(jobz, rng, ul byte, n, kd int, ab []complex64, ldab int, q []complex64, ldq int, vl, vu float32, il, iu int, abstol float32, m []int32, w []float32, z []complex64, ldz int, work []complex64, rwork []float32, iwork, ifail []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *complex64 if len(ab) > 0 { @@ -8175,14 +7907,11 @@ func Chbevx(jobz lapack.Job, rng byte, ul blas.Uplo, n, kd int, ab []complex64, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhbevx.f. -func Zhbevx(jobz lapack.Job, rng byte, ul blas.Uplo, n, kd int, ab []complex128, ldab int, q []complex128, ldq int, vl, vu float64, il, iu int, abstol float64, m []int32, w []float64, z []complex128, ldz int, work []complex128, rwork []float64, iwork, ifail []int32) bool { +func Zhbevx(jobz, rng, ul byte, n, kd int, ab []complex128, ldab int, q []complex128, ldq int, vl, vu float64, il, iu int, abstol float64, m []int32, w []float64, z []complex128, ldz int, work []complex128, rwork []float64, iwork, ifail []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *complex128 if len(ab) > 0 { @@ -8224,14 +7953,11 @@ func Zhbevx(jobz lapack.Job, rng byte, ul blas.Uplo, n, kd int, ab []complex128, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chbgst.f. -func Chbgst(vect byte, ul blas.Uplo, n, ka, kb int, ab []complex64, ldab int, bb []complex64, ldbb int, x []complex64, ldx int, work []complex64, rwork []float32) bool { +func Chbgst(vect, ul byte, n, ka, kb int, ab []complex64, ldab int, bb []complex64, ldbb int, x []complex64, ldx int, work []complex64, rwork []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *complex64 if len(ab) > 0 { @@ -8257,14 +7983,11 @@ func Chbgst(vect byte, ul blas.Uplo, n, ka, kb int, ab []complex64, ldab int, bb } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhbgst.f. -func Zhbgst(vect byte, ul blas.Uplo, n, ka, kb int, ab []complex128, ldab int, bb []complex128, ldbb int, x []complex128, ldx int, work []complex128, rwork []float64) bool { +func Zhbgst(vect, ul byte, n, ka, kb int, ab []complex128, ldab int, bb []complex128, ldbb int, x []complex128, ldx int, work []complex128, rwork []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *complex128 if len(ab) > 0 { @@ -8290,14 +8013,11 @@ func Zhbgst(vect byte, ul blas.Uplo, n, ka, kb int, ab []complex128, ldab int, b } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chbgv.f. -func Chbgv(jobz lapack.Job, ul blas.Uplo, n, ka, kb int, ab []complex64, ldab int, bb []complex64, ldbb int, w []float32, z []complex64, ldz int, work []complex64, rwork []float32) bool { +func Chbgv(jobz, ul byte, n, ka, kb int, ab []complex64, ldab int, bb []complex64, ldbb int, w []float32, z []complex64, ldz int, work []complex64, rwork []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *complex64 if len(ab) > 0 { @@ -8327,14 +8047,11 @@ func Chbgv(jobz lapack.Job, ul blas.Uplo, n, ka, kb int, ab []complex64, ldab in } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhbgv.f. -func Zhbgv(jobz lapack.Job, ul blas.Uplo, n, ka, kb int, ab []complex128, ldab int, bb []complex128, ldbb int, w []float64, z []complex128, ldz int, work []complex128, rwork []float64) bool { +func Zhbgv(jobz, ul byte, n, ka, kb int, ab []complex128, ldab int, bb []complex128, ldbb int, w []float64, z []complex128, ldz int, work []complex128, rwork []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *complex128 if len(ab) > 0 { @@ -8364,14 +8081,11 @@ func Zhbgv(jobz lapack.Job, ul blas.Uplo, n, ka, kb int, ab []complex128, ldab i } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chbgvd.f. -func Chbgvd(jobz lapack.Job, ul blas.Uplo, n, ka, kb int, ab []complex64, ldab int, bb []complex64, ldbb int, w []float32, z []complex64, ldz int, work []complex64, lwork int, rwork []float32, lrwork int, iwork []int32, liwork int) bool { +func Chbgvd(jobz, ul byte, n, ka, kb int, ab []complex64, ldab int, bb []complex64, ldbb int, w []float32, z []complex64, ldz int, work []complex64, lwork int, rwork []float32, lrwork int, iwork []int32, liwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *complex64 if len(ab) > 0 { @@ -8405,14 +8119,11 @@ func Chbgvd(jobz lapack.Job, ul blas.Uplo, n, ka, kb int, ab []complex64, ldab i } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhbgvd.f. -func Zhbgvd(jobz lapack.Job, ul blas.Uplo, n, ka, kb int, ab []complex128, ldab int, bb []complex128, ldbb int, w []float64, z []complex128, ldz int, work []complex128, lwork int, rwork []float64, lrwork int, iwork []int32, liwork int) bool { +func Zhbgvd(jobz, ul byte, n, ka, kb int, ab []complex128, ldab int, bb []complex128, ldbb int, w []float64, z []complex128, ldz int, work []complex128, lwork int, rwork []float64, lrwork int, iwork []int32, liwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *complex128 if len(ab) > 0 { @@ -8446,14 +8157,11 @@ func Zhbgvd(jobz lapack.Job, ul blas.Uplo, n, ka, kb int, ab []complex128, ldab } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chbgvx.f. -func Chbgvx(jobz lapack.Job, rng byte, ul blas.Uplo, n, ka, kb int, ab []complex64, ldab int, bb []complex64, ldbb int, q []complex64, ldq int, vl, vu float32, il, iu int, abstol float32, m []int32, w []float32, z []complex64, ldz int, work []complex64, rwork []float32, iwork, ifail []int32) bool { +func Chbgvx(jobz, rng, ul byte, n, ka, kb int, ab []complex64, ldab int, bb []complex64, ldbb int, q []complex64, ldq int, vl, vu float32, il, iu int, abstol float32, m []int32, w []float32, z []complex64, ldz int, work []complex64, rwork []float32, iwork, ifail []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *complex64 if len(ab) > 0 { @@ -8499,14 +8207,11 @@ func Chbgvx(jobz lapack.Job, rng byte, ul blas.Uplo, n, ka, kb int, ab []complex } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhbgvx.f. -func Zhbgvx(jobz lapack.Job, rng byte, ul blas.Uplo, n, ka, kb int, ab []complex128, ldab int, bb []complex128, ldbb int, q []complex128, ldq int, vl, vu float64, il, iu int, abstol float64, m []int32, w []float64, z []complex128, ldz int, work []complex128, rwork []float64, iwork, ifail []int32) bool { +func Zhbgvx(jobz, rng, ul byte, n, ka, kb int, ab []complex128, ldab int, bb []complex128, ldbb int, q []complex128, ldq int, vl, vu float64, il, iu int, abstol float64, m []int32, w []float64, z []complex128, ldz int, work []complex128, rwork []float64, iwork, ifail []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *complex128 if len(ab) > 0 { @@ -8552,14 +8257,11 @@ func Zhbgvx(jobz lapack.Job, rng byte, ul blas.Uplo, n, ka, kb int, ab []complex } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chbtrd.f. -func Chbtrd(vect byte, ul blas.Uplo, n, kd int, ab []complex64, ldab int, d, e []float32, q []complex64, ldq int, work []complex64) bool { +func Chbtrd(vect, ul byte, n, kd int, ab []complex64, ldab int, d, e []float32, q []complex64, ldq int, work []complex64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *complex64 if len(ab) > 0 { @@ -8585,14 +8287,11 @@ func Chbtrd(vect byte, ul blas.Uplo, n, kd int, ab []complex64, ldab int, d, e [ } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhbtrd.f. -func Zhbtrd(vect byte, ul blas.Uplo, n, kd int, ab []complex128, ldab int, d, e []float64, q []complex128, ldq int, work []complex128) bool { +func Zhbtrd(vect, ul byte, n, kd int, ab []complex128, ldab int, d, e []float64, q []complex128, ldq int, work []complex128) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *complex128 if len(ab) > 0 { @@ -8618,14 +8317,11 @@ func Zhbtrd(vect byte, ul blas.Uplo, n, kd int, ab []complex128, ldab int, d, e } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/checon.f. -func Checon(ul blas.Uplo, n int, a []complex64, lda int, ipiv []int32, anorm float32, rcond []float32, work []complex64) bool { +func Checon(ul byte, n int, a []complex64, lda int, ipiv []int32, anorm float32, rcond []float32, work []complex64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -8647,14 +8343,11 @@ func Checon(ul blas.Uplo, n int, a []complex64, lda int, ipiv []int32, anorm flo } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhecon.f. -func Zhecon(ul blas.Uplo, n int, a []complex128, lda int, ipiv []int32, anorm float64, rcond []float64, work []complex128) bool { +func Zhecon(ul byte, n int, a []complex128, lda int, ipiv []int32, anorm float64, rcond []float64, work []complex128) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -8676,14 +8369,11 @@ func Zhecon(ul blas.Uplo, n int, a []complex128, lda int, ipiv []int32, anorm fl } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cheequb.f. -func Cheequb(ul blas.Uplo, n int, a []complex64, lda int, s, scond, amax []float32, work []complex64) bool { +func Cheequb(ul byte, n int, a []complex64, lda int, s, scond, amax []float32, work []complex64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -8709,14 +8399,11 @@ func Cheequb(ul blas.Uplo, n int, a []complex64, lda int, s, scond, amax []float } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zheequb.f. -func Zheequb(ul blas.Uplo, n int, a []complex128, lda int, s, scond, amax []float64, work []complex128) bool { +func Zheequb(ul byte, n int, a []complex128, lda int, s, scond, amax []float64, work []complex128) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -8742,14 +8429,11 @@ func Zheequb(ul blas.Uplo, n int, a []complex128, lda int, s, scond, amax []floa } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cheev.f. -func Cheev(jobz lapack.Job, ul blas.Uplo, n int, a []complex64, lda int, w []float32, work []complex64, lwork int, rwork []float32) bool { +func Cheev(jobz, ul byte, n int, a []complex64, lda int, w []float32, work []complex64, lwork int, rwork []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -8771,14 +8455,11 @@ func Cheev(jobz lapack.Job, ul blas.Uplo, n int, a []complex64, lda int, w []flo } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zheev.f. -func Zheev(jobz lapack.Job, ul blas.Uplo, n int, a []complex128, lda int, w []float64, work []complex128, lwork int, rwork []float64) bool { +func Zheev(jobz, ul byte, n int, a []complex128, lda int, w []float64, work []complex128, lwork int, rwork []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -8800,14 +8481,11 @@ func Zheev(jobz lapack.Job, ul blas.Uplo, n int, a []complex128, lda int, w []fl } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cheevd.f. -func Cheevd(jobz lapack.Job, ul blas.Uplo, n int, a []complex64, lda int, w []float32, work []complex64, lwork int, rwork []float32, lrwork int, iwork []int32, liwork int) bool { +func Cheevd(jobz, ul byte, n int, a []complex64, lda int, w []float32, work []complex64, lwork int, rwork []float32, lrwork int, iwork []int32, liwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -8833,14 +8511,11 @@ func Cheevd(jobz lapack.Job, ul blas.Uplo, n int, a []complex64, lda int, w []fl } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zheevd.f. -func Zheevd(jobz lapack.Job, ul blas.Uplo, n int, a []complex128, lda int, w []float64, work []complex128, lwork int, rwork []float64, lrwork int, iwork []int32, liwork int) bool { +func Zheevd(jobz, ul byte, n int, a []complex128, lda int, w []float64, work []complex128, lwork int, rwork []float64, lrwork int, iwork []int32, liwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -8866,14 +8541,11 @@ func Zheevd(jobz lapack.Job, ul blas.Uplo, n int, a []complex128, lda int, w []f } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cheevr.f. -func Cheevr(jobz lapack.Job, rng byte, ul blas.Uplo, n int, a []complex64, lda int, vl, vu float32, il, iu int, abstol float32, m []int32, w []float32, z []complex64, ldz int, isuppz []int32, work []complex64, lwork int, rwork []float32, lrwork int, iwork []int32, liwork int) bool { +func Cheevr(jobz, rng, ul byte, n int, a []complex64, lda int, vl, vu float32, il, iu int, abstol float32, m []int32, w []float32, z []complex64, ldz int, isuppz []int32, work []complex64, lwork int, rwork []float32, lrwork int, iwork []int32, liwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -8911,14 +8583,11 @@ func Cheevr(jobz lapack.Job, rng byte, ul blas.Uplo, n int, a []complex64, lda i } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zheevr.f. -func Zheevr(jobz lapack.Job, rng byte, ul blas.Uplo, n int, a []complex128, lda int, vl, vu float64, il, iu int, abstol float64, m []int32, w []float64, z []complex128, ldz int, isuppz []int32, work []complex128, lwork int, rwork []float64, lrwork int, iwork []int32, liwork int) bool { +func Zheevr(jobz, rng, ul byte, n int, a []complex128, lda int, vl, vu float64, il, iu int, abstol float64, m []int32, w []float64, z []complex128, ldz int, isuppz []int32, work []complex128, lwork int, rwork []float64, lrwork int, iwork []int32, liwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -8956,14 +8625,11 @@ func Zheevr(jobz lapack.Job, rng byte, ul blas.Uplo, n int, a []complex128, lda } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cheevx.f. -func Cheevx(jobz lapack.Job, rng byte, ul blas.Uplo, n int, a []complex64, lda int, vl, vu float32, il, iu int, abstol float32, m []int32, w []float32, z []complex64, ldz int, work []complex64, lwork int, rwork []float32, iwork, ifail []int32) bool { +func Cheevx(jobz, rng, ul byte, n int, a []complex64, lda int, vl, vu float32, il, iu int, abstol float32, m []int32, w []float32, z []complex64, ldz int, work []complex64, lwork int, rwork []float32, iwork, ifail []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -9001,14 +8667,11 @@ func Cheevx(jobz lapack.Job, rng byte, ul blas.Uplo, n int, a []complex64, lda i } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zheevx.f. -func Zheevx(jobz lapack.Job, rng byte, ul blas.Uplo, n int, a []complex128, lda int, vl, vu float64, il, iu int, abstol float64, m []int32, w []float64, z []complex128, ldz int, work []complex128, lwork int, rwork []float64, iwork, ifail []int32) bool { +func Zheevx(jobz, rng, ul byte, n int, a []complex128, lda int, vl, vu float64, il, iu int, abstol float64, m []int32, w []float64, z []complex128, ldz int, work []complex128, lwork int, rwork []float64, iwork, ifail []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -9046,14 +8709,11 @@ func Zheevx(jobz lapack.Job, rng byte, ul blas.Uplo, n int, a []complex128, lda } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chegst.f. -func Chegst(itype int, ul blas.Uplo, n int, a []complex64, lda int, b []complex64, ldb int) bool { +func Chegst(itype int, ul byte, n int, a []complex64, lda int, b []complex64, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -9067,14 +8727,11 @@ func Chegst(itype int, ul blas.Uplo, n int, a []complex64, lda int, b []complex6 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhegst.f. -func Zhegst(itype int, ul blas.Uplo, n int, a []complex128, lda int, b []complex128, ldb int) bool { +func Zhegst(itype int, ul byte, n int, a []complex128, lda int, b []complex128, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -9088,14 +8745,11 @@ func Zhegst(itype int, ul blas.Uplo, n int, a []complex128, lda int, b []complex } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chegv.f. -func Chegv(itype int, jobz lapack.Job, ul blas.Uplo, n int, a []complex64, lda int, b []complex64, ldb int, w []float32, work []complex64, lwork int, rwork []float32) bool { +func Chegv(itype int, jobz, ul byte, n int, a []complex64, lda int, b []complex64, ldb int, w []float32, work []complex64, lwork int, rwork []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -9121,14 +8775,11 @@ func Chegv(itype int, jobz lapack.Job, ul blas.Uplo, n int, a []complex64, lda i } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhegv.f. -func Zhegv(itype int, jobz lapack.Job, ul blas.Uplo, n int, a []complex128, lda int, b []complex128, ldb int, w []float64, work []complex128, lwork int, rwork []float64) bool { +func Zhegv(itype int, jobz, ul byte, n int, a []complex128, lda int, b []complex128, ldb int, w []float64, work []complex128, lwork int, rwork []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -9154,14 +8805,11 @@ func Zhegv(itype int, jobz lapack.Job, ul blas.Uplo, n int, a []complex128, lda } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chegvd.f. -func Chegvd(itype int, jobz lapack.Job, ul blas.Uplo, n int, a []complex64, lda int, b []complex64, ldb int, w []float32, work []complex64, lwork int, rwork []float32, lrwork int, iwork []int32, liwork int) bool { +func Chegvd(itype int, jobz, ul byte, n int, a []complex64, lda int, b []complex64, ldb int, w []float32, work []complex64, lwork int, rwork []float32, lrwork int, iwork []int32, liwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -9191,14 +8839,11 @@ func Chegvd(itype int, jobz lapack.Job, ul blas.Uplo, n int, a []complex64, lda } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhegvd.f. -func Zhegvd(itype int, jobz lapack.Job, ul blas.Uplo, n int, a []complex128, lda int, b []complex128, ldb int, w []float64, work []complex128, lwork int, rwork []float64, lrwork int, iwork []int32, liwork int) bool { +func Zhegvd(itype int, jobz, ul byte, n int, a []complex128, lda int, b []complex128, ldb int, w []float64, work []complex128, lwork int, rwork []float64, lrwork int, iwork []int32, liwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -9228,14 +8873,11 @@ func Zhegvd(itype int, jobz lapack.Job, ul blas.Uplo, n int, a []complex128, lda } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chegvx.f. -func Chegvx(itype int, jobz lapack.Job, rng byte, ul blas.Uplo, n int, a []complex64, lda int, b []complex64, ldb int, vl, vu float32, il, iu int, abstol float32, m []int32, w []float32, z []complex64, ldz int, work []complex64, lwork int, rwork []float32, iwork, ifail []int32) bool { +func Chegvx(itype int, jobz, rng, ul byte, n int, a []complex64, lda int, b []complex64, ldb int, vl, vu float32, il, iu int, abstol float32, m []int32, w []float32, z []complex64, ldz int, work []complex64, lwork int, rwork []float32, iwork, ifail []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -9277,14 +8919,11 @@ func Chegvx(itype int, jobz lapack.Job, rng byte, ul blas.Uplo, n int, a []compl } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhegvx.f. -func Zhegvx(itype int, jobz lapack.Job, rng byte, ul blas.Uplo, n int, a []complex128, lda int, b []complex128, ldb int, vl, vu float64, il, iu int, abstol float64, m []int32, w []float64, z []complex128, ldz int, work []complex128, lwork int, rwork []float64, iwork, ifail []int32) bool { +func Zhegvx(itype int, jobz, rng, ul byte, n int, a []complex128, lda int, b []complex128, ldb int, vl, vu float64, il, iu int, abstol float64, m []int32, w []float64, z []complex128, ldz int, work []complex128, lwork int, rwork []float64, iwork, ifail []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -9326,14 +8965,11 @@ func Zhegvx(itype int, jobz lapack.Job, rng byte, ul blas.Uplo, n int, a []compl } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cherfs.f. -func Cherfs(ul blas.Uplo, n, nrhs int, a []complex64, lda int, af []complex64, ldaf int, ipiv []int32, b []complex64, ldb int, x []complex64, ldx int, ferr, berr []float32, work []complex64, rwork []float32) bool { +func Cherfs(ul byte, n, nrhs int, a []complex64, lda int, af []complex64, ldaf int, ipiv []int32, b []complex64, ldb int, x []complex64, ldx int, ferr, berr []float32, work []complex64, rwork []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -9375,14 +9011,11 @@ func Cherfs(ul blas.Uplo, n, nrhs int, a []complex64, lda int, af []complex64, l } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zherfs.f. -func Zherfs(ul blas.Uplo, n, nrhs int, a []complex128, lda int, af []complex128, ldaf int, ipiv []int32, b []complex128, ldb int, x []complex128, ldx int, ferr, berr []float64, work []complex128, rwork []float64) bool { +func Zherfs(ul byte, n, nrhs int, a []complex128, lda int, af []complex128, ldaf int, ipiv []int32, b []complex128, ldb int, x []complex128, ldx int, ferr, berr []float64, work []complex128, rwork []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -9424,14 +9057,11 @@ func Zherfs(ul blas.Uplo, n, nrhs int, a []complex128, lda int, af []complex128, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chesv.f. -func Chesv(ul blas.Uplo, n, nrhs int, a []complex64, lda int, ipiv []int32, b []complex64, ldb int, work []complex64, lwork int) bool { +func Chesv(ul byte, n, nrhs int, a []complex64, lda int, ipiv []int32, b []complex64, ldb int, work []complex64, lwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -9453,14 +9083,11 @@ func Chesv(ul blas.Uplo, n, nrhs int, a []complex64, lda int, ipiv []int32, b [] } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhesv.f. -func Zhesv(ul blas.Uplo, n, nrhs int, a []complex128, lda int, ipiv []int32, b []complex128, ldb int, work []complex128, lwork int) bool { +func Zhesv(ul byte, n, nrhs int, a []complex128, lda int, ipiv []int32, b []complex128, ldb int, work []complex128, lwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -9482,14 +9109,11 @@ func Zhesv(ul blas.Uplo, n, nrhs int, a []complex128, lda int, ipiv []int32, b [ } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chesvx.f. -func Chesvx(fact byte, ul blas.Uplo, n, nrhs int, a []complex64, lda int, af []complex64, ldaf int, ipiv []int32, b []complex64, ldb int, x []complex64, ldx int, rcond, ferr, berr []float32, work []complex64, lwork int, rwork []float32) bool { +func Chesvx(fact, ul byte, n, nrhs int, a []complex64, lda int, af []complex64, ldaf int, ipiv []int32, b []complex64, ldb int, x []complex64, ldx int, rcond, ferr, berr []float32, work []complex64, lwork int, rwork []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -9535,14 +9159,11 @@ func Chesvx(fact byte, ul blas.Uplo, n, nrhs int, a []complex64, lda int, af []c } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhesvx.f. -func Zhesvx(fact byte, ul blas.Uplo, n, nrhs int, a []complex128, lda int, af []complex128, ldaf int, ipiv []int32, b []complex128, ldb int, x []complex128, ldx int, rcond, ferr, berr []float64, work []complex128, lwork int, rwork []float64) bool { +func Zhesvx(fact, ul byte, n, nrhs int, a []complex128, lda int, af []complex128, ldaf int, ipiv []int32, b []complex128, ldb int, x []complex128, ldx int, rcond, ferr, berr []float64, work []complex128, lwork int, rwork []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -9588,14 +9209,11 @@ func Zhesvx(fact byte, ul blas.Uplo, n, nrhs int, a []complex128, lda int, af [] } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chetrd.f. -func Chetrd(ul blas.Uplo, n int, a []complex64, lda int, d, e []float32, tau, work []complex64, lwork int) bool { +func Chetrd(ul byte, n int, a []complex64, lda int, d, e []float32, tau, work []complex64, lwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -9621,14 +9239,11 @@ func Chetrd(ul blas.Uplo, n int, a []complex64, lda int, d, e []float32, tau, wo } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhetrd.f. -func Zhetrd(ul blas.Uplo, n int, a []complex128, lda int, d, e []float64, tau, work []complex128, lwork int) bool { +func Zhetrd(ul byte, n int, a []complex128, lda int, d, e []float64, tau, work []complex128, lwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -9654,14 +9269,11 @@ func Zhetrd(ul blas.Uplo, n int, a []complex128, lda int, d, e []float64, tau, w } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chetrf.f. -func Chetrf(ul blas.Uplo, n int, a []complex64, lda int, ipiv []int32, work []complex64, lwork int) bool { +func Chetrf(ul byte, n int, a []complex64, lda int, ipiv []int32, work []complex64, lwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -9679,14 +9291,11 @@ func Chetrf(ul blas.Uplo, n int, a []complex64, lda int, ipiv []int32, work []co } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhetrf.f. -func Zhetrf(ul blas.Uplo, n int, a []complex128, lda int, ipiv []int32, work []complex128, lwork int) bool { +func Zhetrf(ul byte, n int, a []complex128, lda int, ipiv []int32, work []complex128, lwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -9704,14 +9313,11 @@ func Zhetrf(ul blas.Uplo, n int, a []complex128, lda int, ipiv []int32, work []c } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chetri.f. -func Chetri(ul blas.Uplo, n int, a []complex64, lda int, ipiv []int32, work []complex64) bool { +func Chetri(ul byte, n int, a []complex64, lda int, ipiv []int32, work []complex64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -9729,14 +9335,11 @@ func Chetri(ul blas.Uplo, n int, a []complex64, lda int, ipiv []int32, work []co } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhetri.f. -func Zhetri(ul blas.Uplo, n int, a []complex128, lda int, ipiv []int32, work []complex128) bool { +func Zhetri(ul byte, n int, a []complex128, lda int, ipiv []int32, work []complex128) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -9754,14 +9357,11 @@ func Zhetri(ul blas.Uplo, n int, a []complex128, lda int, ipiv []int32, work []c } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chetrs.f. -func Chetrs(ul blas.Uplo, n, nrhs int, a []complex64, lda int, ipiv []int32, b []complex64, ldb int) bool { +func Chetrs(ul byte, n, nrhs int, a []complex64, lda int, ipiv []int32, b []complex64, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -9779,14 +9379,11 @@ func Chetrs(ul blas.Uplo, n, nrhs int, a []complex64, lda int, ipiv []int32, b [ } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhetrs.f. -func Zhetrs(ul blas.Uplo, n, nrhs int, a []complex128, lda int, ipiv []int32, b []complex128, ldb int) bool { +func Zhetrs(ul byte, n, nrhs int, a []complex128, lda int, ipiv []int32, b []complex128, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -9804,32 +9401,19 @@ func Zhetrs(ul blas.Uplo, n, nrhs int, a []complex128, lda int, ipiv []int32, b } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chfrk.f. -func Chfrk(transr blas.Transpose, ul blas.Uplo, trans blas.Transpose, n, k int, alpha float32, a []complex64, lda int, beta float32, c []complex64) bool { +func Chfrk(transr, ul, trans byte, n, k int, alpha float32, a []complex64, lda int, beta float32, c []complex64) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -9845,32 +9429,19 @@ func Chfrk(transr blas.Transpose, ul blas.Uplo, trans blas.Transpose, n, k int, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhfrk.f. -func Zhfrk(transr blas.Transpose, ul blas.Uplo, trans blas.Transpose, n, k int, alpha float64, a []complex128, lda int, beta float64, c []complex128) bool { +func Zhfrk(transr, ul, trans byte, n, k int, alpha float64, a []complex128, lda int, beta float64, c []complex128) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -9886,7 +9457,7 @@ func Zhfrk(transr blas.Transpose, ul blas.Uplo, trans blas.Transpose, n, k int, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/shgeqz.f. -func Shgeqz(job lapack.Job, compq, compz lapack.Comp, n, ilo, ihi int, h []float32, ldh int, t []float32, ldt int, alphar, alphai, beta, q []float32, ldq int, z []float32, ldz int, work []float32, lwork int) bool { +func Shgeqz(job, compq, compz byte, n, ilo, ihi int, h []float32, ldh int, t []float32, ldt int, alphar, alphai, beta, q []float32, ldq int, z []float32, ldz int, work []float32, lwork int) bool { var _h *float32 if len(h) > 0 { _h = &h[0] @@ -9923,7 +9494,7 @@ func Shgeqz(job lapack.Job, compq, compz lapack.Comp, n, ilo, ihi int, h []float } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dhgeqz.f. -func Dhgeqz(job lapack.Job, compq, compz lapack.Comp, n, ilo, ihi int, h []float64, ldh int, t []float64, ldt int, alphar, alphai, beta, q []float64, ldq int, z []float64, ldz int, work []float64, lwork int) bool { +func Dhgeqz(job, compq, compz byte, n, ilo, ihi int, h []float64, ldh int, t []float64, ldt int, alphar, alphai, beta, q []float64, ldq int, z []float64, ldz int, work []float64, lwork int) bool { var _h *float64 if len(h) > 0 { _h = &h[0] @@ -9960,7 +9531,7 @@ func Dhgeqz(job lapack.Job, compq, compz lapack.Comp, n, ilo, ihi int, h []float } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chgeqz.f. -func Chgeqz(job lapack.Job, compq, compz lapack.Comp, n, ilo, ihi int, h []complex64, ldh int, t []complex64, ldt int, alpha, beta, q []complex64, ldq int, z []complex64, ldz int, work []complex64, lwork int, rwork []float32) bool { +func Chgeqz(job, compq, compz byte, n, ilo, ihi int, h []complex64, ldh int, t []complex64, ldt int, alpha, beta, q []complex64, ldq int, z []complex64, ldz int, work []complex64, lwork int, rwork []float32) bool { var _h *complex64 if len(h) > 0 { _h = &h[0] @@ -9997,7 +9568,7 @@ func Chgeqz(job lapack.Job, compq, compz lapack.Comp, n, ilo, ihi int, h []compl } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhgeqz.f. -func Zhgeqz(job lapack.Job, compq, compz lapack.Comp, n, ilo, ihi int, h []complex128, ldh int, t []complex128, ldt int, alpha, beta, q []complex128, ldq int, z []complex128, ldz int, work []complex128, lwork int, rwork []float64) bool { +func Zhgeqz(job, compq, compz byte, n, ilo, ihi int, h []complex128, ldh int, t []complex128, ldt int, alpha, beta, q []complex128, ldq int, z []complex128, ldz int, work []complex128, lwork int, rwork []float64) bool { var _h *complex128 if len(h) > 0 { _h = &h[0] @@ -10034,14 +9605,11 @@ func Zhgeqz(job lapack.Job, compq, compz lapack.Comp, n, ilo, ihi int, h []compl } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chpcon.f. -func Chpcon(ul blas.Uplo, n int, ap []complex64, ipiv []int32, anorm float32, rcond []float32, work []complex64) bool { +func Chpcon(ul byte, n int, ap []complex64, ipiv []int32, anorm float32, rcond []float32, work []complex64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex64 if len(ap) > 0 { @@ -10063,14 +9631,11 @@ func Chpcon(ul blas.Uplo, n int, ap []complex64, ipiv []int32, anorm float32, rc } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhpcon.f. -func Zhpcon(ul blas.Uplo, n int, ap []complex128, ipiv []int32, anorm float64, rcond []float64, work []complex128) bool { +func Zhpcon(ul byte, n int, ap []complex128, ipiv []int32, anorm float64, rcond []float64, work []complex128) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex128 if len(ap) > 0 { @@ -10092,14 +9657,11 @@ func Zhpcon(ul blas.Uplo, n int, ap []complex128, ipiv []int32, anorm float64, r } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chpev.f. -func Chpev(jobz lapack.Job, ul blas.Uplo, n int, ap []complex64, w []float32, z []complex64, ldz int, work []complex64, rwork []float32) bool { +func Chpev(jobz, ul byte, n int, ap []complex64, w []float32, z []complex64, ldz int, work []complex64, rwork []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex64 if len(ap) > 0 { @@ -10125,14 +9687,11 @@ func Chpev(jobz lapack.Job, ul blas.Uplo, n int, ap []complex64, w []float32, z } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhpev.f. -func Zhpev(jobz lapack.Job, ul blas.Uplo, n int, ap []complex128, w []float64, z []complex128, ldz int, work []complex128, rwork []float64) bool { +func Zhpev(jobz, ul byte, n int, ap []complex128, w []float64, z []complex128, ldz int, work []complex128, rwork []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex128 if len(ap) > 0 { @@ -10158,14 +9717,11 @@ func Zhpev(jobz lapack.Job, ul blas.Uplo, n int, ap []complex128, w []float64, z } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chpevd.f. -func Chpevd(jobz lapack.Job, ul blas.Uplo, n int, ap []complex64, w []float32, z []complex64, ldz int, work []complex64, lwork int, rwork []float32, lrwork int, iwork []int32, liwork int) bool { +func Chpevd(jobz, ul byte, n int, ap []complex64, w []float32, z []complex64, ldz int, work []complex64, lwork int, rwork []float32, lrwork int, iwork []int32, liwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex64 if len(ap) > 0 { @@ -10195,14 +9751,11 @@ func Chpevd(jobz lapack.Job, ul blas.Uplo, n int, ap []complex64, w []float32, z } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhpevd.f. -func Zhpevd(jobz lapack.Job, ul blas.Uplo, n int, ap []complex128, w []float64, z []complex128, ldz int, work []complex128, lwork int, rwork []float64, lrwork int, iwork []int32, liwork int) bool { +func Zhpevd(jobz, ul byte, n int, ap []complex128, w []float64, z []complex128, ldz int, work []complex128, lwork int, rwork []float64, lrwork int, iwork []int32, liwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex128 if len(ap) > 0 { @@ -10232,14 +9785,11 @@ func Zhpevd(jobz lapack.Job, ul blas.Uplo, n int, ap []complex128, w []float64, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chpevx.f. -func Chpevx(jobz lapack.Job, rng byte, ul blas.Uplo, n int, ap []complex64, vl, vu float32, il, iu int, abstol float32, m []int32, w []float32, z []complex64, ldz int, work []complex64, rwork []float32, iwork, ifail []int32) bool { +func Chpevx(jobz, rng, ul byte, n int, ap []complex64, vl, vu float32, il, iu int, abstol float32, m []int32, w []float32, z []complex64, ldz int, work []complex64, rwork []float32, iwork, ifail []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex64 if len(ap) > 0 { @@ -10277,14 +9827,11 @@ func Chpevx(jobz lapack.Job, rng byte, ul blas.Uplo, n int, ap []complex64, vl, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhpevx.f. -func Zhpevx(jobz lapack.Job, rng byte, ul blas.Uplo, n int, ap []complex128, vl, vu float64, il, iu int, abstol float64, m []int32, w []float64, z []complex128, ldz int, work []complex128, rwork []float64, iwork, ifail []int32) bool { +func Zhpevx(jobz, rng, ul byte, n int, ap []complex128, vl, vu float64, il, iu int, abstol float64, m []int32, w []float64, z []complex128, ldz int, work []complex128, rwork []float64, iwork, ifail []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex128 if len(ap) > 0 { @@ -10322,14 +9869,11 @@ func Zhpevx(jobz lapack.Job, rng byte, ul blas.Uplo, n int, ap []complex128, vl, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chpgst.f. -func Chpgst(itype int, ul blas.Uplo, n int, ap, bp []complex64) bool { +func Chpgst(itype int, ul byte, n int, ap, bp []complex64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex64 if len(ap) > 0 { @@ -10343,14 +9887,11 @@ func Chpgst(itype int, ul blas.Uplo, n int, ap, bp []complex64) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhpgst.f. -func Zhpgst(itype int, ul blas.Uplo, n int, ap, bp []complex128) bool { +func Zhpgst(itype int, ul byte, n int, ap, bp []complex128) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex128 if len(ap) > 0 { @@ -10364,14 +9905,11 @@ func Zhpgst(itype int, ul blas.Uplo, n int, ap, bp []complex128) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chpgv.f. -func Chpgv(itype int, jobz lapack.Job, ul blas.Uplo, n int, ap, bp []complex64, w []float32, z []complex64, ldz int, work []complex64, rwork []float32) bool { +func Chpgv(itype int, jobz, ul byte, n int, ap, bp []complex64, w []float32, z []complex64, ldz int, work []complex64, rwork []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex64 if len(ap) > 0 { @@ -10401,14 +9939,11 @@ func Chpgv(itype int, jobz lapack.Job, ul blas.Uplo, n int, ap, bp []complex64, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhpgv.f. -func Zhpgv(itype int, jobz lapack.Job, ul blas.Uplo, n int, ap, bp []complex128, w []float64, z []complex128, ldz int, work []complex128, rwork []float64) bool { +func Zhpgv(itype int, jobz, ul byte, n int, ap, bp []complex128, w []float64, z []complex128, ldz int, work []complex128, rwork []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex128 if len(ap) > 0 { @@ -10438,14 +9973,11 @@ func Zhpgv(itype int, jobz lapack.Job, ul blas.Uplo, n int, ap, bp []complex128, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chpgvd.f. -func Chpgvd(itype int, jobz lapack.Job, ul blas.Uplo, n int, ap, bp []complex64, w []float32, z []complex64, ldz int, work []complex64, lwork int, rwork []float32, lrwork int, iwork []int32, liwork int) bool { +func Chpgvd(itype int, jobz, ul byte, n int, ap, bp []complex64, w []float32, z []complex64, ldz int, work []complex64, lwork int, rwork []float32, lrwork int, iwork []int32, liwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex64 if len(ap) > 0 { @@ -10479,14 +10011,11 @@ func Chpgvd(itype int, jobz lapack.Job, ul blas.Uplo, n int, ap, bp []complex64, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhpgvd.f. -func Zhpgvd(itype int, jobz lapack.Job, ul blas.Uplo, n int, ap, bp []complex128, w []float64, z []complex128, ldz int, work []complex128, lwork int, rwork []float64, lrwork int, iwork []int32, liwork int) bool { +func Zhpgvd(itype int, jobz, ul byte, n int, ap, bp []complex128, w []float64, z []complex128, ldz int, work []complex128, lwork int, rwork []float64, lrwork int, iwork []int32, liwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex128 if len(ap) > 0 { @@ -10520,14 +10049,11 @@ func Zhpgvd(itype int, jobz lapack.Job, ul blas.Uplo, n int, ap, bp []complex128 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chpgvx.f. -func Chpgvx(itype int, jobz lapack.Job, rng byte, ul blas.Uplo, n int, ap, bp []complex64, vl, vu float32, il, iu int, abstol float32, m []int32, w []float32, z []complex64, ldz int, work []complex64, rwork []float32, iwork, ifail []int32) bool { +func Chpgvx(itype int, jobz, rng, ul byte, n int, ap, bp []complex64, vl, vu float32, il, iu int, abstol float32, m []int32, w []float32, z []complex64, ldz int, work []complex64, rwork []float32, iwork, ifail []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex64 if len(ap) > 0 { @@ -10569,14 +10095,11 @@ func Chpgvx(itype int, jobz lapack.Job, rng byte, ul blas.Uplo, n int, ap, bp [] } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhpgvx.f. -func Zhpgvx(itype int, jobz lapack.Job, rng byte, ul blas.Uplo, n int, ap, bp []complex128, vl, vu float64, il, iu int, abstol float64, m []int32, w []float64, z []complex128, ldz int, work []complex128, rwork []float64, iwork, ifail []int32) bool { +func Zhpgvx(itype int, jobz, rng, ul byte, n int, ap, bp []complex128, vl, vu float64, il, iu int, abstol float64, m []int32, w []float64, z []complex128, ldz int, work []complex128, rwork []float64, iwork, ifail []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex128 if len(ap) > 0 { @@ -10618,14 +10141,11 @@ func Zhpgvx(itype int, jobz lapack.Job, rng byte, ul blas.Uplo, n int, ap, bp [] } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chprfs.f. -func Chprfs(ul blas.Uplo, n, nrhs int, ap, afp []complex64, ipiv []int32, b []complex64, ldb int, x []complex64, ldx int, ferr, berr []float32, work []complex64, rwork []float32) bool { +func Chprfs(ul byte, n, nrhs int, ap, afp []complex64, ipiv []int32, b []complex64, ldb int, x []complex64, ldx int, ferr, berr []float32, work []complex64, rwork []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex64 if len(ap) > 0 { @@ -10667,14 +10187,11 @@ func Chprfs(ul blas.Uplo, n, nrhs int, ap, afp []complex64, ipiv []int32, b []co } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhprfs.f. -func Zhprfs(ul blas.Uplo, n, nrhs int, ap, afp []complex128, ipiv []int32, b []complex128, ldb int, x []complex128, ldx int, ferr, berr []float64, work []complex128, rwork []float64) bool { +func Zhprfs(ul byte, n, nrhs int, ap, afp []complex128, ipiv []int32, b []complex128, ldb int, x []complex128, ldx int, ferr, berr []float64, work []complex128, rwork []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex128 if len(ap) > 0 { @@ -10716,14 +10233,11 @@ func Zhprfs(ul blas.Uplo, n, nrhs int, ap, afp []complex128, ipiv []int32, b []c } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chpsv.f. -func Chpsv(ul blas.Uplo, n, nrhs int, ap []complex64, ipiv []int32, b []complex64, ldb int) bool { +func Chpsv(ul byte, n, nrhs int, ap []complex64, ipiv []int32, b []complex64, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex64 if len(ap) > 0 { @@ -10741,14 +10255,11 @@ func Chpsv(ul blas.Uplo, n, nrhs int, ap []complex64, ipiv []int32, b []complex6 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhpsv.f. -func Zhpsv(ul blas.Uplo, n, nrhs int, ap []complex128, ipiv []int32, b []complex128, ldb int) bool { +func Zhpsv(ul byte, n, nrhs int, ap []complex128, ipiv []int32, b []complex128, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex128 if len(ap) > 0 { @@ -10766,14 +10277,11 @@ func Zhpsv(ul blas.Uplo, n, nrhs int, ap []complex128, ipiv []int32, b []complex } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chpsvx.f. -func Chpsvx(fact byte, ul blas.Uplo, n, nrhs int, ap, afp []complex64, ipiv []int32, b []complex64, ldb int, x []complex64, ldx int, rcond, ferr, berr []float32, work []complex64, rwork []float32) bool { +func Chpsvx(fact, ul byte, n, nrhs int, ap, afp []complex64, ipiv []int32, b []complex64, ldb int, x []complex64, ldx int, rcond, ferr, berr []float32, work []complex64, rwork []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex64 if len(ap) > 0 { @@ -10819,14 +10327,11 @@ func Chpsvx(fact byte, ul blas.Uplo, n, nrhs int, ap, afp []complex64, ipiv []in } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhpsvx.f. -func Zhpsvx(fact byte, ul blas.Uplo, n, nrhs int, ap, afp []complex128, ipiv []int32, b []complex128, ldb int, x []complex128, ldx int, rcond, ferr, berr []float64, work []complex128, rwork []float64) bool { +func Zhpsvx(fact, ul byte, n, nrhs int, ap, afp []complex128, ipiv []int32, b []complex128, ldb int, x []complex128, ldx int, rcond, ferr, berr []float64, work []complex128, rwork []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex128 if len(ap) > 0 { @@ -10872,14 +10377,11 @@ func Zhpsvx(fact byte, ul blas.Uplo, n, nrhs int, ap, afp []complex128, ipiv []i } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chptrd.f. -func Chptrd(ul blas.Uplo, n int, ap []complex64, d, e []float32, tau []complex64) bool { +func Chptrd(ul byte, n int, ap []complex64, d, e []float32, tau []complex64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex64 if len(ap) > 0 { @@ -10901,14 +10403,11 @@ func Chptrd(ul blas.Uplo, n int, ap []complex64, d, e []float32, tau []complex64 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhptrd.f. -func Zhptrd(ul blas.Uplo, n int, ap []complex128, d, e []float64, tau []complex128) bool { +func Zhptrd(ul byte, n int, ap []complex128, d, e []float64, tau []complex128) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex128 if len(ap) > 0 { @@ -10930,14 +10429,11 @@ func Zhptrd(ul blas.Uplo, n int, ap []complex128, d, e []float64, tau []complex1 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chptrf.f. -func Chptrf(ul blas.Uplo, n int, ap []complex64, ipiv []int32) bool { +func Chptrf(ul byte, n int, ap []complex64, ipiv []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex64 if len(ap) > 0 { @@ -10951,14 +10447,11 @@ func Chptrf(ul blas.Uplo, n int, ap []complex64, ipiv []int32) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhptrf.f. -func Zhptrf(ul blas.Uplo, n int, ap []complex128, ipiv []int32) bool { +func Zhptrf(ul byte, n int, ap []complex128, ipiv []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex128 if len(ap) > 0 { @@ -10972,14 +10465,11 @@ func Zhptrf(ul blas.Uplo, n int, ap []complex128, ipiv []int32) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chptri.f. -func Chptri(ul blas.Uplo, n int, ap []complex64, ipiv []int32, work []complex64) bool { +func Chptri(ul byte, n int, ap []complex64, ipiv []int32, work []complex64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex64 if len(ap) > 0 { @@ -10997,14 +10487,11 @@ func Chptri(ul blas.Uplo, n int, ap []complex64, ipiv []int32, work []complex64) } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhptri.f. -func Zhptri(ul blas.Uplo, n int, ap []complex128, ipiv []int32, work []complex128) bool { +func Zhptri(ul byte, n int, ap []complex128, ipiv []int32, work []complex128) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex128 if len(ap) > 0 { @@ -11022,14 +10509,11 @@ func Zhptri(ul blas.Uplo, n int, ap []complex128, ipiv []int32, work []complex12 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chptrs.f. -func Chptrs(ul blas.Uplo, n, nrhs int, ap []complex64, ipiv []int32, b []complex64, ldb int) bool { +func Chptrs(ul byte, n, nrhs int, ap []complex64, ipiv []int32, b []complex64, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex64 if len(ap) > 0 { @@ -11047,14 +10531,11 @@ func Chptrs(ul blas.Uplo, n, nrhs int, ap []complex64, ipiv []int32, b []complex } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhptrs.f. -func Zhptrs(ul blas.Uplo, n, nrhs int, ap []complex128, ipiv []int32, b []complex128, ldb int) bool { +func Zhptrs(ul byte, n, nrhs int, ap []complex128, ipiv []int32, b []complex128, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex128 if len(ap) > 0 { @@ -11072,7 +10553,7 @@ func Zhptrs(ul blas.Uplo, n, nrhs int, ap []complex128, ipiv []int32, b []comple } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/shsein.f. -func Shsein(job lapack.Job, eigsrc, initv byte, sel []int32, n int, h []float32, ldh int, wr, wi, vl []float32, ldvl int, vr []float32, ldvr, mm int, m []int32, work []float32, ifaill, ifailr []int32) bool { +func Shsein(job, eigsrc, initv byte, sel []int32, n int, h []float32, ldh int, wr, wi, vl []float32, ldvl int, vr []float32, ldvr, mm int, m []int32, work []float32, ifaill, ifailr []int32) bool { var _sel *int32 if len(sel) > 0 { _sel = &sel[0] @@ -11117,7 +10598,7 @@ func Shsein(job lapack.Job, eigsrc, initv byte, sel []int32, n int, h []float32, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dhsein.f. -func Dhsein(job lapack.Job, eigsrc, initv byte, sel []int32, n int, h []float64, ldh int, wr, wi, vl []float64, ldvl int, vr []float64, ldvr, mm int, m []int32, work []float64, ifaill, ifailr []int32) bool { +func Dhsein(job, eigsrc, initv byte, sel []int32, n int, h []float64, ldh int, wr, wi, vl []float64, ldvl int, vr []float64, ldvr, mm int, m []int32, work []float64, ifaill, ifailr []int32) bool { var _sel *int32 if len(sel) > 0 { _sel = &sel[0] @@ -11162,7 +10643,7 @@ func Dhsein(job lapack.Job, eigsrc, initv byte, sel []int32, n int, h []float64, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chsein.f. -func Chsein(job lapack.Job, eigsrc, initv byte, sel []int32, n int, h []complex64, ldh int, w, vl []complex64, ldvl int, vr []complex64, ldvr, mm int, m []int32, work []complex64, rwork []float32, ifaill, ifailr []int32) bool { +func Chsein(job, eigsrc, initv byte, sel []int32, n int, h []complex64, ldh int, w, vl []complex64, ldvl int, vr []complex64, ldvr, mm int, m []int32, work []complex64, rwork []float32, ifaill, ifailr []int32) bool { var _sel *int32 if len(sel) > 0 { _sel = &sel[0] @@ -11207,7 +10688,7 @@ func Chsein(job lapack.Job, eigsrc, initv byte, sel []int32, n int, h []complex6 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhsein.f. -func Zhsein(job lapack.Job, eigsrc, initv byte, sel []int32, n int, h []complex128, ldh int, w, vl []complex128, ldvl int, vr []complex128, ldvr, mm int, m []int32, work []complex128, rwork []float64, ifaill, ifailr []int32) bool { +func Zhsein(job, eigsrc, initv byte, sel []int32, n int, h []complex128, ldh int, w, vl []complex128, ldvl int, vr []complex128, ldvr, mm int, m []int32, work []complex128, rwork []float64, ifaill, ifailr []int32) bool { var _sel *int32 if len(sel) > 0 { _sel = &sel[0] @@ -11252,7 +10733,7 @@ func Zhsein(job lapack.Job, eigsrc, initv byte, sel []int32, n int, h []complex1 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/shseqr.f. -func Shseqr(job lapack.Job, compz lapack.Comp, n, ilo, ihi int, h []float32, ldh int, wr, wi, z []float32, ldz int, work []float32, lwork int) int { +func Shseqr(job, compz byte, n, ilo, ihi int, h []float32, ldh int, wr, wi, z []float32, ldz int, work []float32, lwork int) int { var _h *float32 if len(h) > 0 { _h = &h[0] @@ -11277,7 +10758,7 @@ func Shseqr(job lapack.Job, compz lapack.Comp, n, ilo, ihi int, h []float32, ldh } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dhseqr.f. -func Dhseqr(job lapack.Job, compz lapack.Comp, n, ilo, ihi int, h []float64, ldh int, wr, wi, z []float64, ldz int, work []float64, lwork int) int { +func Dhseqr(job, compz byte, n, ilo, ihi int, h []float64, ldh int, wr, wi, z []float64, ldz int, work []float64, lwork int) int { var _h *float64 if len(h) > 0 { _h = &h[0] @@ -11302,7 +10783,7 @@ func Dhseqr(job lapack.Job, compz lapack.Comp, n, ilo, ihi int, h []float64, ldh } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chseqr.f. -func Chseqr(job lapack.Job, compz lapack.Comp, n, ilo, ihi int, h []complex64, ldh int, w, z []complex64, ldz int, work []complex64, lwork int) int { +func Chseqr(job, compz byte, n, ilo, ihi int, h []complex64, ldh int, w, z []complex64, ldz int, work []complex64, lwork int) int { var _h *complex64 if len(h) > 0 { _h = &h[0] @@ -11323,7 +10804,7 @@ func Chseqr(job lapack.Job, compz lapack.Comp, n, ilo, ihi int, h []complex64, l } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhseqr.f. -func Zhseqr(job lapack.Job, compz lapack.Comp, n, ilo, ihi int, h []complex128, ldh int, w, z []complex128, ldz int, work []complex128, lwork int) int { +func Zhseqr(job, compz byte, n, ilo, ihi int, h []complex128, ldh int, w, z []complex128, ldz int, work []complex128, lwork int) int { var _h *complex128 if len(h) > 0 { _h = &h[0] @@ -11470,15 +10951,7 @@ func Zlacn2(n int, v, x []complex128, est []float64, kase, isave []int32) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/slacpy.f. -func Slacpy(ul blas.Uplo, m, n int, a []float32, lda int, b []float32, ldb int) bool { - switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' - default: - ul = 'A' - } +func Slacpy(ul byte, m, n int, a []float32, lda int, b []float32, ldb int) bool { var _a *float32 if len(a) > 0 { _a = &a[0] @@ -11491,15 +10964,7 @@ func Slacpy(ul blas.Uplo, m, n int, a []float32, lda int, b []float32, ldb int) } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dlacpy.f. -func Dlacpy(ul blas.Uplo, m, n int, a []float64, lda int, b []float64, ldb int) bool { - switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' - default: - ul = 'A' - } +func Dlacpy(ul byte, m, n int, a []float64, lda int, b []float64, ldb int) bool { var _a *float64 if len(a) > 0 { _a = &a[0] @@ -11512,15 +10977,7 @@ func Dlacpy(ul blas.Uplo, m, n int, a []float64, lda int, b []float64, ldb int) } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/clacpy.f. -func Clacpy(ul blas.Uplo, m, n int, a []complex64, lda int, b []complex64, ldb int) bool { - switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' - default: - ul = 'A' - } +func Clacpy(ul byte, m, n int, a []complex64, lda int, b []complex64, ldb int) bool { var _a *complex64 if len(a) > 0 { _a = &a[0] @@ -11533,15 +10990,7 @@ func Clacpy(ul blas.Uplo, m, n int, a []complex64, lda int, b []complex64, ldb i } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zlacpy.f. -func Zlacpy(ul blas.Uplo, m, n int, a []complex128, lda int, b []complex128, ldb int) bool { - switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' - default: - ul = 'A' - } +func Zlacpy(ul byte, m, n int, a []complex128, lda int, b []complex128, ldb int) bool { var _a *complex128 if len(a) > 0 { _a = &a[0] @@ -11554,14 +11003,11 @@ func Zlacpy(ul blas.Uplo, m, n int, a []complex128, lda int, b []complex128, ldb } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/clacp2.f. -func Clacp2(ul blas.Uplo, m, n int, a []float32, lda int, b []complex64, ldb int) bool { +func Clacp2(ul byte, m, n int, a []float32, lda int, b []complex64, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -11575,14 +11021,11 @@ func Clacp2(ul blas.Uplo, m, n int, a []float32, lda int, b []complex64, ldb int } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zlacp2.f. -func Zlacp2(ul blas.Uplo, m, n int, a []float64, lda int, b []complex128, ldb int) bool { +func Zlacp2(ul byte, m, n int, a []float64, lda int, b []complex128, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -12104,14 +11547,11 @@ func Zlange(norm byte, m, n int, a []complex128, lda int, work []float64) float6 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/clanhe.f. -func Clanhe(norm byte, ul blas.Uplo, n int, a []complex64, lda int, work []float32) float32 { +func Clanhe(norm, ul byte, n int, a []complex64, lda int, work []float32) float32 { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -12125,14 +11565,11 @@ func Clanhe(norm byte, ul blas.Uplo, n int, a []complex64, lda int, work []float } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zlanhe.f. -func Zlanhe(norm byte, ul blas.Uplo, n int, a []complex128, lda int, work []float64) float64 { +func Zlanhe(norm, ul byte, n int, a []complex128, lda int, work []float64) float64 { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -12146,14 +11583,11 @@ func Zlanhe(norm byte, ul blas.Uplo, n int, a []complex128, lda int, work []floa } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/slansy.f. -func Slansy(norm byte, ul blas.Uplo, n int, a []float32, lda int, work []float32) float32 { +func Slansy(norm, ul byte, n int, a []float32, lda int, work []float32) float32 { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -12167,14 +11601,11 @@ func Slansy(norm byte, ul blas.Uplo, n int, a []float32, lda int, work []float32 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dlansy.f. -func Dlansy(norm byte, ul blas.Uplo, n int, a []float64, lda int, work []float64) float64 { +func Dlansy(norm, ul byte, n int, a []float64, lda int, work []float64) float64 { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -12188,14 +11619,11 @@ func Dlansy(norm byte, ul blas.Uplo, n int, a []float64, lda int, work []float64 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/clansy.f. -func Clansy(norm byte, ul blas.Uplo, n int, a []complex64, lda int, work []float32) float32 { +func Clansy(norm, ul byte, n int, a []complex64, lda int, work []float32) float32 { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -12209,14 +11637,11 @@ func Clansy(norm byte, ul blas.Uplo, n int, a []complex64, lda int, work []float } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zlansy.f. -func Zlansy(norm byte, ul blas.Uplo, n int, a []complex128, lda int, work []float64) float64 { +func Zlansy(norm, ul byte, n int, a []complex128, lda int, work []float64) float64 { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -12230,22 +11655,16 @@ func Zlansy(norm byte, ul blas.Uplo, n int, a []complex128, lda int, work []floa } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/slantr.f. -func Slantr(norm byte, ul blas.Uplo, d blas.Diag, m, n int, a []float32, lda int, work []float32) float32 { +func Slantr(norm, ul, d byte, m, n int, a []float32, lda int, work []float32) float32 { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _a *float32 if len(a) > 0 { @@ -12259,22 +11678,16 @@ func Slantr(norm byte, ul blas.Uplo, d blas.Diag, m, n int, a []float32, lda int } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dlantr.f. -func Dlantr(norm byte, ul blas.Uplo, d blas.Diag, m, n int, a []float64, lda int, work []float64) float64 { +func Dlantr(norm, ul, d byte, m, n int, a []float64, lda int, work []float64) float64 { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _a *float64 if len(a) > 0 { @@ -12288,22 +11701,16 @@ func Dlantr(norm byte, ul blas.Uplo, d blas.Diag, m, n int, a []float64, lda int } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/clantr.f. -func Clantr(norm byte, ul blas.Uplo, d blas.Diag, m, n int, a []complex64, lda int, work []float32) float32 { +func Clantr(norm, ul, d byte, m, n int, a []complex64, lda int, work []float32) float32 { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _a *complex64 if len(a) > 0 { @@ -12317,22 +11724,16 @@ func Clantr(norm byte, ul blas.Uplo, d blas.Diag, m, n int, a []complex64, lda i } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zlantr.f. -func Zlantr(norm byte, ul blas.Uplo, d blas.Diag, m, n int, a []complex128, lda int, work []float64) float64 { +func Zlantr(norm, ul, d byte, m, n int, a []complex128, lda int, work []float64) float64 { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _a *complex128 if len(a) > 0 { @@ -12346,22 +11747,14 @@ func Zlantr(norm byte, ul blas.Uplo, d blas.Diag, m, n int, a []complex128, lda } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/slarfb.f. -func Slarfb(side blas.Side, trans blas.Transpose, direct, storev byte, m, n, k int, v []float32, ldv int, t []float32, ldt int, c []float32, ldc int, work []float32, ldwork int) bool { +func Slarfb(side, trans, direct, storev byte, m, n, k int, v []float32, ldv int, t []float32, ldt int, c []float32, ldc int, work []float32, ldwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -12385,22 +11778,14 @@ func Slarfb(side blas.Side, trans blas.Transpose, direct, storev byte, m, n, k i } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dlarfb.f. -func Dlarfb(side blas.Side, trans blas.Transpose, direct, storev byte, m, n, k int, v []float64, ldv int, t []float64, ldt int, c []float64, ldc int, work []float64, ldwork int) bool { +func Dlarfb(side, trans, direct, storev byte, m, n, k int, v []float64, ldv int, t []float64, ldt int, c []float64, ldc int, work []float64, ldwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -12424,22 +11809,14 @@ func Dlarfb(side blas.Side, trans blas.Transpose, direct, storev byte, m, n, k i } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/clarfb.f. -func Clarfb(side blas.Side, trans blas.Transpose, direct, storev byte, m, n, k int, v []complex64, ldv int, t []complex64, ldt int, c []complex64, ldc int, work []complex64, ldwork int) bool { +func Clarfb(side, trans, direct, storev byte, m, n, k int, v []complex64, ldv int, t []complex64, ldt int, c []complex64, ldc int, work []complex64, ldwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -12463,22 +11840,14 @@ func Clarfb(side blas.Side, trans blas.Transpose, direct, storev byte, m, n, k i } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zlarfb.f. -func Zlarfb(side blas.Side, trans blas.Transpose, direct, storev byte, m, n, k int, v []complex128, ldv int, t []complex128, ldt int, c []complex128, ldc int, work []complex128, ldwork int) bool { +func Zlarfb(side, trans, direct, storev byte, m, n, k int, v []complex128, ldv int, t []complex128, ldt int, c []complex128, ldc int, work []complex128, ldwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -12638,12 +12007,9 @@ func Zlarft(direct, storev byte, n, k int, v []complex128, ldv int, tau, t []com } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/slarfx.f. -func Slarfx(side blas.Side, m, n int, v []float32, tau float32, c []float32, ldc int, work []float32) bool { +func Slarfx(side byte, m, n int, v []float32, tau float32, c []float32, ldc int, work []float32) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } @@ -12663,12 +12029,9 @@ func Slarfx(side blas.Side, m, n int, v []float32, tau float32, c []float32, ldc } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dlarfx.f. -func Dlarfx(side blas.Side, m, n int, v []float64, tau float64, c []float64, ldc int, work []float64) bool { +func Dlarfx(side byte, m, n int, v []float64, tau float64, c []float64, ldc int, work []float64) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } @@ -12688,12 +12051,9 @@ func Dlarfx(side blas.Side, m, n int, v []float64, tau float64, c []float64, ldc } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/clarfx.f. -func Clarfx(side blas.Side, m, n int, v []complex64, tau complex64, c []complex64, ldc int, work []complex64) bool { +func Clarfx(side byte, m, n int, v []complex64, tau complex64, c []complex64, ldc int, work []complex64) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } @@ -12713,12 +12073,9 @@ func Clarfx(side blas.Side, m, n int, v []complex64, tau complex64, c []complex6 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zlarfx.f. -func Zlarfx(side blas.Side, m, n int, v []complex128, tau complex128, c []complex128, ldc int, work []complex128) bool { +func Zlarfx(side byte, m, n int, v []complex128, tau complex128, c []complex128, ldc int, work []complex128) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } @@ -12826,15 +12183,7 @@ func Zlascl(typ byte, kl, ku int, cfrom, cto float64, m, n int, a []complex128, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/slaset.f. -func Slaset(ul blas.Uplo, m, n int, alpha, beta float32, a []float32, lda int) bool { - switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' - default: - ul = 'A' - } +func Slaset(ul byte, m, n int, alpha, beta float32, a []float32, lda int) bool { var _a *float32 if len(a) > 0 { _a = &a[0] @@ -12843,15 +12192,7 @@ func Slaset(ul blas.Uplo, m, n int, alpha, beta float32, a []float32, lda int) b } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dlaset.f. -func Dlaset(ul blas.Uplo, m, n int, alpha, beta float64, a []float64, lda int) bool { - switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' - default: - ul = 'A' - } +func Dlaset(ul byte, m, n int, alpha, beta float64, a []float64, lda int) bool { var _a *float64 if len(a) > 0 { _a = &a[0] @@ -12860,15 +12201,7 @@ func Dlaset(ul blas.Uplo, m, n int, alpha, beta float64, a []float64, lda int) b } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/claset.f. -func Claset(ul blas.Uplo, m, n int, alpha, beta complex64, a []complex64, lda int) bool { - switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' - default: - ul = 'A' - } +func Claset(ul byte, m, n int, alpha, beta complex64, a []complex64, lda int) bool { var _a *complex64 if len(a) > 0 { _a = &a[0] @@ -12877,15 +12210,7 @@ func Claset(ul blas.Uplo, m, n int, alpha, beta complex64, a []complex64, lda in } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zlaset.f. -func Zlaset(ul blas.Uplo, m, n int, alpha, beta complex128, a []complex128, lda int) bool { - switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' - default: - ul = 'A' - } +func Zlaset(ul byte, m, n int, alpha, beta complex128, a []complex128, lda int) bool { var _a *complex128 if len(a) > 0 { _a = &a[0] @@ -13048,14 +12373,11 @@ func Zlatms(m, n int, dist byte, iseed []int32, sym byte, d []float64, mode int, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/slauum.f. -func Slauum(ul blas.Uplo, n int, a []float32, lda int) bool { +func Slauum(ul byte, n int, a []float32, lda int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -13065,14 +12387,11 @@ func Slauum(ul blas.Uplo, n int, a []float32, lda int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dlauum.f. -func Dlauum(ul blas.Uplo, n int, a []float64, lda int) bool { +func Dlauum(ul byte, n int, a []float64, lda int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -13082,14 +12401,11 @@ func Dlauum(ul blas.Uplo, n int, a []float64, lda int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/clauum.f. -func Clauum(ul blas.Uplo, n int, a []complex64, lda int) bool { +func Clauum(ul byte, n int, a []complex64, lda int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -13099,14 +12415,11 @@ func Clauum(ul blas.Uplo, n int, a []complex64, lda int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zlauum.f. -func Zlauum(ul blas.Uplo, n int, a []complex128, lda int) bool { +func Zlauum(ul byte, n int, a []complex128, lda int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -13116,14 +12429,11 @@ func Zlauum(ul blas.Uplo, n int, a []complex128, lda int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sopgtr.f. -func Sopgtr(ul blas.Uplo, n int, ap, tau, q []float32, ldq int, work []float32) bool { +func Sopgtr(ul byte, n int, ap, tau, q []float32, ldq int, work []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float32 if len(ap) > 0 { @@ -13145,14 +12455,11 @@ func Sopgtr(ul blas.Uplo, n int, ap, tau, q []float32, ldq int, work []float32) } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dopgtr.f. -func Dopgtr(ul blas.Uplo, n int, ap, tau, q []float64, ldq int, work []float64) bool { +func Dopgtr(ul byte, n int, ap, tau, q []float64, ldq int, work []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float64 if len(ap) > 0 { @@ -13174,30 +12481,19 @@ func Dopgtr(ul blas.Uplo, n int, ap, tau, q []float64, ldq int, work []float64) } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sopmtr.f. -func Sopmtr(side blas.Side, ul blas.Uplo, trans blas.Transpose, m, n int, ap, tau, c []float32, ldc int, work []float32) bool { +func Sopmtr(side, ul, trans byte, m, n int, ap, tau, c []float32, ldc int, work []float32) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -13221,30 +12517,19 @@ func Sopmtr(side blas.Side, ul blas.Uplo, trans blas.Transpose, m, n int, ap, ta } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dopmtr.f. -func Dopmtr(side blas.Side, ul blas.Uplo, trans blas.Transpose, m, n int, ap, tau, c []float64, ldc int, work []float64) bool { +func Dopmtr(side, ul, trans byte, m, n int, ap, tau, c []float64, ldc int, work []float64) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -13472,14 +12757,11 @@ func Dorgrq(m, n, k int, a []float64, lda int, tau, work []float64, lwork int) b } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sorgtr.f. -func Sorgtr(ul blas.Uplo, n int, a []float32, lda int, tau, work []float32, lwork int) bool { +func Sorgtr(ul byte, n int, a []float32, lda int, tau, work []float32, lwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -13497,14 +12779,11 @@ func Sorgtr(ul blas.Uplo, n int, a []float32, lda int, tau, work []float32, lwor } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dorgtr.f. -func Dorgtr(ul blas.Uplo, n int, a []float64, lda int, tau, work []float64, lwork int) bool { +func Dorgtr(ul byte, n int, a []float64, lda int, tau, work []float64, lwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -13522,22 +12801,14 @@ func Dorgtr(ul blas.Uplo, n int, a []float64, lda int, tau, work []float64, lwor } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sormbr.f. -func Sormbr(vect byte, side blas.Side, trans blas.Transpose, m, n, k int, a []float32, lda int, tau, c []float32, ldc int, work []float32, lwork int) bool { +func Sormbr(vect, side, trans byte, m, n, k int, a []float32, lda int, tau, c []float32, ldc int, work []float32, lwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -13561,22 +12832,14 @@ func Sormbr(vect byte, side blas.Side, trans blas.Transpose, m, n, k int, a []fl } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dormbr.f. -func Dormbr(vect byte, side blas.Side, trans blas.Transpose, m, n, k int, a []float64, lda int, tau, c []float64, ldc int, work []float64, lwork int) bool { +func Dormbr(vect, side, trans byte, m, n, k int, a []float64, lda int, tau, c []float64, ldc int, work []float64, lwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -13600,22 +12863,14 @@ func Dormbr(vect byte, side blas.Side, trans blas.Transpose, m, n, k int, a []fl } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sormhr.f. -func Sormhr(side blas.Side, trans blas.Transpose, m, n, ilo, ihi int, a []float32, lda int, tau, c []float32, ldc int, work []float32, lwork int) bool { +func Sormhr(side, trans byte, m, n, ilo, ihi int, a []float32, lda int, tau, c []float32, ldc int, work []float32, lwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -13639,22 +12894,14 @@ func Sormhr(side blas.Side, trans blas.Transpose, m, n, ilo, ihi int, a []float3 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dormhr.f. -func Dormhr(side blas.Side, trans blas.Transpose, m, n, ilo, ihi int, a []float64, lda int, tau, c []float64, ldc int, work []float64, lwork int) bool { +func Dormhr(side, trans byte, m, n, ilo, ihi int, a []float64, lda int, tau, c []float64, ldc int, work []float64, lwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -13678,22 +12925,14 @@ func Dormhr(side blas.Side, trans blas.Transpose, m, n, ilo, ihi int, a []float6 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sormlq.f. -func Sormlq(side blas.Side, trans blas.Transpose, m, n, k int, a []float32, lda int, tau, c []float32, ldc int, work []float32, lwork int) bool { +func Sormlq(side, trans byte, m, n, k int, a []float32, lda int, tau, c []float32, ldc int, work []float32, lwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -13717,22 +12956,14 @@ func Sormlq(side blas.Side, trans blas.Transpose, m, n, k int, a []float32, lda } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dormlq.f. -func Dormlq(side blas.Side, trans blas.Transpose, m, n, k int, a []float64, lda int, tau, c []float64, ldc int, work []float64, lwork int) bool { +func Dormlq(side, trans byte, m, n, k int, a []float64, lda int, tau, c []float64, ldc int, work []float64, lwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -13756,22 +12987,14 @@ func Dormlq(side blas.Side, trans blas.Transpose, m, n, k int, a []float64, lda } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sormql.f. -func Sormql(side blas.Side, trans blas.Transpose, m, n, k int, a []float32, lda int, tau, c []float32, ldc int, work []float32, lwork int) bool { +func Sormql(side, trans byte, m, n, k int, a []float32, lda int, tau, c []float32, ldc int, work []float32, lwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -13795,22 +13018,14 @@ func Sormql(side blas.Side, trans blas.Transpose, m, n, k int, a []float32, lda } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dormql.f. -func Dormql(side blas.Side, trans blas.Transpose, m, n, k int, a []float64, lda int, tau, c []float64, ldc int, work []float64, lwork int) bool { +func Dormql(side, trans byte, m, n, k int, a []float64, lda int, tau, c []float64, ldc int, work []float64, lwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -13834,22 +13049,14 @@ func Dormql(side blas.Side, trans blas.Transpose, m, n, k int, a []float64, lda } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sormqr.f. -func Sormqr(side blas.Side, trans blas.Transpose, m, n, k int, a []float32, lda int, tau, c []float32, ldc int, work []float32, lwork int) bool { +func Sormqr(side, trans byte, m, n, k int, a []float32, lda int, tau, c []float32, ldc int, work []float32, lwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -13873,22 +13080,14 @@ func Sormqr(side blas.Side, trans blas.Transpose, m, n, k int, a []float32, lda } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dormqr.f. -func Dormqr(side blas.Side, trans blas.Transpose, m, n, k int, a []float64, lda int, tau, c []float64, ldc int, work []float64, lwork int) bool { +func Dormqr(side, trans byte, m, n, k int, a []float64, lda int, tau, c []float64, ldc int, work []float64, lwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -13912,22 +13111,14 @@ func Dormqr(side blas.Side, trans blas.Transpose, m, n, k int, a []float64, lda } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sormrq.f. -func Sormrq(side blas.Side, trans blas.Transpose, m, n, k int, a []float32, lda int, tau, c []float32, ldc int, work []float32, lwork int) bool { +func Sormrq(side, trans byte, m, n, k int, a []float32, lda int, tau, c []float32, ldc int, work []float32, lwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -13951,22 +13142,14 @@ func Sormrq(side blas.Side, trans blas.Transpose, m, n, k int, a []float32, lda } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dormrq.f. -func Dormrq(side blas.Side, trans blas.Transpose, m, n, k int, a []float64, lda int, tau, c []float64, ldc int, work []float64, lwork int) bool { +func Dormrq(side, trans byte, m, n, k int, a []float64, lda int, tau, c []float64, ldc int, work []float64, lwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -13990,22 +13173,14 @@ func Dormrq(side blas.Side, trans blas.Transpose, m, n, k int, a []float64, lda } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sormrz.f. -func Sormrz(side blas.Side, trans blas.Transpose, m, n, k, l int, a []float32, lda int, tau, c []float32, ldc int, work []float32, lwork int) bool { +func Sormrz(side, trans byte, m, n, k, l int, a []float32, lda int, tau, c []float32, ldc int, work []float32, lwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -14029,22 +13204,14 @@ func Sormrz(side blas.Side, trans blas.Transpose, m, n, k, l int, a []float32, l } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dormrz.f. -func Dormrz(side blas.Side, trans blas.Transpose, m, n, k, l int, a []float64, lda int, tau, c []float64, ldc int, work []float64, lwork int) bool { +func Dormrz(side, trans byte, m, n, k, l int, a []float64, lda int, tau, c []float64, ldc int, work []float64, lwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -14068,30 +13235,19 @@ func Dormrz(side blas.Side, trans blas.Transpose, m, n, k, l int, a []float64, l } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sormtr.f. -func Sormtr(side blas.Side, ul blas.Uplo, trans blas.Transpose, m, n int, a []float32, lda int, tau, c []float32, ldc int, work []float32, lwork int) bool { +func Sormtr(side, ul, trans byte, m, n int, a []float32, lda int, tau, c []float32, ldc int, work []float32, lwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -14115,30 +13271,19 @@ func Sormtr(side blas.Side, ul blas.Uplo, trans blas.Transpose, m, n int, a []fl } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dormtr.f. -func Dormtr(side blas.Side, ul blas.Uplo, trans blas.Transpose, m, n int, a []float64, lda int, tau, c []float64, ldc int, work []float64, lwork int) bool { +func Dormtr(side, ul, trans byte, m, n int, a []float64, lda int, tau, c []float64, ldc int, work []float64, lwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -14162,14 +13307,11 @@ func Dormtr(side blas.Side, ul blas.Uplo, trans blas.Transpose, m, n int, a []fl } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/spbcon.f. -func Spbcon(ul blas.Uplo, n, kd int, ab []float32, ldab int, anorm float32, rcond, work []float32, iwork []int32) bool { +func Spbcon(ul byte, n, kd int, ab []float32, ldab int, anorm float32, rcond, work []float32, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *float32 if len(ab) > 0 { @@ -14191,14 +13333,11 @@ func Spbcon(ul blas.Uplo, n, kd int, ab []float32, ldab int, anorm float32, rcon } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dpbcon.f. -func Dpbcon(ul blas.Uplo, n, kd int, ab []float64, ldab int, anorm float64, rcond, work []float64, iwork []int32) bool { +func Dpbcon(ul byte, n, kd int, ab []float64, ldab int, anorm float64, rcond, work []float64, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *float64 if len(ab) > 0 { @@ -14220,14 +13359,11 @@ func Dpbcon(ul blas.Uplo, n, kd int, ab []float64, ldab int, anorm float64, rcon } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cpbcon.f. -func Cpbcon(ul blas.Uplo, n, kd int, ab []complex64, ldab int, anorm float32, rcond []float32, work []complex64, rwork []float32) bool { +func Cpbcon(ul byte, n, kd int, ab []complex64, ldab int, anorm float32, rcond []float32, work []complex64, rwork []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *complex64 if len(ab) > 0 { @@ -14249,14 +13385,11 @@ func Cpbcon(ul blas.Uplo, n, kd int, ab []complex64, ldab int, anorm float32, rc } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zpbcon.f. -func Zpbcon(ul blas.Uplo, n, kd int, ab []complex128, ldab int, anorm float64, rcond []float64, work []complex128, rwork []float64) bool { +func Zpbcon(ul byte, n, kd int, ab []complex128, ldab int, anorm float64, rcond []float64, work []complex128, rwork []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *complex128 if len(ab) > 0 { @@ -14278,14 +13411,11 @@ func Zpbcon(ul blas.Uplo, n, kd int, ab []complex128, ldab int, anorm float64, r } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/spbequ.f. -func Spbequ(ul blas.Uplo, n, kd int, ab []float32, ldab int, s, scond, amax []float32) bool { +func Spbequ(ul byte, n, kd int, ab []float32, ldab int, s, scond, amax []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *float32 if len(ab) > 0 { @@ -14307,14 +13437,11 @@ func Spbequ(ul blas.Uplo, n, kd int, ab []float32, ldab int, s, scond, amax []fl } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dpbequ.f. -func Dpbequ(ul blas.Uplo, n, kd int, ab []float64, ldab int, s, scond, amax []float64) bool { +func Dpbequ(ul byte, n, kd int, ab []float64, ldab int, s, scond, amax []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *float64 if len(ab) > 0 { @@ -14336,14 +13463,11 @@ func Dpbequ(ul blas.Uplo, n, kd int, ab []float64, ldab int, s, scond, amax []fl } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cpbequ.f. -func Cpbequ(ul blas.Uplo, n, kd int, ab []complex64, ldab int, s, scond, amax []float32) bool { +func Cpbequ(ul byte, n, kd int, ab []complex64, ldab int, s, scond, amax []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *complex64 if len(ab) > 0 { @@ -14365,14 +13489,11 @@ func Cpbequ(ul blas.Uplo, n, kd int, ab []complex64, ldab int, s, scond, amax [] } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zpbequ.f. -func Zpbequ(ul blas.Uplo, n, kd int, ab []complex128, ldab int, s, scond, amax []float64) bool { +func Zpbequ(ul byte, n, kd int, ab []complex128, ldab int, s, scond, amax []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *complex128 if len(ab) > 0 { @@ -14394,14 +13515,11 @@ func Zpbequ(ul blas.Uplo, n, kd int, ab []complex128, ldab int, s, scond, amax [ } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/spbrfs.f. -func Spbrfs(ul blas.Uplo, n, kd, nrhs int, ab []float32, ldab int, afb []float32, ldafb int, b []float32, ldb int, x []float32, ldx int, ferr, berr, work []float32, iwork []int32) bool { +func Spbrfs(ul byte, n, kd, nrhs int, ab []float32, ldab int, afb []float32, ldafb int, b []float32, ldb int, x []float32, ldx int, ferr, berr, work []float32, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *float32 if len(ab) > 0 { @@ -14439,14 +13557,11 @@ func Spbrfs(ul blas.Uplo, n, kd, nrhs int, ab []float32, ldab int, afb []float32 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dpbrfs.f. -func Dpbrfs(ul blas.Uplo, n, kd, nrhs int, ab []float64, ldab int, afb []float64, ldafb int, b []float64, ldb int, x []float64, ldx int, ferr, berr, work []float64, iwork []int32) bool { +func Dpbrfs(ul byte, n, kd, nrhs int, ab []float64, ldab int, afb []float64, ldafb int, b []float64, ldb int, x []float64, ldx int, ferr, berr, work []float64, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *float64 if len(ab) > 0 { @@ -14484,14 +13599,11 @@ func Dpbrfs(ul blas.Uplo, n, kd, nrhs int, ab []float64, ldab int, afb []float64 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cpbrfs.f. -func Cpbrfs(ul blas.Uplo, n, kd, nrhs int, ab []complex64, ldab int, afb []complex64, ldafb int, b []complex64, ldb int, x []complex64, ldx int, ferr, berr []float32, work []complex64, rwork []float32) bool { +func Cpbrfs(ul byte, n, kd, nrhs int, ab []complex64, ldab int, afb []complex64, ldafb int, b []complex64, ldb int, x []complex64, ldx int, ferr, berr []float32, work []complex64, rwork []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *complex64 if len(ab) > 0 { @@ -14529,14 +13641,11 @@ func Cpbrfs(ul blas.Uplo, n, kd, nrhs int, ab []complex64, ldab int, afb []compl } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zpbrfs.f. -func Zpbrfs(ul blas.Uplo, n, kd, nrhs int, ab []complex128, ldab int, afb []complex128, ldafb int, b []complex128, ldb int, x []complex128, ldx int, ferr, berr []float64, work []complex128, rwork []float64) bool { +func Zpbrfs(ul byte, n, kd, nrhs int, ab []complex128, ldab int, afb []complex128, ldafb int, b []complex128, ldb int, x []complex128, ldx int, ferr, berr []float64, work []complex128, rwork []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *complex128 if len(ab) > 0 { @@ -14574,14 +13683,11 @@ func Zpbrfs(ul blas.Uplo, n, kd, nrhs int, ab []complex128, ldab int, afb []comp } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/spbstf.f. -func Spbstf(ul blas.Uplo, n, kb int, bb []float32, ldbb int) bool { +func Spbstf(ul byte, n, kb int, bb []float32, ldbb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _bb *float32 if len(bb) > 0 { @@ -14591,14 +13697,11 @@ func Spbstf(ul blas.Uplo, n, kb int, bb []float32, ldbb int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dpbstf.f. -func Dpbstf(ul blas.Uplo, n, kb int, bb []float64, ldbb int) bool { +func Dpbstf(ul byte, n, kb int, bb []float64, ldbb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _bb *float64 if len(bb) > 0 { @@ -14608,14 +13711,11 @@ func Dpbstf(ul blas.Uplo, n, kb int, bb []float64, ldbb int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cpbstf.f. -func Cpbstf(ul blas.Uplo, n, kb int, bb []complex64, ldbb int) bool { +func Cpbstf(ul byte, n, kb int, bb []complex64, ldbb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _bb *complex64 if len(bb) > 0 { @@ -14625,14 +13725,11 @@ func Cpbstf(ul blas.Uplo, n, kb int, bb []complex64, ldbb int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zpbstf.f. -func Zpbstf(ul blas.Uplo, n, kb int, bb []complex128, ldbb int) bool { +func Zpbstf(ul byte, n, kb int, bb []complex128, ldbb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _bb *complex128 if len(bb) > 0 { @@ -14642,14 +13739,11 @@ func Zpbstf(ul blas.Uplo, n, kb int, bb []complex128, ldbb int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/spbsv.f. -func Spbsv(ul blas.Uplo, n, kd, nrhs int, ab []float32, ldab int, b []float32, ldb int) bool { +func Spbsv(ul byte, n, kd, nrhs int, ab []float32, ldab int, b []float32, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *float32 if len(ab) > 0 { @@ -14663,14 +13757,11 @@ func Spbsv(ul blas.Uplo, n, kd, nrhs int, ab []float32, ldab int, b []float32, l } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dpbsv.f. -func Dpbsv(ul blas.Uplo, n, kd, nrhs int, ab []float64, ldab int, b []float64, ldb int) bool { +func Dpbsv(ul byte, n, kd, nrhs int, ab []float64, ldab int, b []float64, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *float64 if len(ab) > 0 { @@ -14684,14 +13775,11 @@ func Dpbsv(ul blas.Uplo, n, kd, nrhs int, ab []float64, ldab int, b []float64, l } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cpbsv.f. -func Cpbsv(ul blas.Uplo, n, kd, nrhs int, ab []complex64, ldab int, b []complex64, ldb int) bool { +func Cpbsv(ul byte, n, kd, nrhs int, ab []complex64, ldab int, b []complex64, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *complex64 if len(ab) > 0 { @@ -14705,14 +13793,11 @@ func Cpbsv(ul blas.Uplo, n, kd, nrhs int, ab []complex64, ldab int, b []complex6 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zpbsv.f. -func Zpbsv(ul blas.Uplo, n, kd, nrhs int, ab []complex128, ldab int, b []complex128, ldb int) bool { +func Zpbsv(ul byte, n, kd, nrhs int, ab []complex128, ldab int, b []complex128, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *complex128 if len(ab) > 0 { @@ -14726,14 +13811,11 @@ func Zpbsv(ul blas.Uplo, n, kd, nrhs int, ab []complex128, ldab int, b []complex } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/spbsvx.f. -func Spbsvx(fact byte, ul blas.Uplo, n, kd, nrhs int, ab []float32, ldab int, afb []float32, ldafb int, equed []byte, s, b []float32, ldb int, x []float32, ldx int, rcond, ferr, berr, work []float32, iwork []int32) bool { +func Spbsvx(fact, ul byte, n, kd, nrhs int, ab []float32, ldab int, afb []float32, ldafb int, equed []byte, s, b []float32, ldb int, x []float32, ldx int, rcond, ferr, berr, work []float32, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *float32 if len(ab) > 0 { @@ -14783,14 +13865,11 @@ func Spbsvx(fact byte, ul blas.Uplo, n, kd, nrhs int, ab []float32, ldab int, af } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dpbsvx.f. -func Dpbsvx(fact byte, ul blas.Uplo, n, kd, nrhs int, ab []float64, ldab int, afb []float64, ldafb int, equed []byte, s, b []float64, ldb int, x []float64, ldx int, rcond, ferr, berr, work []float64, iwork []int32) bool { +func Dpbsvx(fact, ul byte, n, kd, nrhs int, ab []float64, ldab int, afb []float64, ldafb int, equed []byte, s, b []float64, ldb int, x []float64, ldx int, rcond, ferr, berr, work []float64, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *float64 if len(ab) > 0 { @@ -14840,14 +13919,11 @@ func Dpbsvx(fact byte, ul blas.Uplo, n, kd, nrhs int, ab []float64, ldab int, af } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cpbsvx.f. -func Cpbsvx(fact byte, ul blas.Uplo, n, kd, nrhs int, ab []complex64, ldab int, afb []complex64, ldafb int, equed []byte, s []float32, b []complex64, ldb int, x []complex64, ldx int, rcond, ferr, berr []float32, work []complex64, rwork []float32) bool { +func Cpbsvx(fact, ul byte, n, kd, nrhs int, ab []complex64, ldab int, afb []complex64, ldafb int, equed []byte, s []float32, b []complex64, ldb int, x []complex64, ldx int, rcond, ferr, berr []float32, work []complex64, rwork []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *complex64 if len(ab) > 0 { @@ -14897,14 +13973,11 @@ func Cpbsvx(fact byte, ul blas.Uplo, n, kd, nrhs int, ab []complex64, ldab int, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zpbsvx.f. -func Zpbsvx(fact byte, ul blas.Uplo, n, kd, nrhs int, ab []complex128, ldab int, afb []complex128, ldafb int, equed []byte, s []float64, b []complex128, ldb int, x []complex128, ldx int, rcond, ferr, berr []float64, work []complex128, rwork []float64) bool { +func Zpbsvx(fact, ul byte, n, kd, nrhs int, ab []complex128, ldab int, afb []complex128, ldafb int, equed []byte, s []float64, b []complex128, ldb int, x []complex128, ldx int, rcond, ferr, berr []float64, work []complex128, rwork []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *complex128 if len(ab) > 0 { @@ -14954,14 +14027,11 @@ func Zpbsvx(fact byte, ul blas.Uplo, n, kd, nrhs int, ab []complex128, ldab int, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/spbtrf.f. -func Spbtrf(ul blas.Uplo, n, kd int, ab []float32, ldab int) bool { +func Spbtrf(ul byte, n, kd int, ab []float32, ldab int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *float32 if len(ab) > 0 { @@ -14971,14 +14041,11 @@ func Spbtrf(ul blas.Uplo, n, kd int, ab []float32, ldab int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dpbtrf.f. -func Dpbtrf(ul blas.Uplo, n, kd int, ab []float64, ldab int) bool { +func Dpbtrf(ul byte, n, kd int, ab []float64, ldab int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *float64 if len(ab) > 0 { @@ -14988,14 +14055,11 @@ func Dpbtrf(ul blas.Uplo, n, kd int, ab []float64, ldab int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cpbtrf.f. -func Cpbtrf(ul blas.Uplo, n, kd int, ab []complex64, ldab int) bool { +func Cpbtrf(ul byte, n, kd int, ab []complex64, ldab int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *complex64 if len(ab) > 0 { @@ -15005,14 +14069,11 @@ func Cpbtrf(ul blas.Uplo, n, kd int, ab []complex64, ldab int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zpbtrf.f. -func Zpbtrf(ul blas.Uplo, n, kd int, ab []complex128, ldab int) bool { +func Zpbtrf(ul byte, n, kd int, ab []complex128, ldab int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *complex128 if len(ab) > 0 { @@ -15022,14 +14083,11 @@ func Zpbtrf(ul blas.Uplo, n, kd int, ab []complex128, ldab int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/spbtrs.f. -func Spbtrs(ul blas.Uplo, n, kd, nrhs int, ab []float32, ldab int, b []float32, ldb int) bool { +func Spbtrs(ul byte, n, kd, nrhs int, ab []float32, ldab int, b []float32, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *float32 if len(ab) > 0 { @@ -15043,14 +14101,11 @@ func Spbtrs(ul blas.Uplo, n, kd, nrhs int, ab []float32, ldab int, b []float32, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dpbtrs.f. -func Dpbtrs(ul blas.Uplo, n, kd, nrhs int, ab []float64, ldab int, b []float64, ldb int) bool { +func Dpbtrs(ul byte, n, kd, nrhs int, ab []float64, ldab int, b []float64, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *float64 if len(ab) > 0 { @@ -15064,14 +14119,11 @@ func Dpbtrs(ul blas.Uplo, n, kd, nrhs int, ab []float64, ldab int, b []float64, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cpbtrs.f. -func Cpbtrs(ul blas.Uplo, n, kd, nrhs int, ab []complex64, ldab int, b []complex64, ldb int) bool { +func Cpbtrs(ul byte, n, kd, nrhs int, ab []complex64, ldab int, b []complex64, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *complex64 if len(ab) > 0 { @@ -15085,14 +14137,11 @@ func Cpbtrs(ul blas.Uplo, n, kd, nrhs int, ab []complex64, ldab int, b []complex } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zpbtrs.f. -func Zpbtrs(ul blas.Uplo, n, kd, nrhs int, ab []complex128, ldab int, b []complex128, ldb int) bool { +func Zpbtrs(ul byte, n, kd, nrhs int, ab []complex128, ldab int, b []complex128, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *complex128 if len(ab) > 0 { @@ -15106,24 +14155,16 @@ func Zpbtrs(ul blas.Uplo, n, kd, nrhs int, ab []complex128, ldab int, b []comple } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/spftrf.f. -func Spftrf(transr blas.Transpose, ul blas.Uplo, n int, a []float32) bool { +func Spftrf(transr, ul byte, n int, a []float32) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -15133,24 +14174,16 @@ func Spftrf(transr blas.Transpose, ul blas.Uplo, n int, a []float32) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dpftrf.f. -func Dpftrf(transr blas.Transpose, ul blas.Uplo, n int, a []float64) bool { +func Dpftrf(transr, ul byte, n int, a []float64) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -15160,24 +14193,16 @@ func Dpftrf(transr blas.Transpose, ul blas.Uplo, n int, a []float64) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cpftrf.f. -func Cpftrf(transr blas.Transpose, ul blas.Uplo, n int, a []complex64) bool { +func Cpftrf(transr, ul byte, n int, a []complex64) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -15187,24 +14212,16 @@ func Cpftrf(transr blas.Transpose, ul blas.Uplo, n int, a []complex64) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zpftrf.f. -func Zpftrf(transr blas.Transpose, ul blas.Uplo, n int, a []complex128) bool { +func Zpftrf(transr, ul byte, n int, a []complex128) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -15214,24 +14231,16 @@ func Zpftrf(transr blas.Transpose, ul blas.Uplo, n int, a []complex128) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/spftri.f. -func Spftri(transr blas.Transpose, ul blas.Uplo, n int, a []float32) bool { +func Spftri(transr, ul byte, n int, a []float32) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -15241,24 +14250,16 @@ func Spftri(transr blas.Transpose, ul blas.Uplo, n int, a []float32) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dpftri.f. -func Dpftri(transr blas.Transpose, ul blas.Uplo, n int, a []float64) bool { +func Dpftri(transr, ul byte, n int, a []float64) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -15268,24 +14269,16 @@ func Dpftri(transr blas.Transpose, ul blas.Uplo, n int, a []float64) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cpftri.f. -func Cpftri(transr blas.Transpose, ul blas.Uplo, n int, a []complex64) bool { +func Cpftri(transr, ul byte, n int, a []complex64) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -15295,24 +14288,16 @@ func Cpftri(transr blas.Transpose, ul blas.Uplo, n int, a []complex64) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zpftri.f. -func Zpftri(transr blas.Transpose, ul blas.Uplo, n int, a []complex128) bool { +func Zpftri(transr, ul byte, n int, a []complex128) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -15322,24 +14307,16 @@ func Zpftri(transr blas.Transpose, ul blas.Uplo, n int, a []complex128) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/spftrs.f. -func Spftrs(transr blas.Transpose, ul blas.Uplo, n, nrhs int, a, b []float32, ldb int) bool { +func Spftrs(transr, ul byte, n, nrhs int, a, b []float32, ldb int) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -15353,24 +14330,16 @@ func Spftrs(transr blas.Transpose, ul blas.Uplo, n, nrhs int, a, b []float32, ld } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dpftrs.f. -func Dpftrs(transr blas.Transpose, ul blas.Uplo, n, nrhs int, a, b []float64, ldb int) bool { +func Dpftrs(transr, ul byte, n, nrhs int, a, b []float64, ldb int) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -15384,24 +14353,16 @@ func Dpftrs(transr blas.Transpose, ul blas.Uplo, n, nrhs int, a, b []float64, ld } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cpftrs.f. -func Cpftrs(transr blas.Transpose, ul blas.Uplo, n, nrhs int, a, b []complex64, ldb int) bool { +func Cpftrs(transr, ul byte, n, nrhs int, a, b []complex64, ldb int) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -15415,24 +14376,16 @@ func Cpftrs(transr blas.Transpose, ul blas.Uplo, n, nrhs int, a, b []complex64, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zpftrs.f. -func Zpftrs(transr blas.Transpose, ul blas.Uplo, n, nrhs int, a, b []complex128, ldb int) bool { +func Zpftrs(transr, ul byte, n, nrhs int, a, b []complex128, ldb int) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -15446,14 +14399,11 @@ func Zpftrs(transr blas.Transpose, ul blas.Uplo, n, nrhs int, a, b []complex128, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/spocon.f. -func Spocon(ul blas.Uplo, n int, a []float32, lda int, anorm float32, rcond, work []float32, iwork []int32) bool { +func Spocon(ul byte, n int, a []float32, lda int, anorm float32, rcond, work []float32, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -15475,14 +14425,11 @@ func Spocon(ul blas.Uplo, n int, a []float32, lda int, anorm float32, rcond, wor } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dpocon.f. -func Dpocon(ul blas.Uplo, n int, a []float64, lda int, anorm float64, rcond, work []float64, iwork []int32) bool { +func Dpocon(ul byte, n int, a []float64, lda int, anorm float64, rcond, work []float64, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -15504,14 +14451,11 @@ func Dpocon(ul blas.Uplo, n int, a []float64, lda int, anorm float64, rcond, wor } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cpocon.f. -func Cpocon(ul blas.Uplo, n int, a []complex64, lda int, anorm float32, rcond []float32, work []complex64, rwork []float32) bool { +func Cpocon(ul byte, n int, a []complex64, lda int, anorm float32, rcond []float32, work []complex64, rwork []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -15533,14 +14477,11 @@ func Cpocon(ul blas.Uplo, n int, a []complex64, lda int, anorm float32, rcond [] } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zpocon.f. -func Zpocon(ul blas.Uplo, n int, a []complex128, lda int, anorm float64, rcond []float64, work []complex128, rwork []float64) bool { +func Zpocon(ul byte, n int, a []complex128, lda int, anorm float64, rcond []float64, work []complex128, rwork []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -15730,14 +14671,11 @@ func Zpoequb(n int, a []complex128, lda int, s, scond, amax []float64) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sporfs.f. -func Sporfs(ul blas.Uplo, n, nrhs int, a []float32, lda int, af []float32, ldaf int, b []float32, ldb int, x []float32, ldx int, ferr, berr, work []float32, iwork []int32) bool { +func Sporfs(ul byte, n, nrhs int, a []float32, lda int, af []float32, ldaf int, b []float32, ldb int, x []float32, ldx int, ferr, berr, work []float32, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -15775,14 +14713,11 @@ func Sporfs(ul blas.Uplo, n, nrhs int, a []float32, lda int, af []float32, ldaf } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dporfs.f. -func Dporfs(ul blas.Uplo, n, nrhs int, a []float64, lda int, af []float64, ldaf int, b []float64, ldb int, x []float64, ldx int, ferr, berr, work []float64, iwork []int32) bool { +func Dporfs(ul byte, n, nrhs int, a []float64, lda int, af []float64, ldaf int, b []float64, ldb int, x []float64, ldx int, ferr, berr, work []float64, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -15820,14 +14755,11 @@ func Dporfs(ul blas.Uplo, n, nrhs int, a []float64, lda int, af []float64, ldaf } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cporfs.f. -func Cporfs(ul blas.Uplo, n, nrhs int, a []complex64, lda int, af []complex64, ldaf int, b []complex64, ldb int, x []complex64, ldx int, ferr, berr []float32, work []complex64, rwork []float32) bool { +func Cporfs(ul byte, n, nrhs int, a []complex64, lda int, af []complex64, ldaf int, b []complex64, ldb int, x []complex64, ldx int, ferr, berr []float32, work []complex64, rwork []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -15865,14 +14797,11 @@ func Cporfs(ul blas.Uplo, n, nrhs int, a []complex64, lda int, af []complex64, l } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zporfs.f. -func Zporfs(ul blas.Uplo, n, nrhs int, a []complex128, lda int, af []complex128, ldaf int, b []complex128, ldb int, x []complex128, ldx int, ferr, berr []float64, work []complex128, rwork []float64) bool { +func Zporfs(ul byte, n, nrhs int, a []complex128, lda int, af []complex128, ldaf int, b []complex128, ldb int, x []complex128, ldx int, ferr, berr []float64, work []complex128, rwork []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -15910,14 +14839,11 @@ func Zporfs(ul blas.Uplo, n, nrhs int, a []complex128, lda int, af []complex128, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sposv.f. -func Sposv(ul blas.Uplo, n, nrhs int, a []float32, lda int, b []float32, ldb int) bool { +func Sposv(ul byte, n, nrhs int, a []float32, lda int, b []float32, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -15931,14 +14857,11 @@ func Sposv(ul blas.Uplo, n, nrhs int, a []float32, lda int, b []float32, ldb int } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dposv.f. -func Dposv(ul blas.Uplo, n, nrhs int, a []float64, lda int, b []float64, ldb int) bool { +func Dposv(ul byte, n, nrhs int, a []float64, lda int, b []float64, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -15952,14 +14875,11 @@ func Dposv(ul blas.Uplo, n, nrhs int, a []float64, lda int, b []float64, ldb int } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cposv.f. -func Cposv(ul blas.Uplo, n, nrhs int, a []complex64, lda int, b []complex64, ldb int) bool { +func Cposv(ul byte, n, nrhs int, a []complex64, lda int, b []complex64, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -15973,14 +14893,11 @@ func Cposv(ul blas.Uplo, n, nrhs int, a []complex64, lda int, b []complex64, ldb } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zposv.f. -func Zposv(ul blas.Uplo, n, nrhs int, a []complex128, lda int, b []complex128, ldb int) bool { +func Zposv(ul byte, n, nrhs int, a []complex128, lda int, b []complex128, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -15994,14 +14911,11 @@ func Zposv(ul blas.Uplo, n, nrhs int, a []complex128, lda int, b []complex128, l } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsposv.f. -func Dsposv(ul blas.Uplo, n, nrhs int, a []float64, lda int, b []float64, ldb int, x []float64, ldx int, work []float64, swork []float32, iter []int32) bool { +func Dsposv(ul byte, n, nrhs int, a []float64, lda int, b []float64, ldb int, x []float64, ldx int, work []float64, swork []float32, iter []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -16031,14 +14945,11 @@ func Dsposv(ul blas.Uplo, n, nrhs int, a []float64, lda int, b []float64, ldb in } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zcposv.f. -func Zcposv(ul blas.Uplo, n, nrhs int, a []complex128, lda int, b []complex128, ldb int, x []complex128, ldx int, work []complex128, swork []complex64, rwork []float64, iter []int32) bool { +func Zcposv(ul byte, n, nrhs int, a []complex128, lda int, b []complex128, ldb int, x []complex128, ldx int, work []complex128, swork []complex64, rwork []float64, iter []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -16072,14 +14983,11 @@ func Zcposv(ul blas.Uplo, n, nrhs int, a []complex128, lda int, b []complex128, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sposvx.f. -func Sposvx(fact byte, ul blas.Uplo, n, nrhs int, a []float32, lda int, af []float32, ldaf int, equed []byte, s, b []float32, ldb int, x []float32, ldx int, rcond, ferr, berr, work []float32, iwork []int32) bool { +func Sposvx(fact, ul byte, n, nrhs int, a []float32, lda int, af []float32, ldaf int, equed []byte, s, b []float32, ldb int, x []float32, ldx int, rcond, ferr, berr, work []float32, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -16129,14 +15037,11 @@ func Sposvx(fact byte, ul blas.Uplo, n, nrhs int, a []float32, lda int, af []flo } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dposvx.f. -func Dposvx(fact byte, ul blas.Uplo, n, nrhs int, a []float64, lda int, af []float64, ldaf int, equed []byte, s, b []float64, ldb int, x []float64, ldx int, rcond, ferr, berr, work []float64, iwork []int32) bool { +func Dposvx(fact, ul byte, n, nrhs int, a []float64, lda int, af []float64, ldaf int, equed []byte, s, b []float64, ldb int, x []float64, ldx int, rcond, ferr, berr, work []float64, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -16186,14 +15091,11 @@ func Dposvx(fact byte, ul blas.Uplo, n, nrhs int, a []float64, lda int, af []flo } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cposvx.f. -func Cposvx(fact byte, ul blas.Uplo, n, nrhs int, a []complex64, lda int, af []complex64, ldaf int, equed []byte, s []float32, b []complex64, ldb int, x []complex64, ldx int, rcond, ferr, berr []float32, work []complex64, rwork []float32) bool { +func Cposvx(fact, ul byte, n, nrhs int, a []complex64, lda int, af []complex64, ldaf int, equed []byte, s []float32, b []complex64, ldb int, x []complex64, ldx int, rcond, ferr, berr []float32, work []complex64, rwork []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -16243,14 +15145,11 @@ func Cposvx(fact byte, ul blas.Uplo, n, nrhs int, a []complex64, lda int, af []c } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zposvx.f. -func Zposvx(fact byte, ul blas.Uplo, n, nrhs int, a []complex128, lda int, af []complex128, ldaf int, equed []byte, s []float64, b []complex128, ldb int, x []complex128, ldx int, rcond, ferr, berr []float64, work []complex128, rwork []float64) bool { +func Zposvx(fact, ul byte, n, nrhs int, a []complex128, lda int, af []complex128, ldaf int, equed []byte, s []float64, b []complex128, ldb int, x []complex128, ldx int, rcond, ferr, berr []float64, work []complex128, rwork []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -16300,14 +15199,11 @@ func Zposvx(fact byte, ul blas.Uplo, n, nrhs int, a []complex128, lda int, af [] } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/spotrf2.f. -func Spotrf2(ul blas.Uplo, n int, a []float32, lda int) bool { +func Spotrf2(ul byte, n int, a []float32, lda int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -16317,14 +15213,11 @@ func Spotrf2(ul blas.Uplo, n int, a []float32, lda int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dpotrf2.f. -func Dpotrf2(ul blas.Uplo, n int, a []float64, lda int) bool { +func Dpotrf2(ul byte, n int, a []float64, lda int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -16334,14 +15227,11 @@ func Dpotrf2(ul blas.Uplo, n int, a []float64, lda int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cpotrf2.f. -func Cpotrf2(ul blas.Uplo, n int, a []complex64, lda int) bool { +func Cpotrf2(ul byte, n int, a []complex64, lda int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -16351,14 +15241,11 @@ func Cpotrf2(ul blas.Uplo, n int, a []complex64, lda int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zpotrf2.f. -func Zpotrf2(ul blas.Uplo, n int, a []complex128, lda int) bool { +func Zpotrf2(ul byte, n int, a []complex128, lda int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -16368,14 +15255,11 @@ func Zpotrf2(ul blas.Uplo, n int, a []complex128, lda int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/spotrf.f. -func Spotrf(ul blas.Uplo, n int, a []float32, lda int) bool { +func Spotrf(ul byte, n int, a []float32, lda int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -16385,14 +15269,11 @@ func Spotrf(ul blas.Uplo, n int, a []float32, lda int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dpotrf.f. -func Dpotrf(ul blas.Uplo, n int, a []float64, lda int) bool { +func Dpotrf(ul byte, n int, a []float64, lda int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -16402,14 +15283,11 @@ func Dpotrf(ul blas.Uplo, n int, a []float64, lda int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cpotrf.f. -func Cpotrf(ul blas.Uplo, n int, a []complex64, lda int) bool { +func Cpotrf(ul byte, n int, a []complex64, lda int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -16419,14 +15297,11 @@ func Cpotrf(ul blas.Uplo, n int, a []complex64, lda int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zpotrf.f. -func Zpotrf(ul blas.Uplo, n int, a []complex128, lda int) bool { +func Zpotrf(ul byte, n int, a []complex128, lda int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -16436,14 +15311,11 @@ func Zpotrf(ul blas.Uplo, n int, a []complex128, lda int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/spotri.f. -func Spotri(ul blas.Uplo, n int, a []float32, lda int) bool { +func Spotri(ul byte, n int, a []float32, lda int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -16453,14 +15325,11 @@ func Spotri(ul blas.Uplo, n int, a []float32, lda int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dpotri.f. -func Dpotri(ul blas.Uplo, n int, a []float64, lda int) bool { +func Dpotri(ul byte, n int, a []float64, lda int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -16470,14 +15339,11 @@ func Dpotri(ul blas.Uplo, n int, a []float64, lda int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cpotri.f. -func Cpotri(ul blas.Uplo, n int, a []complex64, lda int) bool { +func Cpotri(ul byte, n int, a []complex64, lda int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -16487,14 +15353,11 @@ func Cpotri(ul blas.Uplo, n int, a []complex64, lda int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zpotri.f. -func Zpotri(ul blas.Uplo, n int, a []complex128, lda int) bool { +func Zpotri(ul byte, n int, a []complex128, lda int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -16504,14 +15367,11 @@ func Zpotri(ul blas.Uplo, n int, a []complex128, lda int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/spotrs.f. -func Spotrs(ul blas.Uplo, n, nrhs int, a []float32, lda int, b []float32, ldb int) bool { +func Spotrs(ul byte, n, nrhs int, a []float32, lda int, b []float32, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -16525,14 +15385,11 @@ func Spotrs(ul blas.Uplo, n, nrhs int, a []float32, lda int, b []float32, ldb in } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dpotrs.f. -func Dpotrs(ul blas.Uplo, n, nrhs int, a []float64, lda int, b []float64, ldb int) bool { +func Dpotrs(ul byte, n, nrhs int, a []float64, lda int, b []float64, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -16546,14 +15403,11 @@ func Dpotrs(ul blas.Uplo, n, nrhs int, a []float64, lda int, b []float64, ldb in } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cpotrs.f. -func Cpotrs(ul blas.Uplo, n, nrhs int, a []complex64, lda int, b []complex64, ldb int) bool { +func Cpotrs(ul byte, n, nrhs int, a []complex64, lda int, b []complex64, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -16567,14 +15421,11 @@ func Cpotrs(ul blas.Uplo, n, nrhs int, a []complex64, lda int, b []complex64, ld } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zpotrs.f. -func Zpotrs(ul blas.Uplo, n, nrhs int, a []complex128, lda int, b []complex128, ldb int) bool { +func Zpotrs(ul byte, n, nrhs int, a []complex128, lda int, b []complex128, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -16588,14 +15439,11 @@ func Zpotrs(ul blas.Uplo, n, nrhs int, a []complex128, lda int, b []complex128, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sppcon.f. -func Sppcon(ul blas.Uplo, n int, ap []float32, anorm float32, rcond, work []float32, iwork []int32) bool { +func Sppcon(ul byte, n int, ap []float32, anorm float32, rcond, work []float32, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float32 if len(ap) > 0 { @@ -16617,14 +15465,11 @@ func Sppcon(ul blas.Uplo, n int, ap []float32, anorm float32, rcond, work []floa } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dppcon.f. -func Dppcon(ul blas.Uplo, n int, ap []float64, anorm float64, rcond, work []float64, iwork []int32) bool { +func Dppcon(ul byte, n int, ap []float64, anorm float64, rcond, work []float64, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float64 if len(ap) > 0 { @@ -16646,14 +15491,11 @@ func Dppcon(ul blas.Uplo, n int, ap []float64, anorm float64, rcond, work []floa } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cppcon.f. -func Cppcon(ul blas.Uplo, n int, ap []complex64, anorm float32, rcond []float32, work []complex64, rwork []float32) bool { +func Cppcon(ul byte, n int, ap []complex64, anorm float32, rcond []float32, work []complex64, rwork []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex64 if len(ap) > 0 { @@ -16675,14 +15517,11 @@ func Cppcon(ul blas.Uplo, n int, ap []complex64, anorm float32, rcond []float32, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zppcon.f. -func Zppcon(ul blas.Uplo, n int, ap []complex128, anorm float64, rcond []float64, work []complex128, rwork []float64) bool { +func Zppcon(ul byte, n int, ap []complex128, anorm float64, rcond []float64, work []complex128, rwork []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex128 if len(ap) > 0 { @@ -16704,14 +15543,11 @@ func Zppcon(ul blas.Uplo, n int, ap []complex128, anorm float64, rcond []float64 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sppequ.f. -func Sppequ(ul blas.Uplo, n int, ap, s, scond, amax []float32) bool { +func Sppequ(ul byte, n int, ap, s, scond, amax []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float32 if len(ap) > 0 { @@ -16733,14 +15569,11 @@ func Sppequ(ul blas.Uplo, n int, ap, s, scond, amax []float32) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dppequ.f. -func Dppequ(ul blas.Uplo, n int, ap, s, scond, amax []float64) bool { +func Dppequ(ul byte, n int, ap, s, scond, amax []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float64 if len(ap) > 0 { @@ -16762,14 +15595,11 @@ func Dppequ(ul blas.Uplo, n int, ap, s, scond, amax []float64) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cppequ.f. -func Cppequ(ul blas.Uplo, n int, ap []complex64, s, scond, amax []float32) bool { +func Cppequ(ul byte, n int, ap []complex64, s, scond, amax []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex64 if len(ap) > 0 { @@ -16791,14 +15621,11 @@ func Cppequ(ul blas.Uplo, n int, ap []complex64, s, scond, amax []float32) bool } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zppequ.f. -func Zppequ(ul blas.Uplo, n int, ap []complex128, s, scond, amax []float64) bool { +func Zppequ(ul byte, n int, ap []complex128, s, scond, amax []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex128 if len(ap) > 0 { @@ -16820,14 +15647,11 @@ func Zppequ(ul blas.Uplo, n int, ap []complex128, s, scond, amax []float64) bool } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/spprfs.f. -func Spprfs(ul blas.Uplo, n, nrhs int, ap, afp, b []float32, ldb int, x []float32, ldx int, ferr, berr, work []float32, iwork []int32) bool { +func Spprfs(ul byte, n, nrhs int, ap, afp, b []float32, ldb int, x []float32, ldx int, ferr, berr, work []float32, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float32 if len(ap) > 0 { @@ -16865,14 +15689,11 @@ func Spprfs(ul blas.Uplo, n, nrhs int, ap, afp, b []float32, ldb int, x []float3 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dpprfs.f. -func Dpprfs(ul blas.Uplo, n, nrhs int, ap, afp, b []float64, ldb int, x []float64, ldx int, ferr, berr, work []float64, iwork []int32) bool { +func Dpprfs(ul byte, n, nrhs int, ap, afp, b []float64, ldb int, x []float64, ldx int, ferr, berr, work []float64, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float64 if len(ap) > 0 { @@ -16910,14 +15731,11 @@ func Dpprfs(ul blas.Uplo, n, nrhs int, ap, afp, b []float64, ldb int, x []float6 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cpprfs.f. -func Cpprfs(ul blas.Uplo, n, nrhs int, ap, afp, b []complex64, ldb int, x []complex64, ldx int, ferr, berr []float32, work []complex64, rwork []float32) bool { +func Cpprfs(ul byte, n, nrhs int, ap, afp, b []complex64, ldb int, x []complex64, ldx int, ferr, berr []float32, work []complex64, rwork []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex64 if len(ap) > 0 { @@ -16955,14 +15773,11 @@ func Cpprfs(ul blas.Uplo, n, nrhs int, ap, afp, b []complex64, ldb int, x []comp } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zpprfs.f. -func Zpprfs(ul blas.Uplo, n, nrhs int, ap, afp, b []complex128, ldb int, x []complex128, ldx int, ferr, berr []float64, work []complex128, rwork []float64) bool { +func Zpprfs(ul byte, n, nrhs int, ap, afp, b []complex128, ldb int, x []complex128, ldx int, ferr, berr []float64, work []complex128, rwork []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex128 if len(ap) > 0 { @@ -17000,14 +15815,11 @@ func Zpprfs(ul blas.Uplo, n, nrhs int, ap, afp, b []complex128, ldb int, x []com } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sppsv.f. -func Sppsv(ul blas.Uplo, n, nrhs int, ap, b []float32, ldb int) bool { +func Sppsv(ul byte, n, nrhs int, ap, b []float32, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float32 if len(ap) > 0 { @@ -17021,14 +15833,11 @@ func Sppsv(ul blas.Uplo, n, nrhs int, ap, b []float32, ldb int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dppsv.f. -func Dppsv(ul blas.Uplo, n, nrhs int, ap, b []float64, ldb int) bool { +func Dppsv(ul byte, n, nrhs int, ap, b []float64, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float64 if len(ap) > 0 { @@ -17042,14 +15851,11 @@ func Dppsv(ul blas.Uplo, n, nrhs int, ap, b []float64, ldb int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cppsv.f. -func Cppsv(ul blas.Uplo, n, nrhs int, ap, b []complex64, ldb int) bool { +func Cppsv(ul byte, n, nrhs int, ap, b []complex64, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex64 if len(ap) > 0 { @@ -17063,14 +15869,11 @@ func Cppsv(ul blas.Uplo, n, nrhs int, ap, b []complex64, ldb int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zppsv.f. -func Zppsv(ul blas.Uplo, n, nrhs int, ap, b []complex128, ldb int) bool { +func Zppsv(ul byte, n, nrhs int, ap, b []complex128, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex128 if len(ap) > 0 { @@ -17084,14 +15887,11 @@ func Zppsv(ul blas.Uplo, n, nrhs int, ap, b []complex128, ldb int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sppsvx.f. -func Sppsvx(fact byte, ul blas.Uplo, n, nrhs int, ap, afp []float32, equed []byte, s, b []float32, ldb int, x []float32, ldx int, rcond, ferr, berr, work []float32, iwork []int32) bool { +func Sppsvx(fact, ul byte, n, nrhs int, ap, afp []float32, equed []byte, s, b []float32, ldb int, x []float32, ldx int, rcond, ferr, berr, work []float32, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float32 if len(ap) > 0 { @@ -17141,14 +15941,11 @@ func Sppsvx(fact byte, ul blas.Uplo, n, nrhs int, ap, afp []float32, equed []byt } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dppsvx.f. -func Dppsvx(fact byte, ul blas.Uplo, n, nrhs int, ap, afp []float64, equed []byte, s, b []float64, ldb int, x []float64, ldx int, rcond, ferr, berr, work []float64, iwork []int32) bool { +func Dppsvx(fact, ul byte, n, nrhs int, ap, afp []float64, equed []byte, s, b []float64, ldb int, x []float64, ldx int, rcond, ferr, berr, work []float64, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float64 if len(ap) > 0 { @@ -17198,14 +15995,11 @@ func Dppsvx(fact byte, ul blas.Uplo, n, nrhs int, ap, afp []float64, equed []byt } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cppsvx.f. -func Cppsvx(fact byte, ul blas.Uplo, n, nrhs int, ap, afp []complex64, equed []byte, s []float32, b []complex64, ldb int, x []complex64, ldx int, rcond, ferr, berr []float32, work []complex64, rwork []float32) bool { +func Cppsvx(fact, ul byte, n, nrhs int, ap, afp []complex64, equed []byte, s []float32, b []complex64, ldb int, x []complex64, ldx int, rcond, ferr, berr []float32, work []complex64, rwork []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex64 if len(ap) > 0 { @@ -17255,14 +16049,11 @@ func Cppsvx(fact byte, ul blas.Uplo, n, nrhs int, ap, afp []complex64, equed []b } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zppsvx.f. -func Zppsvx(fact byte, ul blas.Uplo, n, nrhs int, ap, afp []complex128, equed []byte, s []float64, b []complex128, ldb int, x []complex128, ldx int, rcond, ferr, berr []float64, work []complex128, rwork []float64) bool { +func Zppsvx(fact, ul byte, n, nrhs int, ap, afp []complex128, equed []byte, s []float64, b []complex128, ldb int, x []complex128, ldx int, rcond, ferr, berr []float64, work []complex128, rwork []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex128 if len(ap) > 0 { @@ -17312,14 +16103,11 @@ func Zppsvx(fact byte, ul blas.Uplo, n, nrhs int, ap, afp []complex128, equed [] } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/spptrf.f. -func Spptrf(ul blas.Uplo, n int, ap []float32) bool { +func Spptrf(ul byte, n int, ap []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float32 if len(ap) > 0 { @@ -17329,14 +16117,11 @@ func Spptrf(ul blas.Uplo, n int, ap []float32) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dpptrf.f. -func Dpptrf(ul blas.Uplo, n int, ap []float64) bool { +func Dpptrf(ul byte, n int, ap []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float64 if len(ap) > 0 { @@ -17346,14 +16131,11 @@ func Dpptrf(ul blas.Uplo, n int, ap []float64) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cpptrf.f. -func Cpptrf(ul blas.Uplo, n int, ap []complex64) bool { +func Cpptrf(ul byte, n int, ap []complex64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex64 if len(ap) > 0 { @@ -17363,14 +16145,11 @@ func Cpptrf(ul blas.Uplo, n int, ap []complex64) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zpptrf.f. -func Zpptrf(ul blas.Uplo, n int, ap []complex128) bool { +func Zpptrf(ul byte, n int, ap []complex128) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex128 if len(ap) > 0 { @@ -17380,14 +16159,11 @@ func Zpptrf(ul blas.Uplo, n int, ap []complex128) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/spptri.f. -func Spptri(ul blas.Uplo, n int, ap []float32) bool { +func Spptri(ul byte, n int, ap []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float32 if len(ap) > 0 { @@ -17397,14 +16173,11 @@ func Spptri(ul blas.Uplo, n int, ap []float32) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dpptri.f. -func Dpptri(ul blas.Uplo, n int, ap []float64) bool { +func Dpptri(ul byte, n int, ap []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float64 if len(ap) > 0 { @@ -17414,14 +16187,11 @@ func Dpptri(ul blas.Uplo, n int, ap []float64) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cpptri.f. -func Cpptri(ul blas.Uplo, n int, ap []complex64) bool { +func Cpptri(ul byte, n int, ap []complex64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex64 if len(ap) > 0 { @@ -17431,14 +16201,11 @@ func Cpptri(ul blas.Uplo, n int, ap []complex64) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zpptri.f. -func Zpptri(ul blas.Uplo, n int, ap []complex128) bool { +func Zpptri(ul byte, n int, ap []complex128) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex128 if len(ap) > 0 { @@ -17448,14 +16215,11 @@ func Zpptri(ul blas.Uplo, n int, ap []complex128) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/spptrs.f. -func Spptrs(ul blas.Uplo, n, nrhs int, ap, b []float32, ldb int) bool { +func Spptrs(ul byte, n, nrhs int, ap, b []float32, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float32 if len(ap) > 0 { @@ -17469,14 +16233,11 @@ func Spptrs(ul blas.Uplo, n, nrhs int, ap, b []float32, ldb int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dpptrs.f. -func Dpptrs(ul blas.Uplo, n, nrhs int, ap, b []float64, ldb int) bool { +func Dpptrs(ul byte, n, nrhs int, ap, b []float64, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float64 if len(ap) > 0 { @@ -17490,14 +16251,11 @@ func Dpptrs(ul blas.Uplo, n, nrhs int, ap, b []float64, ldb int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cpptrs.f. -func Cpptrs(ul blas.Uplo, n, nrhs int, ap, b []complex64, ldb int) bool { +func Cpptrs(ul byte, n, nrhs int, ap, b []complex64, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex64 if len(ap) > 0 { @@ -17511,14 +16269,11 @@ func Cpptrs(ul blas.Uplo, n, nrhs int, ap, b []complex64, ldb int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zpptrs.f. -func Zpptrs(ul blas.Uplo, n, nrhs int, ap, b []complex128, ldb int) bool { +func Zpptrs(ul byte, n, nrhs int, ap, b []complex128, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex128 if len(ap) > 0 { @@ -17532,14 +16287,11 @@ func Zpptrs(ul blas.Uplo, n, nrhs int, ap, b []complex128, ldb int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/spstrf.f. -func Spstrf(ul blas.Uplo, n int, a []float32, lda int, piv, rank []int32, tol float32, work []float32) bool { +func Spstrf(ul byte, n int, a []float32, lda int, piv, rank []int32, tol float32, work []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -17561,14 +16313,11 @@ func Spstrf(ul blas.Uplo, n int, a []float32, lda int, piv, rank []int32, tol fl } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dpstrf.f. -func Dpstrf(ul blas.Uplo, n int, a []float64, lda int, piv, rank []int32, tol float64, work []float64) bool { +func Dpstrf(ul byte, n int, a []float64, lda int, piv, rank []int32, tol float64, work []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -17590,14 +16339,11 @@ func Dpstrf(ul blas.Uplo, n int, a []float64, lda int, piv, rank []int32, tol fl } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cpstrf.f. -func Cpstrf(ul blas.Uplo, n int, a []complex64, lda int, piv, rank []int32, tol float32, work []float32) bool { +func Cpstrf(ul byte, n int, a []complex64, lda int, piv, rank []int32, tol float32, work []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -17619,14 +16365,11 @@ func Cpstrf(ul blas.Uplo, n int, a []complex64, lda int, piv, rank []int32, tol } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zpstrf.f. -func Zpstrf(ul blas.Uplo, n int, a []complex128, lda int, piv, rank []int32, tol float64, work []float64) bool { +func Zpstrf(ul byte, n int, a []complex128, lda int, piv, rank []int32, tol float64, work []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -17732,7 +16475,7 @@ func Zptcon(n int, d []float64, e []complex128, anorm float64, rcond, work []flo } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/spteqr.f. -func Spteqr(compz lapack.Comp, n int, d, e, z []float32, ldz int, work []float32) bool { +func Spteqr(compz byte, n int, d, e, z []float32, ldz int, work []float32) bool { var _d *float32 if len(d) > 0 { _d = &d[0] @@ -17753,7 +16496,7 @@ func Spteqr(compz lapack.Comp, n int, d, e, z []float32, ldz int, work []float32 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dpteqr.f. -func Dpteqr(compz lapack.Comp, n int, d, e, z []float64, ldz int, work []float64) bool { +func Dpteqr(compz byte, n int, d, e, z []float64, ldz int, work []float64) bool { var _d *float64 if len(d) > 0 { _d = &d[0] @@ -17774,7 +16517,7 @@ func Dpteqr(compz lapack.Comp, n int, d, e, z []float64, ldz int, work []float64 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cpteqr.f. -func Cpteqr(compz lapack.Comp, n int, d, e []float32, z []complex64, ldz int, work []float32) bool { +func Cpteqr(compz byte, n int, d, e []float32, z []complex64, ldz int, work []float32) bool { var _d *float32 if len(d) > 0 { _d = &d[0] @@ -17795,7 +16538,7 @@ func Cpteqr(compz lapack.Comp, n int, d, e []float32, z []complex64, ldz int, wo } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zpteqr.f. -func Zpteqr(compz lapack.Comp, n int, d, e []float64, z []complex128, ldz int, work []float64) bool { +func Zpteqr(compz byte, n int, d, e []float64, z []complex128, ldz int, work []float64) bool { var _d *float64 if len(d) > 0 { _d = &d[0] @@ -17898,14 +16641,11 @@ func Dptrfs(n, nrhs int, d, e, df, ef, b []float64, ldb int, x []float64, ldx in } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cptrfs.f. -func Cptrfs(ul blas.Uplo, n, nrhs int, d []float32, e []complex64, df []float32, ef, b []complex64, ldb int, x []complex64, ldx int, ferr, berr []float32, work []complex64, rwork []float32) bool { +func Cptrfs(ul byte, n, nrhs int, d []float32, e []complex64, df []float32, ef, b []complex64, ldb int, x []complex64, ldx int, ferr, berr []float32, work []complex64, rwork []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _d *float32 if len(d) > 0 { @@ -17951,14 +16691,11 @@ func Cptrfs(ul blas.Uplo, n, nrhs int, d []float32, e []complex64, df []float32, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zptrfs.f. -func Zptrfs(ul blas.Uplo, n, nrhs int, d []float64, e []complex128, df []float64, ef, b []complex128, ldb int, x []complex128, ldx int, ferr, berr []float64, work []complex128, rwork []float64) bool { +func Zptrfs(ul byte, n, nrhs int, d []float64, e []complex128, df []float64, ef, b []complex128, ldb int, x []complex128, ldx int, ferr, berr []float64, work []complex128, rwork []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _d *float64 if len(d) > 0 { @@ -18346,14 +17083,11 @@ func Dpttrs(n, nrhs int, d, e, b []float64, ldb int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cpttrs.f. -func Cpttrs(ul blas.Uplo, n, nrhs int, d []float32, e, b []complex64, ldb int) bool { +func Cpttrs(ul byte, n, nrhs int, d []float32, e, b []complex64, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _d *float32 if len(d) > 0 { @@ -18371,14 +17105,11 @@ func Cpttrs(ul blas.Uplo, n, nrhs int, d []float32, e, b []complex64, ldb int) b } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zpttrs.f. -func Zpttrs(ul blas.Uplo, n, nrhs int, d []float64, e, b []complex128, ldb int) bool { +func Zpttrs(ul byte, n, nrhs int, d []float64, e, b []complex128, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _d *float64 if len(d) > 0 { @@ -18396,14 +17127,11 @@ func Zpttrs(ul blas.Uplo, n, nrhs int, d []float64, e, b []complex128, ldb int) } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssbev.f. -func Ssbev(jobz lapack.Job, ul blas.Uplo, n, kd int, ab []float32, ldab int, w, z []float32, ldz int, work []float32) bool { +func Ssbev(jobz, ul byte, n, kd int, ab []float32, ldab int, w, z []float32, ldz int, work []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *float32 if len(ab) > 0 { @@ -18425,14 +17153,11 @@ func Ssbev(jobz lapack.Job, ul blas.Uplo, n, kd int, ab []float32, ldab int, w, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsbev.f. -func Dsbev(jobz lapack.Job, ul blas.Uplo, n, kd int, ab []float64, ldab int, w, z []float64, ldz int, work []float64) bool { +func Dsbev(jobz, ul byte, n, kd int, ab []float64, ldab int, w, z []float64, ldz int, work []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *float64 if len(ab) > 0 { @@ -18454,14 +17179,11 @@ func Dsbev(jobz lapack.Job, ul blas.Uplo, n, kd int, ab []float64, ldab int, w, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssbevd.f. -func Ssbevd(jobz lapack.Job, ul blas.Uplo, n, kd int, ab []float32, ldab int, w, z []float32, ldz int, work []float32, lwork int, iwork []int32, liwork int) bool { +func Ssbevd(jobz, ul byte, n, kd int, ab []float32, ldab int, w, z []float32, ldz int, work []float32, lwork int, iwork []int32, liwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *float32 if len(ab) > 0 { @@ -18487,14 +17209,11 @@ func Ssbevd(jobz lapack.Job, ul blas.Uplo, n, kd int, ab []float32, ldab int, w, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsbevd.f. -func Dsbevd(jobz lapack.Job, ul blas.Uplo, n, kd int, ab []float64, ldab int, w, z []float64, ldz int, work []float64, lwork int, iwork []int32, liwork int) bool { +func Dsbevd(jobz, ul byte, n, kd int, ab []float64, ldab int, w, z []float64, ldz int, work []float64, lwork int, iwork []int32, liwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *float64 if len(ab) > 0 { @@ -18520,14 +17239,11 @@ func Dsbevd(jobz lapack.Job, ul blas.Uplo, n, kd int, ab []float64, ldab int, w, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssbevx.f. -func Ssbevx(jobz lapack.Job, rng byte, ul blas.Uplo, n, kd int, ab []float32, ldab int, q []float32, ldq int, vl, vu float32, il, iu int, abstol float32, m []int32, w, z []float32, ldz int, work []float32, iwork, ifail []int32) bool { +func Ssbevx(jobz, rng, ul byte, n, kd int, ab []float32, ldab int, q []float32, ldq int, vl, vu float32, il, iu int, abstol float32, m []int32, w, z []float32, ldz int, work []float32, iwork, ifail []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *float32 if len(ab) > 0 { @@ -18565,14 +17281,11 @@ func Ssbevx(jobz lapack.Job, rng byte, ul blas.Uplo, n, kd int, ab []float32, ld } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsbevx.f. -func Dsbevx(jobz lapack.Job, rng byte, ul blas.Uplo, n, kd int, ab []float64, ldab int, q []float64, ldq int, vl, vu float64, il, iu int, abstol float64, m []int32, w, z []float64, ldz int, work []float64, iwork, ifail []int32) bool { +func Dsbevx(jobz, rng, ul byte, n, kd int, ab []float64, ldab int, q []float64, ldq int, vl, vu float64, il, iu int, abstol float64, m []int32, w, z []float64, ldz int, work []float64, iwork, ifail []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *float64 if len(ab) > 0 { @@ -18610,14 +17323,11 @@ func Dsbevx(jobz lapack.Job, rng byte, ul blas.Uplo, n, kd int, ab []float64, ld } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssbgst.f. -func Ssbgst(vect byte, ul blas.Uplo, n, ka, kb int, ab []float32, ldab int, bb []float32, ldbb int, x []float32, ldx int, work []float32) bool { +func Ssbgst(vect, ul byte, n, ka, kb int, ab []float32, ldab int, bb []float32, ldbb int, x []float32, ldx int, work []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *float32 if len(ab) > 0 { @@ -18639,14 +17349,11 @@ func Ssbgst(vect byte, ul blas.Uplo, n, ka, kb int, ab []float32, ldab int, bb [ } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsbgst.f. -func Dsbgst(vect byte, ul blas.Uplo, n, ka, kb int, ab []float64, ldab int, bb []float64, ldbb int, x []float64, ldx int, work []float64) bool { +func Dsbgst(vect, ul byte, n, ka, kb int, ab []float64, ldab int, bb []float64, ldbb int, x []float64, ldx int, work []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *float64 if len(ab) > 0 { @@ -18668,14 +17375,11 @@ func Dsbgst(vect byte, ul blas.Uplo, n, ka, kb int, ab []float64, ldab int, bb [ } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssbgv.f. -func Ssbgv(jobz lapack.Job, ul blas.Uplo, n, ka, kb int, ab []float32, ldab int, bb []float32, ldbb int, w, z []float32, ldz int, work []float32) bool { +func Ssbgv(jobz, ul byte, n, ka, kb int, ab []float32, ldab int, bb []float32, ldbb int, w, z []float32, ldz int, work []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *float32 if len(ab) > 0 { @@ -18701,14 +17405,11 @@ func Ssbgv(jobz lapack.Job, ul blas.Uplo, n, ka, kb int, ab []float32, ldab int, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsbgv.f. -func Dsbgv(jobz lapack.Job, ul blas.Uplo, n, ka, kb int, ab []float64, ldab int, bb []float64, ldbb int, w, z []float64, ldz int, work []float64) bool { +func Dsbgv(jobz, ul byte, n, ka, kb int, ab []float64, ldab int, bb []float64, ldbb int, w, z []float64, ldz int, work []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *float64 if len(ab) > 0 { @@ -18734,14 +17435,11 @@ func Dsbgv(jobz lapack.Job, ul blas.Uplo, n, ka, kb int, ab []float64, ldab int, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssbgvd.f. -func Ssbgvd(jobz lapack.Job, ul blas.Uplo, n, ka, kb int, ab []float32, ldab int, bb []float32, ldbb int, w, z []float32, ldz int, work []float32, lwork int, iwork []int32, liwork int) bool { +func Ssbgvd(jobz, ul byte, n, ka, kb int, ab []float32, ldab int, bb []float32, ldbb int, w, z []float32, ldz int, work []float32, lwork int, iwork []int32, liwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *float32 if len(ab) > 0 { @@ -18771,14 +17469,11 @@ func Ssbgvd(jobz lapack.Job, ul blas.Uplo, n, ka, kb int, ab []float32, ldab int } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsbgvd.f. -func Dsbgvd(jobz lapack.Job, ul blas.Uplo, n, ka, kb int, ab []float64, ldab int, bb []float64, ldbb int, w, z []float64, ldz int, work []float64, lwork int, iwork []int32, liwork int) bool { +func Dsbgvd(jobz, ul byte, n, ka, kb int, ab []float64, ldab int, bb []float64, ldbb int, w, z []float64, ldz int, work []float64, lwork int, iwork []int32, liwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *float64 if len(ab) > 0 { @@ -18808,14 +17503,11 @@ func Dsbgvd(jobz lapack.Job, ul blas.Uplo, n, ka, kb int, ab []float64, ldab int } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssbgvx.f. -func Ssbgvx(jobz lapack.Job, rng byte, ul blas.Uplo, n, ka, kb int, ab []float32, ldab int, bb []float32, ldbb int, q []float32, ldq int, vl, vu float32, il, iu int, abstol float32, m []int32, w, z []float32, ldz int, work []float32, iwork, ifail []int32) bool { +func Ssbgvx(jobz, rng, ul byte, n, ka, kb int, ab []float32, ldab int, bb []float32, ldbb int, q []float32, ldq int, vl, vu float32, il, iu int, abstol float32, m []int32, w, z []float32, ldz int, work []float32, iwork, ifail []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *float32 if len(ab) > 0 { @@ -18857,14 +17549,11 @@ func Ssbgvx(jobz lapack.Job, rng byte, ul blas.Uplo, n, ka, kb int, ab []float32 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsbgvx.f. -func Dsbgvx(jobz lapack.Job, rng byte, ul blas.Uplo, n, ka, kb int, ab []float64, ldab int, bb []float64, ldbb int, q []float64, ldq int, vl, vu float64, il, iu int, abstol float64, m []int32, w, z []float64, ldz int, work []float64, iwork, ifail []int32) bool { +func Dsbgvx(jobz, rng, ul byte, n, ka, kb int, ab []float64, ldab int, bb []float64, ldbb int, q []float64, ldq int, vl, vu float64, il, iu int, abstol float64, m []int32, w, z []float64, ldz int, work []float64, iwork, ifail []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *float64 if len(ab) > 0 { @@ -18906,14 +17595,11 @@ func Dsbgvx(jobz lapack.Job, rng byte, ul blas.Uplo, n, ka, kb int, ab []float64 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssbtrd.f. -func Ssbtrd(vect byte, ul blas.Uplo, n, kd int, ab []float32, ldab int, d, e, q []float32, ldq int, work []float32) bool { +func Ssbtrd(vect, ul byte, n, kd int, ab []float32, ldab int, d, e, q []float32, ldq int, work []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *float32 if len(ab) > 0 { @@ -18939,14 +17625,11 @@ func Ssbtrd(vect byte, ul blas.Uplo, n, kd int, ab []float32, ldab int, d, e, q } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsbtrd.f. -func Dsbtrd(vect byte, ul blas.Uplo, n, kd int, ab []float64, ldab int, d, e, q []float64, ldq int, work []float64) bool { +func Dsbtrd(vect, ul byte, n, kd int, ab []float64, ldab int, d, e, q []float64, ldq int, work []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ab *float64 if len(ab) > 0 { @@ -18972,32 +17655,19 @@ func Dsbtrd(vect byte, ul blas.Uplo, n, kd int, ab []float64, ldab int, d, e, q } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssfrk.f. -func Ssfrk(transr blas.Transpose, ul blas.Uplo, trans blas.Transpose, n, k int, alpha float32, a []float32, lda int, beta float32, c []float32) bool { +func Ssfrk(transr, ul, trans byte, n, k int, alpha float32, a []float32, lda int, beta float32, c []float32) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -19013,32 +17683,19 @@ func Ssfrk(transr blas.Transpose, ul blas.Uplo, trans blas.Transpose, n, k int, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsfrk.f. -func Dsfrk(transr blas.Transpose, ul blas.Uplo, trans blas.Transpose, n, k int, alpha float64, a []float64, lda int, beta float64, c []float64) bool { +func Dsfrk(transr, ul, trans byte, n, k int, alpha float64, a []float64, lda int, beta float64, c []float64) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -19054,14 +17711,11 @@ func Dsfrk(transr blas.Transpose, ul blas.Uplo, trans blas.Transpose, n, k int, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sspcon.f. -func Sspcon(ul blas.Uplo, n int, ap []float32, ipiv []int32, anorm float32, rcond, work []float32, iwork []int32) bool { +func Sspcon(ul byte, n int, ap []float32, ipiv []int32, anorm float32, rcond, work []float32, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float32 if len(ap) > 0 { @@ -19087,14 +17741,11 @@ func Sspcon(ul blas.Uplo, n int, ap []float32, ipiv []int32, anorm float32, rcon } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dspcon.f. -func Dspcon(ul blas.Uplo, n int, ap []float64, ipiv []int32, anorm float64, rcond, work []float64, iwork []int32) bool { +func Dspcon(ul byte, n int, ap []float64, ipiv []int32, anorm float64, rcond, work []float64, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float64 if len(ap) > 0 { @@ -19120,14 +17771,11 @@ func Dspcon(ul blas.Uplo, n int, ap []float64, ipiv []int32, anorm float64, rcon } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cspcon.f. -func Cspcon(ul blas.Uplo, n int, ap []complex64, ipiv []int32, anorm float32, rcond []float32, work []complex64) bool { +func Cspcon(ul byte, n int, ap []complex64, ipiv []int32, anorm float32, rcond []float32, work []complex64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex64 if len(ap) > 0 { @@ -19149,14 +17797,11 @@ func Cspcon(ul blas.Uplo, n int, ap []complex64, ipiv []int32, anorm float32, rc } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zspcon.f. -func Zspcon(ul blas.Uplo, n int, ap []complex128, ipiv []int32, anorm float64, rcond []float64, work []complex128) bool { +func Zspcon(ul byte, n int, ap []complex128, ipiv []int32, anorm float64, rcond []float64, work []complex128) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex128 if len(ap) > 0 { @@ -19178,14 +17823,11 @@ func Zspcon(ul blas.Uplo, n int, ap []complex128, ipiv []int32, anorm float64, r } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sspev.f. -func Sspev(jobz lapack.Job, ul blas.Uplo, n int, ap, w, z []float32, ldz int, work []float32) bool { +func Sspev(jobz, ul byte, n int, ap, w, z []float32, ldz int, work []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float32 if len(ap) > 0 { @@ -19207,14 +17849,11 @@ func Sspev(jobz lapack.Job, ul blas.Uplo, n int, ap, w, z []float32, ldz int, wo } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dspev.f. -func Dspev(jobz lapack.Job, ul blas.Uplo, n int, ap, w, z []float64, ldz int, work []float64) bool { +func Dspev(jobz, ul byte, n int, ap, w, z []float64, ldz int, work []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float64 if len(ap) > 0 { @@ -19236,14 +17875,11 @@ func Dspev(jobz lapack.Job, ul blas.Uplo, n int, ap, w, z []float64, ldz int, wo } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sspevd.f. -func Sspevd(jobz lapack.Job, ul blas.Uplo, n int, ap, w, z []float32, ldz int, work []float32, lwork int, iwork []int32, liwork int) bool { +func Sspevd(jobz, ul byte, n int, ap, w, z []float32, ldz int, work []float32, lwork int, iwork []int32, liwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float32 if len(ap) > 0 { @@ -19269,14 +17905,11 @@ func Sspevd(jobz lapack.Job, ul blas.Uplo, n int, ap, w, z []float32, ldz int, w } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dspevd.f. -func Dspevd(jobz lapack.Job, ul blas.Uplo, n int, ap, w, z []float64, ldz int, work []float64, lwork int, iwork []int32, liwork int) bool { +func Dspevd(jobz, ul byte, n int, ap, w, z []float64, ldz int, work []float64, lwork int, iwork []int32, liwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float64 if len(ap) > 0 { @@ -19302,14 +17935,11 @@ func Dspevd(jobz lapack.Job, ul blas.Uplo, n int, ap, w, z []float64, ldz int, w } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sspevx.f. -func Sspevx(jobz lapack.Job, rng byte, ul blas.Uplo, n int, ap []float32, vl, vu float32, il, iu int, abstol float32, m []int32, w, z []float32, ldz int, work []float32, iwork, ifail []int32) bool { +func Sspevx(jobz, rng, ul byte, n int, ap []float32, vl, vu float32, il, iu int, abstol float32, m []int32, w, z []float32, ldz int, work []float32, iwork, ifail []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float32 if len(ap) > 0 { @@ -19343,14 +17973,11 @@ func Sspevx(jobz lapack.Job, rng byte, ul blas.Uplo, n int, ap []float32, vl, vu } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dspevx.f. -func Dspevx(jobz lapack.Job, rng byte, ul blas.Uplo, n int, ap []float64, vl, vu float64, il, iu int, abstol float64, m []int32, w, z []float64, ldz int, work []float64, iwork, ifail []int32) bool { +func Dspevx(jobz, rng, ul byte, n int, ap []float64, vl, vu float64, il, iu int, abstol float64, m []int32, w, z []float64, ldz int, work []float64, iwork, ifail []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float64 if len(ap) > 0 { @@ -19384,14 +18011,11 @@ func Dspevx(jobz lapack.Job, rng byte, ul blas.Uplo, n int, ap []float64, vl, vu } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sspgst.f. -func Sspgst(itype int, ul blas.Uplo, n int, ap, bp []float32) bool { +func Sspgst(itype int, ul byte, n int, ap, bp []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float32 if len(ap) > 0 { @@ -19405,14 +18029,11 @@ func Sspgst(itype int, ul blas.Uplo, n int, ap, bp []float32) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dspgst.f. -func Dspgst(itype int, ul blas.Uplo, n int, ap, bp []float64) bool { +func Dspgst(itype int, ul byte, n int, ap, bp []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float64 if len(ap) > 0 { @@ -19426,14 +18047,11 @@ func Dspgst(itype int, ul blas.Uplo, n int, ap, bp []float64) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sspgv.f. -func Sspgv(itype int, jobz lapack.Job, ul blas.Uplo, n int, ap, bp, w, z []float32, ldz int, work []float32) bool { +func Sspgv(itype int, jobz, ul byte, n int, ap, bp, w, z []float32, ldz int, work []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float32 if len(ap) > 0 { @@ -19459,14 +18077,11 @@ func Sspgv(itype int, jobz lapack.Job, ul blas.Uplo, n int, ap, bp, w, z []float } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dspgv.f. -func Dspgv(itype int, jobz lapack.Job, ul blas.Uplo, n int, ap, bp, w, z []float64, ldz int, work []float64) bool { +func Dspgv(itype int, jobz, ul byte, n int, ap, bp, w, z []float64, ldz int, work []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float64 if len(ap) > 0 { @@ -19492,14 +18107,11 @@ func Dspgv(itype int, jobz lapack.Job, ul blas.Uplo, n int, ap, bp, w, z []float } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sspgvd.f. -func Sspgvd(itype int, jobz lapack.Job, ul blas.Uplo, n int, ap, bp, w, z []float32, ldz int, work []float32, lwork int, iwork []int32, liwork int) bool { +func Sspgvd(itype int, jobz, ul byte, n int, ap, bp, w, z []float32, ldz int, work []float32, lwork int, iwork []int32, liwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float32 if len(ap) > 0 { @@ -19529,14 +18141,11 @@ func Sspgvd(itype int, jobz lapack.Job, ul blas.Uplo, n int, ap, bp, w, z []floa } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dspgvd.f. -func Dspgvd(itype int, jobz lapack.Job, ul blas.Uplo, n int, ap, bp, w, z []float64, ldz int, work []float64, lwork int, iwork []int32, liwork int) bool { +func Dspgvd(itype int, jobz, ul byte, n int, ap, bp, w, z []float64, ldz int, work []float64, lwork int, iwork []int32, liwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float64 if len(ap) > 0 { @@ -19566,14 +18175,11 @@ func Dspgvd(itype int, jobz lapack.Job, ul blas.Uplo, n int, ap, bp, w, z []floa } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sspgvx.f. -func Sspgvx(itype int, jobz lapack.Job, rng byte, ul blas.Uplo, n int, ap, bp []float32, vl, vu float32, il, iu int, abstol float32, m []int32, w, z []float32, ldz int, work []float32, iwork, ifail []int32) bool { +func Sspgvx(itype int, jobz, rng, ul byte, n int, ap, bp []float32, vl, vu float32, il, iu int, abstol float32, m []int32, w, z []float32, ldz int, work []float32, iwork, ifail []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float32 if len(ap) > 0 { @@ -19611,14 +18217,11 @@ func Sspgvx(itype int, jobz lapack.Job, rng byte, ul blas.Uplo, n int, ap, bp [] } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dspgvx.f. -func Dspgvx(itype int, jobz lapack.Job, rng byte, ul blas.Uplo, n int, ap, bp []float64, vl, vu float64, il, iu int, abstol float64, m []int32, w, z []float64, ldz int, work []float64, iwork, ifail []int32) bool { +func Dspgvx(itype int, jobz, rng, ul byte, n int, ap, bp []float64, vl, vu float64, il, iu int, abstol float64, m []int32, w, z []float64, ldz int, work []float64, iwork, ifail []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float64 if len(ap) > 0 { @@ -19656,14 +18259,11 @@ func Dspgvx(itype int, jobz lapack.Job, rng byte, ul blas.Uplo, n int, ap, bp [] } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssprfs.f. -func Ssprfs(ul blas.Uplo, n, nrhs int, ap, afp []float32, ipiv []int32, b []float32, ldb int, x []float32, ldx int, ferr, berr, work []float32, iwork []int32) bool { +func Ssprfs(ul byte, n, nrhs int, ap, afp []float32, ipiv []int32, b []float32, ldb int, x []float32, ldx int, ferr, berr, work []float32, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float32 if len(ap) > 0 { @@ -19705,14 +18305,11 @@ func Ssprfs(ul blas.Uplo, n, nrhs int, ap, afp []float32, ipiv []int32, b []floa } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsprfs.f. -func Dsprfs(ul blas.Uplo, n, nrhs int, ap, afp []float64, ipiv []int32, b []float64, ldb int, x []float64, ldx int, ferr, berr, work []float64, iwork []int32) bool { +func Dsprfs(ul byte, n, nrhs int, ap, afp []float64, ipiv []int32, b []float64, ldb int, x []float64, ldx int, ferr, berr, work []float64, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float64 if len(ap) > 0 { @@ -19754,14 +18351,11 @@ func Dsprfs(ul blas.Uplo, n, nrhs int, ap, afp []float64, ipiv []int32, b []floa } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/csprfs.f. -func Csprfs(ul blas.Uplo, n, nrhs int, ap, afp []complex64, ipiv []int32, b []complex64, ldb int, x []complex64, ldx int, ferr, berr []float32, work []complex64, rwork []float32) bool { +func Csprfs(ul byte, n, nrhs int, ap, afp []complex64, ipiv []int32, b []complex64, ldb int, x []complex64, ldx int, ferr, berr []float32, work []complex64, rwork []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex64 if len(ap) > 0 { @@ -19803,14 +18397,11 @@ func Csprfs(ul blas.Uplo, n, nrhs int, ap, afp []complex64, ipiv []int32, b []co } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zsprfs.f. -func Zsprfs(ul blas.Uplo, n, nrhs int, ap, afp []complex128, ipiv []int32, b []complex128, ldb int, x []complex128, ldx int, ferr, berr []float64, work []complex128, rwork []float64) bool { +func Zsprfs(ul byte, n, nrhs int, ap, afp []complex128, ipiv []int32, b []complex128, ldb int, x []complex128, ldx int, ferr, berr []float64, work []complex128, rwork []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex128 if len(ap) > 0 { @@ -19852,14 +18443,11 @@ func Zsprfs(ul blas.Uplo, n, nrhs int, ap, afp []complex128, ipiv []int32, b []c } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sspsv.f. -func Sspsv(ul blas.Uplo, n, nrhs int, ap []float32, ipiv []int32, b []float32, ldb int) bool { +func Sspsv(ul byte, n, nrhs int, ap []float32, ipiv []int32, b []float32, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float32 if len(ap) > 0 { @@ -19877,14 +18465,11 @@ func Sspsv(ul blas.Uplo, n, nrhs int, ap []float32, ipiv []int32, b []float32, l } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dspsv.f. -func Dspsv(ul blas.Uplo, n, nrhs int, ap []float64, ipiv []int32, b []float64, ldb int) bool { +func Dspsv(ul byte, n, nrhs int, ap []float64, ipiv []int32, b []float64, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float64 if len(ap) > 0 { @@ -19902,14 +18487,11 @@ func Dspsv(ul blas.Uplo, n, nrhs int, ap []float64, ipiv []int32, b []float64, l } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cspsv.f. -func Cspsv(ul blas.Uplo, n, nrhs int, ap []complex64, ipiv []int32, b []complex64, ldb int) bool { +func Cspsv(ul byte, n, nrhs int, ap []complex64, ipiv []int32, b []complex64, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex64 if len(ap) > 0 { @@ -19927,14 +18509,11 @@ func Cspsv(ul blas.Uplo, n, nrhs int, ap []complex64, ipiv []int32, b []complex6 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zspsv.f. -func Zspsv(ul blas.Uplo, n, nrhs int, ap []complex128, ipiv []int32, b []complex128, ldb int) bool { +func Zspsv(ul byte, n, nrhs int, ap []complex128, ipiv []int32, b []complex128, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex128 if len(ap) > 0 { @@ -19952,14 +18531,11 @@ func Zspsv(ul blas.Uplo, n, nrhs int, ap []complex128, ipiv []int32, b []complex } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sspsvx.f. -func Sspsvx(fact byte, ul blas.Uplo, n, nrhs int, ap, afp []float32, ipiv []int32, b []float32, ldb int, x []float32, ldx int, rcond, ferr, berr, work []float32, iwork []int32) bool { +func Sspsvx(fact, ul byte, n, nrhs int, ap, afp []float32, ipiv []int32, b []float32, ldb int, x []float32, ldx int, rcond, ferr, berr, work []float32, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float32 if len(ap) > 0 { @@ -20005,14 +18581,11 @@ func Sspsvx(fact byte, ul blas.Uplo, n, nrhs int, ap, afp []float32, ipiv []int3 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dspsvx.f. -func Dspsvx(fact byte, ul blas.Uplo, n, nrhs int, ap, afp []float64, ipiv []int32, b []float64, ldb int, x []float64, ldx int, rcond, ferr, berr, work []float64, iwork []int32) bool { +func Dspsvx(fact, ul byte, n, nrhs int, ap, afp []float64, ipiv []int32, b []float64, ldb int, x []float64, ldx int, rcond, ferr, berr, work []float64, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float64 if len(ap) > 0 { @@ -20058,14 +18631,11 @@ func Dspsvx(fact byte, ul blas.Uplo, n, nrhs int, ap, afp []float64, ipiv []int3 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cspsvx.f. -func Cspsvx(fact byte, ul blas.Uplo, n, nrhs int, ap, afp []complex64, ipiv []int32, b []complex64, ldb int, x []complex64, ldx int, rcond, ferr, berr []float32, work []complex64, rwork []float32) bool { +func Cspsvx(fact, ul byte, n, nrhs int, ap, afp []complex64, ipiv []int32, b []complex64, ldb int, x []complex64, ldx int, rcond, ferr, berr []float32, work []complex64, rwork []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex64 if len(ap) > 0 { @@ -20111,14 +18681,11 @@ func Cspsvx(fact byte, ul blas.Uplo, n, nrhs int, ap, afp []complex64, ipiv []in } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zspsvx.f. -func Zspsvx(fact byte, ul blas.Uplo, n, nrhs int, ap, afp []complex128, ipiv []int32, b []complex128, ldb int, x []complex128, ldx int, rcond, ferr, berr []float64, work []complex128, rwork []float64) bool { +func Zspsvx(fact, ul byte, n, nrhs int, ap, afp []complex128, ipiv []int32, b []complex128, ldb int, x []complex128, ldx int, rcond, ferr, berr []float64, work []complex128, rwork []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex128 if len(ap) > 0 { @@ -20164,14 +18731,11 @@ func Zspsvx(fact byte, ul blas.Uplo, n, nrhs int, ap, afp []complex128, ipiv []i } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssptrd.f. -func Ssptrd(ul blas.Uplo, n int, ap, d, e, tau []float32) bool { +func Ssptrd(ul byte, n int, ap, d, e, tau []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float32 if len(ap) > 0 { @@ -20193,14 +18757,11 @@ func Ssptrd(ul blas.Uplo, n int, ap, d, e, tau []float32) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsptrd.f. -func Dsptrd(ul blas.Uplo, n int, ap, d, e, tau []float64) bool { +func Dsptrd(ul byte, n int, ap, d, e, tau []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float64 if len(ap) > 0 { @@ -20222,14 +18783,11 @@ func Dsptrd(ul blas.Uplo, n int, ap, d, e, tau []float64) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssptrf.f. -func Ssptrf(ul blas.Uplo, n int, ap []float32, ipiv []int32) bool { +func Ssptrf(ul byte, n int, ap []float32, ipiv []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float32 if len(ap) > 0 { @@ -20243,14 +18801,11 @@ func Ssptrf(ul blas.Uplo, n int, ap []float32, ipiv []int32) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsptrf.f. -func Dsptrf(ul blas.Uplo, n int, ap []float64, ipiv []int32) bool { +func Dsptrf(ul byte, n int, ap []float64, ipiv []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float64 if len(ap) > 0 { @@ -20264,14 +18819,11 @@ func Dsptrf(ul blas.Uplo, n int, ap []float64, ipiv []int32) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/csptrf.f. -func Csptrf(ul blas.Uplo, n int, ap []complex64, ipiv []int32) bool { +func Csptrf(ul byte, n int, ap []complex64, ipiv []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex64 if len(ap) > 0 { @@ -20285,14 +18837,11 @@ func Csptrf(ul blas.Uplo, n int, ap []complex64, ipiv []int32) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zsptrf.f. -func Zsptrf(ul blas.Uplo, n int, ap []complex128, ipiv []int32) bool { +func Zsptrf(ul byte, n int, ap []complex128, ipiv []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex128 if len(ap) > 0 { @@ -20306,14 +18855,11 @@ func Zsptrf(ul blas.Uplo, n int, ap []complex128, ipiv []int32) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssptri.f. -func Ssptri(ul blas.Uplo, n int, ap []float32, ipiv []int32, work []float32) bool { +func Ssptri(ul byte, n int, ap []float32, ipiv []int32, work []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float32 if len(ap) > 0 { @@ -20331,14 +18877,11 @@ func Ssptri(ul blas.Uplo, n int, ap []float32, ipiv []int32, work []float32) boo } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsptri.f. -func Dsptri(ul blas.Uplo, n int, ap []float64, ipiv []int32, work []float64) bool { +func Dsptri(ul byte, n int, ap []float64, ipiv []int32, work []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float64 if len(ap) > 0 { @@ -20356,14 +18899,11 @@ func Dsptri(ul blas.Uplo, n int, ap []float64, ipiv []int32, work []float64) boo } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/csptri.f. -func Csptri(ul blas.Uplo, n int, ap []complex64, ipiv []int32, work []complex64) bool { +func Csptri(ul byte, n int, ap []complex64, ipiv []int32, work []complex64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex64 if len(ap) > 0 { @@ -20381,14 +18921,11 @@ func Csptri(ul blas.Uplo, n int, ap []complex64, ipiv []int32, work []complex64) } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zsptri.f. -func Zsptri(ul blas.Uplo, n int, ap []complex128, ipiv []int32, work []complex128) bool { +func Zsptri(ul byte, n int, ap []complex128, ipiv []int32, work []complex128) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex128 if len(ap) > 0 { @@ -20406,14 +18943,11 @@ func Zsptri(ul blas.Uplo, n int, ap []complex128, ipiv []int32, work []complex12 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssptrs.f. -func Ssptrs(ul blas.Uplo, n, nrhs int, ap []float32, ipiv []int32, b []float32, ldb int) bool { +func Ssptrs(ul byte, n, nrhs int, ap []float32, ipiv []int32, b []float32, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float32 if len(ap) > 0 { @@ -20431,14 +18965,11 @@ func Ssptrs(ul blas.Uplo, n, nrhs int, ap []float32, ipiv []int32, b []float32, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsptrs.f. -func Dsptrs(ul blas.Uplo, n, nrhs int, ap []float64, ipiv []int32, b []float64, ldb int) bool { +func Dsptrs(ul byte, n, nrhs int, ap []float64, ipiv []int32, b []float64, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float64 if len(ap) > 0 { @@ -20456,14 +18987,11 @@ func Dsptrs(ul blas.Uplo, n, nrhs int, ap []float64, ipiv []int32, b []float64, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/csptrs.f. -func Csptrs(ul blas.Uplo, n, nrhs int, ap []complex64, ipiv []int32, b []complex64, ldb int) bool { +func Csptrs(ul byte, n, nrhs int, ap []complex64, ipiv []int32, b []complex64, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex64 if len(ap) > 0 { @@ -20481,14 +19009,11 @@ func Csptrs(ul blas.Uplo, n, nrhs int, ap []complex64, ipiv []int32, b []complex } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zsptrs.f. -func Zsptrs(ul blas.Uplo, n, nrhs int, ap []complex128, ipiv []int32, b []complex128, ldb int) bool { +func Zsptrs(ul byte, n, nrhs int, ap []complex128, ipiv []int32, b []complex128, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex128 if len(ap) > 0 { @@ -20588,7 +19113,7 @@ func Dstebz(rng, order byte, n int, vl, vu float64, il, iu int, abstol float64, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sstedc.f. -func Sstedc(compz lapack.Comp, n int, d, e, z []float32, ldz int, work []float32, lwork int, iwork []int32, liwork int) bool { +func Sstedc(compz byte, n int, d, e, z []float32, ldz int, work []float32, lwork int, iwork []int32, liwork int) bool { var _d *float32 if len(d) > 0 { _d = &d[0] @@ -20613,7 +19138,7 @@ func Sstedc(compz lapack.Comp, n int, d, e, z []float32, ldz int, work []float32 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dstedc.f. -func Dstedc(compz lapack.Comp, n int, d, e, z []float64, ldz int, work []float64, lwork int, iwork []int32, liwork int) bool { +func Dstedc(compz byte, n int, d, e, z []float64, ldz int, work []float64, lwork int, iwork []int32, liwork int) bool { var _d *float64 if len(d) > 0 { _d = &d[0] @@ -20638,7 +19163,7 @@ func Dstedc(compz lapack.Comp, n int, d, e, z []float64, ldz int, work []float64 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cstedc.f. -func Cstedc(compz lapack.Comp, n int, d, e []float32, z []complex64, ldz int, work []complex64, lwork int, rwork []float32, lrwork int, iwork []int32, liwork int) bool { +func Cstedc(compz byte, n int, d, e []float32, z []complex64, ldz int, work []complex64, lwork int, rwork []float32, lrwork int, iwork []int32, liwork int) bool { var _d *float32 if len(d) > 0 { _d = &d[0] @@ -20667,7 +19192,7 @@ func Cstedc(compz lapack.Comp, n int, d, e []float32, z []complex64, ldz int, wo } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zstedc.f. -func Zstedc(compz lapack.Comp, n int, d, e []float64, z []complex128, ldz int, work []complex128, lwork int, rwork []float64, lrwork int, iwork []int32, liwork int) bool { +func Zstedc(compz byte, n int, d, e []float64, z []complex128, ldz int, work []complex128, lwork int, rwork []float64, lrwork int, iwork []int32, liwork int) bool { var _d *float64 if len(d) > 0 { _d = &d[0] @@ -20696,7 +19221,7 @@ func Zstedc(compz lapack.Comp, n int, d, e []float64, z []complex128, ldz int, w } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sstegr.f. -func Sstegr(jobz lapack.Job, rng byte, n int, d, e []float32, vl, vu float32, il, iu int, abstol float32, m []int32, w, z []float32, ldz int, isuppz []int32, work []float32, lwork int, iwork []int32, liwork int) bool { +func Sstegr(jobz, rng byte, n int, d, e []float32, vl, vu float32, il, iu int, abstol float32, m []int32, w, z []float32, ldz int, isuppz []int32, work []float32, lwork int, iwork []int32, liwork int) bool { var _d *float32 if len(d) > 0 { _d = &d[0] @@ -20733,7 +19258,7 @@ func Sstegr(jobz lapack.Job, rng byte, n int, d, e []float32, vl, vu float32, il } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dstegr.f. -func Dstegr(jobz lapack.Job, rng byte, n int, d, e []float64, vl, vu float64, il, iu int, abstol float64, m []int32, w, z []float64, ldz int, isuppz []int32, work []float64, lwork int, iwork []int32, liwork int) bool { +func Dstegr(jobz, rng byte, n int, d, e []float64, vl, vu float64, il, iu int, abstol float64, m []int32, w, z []float64, ldz int, isuppz []int32, work []float64, lwork int, iwork []int32, liwork int) bool { var _d *float64 if len(d) > 0 { _d = &d[0] @@ -20770,7 +19295,7 @@ func Dstegr(jobz lapack.Job, rng byte, n int, d, e []float64, vl, vu float64, il } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cstegr.f. -func Cstegr(jobz lapack.Job, rng byte, n int, d, e []float32, vl, vu float32, il, iu int, abstol float32, m []int32, w []float32, z []complex64, ldz int, isuppz []int32, work []float32, lwork int, iwork []int32, liwork int) bool { +func Cstegr(jobz, rng byte, n int, d, e []float32, vl, vu float32, il, iu int, abstol float32, m []int32, w []float32, z []complex64, ldz int, isuppz []int32, work []float32, lwork int, iwork []int32, liwork int) bool { var _d *float32 if len(d) > 0 { _d = &d[0] @@ -20807,7 +19332,7 @@ func Cstegr(jobz lapack.Job, rng byte, n int, d, e []float32, vl, vu float32, il } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zstegr.f. -func Zstegr(jobz lapack.Job, rng byte, n int, d, e []float64, vl, vu float64, il, iu int, abstol float64, m []int32, w []float64, z []complex128, ldz int, isuppz []int32, work []float64, lwork int, iwork []int32, liwork int) bool { +func Zstegr(jobz, rng byte, n int, d, e []float64, vl, vu float64, il, iu int, abstol float64, m []int32, w []float64, z []complex128, ldz int, isuppz []int32, work []float64, lwork int, iwork []int32, liwork int) bool { var _d *float64 if len(d) > 0 { _d = &d[0] @@ -21008,7 +19533,7 @@ func Zstein(n int, d, e []float64, m int, w []float64, iblock, isplit []int32, z } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sstemr.f. -func Sstemr(jobz lapack.Job, rng byte, n int, d, e []float32, vl, vu float32, il, iu int, m []int32, w, z []float32, ldz, nzc int, isuppz, tryrac []int32, work []float32, lwork int, iwork []int32, liwork int) bool { +func Sstemr(jobz, rng byte, n int, d, e []float32, vl, vu float32, il, iu int, m []int32, w, z []float32, ldz, nzc int, isuppz, tryrac []int32, work []float32, lwork int, iwork []int32, liwork int) bool { var _d *float32 if len(d) > 0 { _d = &d[0] @@ -21049,7 +19574,7 @@ func Sstemr(jobz lapack.Job, rng byte, n int, d, e []float32, vl, vu float32, il } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dstemr.f. -func Dstemr(jobz lapack.Job, rng byte, n int, d, e []float64, vl, vu float64, il, iu int, m []int32, w, z []float64, ldz, nzc int, isuppz, tryrac []int32, work []float64, lwork int, iwork []int32, liwork int) bool { +func Dstemr(jobz, rng byte, n int, d, e []float64, vl, vu float64, il, iu int, m []int32, w, z []float64, ldz, nzc int, isuppz, tryrac []int32, work []float64, lwork int, iwork []int32, liwork int) bool { var _d *float64 if len(d) > 0 { _d = &d[0] @@ -21090,7 +19615,7 @@ func Dstemr(jobz lapack.Job, rng byte, n int, d, e []float64, vl, vu float64, il } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cstemr.f. -func Cstemr(jobz lapack.Job, rng byte, n int, d, e []float32, vl, vu float32, il, iu int, m []int32, w []float32, z []complex64, ldz, nzc int, isuppz, tryrac []int32, work []float32, lwork int, iwork []int32, liwork int) bool { +func Cstemr(jobz, rng byte, n int, d, e []float32, vl, vu float32, il, iu int, m []int32, w []float32, z []complex64, ldz, nzc int, isuppz, tryrac []int32, work []float32, lwork int, iwork []int32, liwork int) bool { var _d *float32 if len(d) > 0 { _d = &d[0] @@ -21131,7 +19656,7 @@ func Cstemr(jobz lapack.Job, rng byte, n int, d, e []float32, vl, vu float32, il } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zstemr.f. -func Zstemr(jobz lapack.Job, rng byte, n int, d, e []float64, vl, vu float64, il, iu int, m []int32, w []float64, z []complex128, ldz, nzc int, isuppz, tryrac []int32, work []float64, lwork int, iwork []int32, liwork int) bool { +func Zstemr(jobz, rng byte, n int, d, e []float64, vl, vu float64, il, iu int, m []int32, w []float64, z []complex128, ldz, nzc int, isuppz, tryrac []int32, work []float64, lwork int, iwork []int32, liwork int) bool { var _d *float64 if len(d) > 0 { _d = &d[0] @@ -21172,7 +19697,7 @@ func Zstemr(jobz lapack.Job, rng byte, n int, d, e []float64, vl, vu float64, il } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssteqr.f. -func Ssteqr(compz lapack.Comp, n int, d, e, z []float32, ldz int, work []float32) bool { +func Ssteqr(compz byte, n int, d, e, z []float32, ldz int, work []float32) bool { var _d *float32 if len(d) > 0 { _d = &d[0] @@ -21193,7 +19718,7 @@ func Ssteqr(compz lapack.Comp, n int, d, e, z []float32, ldz int, work []float32 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsteqr.f. -func Dsteqr(compz lapack.Comp, n int, d, e, z []float64, ldz int, work []float64) bool { +func Dsteqr(compz byte, n int, d, e, z []float64, ldz int, work []float64) bool { var _d *float64 if len(d) > 0 { _d = &d[0] @@ -21214,7 +19739,7 @@ func Dsteqr(compz lapack.Comp, n int, d, e, z []float64, ldz int, work []float64 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/csteqr.f. -func Csteqr(compz lapack.Comp, n int, d, e []float32, z []complex64, ldz int, work []float32) bool { +func Csteqr(compz byte, n int, d, e []float32, z []complex64, ldz int, work []float32) bool { var _d *float32 if len(d) > 0 { _d = &d[0] @@ -21235,7 +19760,7 @@ func Csteqr(compz lapack.Comp, n int, d, e []float32, z []complex64, ldz int, wo } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zsteqr.f. -func Zsteqr(compz lapack.Comp, n int, d, e []float64, z []complex128, ldz int, work []float64) bool { +func Zsteqr(compz byte, n int, d, e []float64, z []complex128, ldz int, work []float64) bool { var _d *float64 if len(d) > 0 { _d = &d[0] @@ -21282,7 +19807,7 @@ func Dsterf(n int, d, e []float64) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sstev.f. -func Sstev(jobz lapack.Job, n int, d, e, z []float32, ldz int, work []float32) bool { +func Sstev(jobz byte, n int, d, e, z []float32, ldz int, work []float32) bool { var _d *float32 if len(d) > 0 { _d = &d[0] @@ -21303,7 +19828,7 @@ func Sstev(jobz lapack.Job, n int, d, e, z []float32, ldz int, work []float32) b } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dstev.f. -func Dstev(jobz lapack.Job, n int, d, e, z []float64, ldz int, work []float64) bool { +func Dstev(jobz byte, n int, d, e, z []float64, ldz int, work []float64) bool { var _d *float64 if len(d) > 0 { _d = &d[0] @@ -21324,7 +19849,7 @@ func Dstev(jobz lapack.Job, n int, d, e, z []float64, ldz int, work []float64) b } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sstevd.f. -func Sstevd(jobz lapack.Job, n int, d, e, z []float32, ldz int, work []float32, lwork int, iwork []int32, liwork int) bool { +func Sstevd(jobz byte, n int, d, e, z []float32, ldz int, work []float32, lwork int, iwork []int32, liwork int) bool { var _d *float32 if len(d) > 0 { _d = &d[0] @@ -21349,7 +19874,7 @@ func Sstevd(jobz lapack.Job, n int, d, e, z []float32, ldz int, work []float32, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dstevd.f. -func Dstevd(jobz lapack.Job, n int, d, e, z []float64, ldz int, work []float64, lwork int, iwork []int32, liwork int) bool { +func Dstevd(jobz byte, n int, d, e, z []float64, ldz int, work []float64, lwork int, iwork []int32, liwork int) bool { var _d *float64 if len(d) > 0 { _d = &d[0] @@ -21374,7 +19899,7 @@ func Dstevd(jobz lapack.Job, n int, d, e, z []float64, ldz int, work []float64, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sstevr.f. -func Sstevr(jobz lapack.Job, rng byte, n int, d, e []float32, vl, vu float32, il, iu int, abstol float32, m []int32, w, z []float32, ldz int, isuppz []int32, work []float32, lwork int, iwork []int32, liwork int) bool { +func Sstevr(jobz, rng byte, n int, d, e []float32, vl, vu float32, il, iu int, abstol float32, m []int32, w, z []float32, ldz int, isuppz []int32, work []float32, lwork int, iwork []int32, liwork int) bool { var _d *float32 if len(d) > 0 { _d = &d[0] @@ -21411,7 +19936,7 @@ func Sstevr(jobz lapack.Job, rng byte, n int, d, e []float32, vl, vu float32, il } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dstevr.f. -func Dstevr(jobz lapack.Job, rng byte, n int, d, e []float64, vl, vu float64, il, iu int, abstol float64, m []int32, w, z []float64, ldz int, isuppz []int32, work []float64, lwork int, iwork []int32, liwork int) bool { +func Dstevr(jobz, rng byte, n int, d, e []float64, vl, vu float64, il, iu int, abstol float64, m []int32, w, z []float64, ldz int, isuppz []int32, work []float64, lwork int, iwork []int32, liwork int) bool { var _d *float64 if len(d) > 0 { _d = &d[0] @@ -21448,7 +19973,7 @@ func Dstevr(jobz lapack.Job, rng byte, n int, d, e []float64, vl, vu float64, il } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sstevx.f. -func Sstevx(jobz lapack.Job, rng byte, n int, d, e []float32, vl, vu float32, il, iu int, abstol float32, m []int32, w, z []float32, ldz int, work []float32, iwork, ifail []int32) bool { +func Sstevx(jobz, rng byte, n int, d, e []float32, vl, vu float32, il, iu int, abstol float32, m []int32, w, z []float32, ldz int, work []float32, iwork, ifail []int32) bool { var _d *float32 if len(d) > 0 { _d = &d[0] @@ -21485,7 +20010,7 @@ func Sstevx(jobz lapack.Job, rng byte, n int, d, e []float32, vl, vu float32, il } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dstevx.f. -func Dstevx(jobz lapack.Job, rng byte, n int, d, e []float64, vl, vu float64, il, iu int, abstol float64, m []int32, w, z []float64, ldz int, work []float64, iwork, ifail []int32) bool { +func Dstevx(jobz, rng byte, n int, d, e []float64, vl, vu float64, il, iu int, abstol float64, m []int32, w, z []float64, ldz int, work []float64, iwork, ifail []int32) bool { var _d *float64 if len(d) > 0 { _d = &d[0] @@ -21522,14 +20047,11 @@ func Dstevx(jobz lapack.Job, rng byte, n int, d, e []float64, vl, vu float64, il } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssycon.f. -func Ssycon(ul blas.Uplo, n int, a []float32, lda int, ipiv []int32, anorm float32, rcond, work []float32, iwork []int32) bool { +func Ssycon(ul byte, n int, a []float32, lda int, ipiv []int32, anorm float32, rcond, work []float32, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -21555,14 +20077,11 @@ func Ssycon(ul blas.Uplo, n int, a []float32, lda int, ipiv []int32, anorm float } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsycon.f. -func Dsycon(ul blas.Uplo, n int, a []float64, lda int, ipiv []int32, anorm float64, rcond, work []float64, iwork []int32) bool { +func Dsycon(ul byte, n int, a []float64, lda int, ipiv []int32, anorm float64, rcond, work []float64, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -21588,14 +20107,11 @@ func Dsycon(ul blas.Uplo, n int, a []float64, lda int, ipiv []int32, anorm float } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/csycon.f. -func Csycon(ul blas.Uplo, n int, a []complex64, lda int, ipiv []int32, anorm float32, rcond []float32, work []complex64) bool { +func Csycon(ul byte, n int, a []complex64, lda int, ipiv []int32, anorm float32, rcond []float32, work []complex64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -21617,14 +20133,11 @@ func Csycon(ul blas.Uplo, n int, a []complex64, lda int, ipiv []int32, anorm flo } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zsycon.f. -func Zsycon(ul blas.Uplo, n int, a []complex128, lda int, ipiv []int32, anorm float64, rcond []float64, work []complex128) bool { +func Zsycon(ul byte, n int, a []complex128, lda int, ipiv []int32, anorm float64, rcond []float64, work []complex128) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -21646,14 +20159,11 @@ func Zsycon(ul blas.Uplo, n int, a []complex128, lda int, ipiv []int32, anorm fl } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssyequb.f. -func Ssyequb(ul blas.Uplo, n int, a []float32, lda int, s, scond, amax, work []float32) bool { +func Ssyequb(ul byte, n int, a []float32, lda int, s, scond, amax, work []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -21679,14 +20189,11 @@ func Ssyequb(ul blas.Uplo, n int, a []float32, lda int, s, scond, amax, work []f } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsyequb.f. -func Dsyequb(ul blas.Uplo, n int, a []float64, lda int, s, scond, amax, work []float64) bool { +func Dsyequb(ul byte, n int, a []float64, lda int, s, scond, amax, work []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -21712,14 +20219,11 @@ func Dsyequb(ul blas.Uplo, n int, a []float64, lda int, s, scond, amax, work []f } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/csyequb.f. -func Csyequb(ul blas.Uplo, n int, a []complex64, lda int, s, scond, amax []float32, work []complex64) bool { +func Csyequb(ul byte, n int, a []complex64, lda int, s, scond, amax []float32, work []complex64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -21745,14 +20249,11 @@ func Csyequb(ul blas.Uplo, n int, a []complex64, lda int, s, scond, amax []float } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zsyequb.f. -func Zsyequb(ul blas.Uplo, n int, a []complex128, lda int, s, scond, amax []float64, work []complex128) bool { +func Zsyequb(ul byte, n int, a []complex128, lda int, s, scond, amax []float64, work []complex128) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -21778,14 +20279,11 @@ func Zsyequb(ul blas.Uplo, n int, a []complex128, lda int, s, scond, amax []floa } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssyev.f. -func Ssyev(jobz lapack.Job, ul blas.Uplo, n int, a []float32, lda int, w, work []float32, lwork int) bool { +func Ssyev(jobz, ul byte, n int, a []float32, lda int, w, work []float32, lwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -21803,14 +20301,11 @@ func Ssyev(jobz lapack.Job, ul blas.Uplo, n int, a []float32, lda int, w, work [ } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsyev.f. -func Dsyev(jobz lapack.Job, ul blas.Uplo, n int, a []float64, lda int, w, work []float64, lwork int) bool { +func Dsyev(jobz, ul byte, n int, a []float64, lda int, w, work []float64, lwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -21828,14 +20323,11 @@ func Dsyev(jobz lapack.Job, ul blas.Uplo, n int, a []float64, lda int, w, work [ } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssyevd.f. -func Ssyevd(jobz lapack.Job, ul blas.Uplo, n int, a []float32, lda int, w, work []float32, lwork int, iwork []int32, liwork int) bool { +func Ssyevd(jobz, ul byte, n int, a []float32, lda int, w, work []float32, lwork int, iwork []int32, liwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -21857,14 +20349,11 @@ func Ssyevd(jobz lapack.Job, ul blas.Uplo, n int, a []float32, lda int, w, work } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsyevd.f. -func Dsyevd(jobz lapack.Job, ul blas.Uplo, n int, a []float64, lda int, w, work []float64, lwork int, iwork []int32, liwork int) bool { +func Dsyevd(jobz, ul byte, n int, a []float64, lda int, w, work []float64, lwork int, iwork []int32, liwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -21886,14 +20375,11 @@ func Dsyevd(jobz lapack.Job, ul blas.Uplo, n int, a []float64, lda int, w, work } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssyevr.f. -func Ssyevr(jobz lapack.Job, rng byte, ul blas.Uplo, n int, a []float32, lda int, vl, vu float32, il, iu int, abstol float32, m []int32, w, z []float32, ldz int, isuppz []int32, work []float32, lwork int, iwork []int32, liwork int) bool { +func Ssyevr(jobz, rng, ul byte, n int, a []float32, lda int, vl, vu float32, il, iu int, abstol float32, m []int32, w, z []float32, ldz int, isuppz []int32, work []float32, lwork int, iwork []int32, liwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -21927,14 +20413,11 @@ func Ssyevr(jobz lapack.Job, rng byte, ul blas.Uplo, n int, a []float32, lda int } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsyevr.f. -func Dsyevr(jobz lapack.Job, rng byte, ul blas.Uplo, n int, a []float64, lda int, vl, vu float64, il, iu int, abstol float64, m []int32, w, z []float64, ldz int, isuppz []int32, work []float64, lwork int, iwork []int32, liwork int) bool { +func Dsyevr(jobz, rng, ul byte, n int, a []float64, lda int, vl, vu float64, il, iu int, abstol float64, m []int32, w, z []float64, ldz int, isuppz []int32, work []float64, lwork int, iwork []int32, liwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -21968,14 +20451,11 @@ func Dsyevr(jobz lapack.Job, rng byte, ul blas.Uplo, n int, a []float64, lda int } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssyevx.f. -func Ssyevx(jobz lapack.Job, rng byte, ul blas.Uplo, n int, a []float32, lda int, vl, vu float32, il, iu int, abstol float32, m []int32, w, z []float32, ldz int, work []float32, lwork int, iwork, ifail []int32) bool { +func Ssyevx(jobz, rng, ul byte, n int, a []float32, lda int, vl, vu float32, il, iu int, abstol float32, m []int32, w, z []float32, ldz int, work []float32, lwork int, iwork, ifail []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -22009,14 +20489,11 @@ func Ssyevx(jobz lapack.Job, rng byte, ul blas.Uplo, n int, a []float32, lda int } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsyevx.f. -func Dsyevx(jobz lapack.Job, rng byte, ul blas.Uplo, n int, a []float64, lda int, vl, vu float64, il, iu int, abstol float64, m []int32, w, z []float64, ldz int, work []float64, lwork int, iwork, ifail []int32) bool { +func Dsyevx(jobz, rng, ul byte, n int, a []float64, lda int, vl, vu float64, il, iu int, abstol float64, m []int32, w, z []float64, ldz int, work []float64, lwork int, iwork, ifail []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -22050,14 +20527,11 @@ func Dsyevx(jobz lapack.Job, rng byte, ul blas.Uplo, n int, a []float64, lda int } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssygst.f. -func Ssygst(itype int, ul blas.Uplo, n int, a []float32, lda int, b []float32, ldb int) bool { +func Ssygst(itype int, ul byte, n int, a []float32, lda int, b []float32, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -22071,14 +20545,11 @@ func Ssygst(itype int, ul blas.Uplo, n int, a []float32, lda int, b []float32, l } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsygst.f. -func Dsygst(itype int, ul blas.Uplo, n int, a []float64, lda int, b []float64, ldb int) bool { +func Dsygst(itype int, ul byte, n int, a []float64, lda int, b []float64, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -22092,14 +20563,11 @@ func Dsygst(itype int, ul blas.Uplo, n int, a []float64, lda int, b []float64, l } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssygv.f. -func Ssygv(itype int, jobz lapack.Job, ul blas.Uplo, n int, a []float32, lda int, b []float32, ldb int, w, work []float32, lwork int) bool { +func Ssygv(itype int, jobz, ul byte, n int, a []float32, lda int, b []float32, ldb int, w, work []float32, lwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -22121,14 +20589,11 @@ func Ssygv(itype int, jobz lapack.Job, ul blas.Uplo, n int, a []float32, lda int } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsygv.f. -func Dsygv(itype int, jobz lapack.Job, ul blas.Uplo, n int, a []float64, lda int, b []float64, ldb int, w, work []float64, lwork int) bool { +func Dsygv(itype int, jobz, ul byte, n int, a []float64, lda int, b []float64, ldb int, w, work []float64, lwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -22150,14 +20615,11 @@ func Dsygv(itype int, jobz lapack.Job, ul blas.Uplo, n int, a []float64, lda int } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssygvd.f. -func Ssygvd(itype int, jobz lapack.Job, ul blas.Uplo, n int, a []float32, lda int, b []float32, ldb int, w, work []float32, lwork int, iwork []int32, liwork int) bool { +func Ssygvd(itype int, jobz, ul byte, n int, a []float32, lda int, b []float32, ldb int, w, work []float32, lwork int, iwork []int32, liwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -22183,14 +20645,11 @@ func Ssygvd(itype int, jobz lapack.Job, ul blas.Uplo, n int, a []float32, lda in } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsygvd.f. -func Dsygvd(itype int, jobz lapack.Job, ul blas.Uplo, n int, a []float64, lda int, b []float64, ldb int, w, work []float64, lwork int, iwork []int32, liwork int) bool { +func Dsygvd(itype int, jobz, ul byte, n int, a []float64, lda int, b []float64, ldb int, w, work []float64, lwork int, iwork []int32, liwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -22216,14 +20675,11 @@ func Dsygvd(itype int, jobz lapack.Job, ul blas.Uplo, n int, a []float64, lda in } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssygvx.f. -func Ssygvx(itype int, jobz lapack.Job, rng byte, ul blas.Uplo, n int, a []float32, lda int, b []float32, ldb int, vl, vu float32, il, iu int, abstol float32, m []int32, w, z []float32, ldz int, work []float32, lwork int, iwork, ifail []int32) bool { +func Ssygvx(itype int, jobz, rng, ul byte, n int, a []float32, lda int, b []float32, ldb int, vl, vu float32, il, iu int, abstol float32, m []int32, w, z []float32, ldz int, work []float32, lwork int, iwork, ifail []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -22261,14 +20717,11 @@ func Ssygvx(itype int, jobz lapack.Job, rng byte, ul blas.Uplo, n int, a []float } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsygvx.f. -func Dsygvx(itype int, jobz lapack.Job, rng byte, ul blas.Uplo, n int, a []float64, lda int, b []float64, ldb int, vl, vu float64, il, iu int, abstol float64, m []int32, w, z []float64, ldz int, work []float64, lwork int, iwork, ifail []int32) bool { +func Dsygvx(itype int, jobz, rng, ul byte, n int, a []float64, lda int, b []float64, ldb int, vl, vu float64, il, iu int, abstol float64, m []int32, w, z []float64, ldz int, work []float64, lwork int, iwork, ifail []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -22306,14 +20759,11 @@ func Dsygvx(itype int, jobz lapack.Job, rng byte, ul blas.Uplo, n int, a []float } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssyrfs.f. -func Ssyrfs(ul blas.Uplo, n, nrhs int, a []float32, lda int, af []float32, ldaf int, ipiv []int32, b []float32, ldb int, x []float32, ldx int, ferr, berr, work []float32, iwork []int32) bool { +func Ssyrfs(ul byte, n, nrhs int, a []float32, lda int, af []float32, ldaf int, ipiv []int32, b []float32, ldb int, x []float32, ldx int, ferr, berr, work []float32, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -22355,14 +20805,11 @@ func Ssyrfs(ul blas.Uplo, n, nrhs int, a []float32, lda int, af []float32, ldaf } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsyrfs.f. -func Dsyrfs(ul blas.Uplo, n, nrhs int, a []float64, lda int, af []float64, ldaf int, ipiv []int32, b []float64, ldb int, x []float64, ldx int, ferr, berr, work []float64, iwork []int32) bool { +func Dsyrfs(ul byte, n, nrhs int, a []float64, lda int, af []float64, ldaf int, ipiv []int32, b []float64, ldb int, x []float64, ldx int, ferr, berr, work []float64, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -22404,14 +20851,11 @@ func Dsyrfs(ul blas.Uplo, n, nrhs int, a []float64, lda int, af []float64, ldaf } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/csyrfs.f. -func Csyrfs(ul blas.Uplo, n, nrhs int, a []complex64, lda int, af []complex64, ldaf int, ipiv []int32, b []complex64, ldb int, x []complex64, ldx int, ferr, berr []float32, work []complex64, rwork []float32) bool { +func Csyrfs(ul byte, n, nrhs int, a []complex64, lda int, af []complex64, ldaf int, ipiv []int32, b []complex64, ldb int, x []complex64, ldx int, ferr, berr []float32, work []complex64, rwork []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -22453,14 +20897,11 @@ func Csyrfs(ul blas.Uplo, n, nrhs int, a []complex64, lda int, af []complex64, l } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zsyrfs.f. -func Zsyrfs(ul blas.Uplo, n, nrhs int, a []complex128, lda int, af []complex128, ldaf int, ipiv []int32, b []complex128, ldb int, x []complex128, ldx int, ferr, berr []float64, work []complex128, rwork []float64) bool { +func Zsyrfs(ul byte, n, nrhs int, a []complex128, lda int, af []complex128, ldaf int, ipiv []int32, b []complex128, ldb int, x []complex128, ldx int, ferr, berr []float64, work []complex128, rwork []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -22502,14 +20943,11 @@ func Zsyrfs(ul blas.Uplo, n, nrhs int, a []complex128, lda int, af []complex128, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssysv.f. -func Ssysv(ul blas.Uplo, n, nrhs int, a []float32, lda int, ipiv []int32, b []float32, ldb int, work []float32, lwork int) bool { +func Ssysv(ul byte, n, nrhs int, a []float32, lda int, ipiv []int32, b []float32, ldb int, work []float32, lwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -22531,14 +20969,11 @@ func Ssysv(ul blas.Uplo, n, nrhs int, a []float32, lda int, ipiv []int32, b []fl } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsysv.f. -func Dsysv(ul blas.Uplo, n, nrhs int, a []float64, lda int, ipiv []int32, b []float64, ldb int, work []float64, lwork int) bool { +func Dsysv(ul byte, n, nrhs int, a []float64, lda int, ipiv []int32, b []float64, ldb int, work []float64, lwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -22560,14 +20995,11 @@ func Dsysv(ul blas.Uplo, n, nrhs int, a []float64, lda int, ipiv []int32, b []fl } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/csysv.f. -func Csysv(ul blas.Uplo, n, nrhs int, a []complex64, lda int, ipiv []int32, b []complex64, ldb int, work []complex64, lwork int) bool { +func Csysv(ul byte, n, nrhs int, a []complex64, lda int, ipiv []int32, b []complex64, ldb int, work []complex64, lwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -22589,14 +21021,11 @@ func Csysv(ul blas.Uplo, n, nrhs int, a []complex64, lda int, ipiv []int32, b [] } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zsysv.f. -func Zsysv(ul blas.Uplo, n, nrhs int, a []complex128, lda int, ipiv []int32, b []complex128, ldb int, work []complex128, lwork int) bool { +func Zsysv(ul byte, n, nrhs int, a []complex128, lda int, ipiv []int32, b []complex128, ldb int, work []complex128, lwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -22618,14 +21047,11 @@ func Zsysv(ul blas.Uplo, n, nrhs int, a []complex128, lda int, ipiv []int32, b [ } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssysvx.f. -func Ssysvx(fact byte, ul blas.Uplo, n, nrhs int, a []float32, lda int, af []float32, ldaf int, ipiv []int32, b []float32, ldb int, x []float32, ldx int, rcond, ferr, berr, work []float32, lwork int, iwork []int32) bool { +func Ssysvx(fact, ul byte, n, nrhs int, a []float32, lda int, af []float32, ldaf int, ipiv []int32, b []float32, ldb int, x []float32, ldx int, rcond, ferr, berr, work []float32, lwork int, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -22671,14 +21097,11 @@ func Ssysvx(fact byte, ul blas.Uplo, n, nrhs int, a []float32, lda int, af []flo } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsysvx.f. -func Dsysvx(fact byte, ul blas.Uplo, n, nrhs int, a []float64, lda int, af []float64, ldaf int, ipiv []int32, b []float64, ldb int, x []float64, ldx int, rcond, ferr, berr, work []float64, lwork int, iwork []int32) bool { +func Dsysvx(fact, ul byte, n, nrhs int, a []float64, lda int, af []float64, ldaf int, ipiv []int32, b []float64, ldb int, x []float64, ldx int, rcond, ferr, berr, work []float64, lwork int, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -22724,14 +21147,11 @@ func Dsysvx(fact byte, ul blas.Uplo, n, nrhs int, a []float64, lda int, af []flo } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/csysvx.f. -func Csysvx(fact byte, ul blas.Uplo, n, nrhs int, a []complex64, lda int, af []complex64, ldaf int, ipiv []int32, b []complex64, ldb int, x []complex64, ldx int, rcond, ferr, berr []float32, work []complex64, lwork int, rwork []float32) bool { +func Csysvx(fact, ul byte, n, nrhs int, a []complex64, lda int, af []complex64, ldaf int, ipiv []int32, b []complex64, ldb int, x []complex64, ldx int, rcond, ferr, berr []float32, work []complex64, lwork int, rwork []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -22777,14 +21197,11 @@ func Csysvx(fact byte, ul blas.Uplo, n, nrhs int, a []complex64, lda int, af []c } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zsysvx.f. -func Zsysvx(fact byte, ul blas.Uplo, n, nrhs int, a []complex128, lda int, af []complex128, ldaf int, ipiv []int32, b []complex128, ldb int, x []complex128, ldx int, rcond, ferr, berr []float64, work []complex128, lwork int, rwork []float64) bool { +func Zsysvx(fact, ul byte, n, nrhs int, a []complex128, lda int, af []complex128, ldaf int, ipiv []int32, b []complex128, ldb int, x []complex128, ldx int, rcond, ferr, berr []float64, work []complex128, lwork int, rwork []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -22830,14 +21247,11 @@ func Zsysvx(fact byte, ul blas.Uplo, n, nrhs int, a []complex128, lda int, af [] } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssytrd.f. -func Ssytrd(ul blas.Uplo, n int, a []float32, lda int, d, e, tau, work []float32, lwork int) bool { +func Ssytrd(ul byte, n int, a []float32, lda int, d, e, tau, work []float32, lwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -22863,14 +21277,11 @@ func Ssytrd(ul blas.Uplo, n int, a []float32, lda int, d, e, tau, work []float32 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsytrd.f. -func Dsytrd(ul blas.Uplo, n int, a []float64, lda int, d, e, tau, work []float64, lwork int) bool { +func Dsytrd(ul byte, n int, a []float64, lda int, d, e, tau, work []float64, lwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -22896,14 +21307,11 @@ func Dsytrd(ul blas.Uplo, n int, a []float64, lda int, d, e, tau, work []float64 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssytrf.f. -func Ssytrf(ul blas.Uplo, n int, a []float32, lda int, ipiv []int32, work []float32, lwork int) bool { +func Ssytrf(ul byte, n int, a []float32, lda int, ipiv []int32, work []float32, lwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -22921,14 +21329,11 @@ func Ssytrf(ul blas.Uplo, n int, a []float32, lda int, ipiv []int32, work []floa } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsytrf.f. -func Dsytrf(ul blas.Uplo, n int, a []float64, lda int, ipiv []int32, work []float64, lwork int) bool { +func Dsytrf(ul byte, n int, a []float64, lda int, ipiv []int32, work []float64, lwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -22946,14 +21351,11 @@ func Dsytrf(ul blas.Uplo, n int, a []float64, lda int, ipiv []int32, work []floa } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/csytrf.f. -func Csytrf(ul blas.Uplo, n int, a []complex64, lda int, ipiv []int32, work []complex64, lwork int) bool { +func Csytrf(ul byte, n int, a []complex64, lda int, ipiv []int32, work []complex64, lwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -22971,14 +21373,11 @@ func Csytrf(ul blas.Uplo, n int, a []complex64, lda int, ipiv []int32, work []co } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zsytrf.f. -func Zsytrf(ul blas.Uplo, n int, a []complex128, lda int, ipiv []int32, work []complex128, lwork int) bool { +func Zsytrf(ul byte, n int, a []complex128, lda int, ipiv []int32, work []complex128, lwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -22996,14 +21395,11 @@ func Zsytrf(ul blas.Uplo, n int, a []complex128, lda int, ipiv []int32, work []c } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssytri.f. -func Ssytri(ul blas.Uplo, n int, a []float32, lda int, ipiv []int32, work []float32) bool { +func Ssytri(ul byte, n int, a []float32, lda int, ipiv []int32, work []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -23021,14 +21417,11 @@ func Ssytri(ul blas.Uplo, n int, a []float32, lda int, ipiv []int32, work []floa } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsytri.f. -func Dsytri(ul blas.Uplo, n int, a []float64, lda int, ipiv []int32, work []float64) bool { +func Dsytri(ul byte, n int, a []float64, lda int, ipiv []int32, work []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -23046,14 +21439,11 @@ func Dsytri(ul blas.Uplo, n int, a []float64, lda int, ipiv []int32, work []floa } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/csytri.f. -func Csytri(ul blas.Uplo, n int, a []complex64, lda int, ipiv []int32, work []complex64) bool { +func Csytri(ul byte, n int, a []complex64, lda int, ipiv []int32, work []complex64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -23071,14 +21461,11 @@ func Csytri(ul blas.Uplo, n int, a []complex64, lda int, ipiv []int32, work []co } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zsytri.f. -func Zsytri(ul blas.Uplo, n int, a []complex128, lda int, ipiv []int32, work []complex128) bool { +func Zsytri(ul byte, n int, a []complex128, lda int, ipiv []int32, work []complex128) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -23096,14 +21483,11 @@ func Zsytri(ul blas.Uplo, n int, a []complex128, lda int, ipiv []int32, work []c } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssytrs.f. -func Ssytrs(ul blas.Uplo, n, nrhs int, a []float32, lda int, ipiv []int32, b []float32, ldb int) bool { +func Ssytrs(ul byte, n, nrhs int, a []float32, lda int, ipiv []int32, b []float32, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -23121,14 +21505,11 @@ func Ssytrs(ul blas.Uplo, n, nrhs int, a []float32, lda int, ipiv []int32, b []f } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsytrs.f. -func Dsytrs(ul blas.Uplo, n, nrhs int, a []float64, lda int, ipiv []int32, b []float64, ldb int) bool { +func Dsytrs(ul byte, n, nrhs int, a []float64, lda int, ipiv []int32, b []float64, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -23146,14 +21527,11 @@ func Dsytrs(ul blas.Uplo, n, nrhs int, a []float64, lda int, ipiv []int32, b []f } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/csytrs.f. -func Csytrs(ul blas.Uplo, n, nrhs int, a []complex64, lda int, ipiv []int32, b []complex64, ldb int) bool { +func Csytrs(ul byte, n, nrhs int, a []complex64, lda int, ipiv []int32, b []complex64, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -23171,14 +21549,11 @@ func Csytrs(ul blas.Uplo, n, nrhs int, a []complex64, lda int, ipiv []int32, b [ } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zsytrs.f. -func Zsytrs(ul blas.Uplo, n, nrhs int, a []complex128, lda int, ipiv []int32, b []complex128, ldb int) bool { +func Zsytrs(ul byte, n, nrhs int, a []complex128, lda int, ipiv []int32, b []complex128, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -23196,22 +21571,16 @@ func Zsytrs(ul blas.Uplo, n, nrhs int, a []complex128, lda int, ipiv []int32, b } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/stbcon.f. -func Stbcon(norm byte, ul blas.Uplo, d blas.Diag, n, kd int, ab []float32, ldab int, rcond, work []float32, iwork []int32) bool { +func Stbcon(norm, ul, d byte, n, kd int, ab []float32, ldab int, rcond, work []float32, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _ab *float32 if len(ab) > 0 { @@ -23233,22 +21602,16 @@ func Stbcon(norm byte, ul blas.Uplo, d blas.Diag, n, kd int, ab []float32, ldab } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dtbcon.f. -func Dtbcon(norm byte, ul blas.Uplo, d blas.Diag, n, kd int, ab []float64, ldab int, rcond, work []float64, iwork []int32) bool { +func Dtbcon(norm, ul, d byte, n, kd int, ab []float64, ldab int, rcond, work []float64, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _ab *float64 if len(ab) > 0 { @@ -23270,22 +21633,16 @@ func Dtbcon(norm byte, ul blas.Uplo, d blas.Diag, n, kd int, ab []float64, ldab } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ctbcon.f. -func Ctbcon(norm byte, ul blas.Uplo, d blas.Diag, n, kd int, ab []complex64, ldab int, rcond []float32, work []complex64, rwork []float32) bool { +func Ctbcon(norm, ul, d byte, n, kd int, ab []complex64, ldab int, rcond []float32, work []complex64, rwork []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _ab *complex64 if len(ab) > 0 { @@ -23307,22 +21664,16 @@ func Ctbcon(norm byte, ul blas.Uplo, d blas.Diag, n, kd int, ab []complex64, lda } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ztbcon.f. -func Ztbcon(norm byte, ul blas.Uplo, d blas.Diag, n, kd int, ab []complex128, ldab int, rcond []float64, work []complex128, rwork []float64) bool { +func Ztbcon(norm, ul, d byte, n, kd int, ab []complex128, ldab int, rcond []float64, work []complex128, rwork []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _ab *complex128 if len(ab) > 0 { @@ -23344,32 +21695,21 @@ func Ztbcon(norm byte, ul blas.Uplo, d blas.Diag, n, kd int, ab []complex128, ld } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/stbrfs.f. -func Stbrfs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, kd, nrhs int, ab []float32, ldab int, b []float32, ldb int, x []float32, ldx int, ferr, berr, work []float32, iwork []int32) bool { +func Stbrfs(ul, trans, d byte, n, kd, nrhs int, ab []float32, ldab int, b []float32, ldb int, x []float32, ldx int, ferr, berr, work []float32, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _ab *float32 if len(ab) > 0 { @@ -23403,32 +21743,21 @@ func Stbrfs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, kd, nrhs int, ab } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dtbrfs.f. -func Dtbrfs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, kd, nrhs int, ab []float64, ldab int, b []float64, ldb int, x []float64, ldx int, ferr, berr, work []float64, iwork []int32) bool { +func Dtbrfs(ul, trans, d byte, n, kd, nrhs int, ab []float64, ldab int, b []float64, ldb int, x []float64, ldx int, ferr, berr, work []float64, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _ab *float64 if len(ab) > 0 { @@ -23462,32 +21791,21 @@ func Dtbrfs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, kd, nrhs int, ab } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ctbrfs.f. -func Ctbrfs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, kd, nrhs int, ab []complex64, ldab int, b []complex64, ldb int, x []complex64, ldx int, ferr, berr []float32, work []complex64, rwork []float32) bool { +func Ctbrfs(ul, trans, d byte, n, kd, nrhs int, ab []complex64, ldab int, b []complex64, ldb int, x []complex64, ldx int, ferr, berr []float32, work []complex64, rwork []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _ab *complex64 if len(ab) > 0 { @@ -23521,32 +21839,21 @@ func Ctbrfs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, kd, nrhs int, ab } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ztbrfs.f. -func Ztbrfs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, kd, nrhs int, ab []complex128, ldab int, b []complex128, ldb int, x []complex128, ldx int, ferr, berr []float64, work []complex128, rwork []float64) bool { +func Ztbrfs(ul, trans, d byte, n, kd, nrhs int, ab []complex128, ldab int, b []complex128, ldb int, x []complex128, ldx int, ferr, berr []float64, work []complex128, rwork []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _ab *complex128 if len(ab) > 0 { @@ -23580,32 +21887,21 @@ func Ztbrfs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, kd, nrhs int, ab } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/stbtrs.f. -func Stbtrs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, kd, nrhs int, ab []float32, ldab int, b []float32, ldb int) bool { +func Stbtrs(ul, trans, d byte, n, kd, nrhs int, ab []float32, ldab int, b []float32, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _ab *float32 if len(ab) > 0 { @@ -23619,32 +21915,21 @@ func Stbtrs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, kd, nrhs int, ab } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dtbtrs.f. -func Dtbtrs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, kd, nrhs int, ab []float64, ldab int, b []float64, ldb int) bool { +func Dtbtrs(ul, trans, d byte, n, kd, nrhs int, ab []float64, ldab int, b []float64, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _ab *float64 if len(ab) > 0 { @@ -23658,32 +21943,21 @@ func Dtbtrs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, kd, nrhs int, ab } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ctbtrs.f. -func Ctbtrs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, kd, nrhs int, ab []complex64, ldab int, b []complex64, ldb int) bool { +func Ctbtrs(ul, trans, d byte, n, kd, nrhs int, ab []complex64, ldab int, b []complex64, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _ab *complex64 if len(ab) > 0 { @@ -23697,32 +21971,21 @@ func Ctbtrs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, kd, nrhs int, ab } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ztbtrs.f. -func Ztbtrs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, kd, nrhs int, ab []complex128, ldab int, b []complex128, ldb int) bool { +func Ztbtrs(ul, trans, d byte, n, kd, nrhs int, ab []complex128, ldab int, b []complex128, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _ab *complex128 if len(ab) > 0 { @@ -23736,50 +21999,31 @@ func Ztbtrs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, kd, nrhs int, ab } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/stfsm.f. -func Stfsm(transr blas.Transpose, side blas.Side, ul blas.Uplo, trans blas.Transpose, d blas.Diag, m, n int, alpha float32, a, b []float32, ldb int) bool { +func Stfsm(transr, side, ul, trans, d byte, m, n int, alpha float32, a, b []float32, ldb int) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _a *float32 if len(a) > 0 { @@ -23793,50 +22037,31 @@ func Stfsm(transr blas.Transpose, side blas.Side, ul blas.Uplo, trans blas.Trans } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dtfsm.f. -func Dtfsm(transr blas.Transpose, side blas.Side, ul blas.Uplo, trans blas.Transpose, d blas.Diag, m, n int, alpha float64, a, b []float64, ldb int) bool { +func Dtfsm(transr, side, ul, trans, d byte, m, n int, alpha float64, a, b []float64, ldb int) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _a *float64 if len(a) > 0 { @@ -23850,50 +22075,31 @@ func Dtfsm(transr blas.Transpose, side blas.Side, ul blas.Uplo, trans blas.Trans } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ctfsm.f. -func Ctfsm(transr blas.Transpose, side blas.Side, ul blas.Uplo, trans blas.Transpose, d blas.Diag, m, n int, alpha complex64, a, b []complex64, ldb int) bool { +func Ctfsm(transr, side, ul, trans, d byte, m, n int, alpha complex64, a, b []complex64, ldb int) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _a *complex64 if len(a) > 0 { @@ -23907,50 +22113,31 @@ func Ctfsm(transr blas.Transpose, side blas.Side, ul blas.Uplo, trans blas.Trans } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ztfsm.f. -func Ztfsm(transr blas.Transpose, side blas.Side, ul blas.Uplo, trans blas.Transpose, d blas.Diag, m, n int, alpha complex128, a, b []complex128, ldb int) bool { +func Ztfsm(transr, side, ul, trans, d byte, m, n int, alpha complex128, a, b []complex128, ldb int) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _a *complex128 if len(a) > 0 { @@ -23964,32 +22151,21 @@ func Ztfsm(transr blas.Transpose, side blas.Side, ul blas.Uplo, trans blas.Trans } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/stftri.f. -func Stftri(transr blas.Transpose, ul blas.Uplo, d blas.Diag, n int, a []float32) bool { +func Stftri(transr, ul, d byte, n int, a []float32) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _a *float32 if len(a) > 0 { @@ -23999,32 +22175,21 @@ func Stftri(transr blas.Transpose, ul blas.Uplo, d blas.Diag, n int, a []float32 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dtftri.f. -func Dtftri(transr blas.Transpose, ul blas.Uplo, d blas.Diag, n int, a []float64) bool { +func Dtftri(transr, ul, d byte, n int, a []float64) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _a *float64 if len(a) > 0 { @@ -24034,32 +22199,21 @@ func Dtftri(transr blas.Transpose, ul blas.Uplo, d blas.Diag, n int, a []float64 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ctftri.f. -func Ctftri(transr blas.Transpose, ul blas.Uplo, d blas.Diag, n int, a []complex64) bool { +func Ctftri(transr, ul, d byte, n int, a []complex64) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _a *complex64 if len(a) > 0 { @@ -24069,32 +22223,21 @@ func Ctftri(transr blas.Transpose, ul blas.Uplo, d blas.Diag, n int, a []complex } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ztftri.f. -func Ztftri(transr blas.Transpose, ul blas.Uplo, d blas.Diag, n int, a []complex128) bool { +func Ztftri(transr, ul, d byte, n int, a []complex128) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _a *complex128 if len(a) > 0 { @@ -24104,24 +22247,16 @@ func Ztftri(transr blas.Transpose, ul blas.Uplo, d blas.Diag, n int, a []complex } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/stfttp.f. -func Stfttp(transr blas.Transpose, ul blas.Uplo, n int, arf, ap []float32) bool { +func Stfttp(transr, ul byte, n int, arf, ap []float32) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _arf *float32 if len(arf) > 0 { @@ -24135,24 +22270,16 @@ func Stfttp(transr blas.Transpose, ul blas.Uplo, n int, arf, ap []float32) bool } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dtfttp.f. -func Dtfttp(transr blas.Transpose, ul blas.Uplo, n int, arf, ap []float64) bool { +func Dtfttp(transr, ul byte, n int, arf, ap []float64) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _arf *float64 if len(arf) > 0 { @@ -24166,24 +22293,16 @@ func Dtfttp(transr blas.Transpose, ul blas.Uplo, n int, arf, ap []float64) bool } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ctfttp.f. -func Ctfttp(transr blas.Transpose, ul blas.Uplo, n int, arf, ap []complex64) bool { +func Ctfttp(transr, ul byte, n int, arf, ap []complex64) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _arf *complex64 if len(arf) > 0 { @@ -24197,24 +22316,16 @@ func Ctfttp(transr blas.Transpose, ul blas.Uplo, n int, arf, ap []complex64) boo } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ztfttp.f. -func Ztfttp(transr blas.Transpose, ul blas.Uplo, n int, arf, ap []complex128) bool { +func Ztfttp(transr, ul byte, n int, arf, ap []complex128) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _arf *complex128 if len(arf) > 0 { @@ -24228,24 +22339,16 @@ func Ztfttp(transr blas.Transpose, ul blas.Uplo, n int, arf, ap []complex128) bo } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/stfttr.f. -func Stfttr(transr blas.Transpose, ul blas.Uplo, n int, arf, a []float32, lda int) bool { +func Stfttr(transr, ul byte, n int, arf, a []float32, lda int) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _arf *float32 if len(arf) > 0 { @@ -24259,24 +22362,16 @@ func Stfttr(transr blas.Transpose, ul blas.Uplo, n int, arf, a []float32, lda in } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dtfttr.f. -func Dtfttr(transr blas.Transpose, ul blas.Uplo, n int, arf, a []float64, lda int) bool { +func Dtfttr(transr, ul byte, n int, arf, a []float64, lda int) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _arf *float64 if len(arf) > 0 { @@ -24290,24 +22385,16 @@ func Dtfttr(transr blas.Transpose, ul blas.Uplo, n int, arf, a []float64, lda in } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ctfttr.f. -func Ctfttr(transr blas.Transpose, ul blas.Uplo, n int, arf, a []complex64, lda int) bool { +func Ctfttr(transr, ul byte, n int, arf, a []complex64, lda int) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _arf *complex64 if len(arf) > 0 { @@ -24321,24 +22408,16 @@ func Ctfttr(transr blas.Transpose, ul blas.Uplo, n int, arf, a []complex64, lda } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ztfttr.f. -func Ztfttr(transr blas.Transpose, ul blas.Uplo, n int, arf, a []complex128, lda int) bool { +func Ztfttr(transr, ul byte, n int, arf, a []complex128, lda int) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _arf *complex128 if len(arf) > 0 { @@ -24352,12 +22431,9 @@ func Ztfttr(transr blas.Transpose, ul blas.Uplo, n int, arf, a []complex128, lda } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/stgevc.f. -func Stgevc(side blas.Side, howmny byte, sel []int32, n int, s []float32, lds int, p []float32, ldp int, vl []float32, ldvl int, vr []float32, ldvr, mm int, m []int32, work []float32) bool { +func Stgevc(side, howmny byte, sel []int32, n int, s []float32, lds int, p []float32, ldp int, vl []float32, ldvl int, vr []float32, ldvr, mm int, m []int32, work []float32) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } @@ -24393,12 +22469,9 @@ func Stgevc(side blas.Side, howmny byte, sel []int32, n int, s []float32, lds in } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dtgevc.f. -func Dtgevc(side blas.Side, howmny byte, sel []int32, n int, s []float64, lds int, p []float64, ldp int, vl []float64, ldvl int, vr []float64, ldvr, mm int, m []int32, work []float64) bool { +func Dtgevc(side, howmny byte, sel []int32, n int, s []float64, lds int, p []float64, ldp int, vl []float64, ldvl int, vr []float64, ldvr, mm int, m []int32, work []float64) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } @@ -24434,12 +22507,9 @@ func Dtgevc(side blas.Side, howmny byte, sel []int32, n int, s []float64, lds in } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ctgevc.f. -func Ctgevc(side blas.Side, howmny byte, sel []int32, n int, s []complex64, lds int, p []complex64, ldp int, vl []complex64, ldvl int, vr []complex64, ldvr, mm int, m []int32, work []complex64, rwork []float32) bool { +func Ctgevc(side, howmny byte, sel []int32, n int, s []complex64, lds int, p []complex64, ldp int, vl []complex64, ldvl int, vr []complex64, ldvr, mm int, m []int32, work []complex64, rwork []float32) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } @@ -24479,12 +22549,9 @@ func Ctgevc(side blas.Side, howmny byte, sel []int32, n int, s []complex64, lds } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ztgevc.f. -func Ztgevc(side blas.Side, howmny byte, sel []int32, n int, s []complex128, lds int, p []complex128, ldp int, vl []complex128, ldvl int, vr []complex128, ldvr, mm int, m []int32, work []complex128, rwork []float64) bool { +func Ztgevc(side, howmny byte, sel []int32, n int, s []complex128, lds int, p []complex128, ldp int, vl []complex128, ldvl int, vr []complex128, ldvr, mm int, m []int32, work []complex128, rwork []float64) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } @@ -24632,7 +22699,7 @@ func Ztgexc(wantq, wantz int32, n int, a []complex128, lda int, b []complex128, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/stgsen.f. -func Stgsen(ijob lapack.Job, wantq, wantz int32, sel []int32, n int, a []float32, lda int, b []float32, ldb int, alphar, alphai, beta, q []float32, ldq int, z []float32, ldz int, m []int32, pl, pr, dif, work []float32, lwork int, iwork []int32, liwork int) bool { +func Stgsen(ijob byte, wantq, wantz int32, sel []int32, n int, a []float32, lda int, b []float32, ldb int, alphar, alphai, beta, q []float32, ldq int, z []float32, ldz int, m []int32, pl, pr, dif, work []float32, lwork int, iwork []int32, liwork int) bool { var _sel *int32 if len(sel) > 0 { _sel = &sel[0] @@ -24693,7 +22760,7 @@ func Stgsen(ijob lapack.Job, wantq, wantz int32, sel []int32, n int, a []float32 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dtgsen.f. -func Dtgsen(ijob lapack.Job, wantq, wantz int32, sel []int32, n int, a []float64, lda int, b []float64, ldb int, alphar, alphai, beta, q []float64, ldq int, z []float64, ldz int, m []int32, pl, pr, dif, work []float64, lwork int, iwork []int32, liwork int) bool { +func Dtgsen(ijob byte, wantq, wantz int32, sel []int32, n int, a []float64, lda int, b []float64, ldb int, alphar, alphai, beta, q []float64, ldq int, z []float64, ldz int, m []int32, pl, pr, dif, work []float64, lwork int, iwork []int32, liwork int) bool { var _sel *int32 if len(sel) > 0 { _sel = &sel[0] @@ -24754,7 +22821,7 @@ func Dtgsen(ijob lapack.Job, wantq, wantz int32, sel []int32, n int, a []float64 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ctgsen.f. -func Ctgsen(ijob lapack.Job, wantq, wantz int32, sel []int32, n int, a []complex64, lda int, b []complex64, ldb int, alpha, beta, q []complex64, ldq int, z []complex64, ldz int, m []int32, pl, pr, dif []float32, work []complex64, lwork int, iwork []int32, liwork int) bool { +func Ctgsen(ijob byte, wantq, wantz int32, sel []int32, n int, a []complex64, lda int, b []complex64, ldb int, alpha, beta, q []complex64, ldq int, z []complex64, ldz int, m []int32, pl, pr, dif []float32, work []complex64, lwork int, iwork []int32, liwork int) bool { var _sel *int32 if len(sel) > 0 { _sel = &sel[0] @@ -24811,7 +22878,7 @@ func Ctgsen(ijob lapack.Job, wantq, wantz int32, sel []int32, n int, a []complex } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ztgsen.f. -func Ztgsen(ijob lapack.Job, wantq, wantz int32, sel []int32, n int, a []complex128, lda int, b []complex128, ldb int, alpha, beta, q []complex128, ldq int, z []complex128, ldz int, m []int32, pl, pr, dif []float64, work []complex128, lwork int, iwork []int32, liwork int) bool { +func Ztgsen(ijob byte, wantq, wantz int32, sel []int32, n int, a []complex128, lda int, b []complex128, ldb int, alpha, beta, q []complex128, ldq int, z []complex128, ldz int, m []int32, pl, pr, dif []float64, work []complex128, lwork int, iwork []int32, liwork int) bool { var _sel *int32 if len(sel) > 0 { _sel = &sel[0] @@ -24868,7 +22935,7 @@ func Ztgsen(ijob lapack.Job, wantq, wantz int32, sel []int32, n int, a []complex } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/stgsja.f. -func Stgsja(jobu, jobv, jobq lapack.Job, m, p, n, k, l int, a []float32, lda int, b []float32, ldb int, tola, tolb float32, alpha, beta, u []float32, ldu int, v []float32, ldv int, q []float32, ldq int, work []float32, ncycle []int32) bool { +func Stgsja(jobu, jobv, jobq byte, m, p, n, k, l int, a []float32, lda int, b []float32, ldb int, tola, tolb float32, alpha, beta, u []float32, ldu int, v []float32, ldv int, q []float32, ldq int, work []float32, ncycle []int32) bool { var _a *float32 if len(a) > 0 { _a = &a[0] @@ -24909,7 +22976,7 @@ func Stgsja(jobu, jobv, jobq lapack.Job, m, p, n, k, l int, a []float32, lda int } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dtgsja.f. -func Dtgsja(jobu, jobv, jobq lapack.Job, m, p, n, k, l int, a []float64, lda int, b []float64, ldb int, tola, tolb float64, alpha, beta, u []float64, ldu int, v []float64, ldv int, q []float64, ldq int, work []float64, ncycle []int32) bool { +func Dtgsja(jobu, jobv, jobq byte, m, p, n, k, l int, a []float64, lda int, b []float64, ldb int, tola, tolb float64, alpha, beta, u []float64, ldu int, v []float64, ldv int, q []float64, ldq int, work []float64, ncycle []int32) bool { var _a *float64 if len(a) > 0 { _a = &a[0] @@ -24950,7 +23017,7 @@ func Dtgsja(jobu, jobv, jobq lapack.Job, m, p, n, k, l int, a []float64, lda int } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ctgsja.f. -func Ctgsja(jobu, jobv, jobq lapack.Job, m, p, n, k, l int, a []complex64, lda int, b []complex64, ldb int, tola, tolb float32, alpha, beta []float32, u []complex64, ldu int, v []complex64, ldv int, q []complex64, ldq int, work []complex64, ncycle []int32) bool { +func Ctgsja(jobu, jobv, jobq byte, m, p, n, k, l int, a []complex64, lda int, b []complex64, ldb int, tola, tolb float32, alpha, beta []float32, u []complex64, ldu int, v []complex64, ldv int, q []complex64, ldq int, work []complex64, ncycle []int32) bool { var _a *complex64 if len(a) > 0 { _a = &a[0] @@ -24991,7 +23058,7 @@ func Ctgsja(jobu, jobv, jobq lapack.Job, m, p, n, k, l int, a []complex64, lda i } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ztgsja.f. -func Ztgsja(jobu, jobv, jobq lapack.Job, m, p, n, k, l int, a []complex128, lda int, b []complex128, ldb int, tola, tolb float64, alpha, beta []float64, u []complex128, ldu int, v []complex128, ldv int, q []complex128, ldq int, work []complex128, ncycle []int32) bool { +func Ztgsja(jobu, jobv, jobq byte, m, p, n, k, l int, a []complex128, lda int, b []complex128, ldb int, tola, tolb float64, alpha, beta []float64, u []complex128, ldu int, v []complex128, ldv int, q []complex128, ldq int, work []complex128, ncycle []int32) bool { var _a *complex128 if len(a) > 0 { _a = &a[0] @@ -25032,7 +23099,7 @@ func Ztgsja(jobu, jobv, jobq lapack.Job, m, p, n, k, l int, a []complex128, lda } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/stgsna.f. -func Stgsna(job lapack.Job, howmny byte, sel []int32, n int, a []float32, lda int, b []float32, ldb int, vl []float32, ldvl int, vr []float32, ldvr int, s, dif []float32, mm int, m []int32, work []float32, lwork int, iwork []int32) bool { +func Stgsna(job, howmny byte, sel []int32, n int, a []float32, lda int, b []float32, ldb int, vl []float32, ldvl int, vr []float32, ldvr int, s, dif []float32, mm int, m []int32, work []float32, lwork int, iwork []int32) bool { var _sel *int32 if len(sel) > 0 { _sel = &sel[0] @@ -25077,7 +23144,7 @@ func Stgsna(job lapack.Job, howmny byte, sel []int32, n int, a []float32, lda in } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dtgsna.f. -func Dtgsna(job lapack.Job, howmny byte, sel []int32, n int, a []float64, lda int, b []float64, ldb int, vl []float64, ldvl int, vr []float64, ldvr int, s, dif []float64, mm int, m []int32, work []float64, lwork int, iwork []int32) bool { +func Dtgsna(job, howmny byte, sel []int32, n int, a []float64, lda int, b []float64, ldb int, vl []float64, ldvl int, vr []float64, ldvr int, s, dif []float64, mm int, m []int32, work []float64, lwork int, iwork []int32) bool { var _sel *int32 if len(sel) > 0 { _sel = &sel[0] @@ -25122,7 +23189,7 @@ func Dtgsna(job lapack.Job, howmny byte, sel []int32, n int, a []float64, lda in } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ctgsna.f. -func Ctgsna(job lapack.Job, howmny byte, sel []int32, n int, a []complex64, lda int, b []complex64, ldb int, vl []complex64, ldvl int, vr []complex64, ldvr int, s, dif []float32, mm int, m []int32, work []complex64, lwork int, iwork []int32) bool { +func Ctgsna(job, howmny byte, sel []int32, n int, a []complex64, lda int, b []complex64, ldb int, vl []complex64, ldvl int, vr []complex64, ldvr int, s, dif []float32, mm int, m []int32, work []complex64, lwork int, iwork []int32) bool { var _sel *int32 if len(sel) > 0 { _sel = &sel[0] @@ -25167,7 +23234,7 @@ func Ctgsna(job lapack.Job, howmny byte, sel []int32, n int, a []complex64, lda } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ztgsna.f. -func Ztgsna(job lapack.Job, howmny byte, sel []int32, n int, a []complex128, lda int, b []complex128, ldb int, vl []complex128, ldvl int, vr []complex128, ldvr int, s, dif []float64, mm int, m []int32, work []complex128, lwork int, iwork []int32) bool { +func Ztgsna(job, howmny byte, sel []int32, n int, a []complex128, lda int, b []complex128, ldb int, vl []complex128, ldvl int, vr []complex128, ldvr int, s, dif []float64, mm int, m []int32, work []complex128, lwork int, iwork []int32) bool { var _sel *int32 if len(sel) > 0 { _sel = &sel[0] @@ -25212,14 +23279,9 @@ func Ztgsna(job lapack.Job, howmny byte, sel []int32, n int, a []complex128, lda } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/stgsyl.f. -func Stgsyl(trans blas.Transpose, ijob lapack.Job, m, n int, a []float32, lda int, b []float32, ldb int, c []float32, ldc int, d []float32, ldd int, e []float32, lde int, f []float32, ldf int, scale, dif, work []float32, lwork int, iwork []int32) bool { +func Stgsyl(trans byte, ijob byte, m, n int, a []float32, lda int, b []float32, ldb int, c []float32, ldc int, d []float32, ldd int, e []float32, lde int, f []float32, ldf int, scale, dif, work []float32, lwork int, iwork []int32) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -25267,14 +23329,9 @@ func Stgsyl(trans blas.Transpose, ijob lapack.Job, m, n int, a []float32, lda in } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dtgsyl.f. -func Dtgsyl(trans blas.Transpose, ijob lapack.Job, m, n int, a []float64, lda int, b []float64, ldb int, c []float64, ldc int, d []float64, ldd int, e []float64, lde int, f []float64, ldf int, scale, dif, work []float64, lwork int, iwork []int32) bool { +func Dtgsyl(trans byte, ijob byte, m, n int, a []float64, lda int, b []float64, ldb int, c []float64, ldc int, d []float64, ldd int, e []float64, lde int, f []float64, ldf int, scale, dif, work []float64, lwork int, iwork []int32) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -25322,14 +23379,9 @@ func Dtgsyl(trans blas.Transpose, ijob lapack.Job, m, n int, a []float64, lda in } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ctgsyl.f. -func Ctgsyl(trans blas.Transpose, ijob lapack.Job, m, n int, a []complex64, lda int, b []complex64, ldb int, c []complex64, ldc int, d []complex64, ldd int, e []complex64, lde int, f []complex64, ldf int, scale, dif []float32, work []complex64, lwork int, iwork []int32) bool { +func Ctgsyl(trans byte, ijob byte, m, n int, a []complex64, lda int, b []complex64, ldb int, c []complex64, ldc int, d []complex64, ldd int, e []complex64, lde int, f []complex64, ldf int, scale, dif []float32, work []complex64, lwork int, iwork []int32) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -25377,14 +23429,9 @@ func Ctgsyl(trans blas.Transpose, ijob lapack.Job, m, n int, a []complex64, lda } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ztgsyl.f. -func Ztgsyl(trans blas.Transpose, ijob lapack.Job, m, n int, a []complex128, lda int, b []complex128, ldb int, c []complex128, ldc int, d []complex128, ldd int, e []complex128, lde int, f []complex128, ldf int, scale, dif []float64, work []complex128, lwork int, iwork []int32) bool { +func Ztgsyl(trans byte, ijob byte, m, n int, a []complex128, lda int, b []complex128, ldb int, c []complex128, ldc int, d []complex128, ldd int, e []complex128, lde int, f []complex128, ldf int, scale, dif []float64, work []complex128, lwork int, iwork []int32) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -25432,22 +23479,16 @@ func Ztgsyl(trans blas.Transpose, ijob lapack.Job, m, n int, a []complex128, lda } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/stpcon.f. -func Stpcon(norm byte, ul blas.Uplo, d blas.Diag, n int, ap, rcond, work []float32, iwork []int32) bool { +func Stpcon(norm, ul, d byte, n int, ap, rcond, work []float32, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _ap *float32 if len(ap) > 0 { @@ -25469,22 +23510,16 @@ func Stpcon(norm byte, ul blas.Uplo, d blas.Diag, n int, ap, rcond, work []float } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dtpcon.f. -func Dtpcon(norm byte, ul blas.Uplo, d blas.Diag, n int, ap, rcond, work []float64, iwork []int32) bool { +func Dtpcon(norm, ul, d byte, n int, ap, rcond, work []float64, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _ap *float64 if len(ap) > 0 { @@ -25506,22 +23541,16 @@ func Dtpcon(norm byte, ul blas.Uplo, d blas.Diag, n int, ap, rcond, work []float } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ctpcon.f. -func Ctpcon(norm byte, ul blas.Uplo, d blas.Diag, n int, ap []complex64, rcond []float32, work []complex64, rwork []float32) bool { +func Ctpcon(norm, ul, d byte, n int, ap []complex64, rcond []float32, work []complex64, rwork []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _ap *complex64 if len(ap) > 0 { @@ -25543,22 +23572,16 @@ func Ctpcon(norm byte, ul blas.Uplo, d blas.Diag, n int, ap []complex64, rcond [ } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ztpcon.f. -func Ztpcon(norm byte, ul blas.Uplo, d blas.Diag, n int, ap []complex128, rcond []float64, work []complex128, rwork []float64) bool { +func Ztpcon(norm, ul, d byte, n int, ap []complex128, rcond []float64, work []complex128, rwork []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _ap *complex128 if len(ap) > 0 { @@ -25580,32 +23603,21 @@ func Ztpcon(norm byte, ul blas.Uplo, d blas.Diag, n int, ap []complex128, rcond } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/stprfs.f. -func Stprfs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, nrhs int, ap, b []float32, ldb int, x []float32, ldx int, ferr, berr, work []float32, iwork []int32) bool { +func Stprfs(ul, trans, d byte, n, nrhs int, ap, b []float32, ldb int, x []float32, ldx int, ferr, berr, work []float32, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _ap *float32 if len(ap) > 0 { @@ -25639,32 +23651,21 @@ func Stprfs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, nrhs int, ap, b } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dtprfs.f. -func Dtprfs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, nrhs int, ap, b []float64, ldb int, x []float64, ldx int, ferr, berr, work []float64, iwork []int32) bool { +func Dtprfs(ul, trans, d byte, n, nrhs int, ap, b []float64, ldb int, x []float64, ldx int, ferr, berr, work []float64, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _ap *float64 if len(ap) > 0 { @@ -25698,32 +23699,21 @@ func Dtprfs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, nrhs int, ap, b } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ctprfs.f. -func Ctprfs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, nrhs int, ap, b []complex64, ldb int, x []complex64, ldx int, ferr, berr []float32, work []complex64, rwork []float32) bool { +func Ctprfs(ul, trans, d byte, n, nrhs int, ap, b []complex64, ldb int, x []complex64, ldx int, ferr, berr []float32, work []complex64, rwork []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _ap *complex64 if len(ap) > 0 { @@ -25757,32 +23747,21 @@ func Ctprfs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, nrhs int, ap, b } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ztprfs.f. -func Ztprfs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, nrhs int, ap, b []complex128, ldb int, x []complex128, ldx int, ferr, berr []float64, work []complex128, rwork []float64) bool { +func Ztprfs(ul, trans, d byte, n, nrhs int, ap, b []complex128, ldb int, x []complex128, ldx int, ferr, berr []float64, work []complex128, rwork []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _ap *complex128 if len(ap) > 0 { @@ -25816,22 +23795,16 @@ func Ztprfs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, nrhs int, ap, b } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/stptri.f. -func Stptri(ul blas.Uplo, d blas.Diag, n int, ap []float32) bool { +func Stptri(ul, d byte, n int, ap []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _ap *float32 if len(ap) > 0 { @@ -25841,22 +23814,16 @@ func Stptri(ul blas.Uplo, d blas.Diag, n int, ap []float32) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dtptri.f. -func Dtptri(ul blas.Uplo, d blas.Diag, n int, ap []float64) bool { +func Dtptri(ul, d byte, n int, ap []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _ap *float64 if len(ap) > 0 { @@ -25866,22 +23833,16 @@ func Dtptri(ul blas.Uplo, d blas.Diag, n int, ap []float64) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ctptri.f. -func Ctptri(ul blas.Uplo, d blas.Diag, n int, ap []complex64) bool { +func Ctptri(ul, d byte, n int, ap []complex64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _ap *complex64 if len(ap) > 0 { @@ -25891,22 +23852,16 @@ func Ctptri(ul blas.Uplo, d blas.Diag, n int, ap []complex64) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ztptri.f. -func Ztptri(ul blas.Uplo, d blas.Diag, n int, ap []complex128) bool { +func Ztptri(ul, d byte, n int, ap []complex128) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _ap *complex128 if len(ap) > 0 { @@ -25916,32 +23871,21 @@ func Ztptri(ul blas.Uplo, d blas.Diag, n int, ap []complex128) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/stptrs.f. -func Stptrs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, nrhs int, ap, b []float32, ldb int) bool { +func Stptrs(ul, trans, d byte, n, nrhs int, ap, b []float32, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _ap *float32 if len(ap) > 0 { @@ -25955,32 +23899,21 @@ func Stptrs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, nrhs int, ap, b } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dtptrs.f. -func Dtptrs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, nrhs int, ap, b []float64, ldb int) bool { +func Dtptrs(ul, trans, d byte, n, nrhs int, ap, b []float64, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _ap *float64 if len(ap) > 0 { @@ -25994,32 +23927,21 @@ func Dtptrs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, nrhs int, ap, b } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ctptrs.f. -func Ctptrs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, nrhs int, ap, b []complex64, ldb int) bool { +func Ctptrs(ul, trans, d byte, n, nrhs int, ap, b []complex64, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _ap *complex64 if len(ap) > 0 { @@ -26033,32 +23955,21 @@ func Ctptrs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, nrhs int, ap, b } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ztptrs.f. -func Ztptrs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, nrhs int, ap, b []complex128, ldb int) bool { +func Ztptrs(ul, trans, d byte, n, nrhs int, ap, b []complex128, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _ap *complex128 if len(ap) > 0 { @@ -26072,24 +23983,16 @@ func Ztptrs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, nrhs int, ap, b } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/stpttf.f. -func Stpttf(transr blas.Transpose, ul blas.Uplo, n int, ap, arf []float32) bool { +func Stpttf(transr, ul byte, n int, ap, arf []float32) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float32 if len(ap) > 0 { @@ -26103,24 +24006,16 @@ func Stpttf(transr blas.Transpose, ul blas.Uplo, n int, ap, arf []float32) bool } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dtpttf.f. -func Dtpttf(transr blas.Transpose, ul blas.Uplo, n int, ap, arf []float64) bool { +func Dtpttf(transr, ul byte, n int, ap, arf []float64) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float64 if len(ap) > 0 { @@ -26134,24 +24029,16 @@ func Dtpttf(transr blas.Transpose, ul blas.Uplo, n int, ap, arf []float64) bool } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ctpttf.f. -func Ctpttf(transr blas.Transpose, ul blas.Uplo, n int, ap, arf []complex64) bool { +func Ctpttf(transr, ul byte, n int, ap, arf []complex64) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex64 if len(ap) > 0 { @@ -26165,24 +24052,16 @@ func Ctpttf(transr blas.Transpose, ul blas.Uplo, n int, ap, arf []complex64) boo } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ztpttf.f. -func Ztpttf(transr blas.Transpose, ul blas.Uplo, n int, ap, arf []complex128) bool { +func Ztpttf(transr, ul byte, n int, ap, arf []complex128) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex128 if len(ap) > 0 { @@ -26196,14 +24075,11 @@ func Ztpttf(transr blas.Transpose, ul blas.Uplo, n int, ap, arf []complex128) bo } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/stpttr.f. -func Stpttr(ul blas.Uplo, n int, ap, a []float32, lda int) bool { +func Stpttr(ul byte, n int, ap, a []float32, lda int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float32 if len(ap) > 0 { @@ -26217,14 +24093,11 @@ func Stpttr(ul blas.Uplo, n int, ap, a []float32, lda int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dtpttr.f. -func Dtpttr(ul blas.Uplo, n int, ap, a []float64, lda int) bool { +func Dtpttr(ul byte, n int, ap, a []float64, lda int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *float64 if len(ap) > 0 { @@ -26238,14 +24111,11 @@ func Dtpttr(ul blas.Uplo, n int, ap, a []float64, lda int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ctpttr.f. -func Ctpttr(ul blas.Uplo, n int, ap, a []complex64, lda int) bool { +func Ctpttr(ul byte, n int, ap, a []complex64, lda int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex64 if len(ap) > 0 { @@ -26259,14 +24129,11 @@ func Ctpttr(ul blas.Uplo, n int, ap, a []complex64, lda int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ztpttr.f. -func Ztpttr(ul blas.Uplo, n int, ap, a []complex128, lda int) bool { +func Ztpttr(ul byte, n int, ap, a []complex128, lda int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex128 if len(ap) > 0 { @@ -26280,22 +24147,16 @@ func Ztpttr(ul blas.Uplo, n int, ap, a []complex128, lda int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/strcon.f. -func Strcon(norm byte, ul blas.Uplo, d blas.Diag, n int, a []float32, lda int, rcond, work []float32, iwork []int32) bool { +func Strcon(norm, ul, d byte, n int, a []float32, lda int, rcond, work []float32, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _a *float32 if len(a) > 0 { @@ -26317,22 +24178,16 @@ func Strcon(norm byte, ul blas.Uplo, d blas.Diag, n int, a []float32, lda int, r } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dtrcon.f. -func Dtrcon(norm byte, ul blas.Uplo, d blas.Diag, n int, a []float64, lda int, rcond, work []float64, iwork []int32) bool { +func Dtrcon(norm, ul, d byte, n int, a []float64, lda int, rcond, work []float64, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _a *float64 if len(a) > 0 { @@ -26354,22 +24209,16 @@ func Dtrcon(norm byte, ul blas.Uplo, d blas.Diag, n int, a []float64, lda int, r } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ctrcon.f. -func Ctrcon(norm byte, ul blas.Uplo, d blas.Diag, n int, a []complex64, lda int, rcond []float32, work []complex64, rwork []float32) bool { +func Ctrcon(norm, ul, d byte, n int, a []complex64, lda int, rcond []float32, work []complex64, rwork []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _a *complex64 if len(a) > 0 { @@ -26391,22 +24240,16 @@ func Ctrcon(norm byte, ul blas.Uplo, d blas.Diag, n int, a []complex64, lda int, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ztrcon.f. -func Ztrcon(norm byte, ul blas.Uplo, d blas.Diag, n int, a []complex128, lda int, rcond []float64, work []complex128, rwork []float64) bool { +func Ztrcon(norm, ul, d byte, n int, a []complex128, lda int, rcond []float64, work []complex128, rwork []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _a *complex128 if len(a) > 0 { @@ -26428,12 +24271,9 @@ func Ztrcon(norm byte, ul blas.Uplo, d blas.Diag, n int, a []complex128, lda int } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/strevc.f. -func Strevc(side blas.Side, howmny byte, sel []int32, n int, t []float32, ldt int, vl []float32, ldvl int, vr []float32, ldvr, mm int, m []int32, work []float32) bool { +func Strevc(side, howmny byte, sel []int32, n int, t []float32, ldt int, vl []float32, ldvl int, vr []float32, ldvr, mm int, m []int32, work []float32) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } @@ -26465,12 +24305,9 @@ func Strevc(side blas.Side, howmny byte, sel []int32, n int, t []float32, ldt in } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dtrevc.f. -func Dtrevc(side blas.Side, howmny byte, sel []int32, n int, t []float64, ldt int, vl []float64, ldvl int, vr []float64, ldvr, mm int, m []int32, work []float64) bool { +func Dtrevc(side, howmny byte, sel []int32, n int, t []float64, ldt int, vl []float64, ldvl int, vr []float64, ldvr, mm int, m []int32, work []float64) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } @@ -26502,12 +24339,9 @@ func Dtrevc(side blas.Side, howmny byte, sel []int32, n int, t []float64, ldt in } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ctrevc.f. -func Ctrevc(side blas.Side, howmny byte, sel []int32, n int, t []complex64, ldt int, vl []complex64, ldvl int, vr []complex64, ldvr, mm int, m []int32, work []complex64, rwork []float32) bool { +func Ctrevc(side, howmny byte, sel []int32, n int, t []complex64, ldt int, vl []complex64, ldvl int, vr []complex64, ldvr, mm int, m []int32, work []complex64, rwork []float32) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } @@ -26543,12 +24377,9 @@ func Ctrevc(side blas.Side, howmny byte, sel []int32, n int, t []complex64, ldt } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ztrevc.f. -func Ztrevc(side blas.Side, howmny byte, sel []int32, n int, t []complex128, ldt int, vl []complex128, ldvl int, vr []complex128, ldvr, mm int, m []int32, work []complex128, rwork []float64) bool { +func Ztrevc(side, howmny byte, sel []int32, n int, t []complex128, ldt int, vl []complex128, ldvl int, vr []complex128, ldvr, mm int, m []int32, work []complex128, rwork []float64) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } @@ -26584,7 +24415,7 @@ func Ztrevc(side blas.Side, howmny byte, sel []int32, n int, t []complex128, ldt } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/strexc.f. -func Strexc(compq lapack.Comp, n int, t []float32, ldt int, q []float32, ldq int, ifst, ilst []int32, work []float32) bool { +func Strexc(compq byte, n int, t []float32, ldt int, q []float32, ldq int, ifst, ilst []int32, work []float32) bool { var _t *float32 if len(t) > 0 { _t = &t[0] @@ -26609,7 +24440,7 @@ func Strexc(compq lapack.Comp, n int, t []float32, ldt int, q []float32, ldq int } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dtrexc.f. -func Dtrexc(compq lapack.Comp, n int, t []float64, ldt int, q []float64, ldq int, ifst, ilst []int32, work []float64) bool { +func Dtrexc(compq byte, n int, t []float64, ldt int, q []float64, ldq int, ifst, ilst []int32, work []float64) bool { var _t *float64 if len(t) > 0 { _t = &t[0] @@ -26634,7 +24465,7 @@ func Dtrexc(compq lapack.Comp, n int, t []float64, ldt int, q []float64, ldq int } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ctrexc.f. -func Ctrexc(compq lapack.Comp, n int, t []complex64, ldt int, q []complex64, ldq, ifst, ilst int) bool { +func Ctrexc(compq byte, n int, t []complex64, ldt int, q []complex64, ldq, ifst, ilst int) bool { var _t *complex64 if len(t) > 0 { _t = &t[0] @@ -26647,7 +24478,7 @@ func Ctrexc(compq lapack.Comp, n int, t []complex64, ldt int, q []complex64, ldq } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ztrexc.f. -func Ztrexc(compq lapack.Comp, n int, t []complex128, ldt int, q []complex128, ldq, ifst, ilst int) bool { +func Ztrexc(compq byte, n int, t []complex128, ldt int, q []complex128, ldq, ifst, ilst int) bool { var _t *complex128 if len(t) > 0 { _t = &t[0] @@ -26660,32 +24491,21 @@ func Ztrexc(compq lapack.Comp, n int, t []complex128, ldt int, q []complex128, l } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/strrfs.f. -func Strrfs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, nrhs int, a []float32, lda int, b []float32, ldb int, x []float32, ldx int, ferr, berr, work []float32, iwork []int32) bool { +func Strrfs(ul, trans, d byte, n, nrhs int, a []float32, lda int, b []float32, ldb int, x []float32, ldx int, ferr, berr, work []float32, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _a *float32 if len(a) > 0 { @@ -26719,32 +24539,21 @@ func Strrfs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, nrhs int, a []fl } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dtrrfs.f. -func Dtrrfs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, nrhs int, a []float64, lda int, b []float64, ldb int, x []float64, ldx int, ferr, berr, work []float64, iwork []int32) bool { +func Dtrrfs(ul, trans, d byte, n, nrhs int, a []float64, lda int, b []float64, ldb int, x []float64, ldx int, ferr, berr, work []float64, iwork []int32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _a *float64 if len(a) > 0 { @@ -26778,32 +24587,21 @@ func Dtrrfs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, nrhs int, a []fl } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ctrrfs.f. -func Ctrrfs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, nrhs int, a []complex64, lda int, b []complex64, ldb int, x []complex64, ldx int, ferr, berr []float32, work []complex64, rwork []float32) bool { +func Ctrrfs(ul, trans, d byte, n, nrhs int, a []complex64, lda int, b []complex64, ldb int, x []complex64, ldx int, ferr, berr []float32, work []complex64, rwork []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _a *complex64 if len(a) > 0 { @@ -26837,32 +24635,21 @@ func Ctrrfs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, nrhs int, a []co } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ztrrfs.f. -func Ztrrfs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, nrhs int, a []complex128, lda int, b []complex128, ldb int, x []complex128, ldx int, ferr, berr []float64, work []complex128, rwork []float64) bool { +func Ztrrfs(ul, trans, d byte, n, nrhs int, a []complex128, lda int, b []complex128, ldb int, x []complex128, ldx int, ferr, berr []float64, work []complex128, rwork []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _a *complex128 if len(a) > 0 { @@ -26896,7 +24683,7 @@ func Ztrrfs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, nrhs int, a []co } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/strsen.f. -func Strsen(job lapack.Job, compq lapack.Comp, sel []int32, n int, t []float32, ldt int, q []float32, ldq int, wr, wi []float32, m []int32, s, sep, work []float32, lwork int, iwork []int32, liwork int) bool { +func Strsen(job, compq byte, sel []int32, n int, t []float32, ldt int, q []float32, ldq int, wr, wi []float32, m []int32, s, sep, work []float32, lwork int, iwork []int32, liwork int) bool { var _sel *int32 if len(sel) > 0 { _sel = &sel[0] @@ -26941,7 +24728,7 @@ func Strsen(job lapack.Job, compq lapack.Comp, sel []int32, n int, t []float32, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dtrsen.f. -func Dtrsen(job lapack.Job, compq lapack.Comp, sel []int32, n int, t []float64, ldt int, q []float64, ldq int, wr, wi []float64, m []int32, s, sep, work []float64, lwork int, iwork []int32, liwork int) bool { +func Dtrsen(job, compq byte, sel []int32, n int, t []float64, ldt int, q []float64, ldq int, wr, wi []float64, m []int32, s, sep, work []float64, lwork int, iwork []int32, liwork int) bool { var _sel *int32 if len(sel) > 0 { _sel = &sel[0] @@ -26986,7 +24773,7 @@ func Dtrsen(job lapack.Job, compq lapack.Comp, sel []int32, n int, t []float64, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ctrsen.f. -func Ctrsen(job lapack.Job, compq lapack.Comp, sel []int32, n int, t []complex64, ldt int, q []complex64, ldq int, w []complex64, m []int32, s, sep []float32, work []complex64, lwork int) bool { +func Ctrsen(job, compq byte, sel []int32, n int, t []complex64, ldt int, q []complex64, ldq int, w []complex64, m []int32, s, sep []float32, work []complex64, lwork int) bool { var _sel *int32 if len(sel) > 0 { _sel = &sel[0] @@ -27023,7 +24810,7 @@ func Ctrsen(job lapack.Job, compq lapack.Comp, sel []int32, n int, t []complex64 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ztrsen.f. -func Ztrsen(job lapack.Job, compq lapack.Comp, sel []int32, n int, t []complex128, ldt int, q []complex128, ldq int, w []complex128, m []int32, s, sep []float64, work []complex128, lwork int) bool { +func Ztrsen(job, compq byte, sel []int32, n int, t []complex128, ldt int, q []complex128, ldq int, w []complex128, m []int32, s, sep []float64, work []complex128, lwork int) bool { var _sel *int32 if len(sel) > 0 { _sel = &sel[0] @@ -27060,7 +24847,7 @@ func Ztrsen(job lapack.Job, compq lapack.Comp, sel []int32, n int, t []complex12 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/strsna.f. -func Strsna(job lapack.Job, howmny byte, sel []int32, n int, t []float32, ldt int, vl []float32, ldvl int, vr []float32, ldvr int, s, sep []float32, mm int, m []int32, work []float32, ldwork int, iwork []int32) bool { +func Strsna(job, howmny byte, sel []int32, n int, t []float32, ldt int, vl []float32, ldvl int, vr []float32, ldvr int, s, sep []float32, mm int, m []int32, work []float32, ldwork int, iwork []int32) bool { var _sel *int32 if len(sel) > 0 { _sel = &sel[0] @@ -27101,7 +24888,7 @@ func Strsna(job lapack.Job, howmny byte, sel []int32, n int, t []float32, ldt in } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dtrsna.f. -func Dtrsna(job lapack.Job, howmny byte, sel []int32, n int, t []float64, ldt int, vl []float64, ldvl int, vr []float64, ldvr int, s, sep []float64, mm int, m []int32, work []float64, ldwork int, iwork []int32) bool { +func Dtrsna(job, howmny byte, sel []int32, n int, t []float64, ldt int, vl []float64, ldvl int, vr []float64, ldvr int, s, sep []float64, mm int, m []int32, work []float64, ldwork int, iwork []int32) bool { var _sel *int32 if len(sel) > 0 { _sel = &sel[0] @@ -27142,7 +24929,7 @@ func Dtrsna(job lapack.Job, howmny byte, sel []int32, n int, t []float64, ldt in } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ctrsna.f. -func Ctrsna(job lapack.Job, howmny byte, sel []int32, n int, t []complex64, ldt int, vl []complex64, ldvl int, vr []complex64, ldvr int, s, sep []float32, mm int, m []int32, work []complex64, ldwork int, rwork []float32) bool { +func Ctrsna(job, howmny byte, sel []int32, n int, t []complex64, ldt int, vl []complex64, ldvl int, vr []complex64, ldvr int, s, sep []float32, mm int, m []int32, work []complex64, ldwork int, rwork []float32) bool { var _sel *int32 if len(sel) > 0 { _sel = &sel[0] @@ -27183,7 +24970,7 @@ func Ctrsna(job lapack.Job, howmny byte, sel []int32, n int, t []complex64, ldt } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ztrsna.f. -func Ztrsna(job lapack.Job, howmny byte, sel []int32, n int, t []complex128, ldt int, vl []complex128, ldvl int, vr []complex128, ldvr int, s, sep []float64, mm int, m []int32, work []complex128, ldwork int, rwork []float64) bool { +func Ztrsna(job, howmny byte, sel []int32, n int, t []complex128, ldt int, vl []complex128, ldvl int, vr []complex128, ldvr int, s, sep []float64, mm int, m []int32, work []complex128, ldwork int, rwork []float64) bool { var _sel *int32 if len(sel) > 0 { _sel = &sel[0] @@ -27224,26 +25011,16 @@ func Ztrsna(job lapack.Job, howmny byte, sel []int32, n int, t []complex128, ldt } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/strsyl.f. -func Strsyl(trana, tranb blas.Transpose, isgn, m, n int, a []float32, lda int, b []float32, ldb int, c []float32, ldc int, scale []float32) bool { +func Strsyl(trana, tranb byte, isgn, m, n int, a []float32, lda int, b []float32, ldb int, c []float32, ldc int, scale []float32) bool { switch trana { - case blas.NoTrans: - trana = 'N' - case blas.Trans: - trana = 'T' - case blas.ConjTrans: - trana = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad trana") } switch tranb { - case blas.NoTrans: - tranb = 'N' - case blas.Trans: - tranb = 'T' - case blas.ConjTrans: - tranb = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad tranb") } var _a *float32 if len(a) > 0 { @@ -27265,26 +25042,16 @@ func Strsyl(trana, tranb blas.Transpose, isgn, m, n int, a []float32, lda int, b } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dtrsyl.f. -func Dtrsyl(trana, tranb blas.Transpose, isgn, m, n int, a []float64, lda int, b []float64, ldb int, c []float64, ldc int, scale []float64) bool { +func Dtrsyl(trana, tranb byte, isgn, m, n int, a []float64, lda int, b []float64, ldb int, c []float64, ldc int, scale []float64) bool { switch trana { - case blas.NoTrans: - trana = 'N' - case blas.Trans: - trana = 'T' - case blas.ConjTrans: - trana = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad trana") } switch tranb { - case blas.NoTrans: - tranb = 'N' - case blas.Trans: - tranb = 'T' - case blas.ConjTrans: - tranb = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad tranb") } var _a *float64 if len(a) > 0 { @@ -27306,26 +25073,16 @@ func Dtrsyl(trana, tranb blas.Transpose, isgn, m, n int, a []float64, lda int, b } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ctrsyl.f. -func Ctrsyl(trana, tranb blas.Transpose, isgn, m, n int, a []complex64, lda int, b []complex64, ldb int, c []complex64, ldc int, scale []float32) bool { +func Ctrsyl(trana, tranb byte, isgn, m, n int, a []complex64, lda int, b []complex64, ldb int, c []complex64, ldc int, scale []float32) bool { switch trana { - case blas.NoTrans: - trana = 'N' - case blas.Trans: - trana = 'T' - case blas.ConjTrans: - trana = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad trana") } switch tranb { - case blas.NoTrans: - tranb = 'N' - case blas.Trans: - tranb = 'T' - case blas.ConjTrans: - tranb = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad tranb") } var _a *complex64 if len(a) > 0 { @@ -27347,26 +25104,16 @@ func Ctrsyl(trana, tranb blas.Transpose, isgn, m, n int, a []complex64, lda int, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ztrsyl.f. -func Ztrsyl(trana, tranb blas.Transpose, isgn, m, n int, a []complex128, lda int, b []complex128, ldb int, c []complex128, ldc int, scale []float64) bool { +func Ztrsyl(trana, tranb byte, isgn, m, n int, a []complex128, lda int, b []complex128, ldb int, c []complex128, ldc int, scale []float64) bool { switch trana { - case blas.NoTrans: - trana = 'N' - case blas.Trans: - trana = 'T' - case blas.ConjTrans: - trana = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad trana") } switch tranb { - case blas.NoTrans: - tranb = 'N' - case blas.Trans: - tranb = 'T' - case blas.ConjTrans: - tranb = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad tranb") } var _a *complex128 if len(a) > 0 { @@ -27388,22 +25135,16 @@ func Ztrsyl(trana, tranb blas.Transpose, isgn, m, n int, a []complex128, lda int } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/strtri.f. -func Strtri(ul blas.Uplo, d blas.Diag, n int, a []float32, lda int) bool { +func Strtri(ul, d byte, n int, a []float32, lda int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _a *float32 if len(a) > 0 { @@ -27413,22 +25154,16 @@ func Strtri(ul blas.Uplo, d blas.Diag, n int, a []float32, lda int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dtrtri.f. -func Dtrtri(ul blas.Uplo, d blas.Diag, n int, a []float64, lda int) bool { +func Dtrtri(ul, d byte, n int, a []float64, lda int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _a *float64 if len(a) > 0 { @@ -27438,22 +25173,16 @@ func Dtrtri(ul blas.Uplo, d blas.Diag, n int, a []float64, lda int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ctrtri.f. -func Ctrtri(ul blas.Uplo, d blas.Diag, n int, a []complex64, lda int) bool { +func Ctrtri(ul, d byte, n int, a []complex64, lda int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _a *complex64 if len(a) > 0 { @@ -27463,22 +25192,16 @@ func Ctrtri(ul blas.Uplo, d blas.Diag, n int, a []complex64, lda int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ztrtri.f. -func Ztrtri(ul blas.Uplo, d blas.Diag, n int, a []complex128, lda int) bool { +func Ztrtri(ul, d byte, n int, a []complex128, lda int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _a *complex128 if len(a) > 0 { @@ -27488,32 +25211,21 @@ func Ztrtri(ul blas.Uplo, d blas.Diag, n int, a []complex128, lda int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/strtrs.f. -func Strtrs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, nrhs int, a []float32, lda int, b []float32, ldb int) bool { +func Strtrs(ul, trans, d byte, n, nrhs int, a []float32, lda int, b []float32, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _a *float32 if len(a) > 0 { @@ -27527,32 +25239,21 @@ func Strtrs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, nrhs int, a []fl } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dtrtrs.f. -func Dtrtrs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, nrhs int, a []float64, lda int, b []float64, ldb int) bool { +func Dtrtrs(ul, trans, d byte, n, nrhs int, a []float64, lda int, b []float64, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _a *float64 if len(a) > 0 { @@ -27566,32 +25267,21 @@ func Dtrtrs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, nrhs int, a []fl } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ctrtrs.f. -func Ctrtrs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, nrhs int, a []complex64, lda int, b []complex64, ldb int) bool { +func Ctrtrs(ul, trans, d byte, n, nrhs int, a []complex64, lda int, b []complex64, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _a *complex64 if len(a) > 0 { @@ -27605,32 +25295,21 @@ func Ctrtrs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, nrhs int, a []co } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ztrtrs.f. -func Ztrtrs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, nrhs int, a []complex128, lda int, b []complex128, ldb int) bool { +func Ztrtrs(ul, trans, d byte, n, nrhs int, a []complex128, lda int, b []complex128, ldb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } switch d { - case blas.Unit: - d = 'U' - case blas.NonUnit: - d = 'N' + case 'U', 'N': default: - panic("lapack: illegal diagonal") + panic("lapack: bad diagonal") } var _a *complex128 if len(a) > 0 { @@ -27644,24 +25323,16 @@ func Ztrtrs(ul blas.Uplo, trans blas.Transpose, d blas.Diag, n, nrhs int, a []co } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/strttf.f. -func Strttf(transr blas.Transpose, ul blas.Uplo, n int, a []float32, lda int, arf []float32) bool { +func Strttf(transr, ul byte, n int, a []float32, lda int, arf []float32) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -27675,24 +25346,16 @@ func Strttf(transr blas.Transpose, ul blas.Uplo, n int, a []float32, lda int, ar } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dtrttf.f. -func Dtrttf(transr blas.Transpose, ul blas.Uplo, n int, a []float64, lda int, arf []float64) bool { +func Dtrttf(transr, ul byte, n int, a []float64, lda int, arf []float64) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -27706,24 +25369,16 @@ func Dtrttf(transr blas.Transpose, ul blas.Uplo, n int, a []float64, lda int, ar } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ctrttf.f. -func Ctrttf(transr blas.Transpose, ul blas.Uplo, n int, a []complex64, lda int, arf []complex64) bool { +func Ctrttf(transr, ul byte, n int, a []complex64, lda int, arf []complex64) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -27737,24 +25392,16 @@ func Ctrttf(transr blas.Transpose, ul blas.Uplo, n int, a []complex64, lda int, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ztrttf.f. -func Ztrttf(transr blas.Transpose, ul blas.Uplo, n int, a []complex128, lda int, arf []complex128) bool { +func Ztrttf(transr, ul byte, n int, a []complex128, lda int, arf []complex128) bool { switch transr { - case blas.NoTrans: - transr = 'N' - case blas.Trans: - transr = 'T' - case blas.ConjTrans: - transr = 'C' + case 'N', 'T', 'C': default: - panic("lapack: bad trans") + panic("lapack: bad transr") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -27768,14 +25415,11 @@ func Ztrttf(transr blas.Transpose, ul blas.Uplo, n int, a []complex128, lda int, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/strttp.f. -func Strttp(ul blas.Uplo, n int, a []float32, lda int, ap []float32) bool { +func Strttp(ul byte, n int, a []float32, lda int, ap []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -27789,14 +25433,11 @@ func Strttp(ul blas.Uplo, n int, a []float32, lda int, ap []float32) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dtrttp.f. -func Dtrttp(ul blas.Uplo, n int, a []float64, lda int, ap []float64) bool { +func Dtrttp(ul byte, n int, a []float64, lda int, ap []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -27810,14 +25451,11 @@ func Dtrttp(ul blas.Uplo, n int, a []float64, lda int, ap []float64) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ctrttp.f. -func Ctrttp(ul blas.Uplo, n int, a []complex64, lda int, ap []complex64) bool { +func Ctrttp(ul byte, n int, a []complex64, lda int, ap []complex64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -27831,14 +25469,11 @@ func Ctrttp(ul blas.Uplo, n int, a []complex64, lda int, ap []complex64) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ztrttp.f. -func Ztrttp(ul blas.Uplo, n int, a []complex128, lda int, ap []complex128) bool { +func Ztrttp(ul byte, n int, a []complex128, lda int, ap []complex128) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -28124,14 +25759,11 @@ func Zungrq(m, n, k int, a []complex128, lda int, tau, work []complex128, lwork } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cungtr.f. -func Cungtr(ul blas.Uplo, n int, a []complex64, lda int, tau, work []complex64, lwork int) bool { +func Cungtr(ul byte, n int, a []complex64, lda int, tau, work []complex64, lwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -28149,14 +25781,11 @@ func Cungtr(ul blas.Uplo, n int, a []complex64, lda int, tau, work []complex64, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zungtr.f. -func Zungtr(ul blas.Uplo, n int, a []complex128, lda int, tau, work []complex128, lwork int) bool { +func Zungtr(ul byte, n int, a []complex128, lda int, tau, work []complex128, lwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -28174,22 +25803,14 @@ func Zungtr(ul blas.Uplo, n int, a []complex128, lda int, tau, work []complex128 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cunmbr.f. -func Cunmbr(vect byte, side blas.Side, trans blas.Transpose, m, n, k int, a []complex64, lda int, tau, c []complex64, ldc int, work []complex64, lwork int) bool { +func Cunmbr(vect, side, trans byte, m, n, k int, a []complex64, lda int, tau, c []complex64, ldc int, work []complex64, lwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -28213,22 +25834,14 @@ func Cunmbr(vect byte, side blas.Side, trans blas.Transpose, m, n, k int, a []co } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zunmbr.f. -func Zunmbr(vect byte, side blas.Side, trans blas.Transpose, m, n, k int, a []complex128, lda int, tau, c []complex128, ldc int, work []complex128, lwork int) bool { +func Zunmbr(vect, side, trans byte, m, n, k int, a []complex128, lda int, tau, c []complex128, ldc int, work []complex128, lwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -28252,22 +25865,14 @@ func Zunmbr(vect byte, side blas.Side, trans blas.Transpose, m, n, k int, a []co } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cunmhr.f. -func Cunmhr(side blas.Side, trans blas.Transpose, m, n, ilo, ihi int, a []complex64, lda int, tau, c []complex64, ldc int, work []complex64, lwork int) bool { +func Cunmhr(side, trans byte, m, n, ilo, ihi int, a []complex64, lda int, tau, c []complex64, ldc int, work []complex64, lwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -28291,22 +25896,14 @@ func Cunmhr(side blas.Side, trans blas.Transpose, m, n, ilo, ihi int, a []comple } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zunmhr.f. -func Zunmhr(side blas.Side, trans blas.Transpose, m, n, ilo, ihi int, a []complex128, lda int, tau, c []complex128, ldc int, work []complex128, lwork int) bool { +func Zunmhr(side, trans byte, m, n, ilo, ihi int, a []complex128, lda int, tau, c []complex128, ldc int, work []complex128, lwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -28330,22 +25927,14 @@ func Zunmhr(side blas.Side, trans blas.Transpose, m, n, ilo, ihi int, a []comple } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cunmlq.f. -func Cunmlq(side blas.Side, trans blas.Transpose, m, n, k int, a []complex64, lda int, tau, c []complex64, ldc int, work []complex64, lwork int) bool { +func Cunmlq(side, trans byte, m, n, k int, a []complex64, lda int, tau, c []complex64, ldc int, work []complex64, lwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -28369,22 +25958,14 @@ func Cunmlq(side blas.Side, trans blas.Transpose, m, n, k int, a []complex64, ld } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zunmlq.f. -func Zunmlq(side blas.Side, trans blas.Transpose, m, n, k int, a []complex128, lda int, tau, c []complex128, ldc int, work []complex128, lwork int) bool { +func Zunmlq(side, trans byte, m, n, k int, a []complex128, lda int, tau, c []complex128, ldc int, work []complex128, lwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -28408,22 +25989,14 @@ func Zunmlq(side blas.Side, trans blas.Transpose, m, n, k int, a []complex128, l } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cunmql.f. -func Cunmql(side blas.Side, trans blas.Transpose, m, n, k int, a []complex64, lda int, tau, c []complex64, ldc int, work []complex64, lwork int) bool { +func Cunmql(side, trans byte, m, n, k int, a []complex64, lda int, tau, c []complex64, ldc int, work []complex64, lwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -28447,22 +26020,14 @@ func Cunmql(side blas.Side, trans blas.Transpose, m, n, k int, a []complex64, ld } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zunmql.f. -func Zunmql(side blas.Side, trans blas.Transpose, m, n, k int, a []complex128, lda int, tau, c []complex128, ldc int, work []complex128, lwork int) bool { +func Zunmql(side, trans byte, m, n, k int, a []complex128, lda int, tau, c []complex128, ldc int, work []complex128, lwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -28486,22 +26051,14 @@ func Zunmql(side blas.Side, trans blas.Transpose, m, n, k int, a []complex128, l } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cunmqr.f. -func Cunmqr(side blas.Side, trans blas.Transpose, m, n, k int, a []complex64, lda int, tau, c []complex64, ldc int, work []complex64, lwork int) bool { +func Cunmqr(side, trans byte, m, n, k int, a []complex64, lda int, tau, c []complex64, ldc int, work []complex64, lwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -28525,22 +26082,14 @@ func Cunmqr(side blas.Side, trans blas.Transpose, m, n, k int, a []complex64, ld } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zunmqr.f. -func Zunmqr(side blas.Side, trans blas.Transpose, m, n, k int, a []complex128, lda int, tau, c []complex128, ldc int, work []complex128, lwork int) bool { +func Zunmqr(side, trans byte, m, n, k int, a []complex128, lda int, tau, c []complex128, ldc int, work []complex128, lwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -28564,22 +26113,14 @@ func Zunmqr(side blas.Side, trans blas.Transpose, m, n, k int, a []complex128, l } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cunmrq.f. -func Cunmrq(side blas.Side, trans blas.Transpose, m, n, k int, a []complex64, lda int, tau, c []complex64, ldc int, work []complex64, lwork int) bool { +func Cunmrq(side, trans byte, m, n, k int, a []complex64, lda int, tau, c []complex64, ldc int, work []complex64, lwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -28603,22 +26144,14 @@ func Cunmrq(side blas.Side, trans blas.Transpose, m, n, k int, a []complex64, ld } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zunmrq.f. -func Zunmrq(side blas.Side, trans blas.Transpose, m, n, k int, a []complex128, lda int, tau, c []complex128, ldc int, work []complex128, lwork int) bool { +func Zunmrq(side, trans byte, m, n, k int, a []complex128, lda int, tau, c []complex128, ldc int, work []complex128, lwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -28642,22 +26175,14 @@ func Zunmrq(side blas.Side, trans blas.Transpose, m, n, k int, a []complex128, l } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cunmrz.f. -func Cunmrz(side blas.Side, trans blas.Transpose, m, n, k, l int, a []complex64, lda int, tau, c []complex64, ldc int, work []complex64, lwork int) bool { +func Cunmrz(side, trans byte, m, n, k, l int, a []complex64, lda int, tau, c []complex64, ldc int, work []complex64, lwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -28681,22 +26206,14 @@ func Cunmrz(side blas.Side, trans blas.Transpose, m, n, k, l int, a []complex64, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zunmrz.f. -func Zunmrz(side blas.Side, trans blas.Transpose, m, n, k, l int, a []complex128, lda int, tau, c []complex128, ldc int, work []complex128, lwork int) bool { +func Zunmrz(side, trans byte, m, n, k, l int, a []complex128, lda int, tau, c []complex128, ldc int, work []complex128, lwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -28720,30 +26237,19 @@ func Zunmrz(side blas.Side, trans blas.Transpose, m, n, k, l int, a []complex128 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cunmtr.f. -func Cunmtr(side blas.Side, ul blas.Uplo, trans blas.Transpose, m, n int, a []complex64, lda int, tau, c []complex64, ldc int, work []complex64, lwork int) bool { +func Cunmtr(side, ul, trans byte, m, n int, a []complex64, lda int, tau, c []complex64, ldc int, work []complex64, lwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -28767,30 +26273,19 @@ func Cunmtr(side blas.Side, ul blas.Uplo, trans blas.Transpose, m, n int, a []co } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zunmtr.f. -func Zunmtr(side blas.Side, ul blas.Uplo, trans blas.Transpose, m, n int, a []complex128, lda int, tau, c []complex128, ldc int, work []complex128, lwork int) bool { +func Zunmtr(side, ul, trans byte, m, n int, a []complex128, lda int, tau, c []complex128, ldc int, work []complex128, lwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -28814,14 +26309,11 @@ func Zunmtr(side blas.Side, ul blas.Uplo, trans blas.Transpose, m, n int, a []co } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cupgtr.f. -func Cupgtr(ul blas.Uplo, n int, ap, tau, q []complex64, ldq int, work []complex64) bool { +func Cupgtr(ul byte, n int, ap, tau, q []complex64, ldq int, work []complex64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex64 if len(ap) > 0 { @@ -28843,14 +26335,11 @@ func Cupgtr(ul blas.Uplo, n int, ap, tau, q []complex64, ldq int, work []complex } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zupgtr.f. -func Zupgtr(ul blas.Uplo, n int, ap, tau, q []complex128, ldq int, work []complex128) bool { +func Zupgtr(ul byte, n int, ap, tau, q []complex128, ldq int, work []complex128) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _ap *complex128 if len(ap) > 0 { @@ -28872,30 +26361,19 @@ func Zupgtr(ul blas.Uplo, n int, ap, tau, q []complex128, ldq int, work []comple } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cupmtr.f. -func Cupmtr(side blas.Side, ul blas.Uplo, trans blas.Transpose, m, n int, ap, tau, c []complex64, ldc int, work []complex64) bool { +func Cupmtr(side, ul, trans byte, m, n int, ap, tau, c []complex64, ldc int, work []complex64) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -28919,30 +26397,19 @@ func Cupmtr(side blas.Side, ul blas.Uplo, trans blas.Transpose, m, n int, ap, ta } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zupmtr.f. -func Zupmtr(side blas.Side, ul blas.Uplo, trans blas.Transpose, m, n int, ap, tau, c []complex128, ldc int, work []complex128) bool { +func Zupmtr(side, ul, trans byte, m, n int, ap, tau, c []complex128, ldc int, work []complex128) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -28966,14 +26433,9 @@ func Zupmtr(side blas.Side, ul blas.Uplo, trans blas.Transpose, m, n int, ap, ta } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cbbcsd.f. -func Cbbcsd(jobu1, jobu2, jobv1t, jobv2t lapack.Job, trans blas.Transpose, m, p, q int, theta, phi []float32, u1 []complex64, ldu1 int, u2 []complex64, ldu2 int, v1t []complex64, ldv1t int, v2t []complex64, ldv2t int, b11d, b11e, b12d, b12e, b21d, b21e, b22d, b22e, rwork []float32, lrwork int) bool { +func Cbbcsd(jobu1, jobu2, jobv1t, jobv2t, trans byte, m, p, q int, theta, phi []float32, u1 []complex64, ldu1 int, u2 []complex64, ldu2 int, v1t []complex64, ldv1t int, v2t []complex64, ldv2t int, b11d, b11e, b12d, b12e, b21d, b21e, b22d, b22e, rwork []float32, lrwork int) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -29041,14 +26503,11 @@ func Cbbcsd(jobu1, jobu2, jobv1t, jobv2t lapack.Job, trans blas.Transpose, m, p, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cheswapr.f. -func Cheswapr(ul blas.Uplo, n int, a []complex64, i1, i2 int) bool { +func Cheswapr(ul byte, n int, a []complex64, i1, i2 int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -29058,14 +26517,11 @@ func Cheswapr(ul blas.Uplo, n int, a []complex64, i1, i2 int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chetri2.f. -func Chetri2(ul blas.Uplo, n int, a []complex64, lda int, ipiv []int32, work []complex64, lwork int) bool { +func Chetri2(ul byte, n int, a []complex64, lda int, ipiv []int32, work []complex64, lwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -29083,14 +26539,11 @@ func Chetri2(ul blas.Uplo, n int, a []complex64, lda int, ipiv []int32, work []c } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chetri2x.f. -func Chetri2x(ul blas.Uplo, n int, a []complex64, lda int, ipiv []int32, work []complex64, nb int) bool { +func Chetri2x(ul byte, n int, a []complex64, lda int, ipiv []int32, work []complex64, nb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -29108,14 +26561,11 @@ func Chetri2x(ul blas.Uplo, n int, a []complex64, lda int, ipiv []int32, work [] } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chetrs2.f. -func Chetrs2(ul blas.Uplo, n, nrhs int, a []complex64, lda int, ipiv []int32, b []complex64, ldb int, work []complex64) bool { +func Chetrs2(ul byte, n, nrhs int, a []complex64, lda int, ipiv []int32, b []complex64, ldb int, work []complex64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -29137,14 +26587,11 @@ func Chetrs2(ul blas.Uplo, n, nrhs int, a []complex64, lda int, ipiv []int32, b } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/csyconv.f. -func Csyconv(ul blas.Uplo, way byte, n int, a []complex64, lda int, ipiv []int32, work []complex64) bool { +func Csyconv(ul, way byte, n int, a []complex64, lda int, ipiv []int32, work []complex64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -29162,14 +26609,11 @@ func Csyconv(ul blas.Uplo, way byte, n int, a []complex64, lda int, ipiv []int32 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/csyswapr.f. -func Csyswapr(ul blas.Uplo, n int, a []complex64, i1, i2 int) bool { +func Csyswapr(ul byte, n int, a []complex64, i1, i2 int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -29179,14 +26623,11 @@ func Csyswapr(ul blas.Uplo, n int, a []complex64, i1, i2 int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/csytri2.f. -func Csytri2(ul blas.Uplo, n int, a []complex64, lda int, ipiv []int32, work []complex64, lwork int) bool { +func Csytri2(ul byte, n int, a []complex64, lda int, ipiv []int32, work []complex64, lwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -29204,14 +26645,11 @@ func Csytri2(ul blas.Uplo, n int, a []complex64, lda int, ipiv []int32, work []c } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/csytri2x.f. -func Csytri2x(ul blas.Uplo, n int, a []complex64, lda int, ipiv []int32, work []complex64, nb int) bool { +func Csytri2x(ul byte, n int, a []complex64, lda int, ipiv []int32, work []complex64, nb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -29229,14 +26667,11 @@ func Csytri2x(ul blas.Uplo, n int, a []complex64, lda int, ipiv []int32, work [] } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/csytrs2.f. -func Csytrs2(ul blas.Uplo, n, nrhs int, a []complex64, lda int, ipiv []int32, b []complex64, ldb int, work []complex64) bool { +func Csytrs2(ul byte, n, nrhs int, a []complex64, lda int, ipiv []int32, b []complex64, ldb int, work []complex64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex64 if len(a) > 0 { @@ -29258,14 +26693,9 @@ func Csytrs2(ul blas.Uplo, n, nrhs int, a []complex64, lda int, ipiv []int32, b } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cunbdb.f. -func Cunbdb(trans blas.Transpose, signs byte, m, p, q int, x11 []complex64, ldx11 int, x12 []complex64, ldx12 int, x21 []complex64, ldx21 int, x22 []complex64, ldx22 int, theta, phi []float32, taup1, taup2, tauq1, tauq2, work []complex64, lwork int) bool { +func Cunbdb(trans, signs byte, m, p, q int, x11 []complex64, ldx11 int, x12 []complex64, ldx12 int, x21 []complex64, ldx21 int, x22 []complex64, ldx22 int, theta, phi []float32, taup1, taup2, tauq1, tauq2, work []complex64, lwork int) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -29317,14 +26747,9 @@ func Cunbdb(trans blas.Transpose, signs byte, m, p, q int, x11 []complex64, ldx1 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cuncsd.f. -func Cuncsd(jobu1, jobu2, jobv1t, jobv2t lapack.Job, trans blas.Transpose, signs byte, m, p, q int, x11 []complex64, ldx11 int, x12 []complex64, ldx12 int, x21 []complex64, ldx21 int, x22 []complex64, ldx22 int, theta []float32, u1 []complex64, ldu1 int, u2 []complex64, ldu2 int, v1t []complex64, ldv1t int, v2t []complex64, ldv2t int, work []complex64, lwork int, rwork []float32, lrwork int, iwork []int32) bool { +func Cuncsd(jobu1, jobu2, jobv1t, jobv2t, trans, signs byte, m, p, q int, x11 []complex64, ldx11 int, x12 []complex64, ldx12 int, x21 []complex64, ldx21 int, x22 []complex64, ldx22 int, theta []float32, u1 []complex64, ldu1 int, u2 []complex64, ldu2 int, v1t []complex64, ldv1t int, v2t []complex64, ldv2t int, work []complex64, lwork int, rwork []float32, lrwork int, iwork []int32) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -29380,7 +26805,7 @@ func Cuncsd(jobu1, jobu2, jobv1t, jobv2t lapack.Job, trans blas.Transpose, signs } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cuncsd2by1.f. -func Cuncsd2by1(jobu1, jobu2, jobv1t lapack.Job, m, p, q int, x11 []complex64, ldx11 int, x21 []complex64, ldx21 int, theta, u1 []complex64, ldu1 int, u2 []complex64, ldu2 int, v1t []complex64, ldv1t int, work []complex64, lwork int, rwork []float32, lrwork int, iwork []int32) bool { +func Cuncsd2by1(jobu1, jobu2, jobv1t byte, m, p, q int, x11 []complex64, ldx11 int, x21 []complex64, ldx21 int, theta, u1 []complex64, ldu1 int, u2 []complex64, ldu2 int, v1t []complex64, ldv1t int, work []complex64, lwork int, rwork []float32, lrwork int, iwork []int32) bool { var _x11 *complex64 if len(x11) > 0 { _x11 = &x11[0] @@ -29421,14 +26846,9 @@ func Cuncsd2by1(jobu1, jobu2, jobv1t lapack.Job, m, p, q int, x11 []complex64, l } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dbbcsd.f. -func Dbbcsd(jobu1, jobu2, jobv1t, jobv2t lapack.Job, trans blas.Transpose, m, p, q int, theta, phi, u1 []float64, ldu1 int, u2 []float64, ldu2 int, v1t []float64, ldv1t int, v2t []float64, ldv2t int, b11d, b11e, b12d, b12e, b21d, b21e, b22d, b22e, work []float64, lwork int) bool { +func Dbbcsd(jobu1, jobu2, jobv1t, jobv2t, trans byte, m, p, q int, theta, phi, u1 []float64, ldu1 int, u2 []float64, ldu2 int, v1t []float64, ldv1t int, v2t []float64, ldv2t int, b11d, b11e, b12d, b12e, b21d, b21e, b22d, b22e, work []float64, lwork int) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -29496,14 +26916,9 @@ func Dbbcsd(jobu1, jobu2, jobv1t, jobv2t lapack.Job, trans blas.Transpose, m, p, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dorbdb.f. -func Dorbdb(trans blas.Transpose, signs byte, m, p, q int, x11 []float64, ldx11 int, x12 []float64, ldx12 int, x21 []float64, ldx21 int, x22 []float64, ldx22 int, theta, phi, taup1, taup2, tauq1, tauq2, work []float64, lwork int) bool { +func Dorbdb(trans, signs byte, m, p, q int, x11 []float64, ldx11 int, x12 []float64, ldx12 int, x21 []float64, ldx21 int, x22 []float64, ldx22 int, theta, phi, taup1, taup2, tauq1, tauq2, work []float64, lwork int) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -29555,14 +26970,9 @@ func Dorbdb(trans blas.Transpose, signs byte, m, p, q int, x11 []float64, ldx11 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dorcsd.f. -func Dorcsd(jobu1, jobu2, jobv1t, jobv2t lapack.Job, trans blas.Transpose, signs byte, m, p, q int, x11 []float64, ldx11 int, x12 []float64, ldx12 int, x21 []float64, ldx21 int, x22 []float64, ldx22 int, theta, u1 []float64, ldu1 int, u2 []float64, ldu2 int, v1t []float64, ldv1t int, v2t []float64, ldv2t int, work []float64, lwork int, iwork []int32) bool { +func Dorcsd(jobu1, jobu2, jobv1t, jobv2t, trans, signs byte, m, p, q int, x11 []float64, ldx11 int, x12 []float64, ldx12 int, x21 []float64, ldx21 int, x22 []float64, ldx22 int, theta, u1 []float64, ldu1 int, u2 []float64, ldu2 int, v1t []float64, ldv1t int, v2t []float64, ldv2t int, work []float64, lwork int, iwork []int32) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -29614,7 +27024,7 @@ func Dorcsd(jobu1, jobu2, jobv1t, jobv2t lapack.Job, trans blas.Transpose, signs } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dorcsd2by1.f. -func Dorcsd2by1(jobu1, jobu2, jobv1t lapack.Job, m, p, q int, x11 []float64, ldx11 int, x21 []float64, ldx21 int, theta, u1 []float64, ldu1 int, u2 []float64, ldu2 int, v1t []float64, ldv1t int, work []float64, lwork int, iwork []int32) bool { +func Dorcsd2by1(jobu1, jobu2, jobv1t byte, m, p, q int, x11 []float64, ldx11 int, x21 []float64, ldx21 int, theta, u1 []float64, ldu1 int, u2 []float64, ldu2 int, v1t []float64, ldv1t int, work []float64, lwork int, iwork []int32) bool { var _x11 *float64 if len(x11) > 0 { _x11 = &x11[0] @@ -29651,14 +27061,11 @@ func Dorcsd2by1(jobu1, jobu2, jobv1t lapack.Job, m, p, q int, x11 []float64, ldx } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsyconv.f. -func Dsyconv(ul blas.Uplo, way byte, n int, a []float64, lda int, ipiv []int32, work []float64) bool { +func Dsyconv(ul, way byte, n int, a []float64, lda int, ipiv []int32, work []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -29676,14 +27083,11 @@ func Dsyconv(ul blas.Uplo, way byte, n int, a []float64, lda int, ipiv []int32, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsyswapr.f. -func Dsyswapr(ul blas.Uplo, n int, a []float64, i1, i2 int) bool { +func Dsyswapr(ul byte, n int, a []float64, i1, i2 int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -29693,14 +27097,11 @@ func Dsyswapr(ul blas.Uplo, n int, a []float64, i1, i2 int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsytri2.f. -func Dsytri2(ul blas.Uplo, n int, a []float64, lda int, ipiv []int32, work []complex128, lwork int) bool { +func Dsytri2(ul byte, n int, a []float64, lda int, ipiv []int32, work []complex128, lwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -29718,14 +27119,11 @@ func Dsytri2(ul blas.Uplo, n int, a []float64, lda int, ipiv []int32, work []com } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsytri2x.f. -func Dsytri2x(ul blas.Uplo, n int, a []float64, lda int, ipiv []int32, work []float64, nb int) bool { +func Dsytri2x(ul byte, n int, a []float64, lda int, ipiv []int32, work []float64, nb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -29743,14 +27141,11 @@ func Dsytri2x(ul blas.Uplo, n int, a []float64, lda int, ipiv []int32, work []fl } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsytrs2.f. -func Dsytrs2(ul blas.Uplo, n, nrhs int, a []float64, lda int, ipiv []int32, b []float64, ldb int, work []float64) bool { +func Dsytrs2(ul byte, n, nrhs int, a []float64, lda int, ipiv []int32, b []float64, ldb int, work []float64) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float64 if len(a) > 0 { @@ -29772,14 +27167,9 @@ func Dsytrs2(ul blas.Uplo, n, nrhs int, a []float64, lda int, ipiv []int32, b [] } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sbbcsd.f. -func Sbbcsd(jobu1, jobu2, jobv1t, jobv2t lapack.Job, trans blas.Transpose, m, p, q int, theta, phi, u1 []float32, ldu1 int, u2 []float32, ldu2 int, v1t []float32, ldv1t int, v2t []float32, ldv2t int, b11d, b11e, b12d, b12e, b21d, b21e, b22d, b22e, work []float32, lwork int) bool { +func Sbbcsd(jobu1, jobu2, jobv1t, jobv2t, trans byte, m, p, q int, theta, phi, u1 []float32, ldu1 int, u2 []float32, ldu2 int, v1t []float32, ldv1t int, v2t []float32, ldv2t int, b11d, b11e, b12d, b12e, b21d, b21e, b22d, b22e, work []float32, lwork int) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -29847,14 +27237,9 @@ func Sbbcsd(jobu1, jobu2, jobv1t, jobv2t lapack.Job, trans blas.Transpose, m, p, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sorbdb.f. -func Sorbdb(trans blas.Transpose, signs byte, m, p, q int, x11 []float32, ldx11 int, x12 []float32, ldx12 int, x21 []float32, ldx21 int, x22 []float32, ldx22 int, theta, phi, taup1, taup2, tauq1, tauq2, work []float32, lwork int) bool { +func Sorbdb(trans, signs byte, m, p, q int, x11 []float32, ldx11 int, x12 []float32, ldx12 int, x21 []float32, ldx21 int, x22 []float32, ldx22 int, theta, phi, taup1, taup2, tauq1, tauq2, work []float32, lwork int) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -29906,14 +27291,9 @@ func Sorbdb(trans blas.Transpose, signs byte, m, p, q int, x11 []float32, ldx11 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sorcsd.f. -func Sorcsd(jobu1, jobu2, jobv1t, jobv2t lapack.Job, trans blas.Transpose, signs byte, m, p, q int, x11 []float32, ldx11 int, x12 []float32, ldx12 int, x21 []float32, ldx21 int, x22 []float32, ldx22 int, theta, u1 []float32, ldu1 int, u2 []float32, ldu2 int, v1t []float32, ldv1t int, v2t []float32, ldv2t int, work []float32, lwork int, iwork []int32) bool { +func Sorcsd(jobu1, jobu2, jobv1t, jobv2t, trans, signs byte, m, p, q int, x11 []float32, ldx11 int, x12 []float32, ldx12 int, x21 []float32, ldx21 int, x22 []float32, ldx22 int, theta, u1 []float32, ldu1 int, u2 []float32, ldu2 int, v1t []float32, ldv1t int, v2t []float32, ldv2t int, work []float32, lwork int, iwork []int32) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -29965,7 +27345,7 @@ func Sorcsd(jobu1, jobu2, jobv1t, jobv2t lapack.Job, trans blas.Transpose, signs } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sorcsd2by1.f. -func Sorcsd2by1(jobu1, jobu2, jobv1t lapack.Job, m, p, q int, x11 []float32, ldx11 int, x21 []float32, ldx21 int, theta, u1 []float32, ldu1 int, u2 []float32, ldu2 int, v1t []float32, ldv1t int, work []float32, lwork int, iwork []int32) bool { +func Sorcsd2by1(jobu1, jobu2, jobv1t byte, m, p, q int, x11 []float32, ldx11 int, x21 []float32, ldx21 int, theta, u1 []float32, ldu1 int, u2 []float32, ldu2 int, v1t []float32, ldv1t int, work []float32, lwork int, iwork []int32) bool { var _x11 *float32 if len(x11) > 0 { _x11 = &x11[0] @@ -30002,14 +27382,11 @@ func Sorcsd2by1(jobu1, jobu2, jobv1t lapack.Job, m, p, q int, x11 []float32, ldx } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssyconv.f. -func Ssyconv(ul blas.Uplo, way byte, n int, a []float32, lda int, ipiv []int32, work []float32) bool { +func Ssyconv(ul, way byte, n int, a []float32, lda int, ipiv []int32, work []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -30027,14 +27404,11 @@ func Ssyconv(ul blas.Uplo, way byte, n int, a []float32, lda int, ipiv []int32, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssyswapr.f. -func Ssyswapr(ul blas.Uplo, n int, a []float32, i1, i2 int) bool { +func Ssyswapr(ul byte, n int, a []float32, i1, i2 int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -30044,14 +27418,11 @@ func Ssyswapr(ul blas.Uplo, n int, a []float32, i1, i2 int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssytri2.f. -func Ssytri2(ul blas.Uplo, n int, a []float32, lda int, ipiv []int32, work []complex64, lwork int) bool { +func Ssytri2(ul byte, n int, a []float32, lda int, ipiv []int32, work []complex64, lwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -30069,14 +27440,11 @@ func Ssytri2(ul blas.Uplo, n int, a []float32, lda int, ipiv []int32, work []com } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssytri2x.f. -func Ssytri2x(ul blas.Uplo, n int, a []float32, lda int, ipiv []int32, work []float32, nb int) bool { +func Ssytri2x(ul byte, n int, a []float32, lda int, ipiv []int32, work []float32, nb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -30094,14 +27462,11 @@ func Ssytri2x(ul blas.Uplo, n int, a []float32, lda int, ipiv []int32, work []fl } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssytrs2.f. -func Ssytrs2(ul blas.Uplo, n, nrhs int, a []float32, lda int, ipiv []int32, b []float32, ldb int, work []float32) bool { +func Ssytrs2(ul byte, n, nrhs int, a []float32, lda int, ipiv []int32, b []float32, ldb int, work []float32) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *float32 if len(a) > 0 { @@ -30123,14 +27488,9 @@ func Ssytrs2(ul blas.Uplo, n, nrhs int, a []float32, lda int, ipiv []int32, b [] } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zbbcsd.f. -func Zbbcsd(jobu1, jobu2, jobv1t, jobv2t lapack.Job, trans blas.Transpose, m, p, q int, theta, phi []float64, u1 []complex128, ldu1 int, u2 []complex128, ldu2 int, v1t []complex128, ldv1t int, v2t []complex128, ldv2t int, b11d, b11e, b12d, b12e, b21d, b21e, b22d, b22e, rwork []float64, lrwork int) bool { +func Zbbcsd(jobu1, jobu2, jobv1t, jobv2t, trans byte, m, p, q int, theta, phi []float64, u1 []complex128, ldu1 int, u2 []complex128, ldu2 int, v1t []complex128, ldv1t int, v2t []complex128, ldv2t int, b11d, b11e, b12d, b12e, b21d, b21e, b22d, b22e, rwork []float64, lrwork int) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -30198,14 +27558,11 @@ func Zbbcsd(jobu1, jobu2, jobv1t, jobv2t lapack.Job, trans blas.Transpose, m, p, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zheswapr.f. -func Zheswapr(ul blas.Uplo, n int, a []complex128, i1, i2 int) bool { +func Zheswapr(ul byte, n int, a []complex128, i1, i2 int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -30215,14 +27572,11 @@ func Zheswapr(ul blas.Uplo, n int, a []complex128, i1, i2 int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhetri2.f. -func Zhetri2(ul blas.Uplo, n int, a []complex128, lda int, ipiv []int32, work []complex128, lwork int) bool { +func Zhetri2(ul byte, n int, a []complex128, lda int, ipiv []int32, work []complex128, lwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -30240,14 +27594,11 @@ func Zhetri2(ul blas.Uplo, n int, a []complex128, lda int, ipiv []int32, work [] } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhetri2x.f. -func Zhetri2x(ul blas.Uplo, n int, a []complex128, lda int, ipiv []int32, work []complex128, nb int) bool { +func Zhetri2x(ul byte, n int, a []complex128, lda int, ipiv []int32, work []complex128, nb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -30265,14 +27616,11 @@ func Zhetri2x(ul blas.Uplo, n int, a []complex128, lda int, ipiv []int32, work [ } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhetrs2.f. -func Zhetrs2(ul blas.Uplo, n, nrhs int, a []complex128, lda int, ipiv []int32, b []complex128, ldb int, work []complex128) bool { +func Zhetrs2(ul byte, n, nrhs int, a []complex128, lda int, ipiv []int32, b []complex128, ldb int, work []complex128) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -30294,14 +27642,11 @@ func Zhetrs2(ul blas.Uplo, n, nrhs int, a []complex128, lda int, ipiv []int32, b } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zsyconv.f. -func Zsyconv(ul blas.Uplo, way byte, n int, a []complex128, lda int, ipiv []int32, work []complex128) bool { +func Zsyconv(ul, way byte, n int, a []complex128, lda int, ipiv []int32, work []complex128) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -30319,14 +27664,11 @@ func Zsyconv(ul blas.Uplo, way byte, n int, a []complex128, lda int, ipiv []int3 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zsyswapr.f. -func Zsyswapr(ul blas.Uplo, n int, a []complex128, i1, i2 int) bool { +func Zsyswapr(ul byte, n int, a []complex128, i1, i2 int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -30336,14 +27678,11 @@ func Zsyswapr(ul blas.Uplo, n int, a []complex128, i1, i2 int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zsytri2.f. -func Zsytri2(ul blas.Uplo, n int, a []complex128, lda int, ipiv []int32, work []complex128, lwork int) bool { +func Zsytri2(ul byte, n int, a []complex128, lda int, ipiv []int32, work []complex128, lwork int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -30361,14 +27700,11 @@ func Zsytri2(ul blas.Uplo, n int, a []complex128, lda int, ipiv []int32, work [] } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zsytri2x.f. -func Zsytri2x(ul blas.Uplo, n int, a []complex128, lda int, ipiv []int32, work []complex128, nb int) bool { +func Zsytri2x(ul byte, n int, a []complex128, lda int, ipiv []int32, work []complex128, nb int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -30386,14 +27722,11 @@ func Zsytri2x(ul blas.Uplo, n int, a []complex128, lda int, ipiv []int32, work [ } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zsytrs2.f. -func Zsytrs2(ul blas.Uplo, n, nrhs int, a []complex128, lda int, ipiv []int32, b []complex128, ldb int, work []complex128) bool { +func Zsytrs2(ul byte, n, nrhs int, a []complex128, lda int, ipiv []int32, b []complex128, ldb int, work []complex128) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _a *complex128 if len(a) > 0 { @@ -30415,14 +27748,9 @@ func Zsytrs2(ul blas.Uplo, n, nrhs int, a []complex128, lda int, ipiv []int32, b } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zunbdb.f. -func Zunbdb(trans blas.Transpose, signs byte, m, p, q int, x11 []complex128, ldx11 int, x12 []complex128, ldx12 int, x21 []complex128, ldx21 int, x22 []complex128, ldx22 int, theta, phi []float64, taup1, taup2, tauq1, tauq2, work []complex128, lwork int) bool { +func Zunbdb(trans, signs byte, m, p, q int, x11 []complex128, ldx11 int, x12 []complex128, ldx12 int, x21 []complex128, ldx21 int, x22 []complex128, ldx22 int, theta, phi []float64, taup1, taup2, tauq1, tauq2, work []complex128, lwork int) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -30474,14 +27802,9 @@ func Zunbdb(trans blas.Transpose, signs byte, m, p, q int, x11 []complex128, ldx } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zuncsd.f. -func Zuncsd(jobu1, jobu2, jobv1t, jobv2t lapack.Job, trans blas.Transpose, signs byte, m, p, q int, x11 []complex128, ldx11 int, x12 []complex128, ldx12 int, x21 []complex128, ldx21 int, x22 []complex128, ldx22 int, theta []float64, u1 []complex128, ldu1 int, u2 []complex128, ldu2 int, v1t []complex128, ldv1t int, v2t []complex128, ldv2t int, work []complex128, lwork int, rwork []float64, lrwork int, iwork []int32) bool { +func Zuncsd(jobu1, jobu2, jobv1t, jobv2t, trans, signs byte, m, p, q int, x11 []complex128, ldx11 int, x12 []complex128, ldx12 int, x21 []complex128, ldx21 int, x22 []complex128, ldx22 int, theta []float64, u1 []complex128, ldu1 int, u2 []complex128, ldu2 int, v1t []complex128, ldv1t int, v2t []complex128, ldv2t int, work []complex128, lwork int, rwork []float64, lrwork int, iwork []int32) bool { switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -30537,7 +27860,7 @@ func Zuncsd(jobu1, jobu2, jobv1t, jobv2t lapack.Job, trans blas.Transpose, signs } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zuncsd2by1.f. -func Zuncsd2by1(jobu1, jobu2, jobv1t lapack.Job, m, p, q int, x11 []complex128, ldx11 int, x21 []complex128, ldx21 int, theta, u1 []complex128, ldu1 int, u2 []complex128, ldu2 int, v1t []complex128, ldv1t int, work []complex128, lwork int, rwork []float64, lrwork int, iwork []int32) bool { +func Zuncsd2by1(jobu1, jobu2, jobv1t byte, m, p, q int, x11 []complex128, ldx11 int, x21 []complex128, ldx21 int, theta, u1 []complex128, ldu1 int, u2 []complex128, ldu2 int, v1t []complex128, ldv1t int, work []complex128, lwork int, rwork []float64, lrwork int, iwork []int32) bool { var _x11 *complex128 if len(x11) > 0 { _x11 = &x11[0] @@ -30578,22 +27901,14 @@ func Zuncsd2by1(jobu1, jobu2, jobv1t lapack.Job, m, p, q int, x11 []complex128, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sgemqrt.f. -func Sgemqrt(side blas.Side, trans blas.Transpose, m, n, k, nb int, v []float32, ldv int, t []float32, ldt int, c []float32, ldc int, work []float32) bool { +func Sgemqrt(side, trans byte, m, n, k, nb int, v []float32, ldv int, t []float32, ldt int, c []float32, ldc int, work []float32) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -30617,22 +27932,14 @@ func Sgemqrt(side blas.Side, trans blas.Transpose, m, n, k, nb int, v []float32, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dgemqrt.f. -func Dgemqrt(side blas.Side, trans blas.Transpose, m, n, k, nb int, v []float64, ldv int, t []float64, ldt int, c []float64, ldc int, work []float64) bool { +func Dgemqrt(side, trans byte, m, n, k, nb int, v []float64, ldv int, t []float64, ldt int, c []float64, ldc int, work []float64) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -30656,22 +27963,14 @@ func Dgemqrt(side blas.Side, trans blas.Transpose, m, n, k, nb int, v []float64, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cgemqrt.f. -func Cgemqrt(side blas.Side, trans blas.Transpose, m, n, k, nb int, v []complex64, ldv int, t []complex64, ldt int, c []complex64, ldc int, work []complex64) bool { +func Cgemqrt(side, trans byte, m, n, k, nb int, v []complex64, ldv int, t []complex64, ldt int, c []complex64, ldc int, work []complex64) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -30695,22 +27994,14 @@ func Cgemqrt(side blas.Side, trans blas.Transpose, m, n, k, nb int, v []complex6 } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zgemqrt.f. -func Zgemqrt(side blas.Side, trans blas.Transpose, m, n, k, nb int, v []complex128, ldv int, t []complex128, ldt int, c []complex128, ldc int, work []complex128) bool { +func Zgemqrt(side, trans byte, m, n, k, nb int, v []complex128, ldv int, t []complex128, ldt int, c []complex128, ldc int, work []complex128) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -30906,22 +28197,14 @@ func Zgeqrt3(m, n int, a []complex128, lda int, t []complex128, ldt int) bool { } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/stpmqrt.f. -func Stpmqrt(side blas.Side, trans blas.Transpose, m, n, k, l, nb int, v []float32, ldv int, t []float32, ldt int, a []float32, lda int, b []float32, ldb int, work []float32) bool { +func Stpmqrt(side, trans byte, m, n, k, l, nb int, v []float32, ldv int, t []float32, ldt int, a []float32, lda int, b []float32, ldb int, work []float32) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -30949,22 +28232,14 @@ func Stpmqrt(side blas.Side, trans blas.Transpose, m, n, k, l, nb int, v []float } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dtpmqrt.f. -func Dtpmqrt(side blas.Side, trans blas.Transpose, m, n, k, l, nb int, v []float64, ldv int, t []float64, ldt int, a []float64, lda int, b []float64, ldb int, work []float64) bool { +func Dtpmqrt(side, trans byte, m, n, k, l, nb int, v []float64, ldv int, t []float64, ldt int, a []float64, lda int, b []float64, ldb int, work []float64) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -30992,22 +28267,14 @@ func Dtpmqrt(side blas.Side, trans blas.Transpose, m, n, k, l, nb int, v []float } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ctpmqrt.f. -func Ctpmqrt(side blas.Side, trans blas.Transpose, m, n, k, l, nb int, v []complex64, ldv int, t []complex64, ldt int, a []complex64, lda int, b []complex64, ldb int, work []complex64) bool { +func Ctpmqrt(side, trans byte, m, n, k, l, nb int, v []complex64, ldv int, t []complex64, ldt int, a []complex64, lda int, b []complex64, ldb int, work []complex64) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -31035,22 +28302,14 @@ func Ctpmqrt(side blas.Side, trans blas.Transpose, m, n, k, l, nb int, v []compl } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ztpmqrt.f. -func Ztpmqrt(side blas.Side, trans blas.Transpose, m, n, k, l, nb int, v []complex128, ldv int, t []complex128, ldt int, a []complex128, lda int, b []complex128, ldb int, work []complex128) bool { +func Ztpmqrt(side, trans byte, m, n, k, l, nb int, v []complex128, ldv int, t []complex128, ldt int, a []complex128, lda int, b []complex128, ldb int, work []complex128) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -31230,22 +28489,14 @@ func Ztpqrt2(m, n, l int, a []complex128, lda int, b []complex128, ldb int, t [] } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/stprfb.f. -func Stprfb(side blas.Side, trans blas.Transpose, direct, storev byte, m, n, k, l int, v []float32, ldv int, t []float32, ldt int, a []float32, lda int, b []float32, ldb int, work []float32, ldwork int) bool { +func Stprfb(side, trans, direct, storev byte, m, n, k, l int, v []float32, ldv int, t []float32, ldt int, a []float32, lda int, b []float32, ldb int, work []float32, ldwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -31273,22 +28524,14 @@ func Stprfb(side blas.Side, trans blas.Transpose, direct, storev byte, m, n, k, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dtprfb.f. -func Dtprfb(side blas.Side, trans blas.Transpose, direct, storev byte, m, n, k, l int, v []float64, ldv int, t []float64, ldt int, a []float64, lda int, b []float64, ldb int, work []float64, ldwork int) bool { +func Dtprfb(side, trans, direct, storev byte, m, n, k, l int, v []float64, ldv int, t []float64, ldt int, a []float64, lda int, b []float64, ldb int, work []float64, ldwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -31316,22 +28559,14 @@ func Dtprfb(side blas.Side, trans blas.Transpose, direct, storev byte, m, n, k, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ctprfb.f. -func Ctprfb(side blas.Side, trans blas.Transpose, direct, storev byte, m, n, k, l int, v []complex64, ldv int, t []complex64, ldt int, a []complex64, lda int, b []complex64, ldb int, work []complex64, ldwork int) bool { +func Ctprfb(side, trans, direct, storev byte, m, n, k, l int, v []complex64, ldv int, t []complex64, ldt int, a []complex64, lda int, b []complex64, ldb int, work []complex64, ldwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -31359,22 +28594,14 @@ func Ctprfb(side blas.Side, trans blas.Transpose, direct, storev byte, m, n, k, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ztprfb.f. -func Ztprfb(side blas.Side, trans blas.Transpose, direct, storev byte, m, n, k, l int, v []complex128, ldv int, t []complex128, ldt int, a []complex128, lda int, b []complex128, ldb int, work []complex128, ldwork int) bool { +func Ztprfb(side, trans, direct, storev byte, m, n, k, l int, v []complex128, ldv int, t []complex128, ldt int, a []complex128, lda int, b []complex128, ldb int, work []complex128, ldwork int) bool { switch side { - case blas.Left: - side = 'L' - case blas.Right: - side = 'R' + case 'L', 'R': default: panic("lapack: bad side") } switch trans { - case blas.NoTrans: - trans = 'N' - case blas.Trans: - trans = 'T' - case blas.ConjTrans: - trans = 'C' + case 'N', 'T', 'C': default: panic("lapack: bad trans") } @@ -31402,14 +28629,11 @@ func Ztprfb(side blas.Side, trans blas.Transpose, direct, storev byte, m, n, k, } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/csyr.f. -func Csyr(ul blas.Uplo, n int, alpha complex64, x []complex64, incx int, a []complex64, lda int) bool { +func Csyr(ul byte, n int, alpha complex64, x []complex64, incx int, a []complex64, lda int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _x *complex64 if len(x) > 0 { @@ -31423,14 +28647,11 @@ func Csyr(ul blas.Uplo, n int, alpha complex64, x []complex64, incx int, a []com } // See http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zsyr.f. -func Zsyr(ul blas.Uplo, n int, alpha complex128, x []complex128, incx int, a []complex128, lda int) bool { +func Zsyr(ul byte, n int, alpha complex128, x []complex128, incx int, a []complex128, lda int) bool { switch ul { - case blas.Upper: - ul = 'U' - case blas.Lower: - ul = 'L' + case 'U', 'L': default: - panic("lapack: illegal triangle") + panic("lapack: bad triangle") } var _x *complex128 if len(x) > 0 { diff --git a/lapack/netlib/bench_test.go b/lapack/netlib/bench_test.go index c9ce885b..2618ad8d 100644 --- a/lapack/netlib/bench_test.go +++ b/lapack/netlib/bench_test.go @@ -1,9 +1,7 @@ -// Copyright ©2016 The gonum Authors. All rights reserved. +// Copyright ©2016 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. -// +build go1.7 - package netlib import ( diff --git a/lapack/netlib/conv.go b/lapack/netlib/conv.go new file mode 100644 index 00000000..aad8305c --- /dev/null +++ b/lapack/netlib/conv.go @@ -0,0 +1,82 @@ +// Copyright ©2019 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 "gonum.org/v1/gonum/blas" + +// bandTriToLapacke converts a triangular or symmetric band matrix A in CBLAS +// row-major layout to LAPACKE row-major layout and stores the result in B. +// +// For example, when n = 6, kd = 2 and uplo == 'U', bandTriToLapacke converts +// A = a00 a01 a02 +// a11 a12 a13 +// a22 a23 a24 +// a33 a34 a35 +// a44 a45 * +// a55 * * +// stored in a slice as +// a = [a00 a01 a02 a11 a12 a13 a22 a23 a24 a33 a34 a35 a44 a45 * a55 * *] +// to +// B = * * a02 a13 a24 a35 +// * a01 a12 a23 a34 a45 +// a00 a11 a22 a33 a44 a55 +// stored in a slice as +// b = [* * a02 a13 a24 a35 * a01 a12 a23 a34 a45 a00 a11 a22 a33 a44 a55] +// +// When n = 6, kd = 2 and uplo == 'L', bandTriToLapacke converts +// A = * * a00 +// * a10 a11 +// a20 a21 a22 +// a31 a32 a33 +// a42 a43 a44 +// a53 a54 a55 +// stored in a slice as +// a = [* * a00 * a10 a11 a20 a21 a22 a31 a32 a33 a42 a43 a44 a53 a54 a55] +// to +// B = a00 a11 a22 a33 a44 a55 +// a10 a21 a32 a43 a54 * +// a20 a31 a42 a53 * * +// stored in a slice as +// b = [a00 a11 a22 a33 a44 a55 a10 a21 a32 a43 a54 * a20 a31 a42 a53 * * ] +// +// In these example elements marked as * are not referenced. +func bandTriToLapacke(uplo blas.Uplo, n, kd int, a []float64, lda int, b []float64, ldb int) { + if uplo == blas.Upper { + for i := 0; i < n; i++ { + for jb := 0; jb < min(n-i, kd+1); jb++ { + j := i + jb // Column index in the full matrix + b[(kd-jb)*ldb+j] = a[i*lda+jb] + } + } + } else { + for i := 0; i < n; i++ { + for jb := max(0, kd-i); jb < kd+1; jb++ { + j := i - kd + jb // Column index in the full matrix + b[(kd-jb)*ldb+j] = a[i*lda+jb] + } + } + } +} + +// bandTriToGonum converts a triangular or symmetric band matrix A in LAPACKE +// row-major layout to CBLAS row-major layout and stores the result in B. In +// other words, it performs the inverse conversion to bandTriToLapacke. +func bandTriToGonum(uplo blas.Uplo, n, kd int, a []float64, lda int, b []float64, ldb int) { + if uplo == blas.Upper { + for j := 0; j < n; j++ { + for ib := max(0, kd-j); ib < kd+1; ib++ { + i := j - kd + ib // Row index in the full matrix + b[i*ldb+kd-ib] = a[ib*lda+j] + } + } + } else { + for j := 0; j < n; j++ { + for ib := 0; ib < min(n-j, kd+1); ib++ { + i := j + ib // Row index in the full matrix + b[i*ldb+kd-ib] = a[ib*lda+j] + } + } + } +} diff --git a/lapack/netlib/conv_test.go b/lapack/netlib/conv_test.go new file mode 100644 index 00000000..baeffccd --- /dev/null +++ b/lapack/netlib/conv_test.go @@ -0,0 +1,131 @@ +// Copyright ©2019 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 ( + "fmt" + "testing" + + "golang.org/x/exp/rand" + + "gonum.org/v1/gonum/blas" + "gonum.org/v1/gonum/floats" +) + +func TestConvBandTri(t *testing.T) { + for ti, test := range []struct { + uplo blas.Uplo + n, kd int + a, b []float64 + }{ + { + uplo: blas.Upper, + n: 6, + kd: 2, + a: []float64{ + 1, 2, 3, // 1. row + 4, 5, 6, + 7, 8, 9, + 10, 11, 12, + 13, 14, -1, + 15, -1, -1, // 6. row + }, + b: []float64{ + -1, -1, 3, 6, 9, 12, // 2. super-diagonal + -1, 2, 5, 8, 11, 14, + 1, 4, 7, 10, 13, 15, // main diagonal + }, + }, + { + uplo: blas.Lower, + n: 6, + kd: 2, + a: []float64{ + -1, -1, 1, // 1. row + -1, 2, 3, + 4, 5, 6, + 7, 8, 9, + 10, 11, 12, + 13, 14, 15, // 6. row + }, + b: []float64{ + 1, 3, 6, 9, 12, 15, // main diagonal + 2, 5, 8, 11, 14, -1, + 4, 7, 10, 13, -1, -1, // 2. sub-diagonal + }, + }, + } { + uplo := test.uplo + n := test.n + kd := test.kd + name := fmt.Sprintf("Case %v (uplo=%c,n=%v,kd=%v)", ti, uplo, n, kd) + + a := make([]float64, len(test.a)) + copy(a, test.a) + lda := kd + 1 + + got := make([]float64, len(test.b)) + for i := range got { + got[i] = -1 + } + ldb := max(1, n) + + bandTriToLapacke(uplo, n, kd, a, lda, got, ldb) + if !floats.Equal(test.a, a) { + t.Errorf("%v: unexpected modification of A in conversion to LAPACKE row-major", name) + } + if !floats.Equal(test.b, got) { + t.Errorf("%v: unexpected conversion to LAPACKE row-major;\ngot %v\nwant %v", name, got, test.b) + } + + b := make([]float64, len(test.b)) + copy(b, test.b) + + got = make([]float64, len(test.a)) + for i := range got { + got[i] = -1 + } + + bandTriToGonum(uplo, n, kd, b, ldb, got, lda) + if !floats.Equal(test.b, b) { + t.Errorf("%v: unexpected modification of B in conversion to Gonum row-major", name) + } + if !floats.Equal(test.a, got) { + t.Errorf("%v: unexpected conversion to Gonum row-major;\ngot %v\nwant %v", name, got, test.b) + } + } + + rnd := rand.New(rand.NewSource(1)) + for _, n := range []int{0, 1, 2, 3, 4, 5, 10} { + for _, kd := range []int{0, (n + 1) / 4, (3*n - 1) / 4, (5*n + 1) / 4} { + for _, uplo := range []blas.Uplo{blas.Upper, blas.Lower} { + for _, ldextra := range []int{0, 3} { + name := fmt.Sprintf("uplo=%c,n=%v,kd=%v", uplo, n, kd) + + lda := kd + 1 + ldextra + a := make([]float64, n*lda) + for i := range a { + a[i] = rnd.NormFloat64() + } + aCopy := make([]float64, len(a)) + copy(aCopy, a) + + ldb := max(1, n) + ldextra + b := make([]float64, (kd+1)*ldb) + for i := range b { + b[i] = rnd.NormFloat64() + } + + bandTriToLapacke(uplo, n, kd, a, lda, b, ldb) + bandTriToGonum(uplo, n, kd, b, ldb, a, lda) + + if !floats.Equal(a, aCopy) { + t.Errorf("%v: conversion does not roundtrip", name) + } + } + } + } + } +} diff --git a/lapack/netlib/errors.go b/lapack/netlib/errors.go new file mode 100644 index 00000000..11b6a6db --- /dev/null +++ b/lapack/netlib/errors.go @@ -0,0 +1,184 @@ +// Code generated by "go generate gonum.org/v1/netlib/lapack/netlib”; DO NOT EDIT. + +// Copyright ©2015 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 + +// Copied from gonum/lapack/gonum. Keep in sync. +const ( + // Panic strings for bad enumeration values. + badApplyOrtho = "lapack: bad ApplyOrtho" + badBalanceJob = "lapack: bad BalanceJob" + badDiag = "lapack: bad Diag" + badDirect = "lapack: bad Direct" + badEVComp = "lapack: bad EVComp" + badEVHowMany = "lapack: bad EVHowMany" + badEVJob = "lapack: bad EVJob" + badEVSide = "lapack: bad EVSide" + badGSVDJob = "lapack: bad GSVDJob" + badGenOrtho = "lapack: bad GenOrtho" + badLeftEVJob = "lapack: bad LeftEVJob" + badMatrixType = "lapack: bad MatrixType" + badMaximizeNormXJob = "lapack: bad MaximizeNormXJob" + badNorm = "lapack: bad Norm" + badPivot = "lapack: bad Pivot" + badRightEVJob = "lapack: bad RightEVJob" + badSVDJob = "lapack: bad SVDJob" + badSchurComp = "lapack: bad SchurComp" + badSchurJob = "lapack: bad SchurJob" + badSide = "lapack: bad Side" + badSort = "lapack: bad Sort" + badStoreV = "lapack: bad StoreV" + badTrans = "lapack: bad Trans" + badUpdateSchurComp = "lapack: bad UpdateSchurComp" + badUplo = "lapack: bad Uplo" + bothSVDOver = "lapack: both jobU and jobVT are lapack.SVDOverwrite" + + // Panic strings for bad numerical and string values. + badIfst = "lapack: ifst out of range" + badIhi = "lapack: ihi out of range" + badIhiz = "lapack: ihiz out of range" + badIlo = "lapack: ilo out of range" + badIloz = "lapack: iloz out of range" + badIlst = "lapack: ilst out of range" + badIsave = "lapack: bad isave value" + badIspec = "lapack: bad ispec value" + badJ1 = "lapack: j1 out of range" + badJpvt = "lapack: bad element of jpvt" + badK1 = "lapack: k1 out of range" + badK2 = "lapack: k2 out of range" + badKacc22 = "lapack: invalid value of kacc22" + badKbot = "lapack: kbot out of range" + badKtop = "lapack: ktop out of range" + badLWork = "lapack: insufficient declared workspace length" + badMm = "lapack: mm out of range" + badN1 = "lapack: bad value of n1" + badN2 = "lapack: bad value of n2" + badNa = "lapack: bad value of na" + badName = "lapack: bad name" + badNh = "lapack: bad value of nh" + badNw = "lapack: bad value of nw" + badPp = "lapack: bad value of pp" + badShifts = "lapack: bad shifts" + i0LT0 = "lapack: i0 < 0" + kGTM = "lapack: k > m" + kGTN = "lapack: k > n" + kLT0 = "lapack: k < 0" + kLT1 = "lapack: k < 1" + kdLT0 = "lapack: kd < 0" + klLT0 = "lapack: kl < 0" + kuLT0 = "lapack: ku < 0" + mGTN = "lapack: m > n" + mLT0 = "lapack: m < 0" + mmLT0 = "lapack: mm < 0" + n0LT0 = "lapack: n0 < 0" + nGTM = "lapack: n > m" + nLT0 = "lapack: n < 0" + nLT1 = "lapack: n < 1" + nLTM = "lapack: n < m" + nanCFrom = "lapack: cfrom is NaN" + nanCTo = "lapack: cto is NaN" + nbGTM = "lapack: nb > m" + nbGTN = "lapack: nb > n" + nbLT0 = "lapack: nb < 0" + nccLT0 = "lapack: ncc < 0" + ncvtLT0 = "lapack: ncvt < 0" + negANorm = "lapack: anorm < 0" + negZ = "lapack: negative z value" + nhLT0 = "lapack: nh < 0" + notIsolated = "lapack: block is not isolated" + nrhsLT0 = "lapack: nrhs < 0" + nruLT0 = "lapack: nru < 0" + nshftsLT0 = "lapack: nshfts < 0" + nshftsOdd = "lapack: nshfts must be even" + nvLT0 = "lapack: nv < 0" + offsetGTM = "lapack: offset > m" + offsetLT0 = "lapack: offset < 0" + pLT0 = "lapack: p < 0" + recurLT0 = "lapack: recur < 0" + zeroCFrom = "lapack: zero cfrom" + + // Panic strings for bad slice lengths. + badLenAlpha = "lapack: bad length of alpha" + badLenBeta = "lapack: bad length of beta" + badLenIpiv = "lapack: bad length of ipiv" + badLenJpiv = "lapack: bad length of jpiv" + badLenJpvt = "lapack: bad length of jpvt" + badLenK = "lapack: bad length of k" + badLenPiv = "lapack: bad length of piv" + badLenSelected = "lapack: bad length of selected" + badLenSi = "lapack: bad length of si" + badLenSr = "lapack: bad length of sr" + badLenTau = "lapack: bad length of tau" + badLenWi = "lapack: bad length of wi" + badLenWr = "lapack: bad length of wr" + + // Panic strings for insufficient slice lengths. + shortA = "lapack: insufficient length of a" + shortAB = "lapack: insufficient length of ab" + shortAuxv = "lapack: insufficient length of auxv" + shortB = "lapack: insufficient length of b" + shortC = "lapack: insufficient length of c" + shortCNorm = "lapack: insufficient length of cnorm" + shortD = "lapack: insufficient length of d" + shortDL = "lapack: insufficient length of dl" + shortDU = "lapack: insufficient length of du" + shortE = "lapack: insufficient length of e" + shortF = "lapack: insufficient length of f" + shortH = "lapack: insufficient length of h" + shortIWork = "lapack: insufficient length of iwork" + shortIsgn = "lapack: insufficient length of isgn" + shortQ = "lapack: insufficient length of q" + shortRHS = "lapack: insufficient length of rhs" + shortS = "lapack: insufficient length of s" + shortScale = "lapack: insufficient length of scale" + shortT = "lapack: insufficient length of t" + shortTau = "lapack: insufficient length of tau" + shortTauP = "lapack: insufficient length of tauP" + shortTauQ = "lapack: insufficient length of tauQ" + shortU = "lapack: insufficient length of u" + shortV = "lapack: insufficient length of v" + shortVL = "lapack: insufficient length of vl" + shortVR = "lapack: insufficient length of vr" + shortVT = "lapack: insufficient length of vt" + shortVn1 = "lapack: insufficient length of vn1" + shortVn2 = "lapack: insufficient length of vn2" + shortW = "lapack: insufficient length of w" + shortWH = "lapack: insufficient length of wh" + shortWV = "lapack: insufficient length of wv" + shortWi = "lapack: insufficient length of wi" + shortWork = "lapack: insufficient length of work" + shortWr = "lapack: insufficient length of wr" + shortX = "lapack: insufficient length of x" + shortY = "lapack: insufficient length of y" + shortZ = "lapack: insufficient length of z" + + // Panic strings for bad leading dimensions of matrices. + badLdA = "lapack: bad leading dimension of A" + badLdB = "lapack: bad leading dimension of B" + badLdC = "lapack: bad leading dimension of C" + badLdF = "lapack: bad leading dimension of F" + badLdH = "lapack: bad leading dimension of H" + badLdQ = "lapack: bad leading dimension of Q" + badLdT = "lapack: bad leading dimension of T" + badLdU = "lapack: bad leading dimension of U" + badLdV = "lapack: bad leading dimension of V" + badLdVL = "lapack: bad leading dimension of VL" + badLdVR = "lapack: bad leading dimension of VR" + badLdVT = "lapack: bad leading dimension of VT" + badLdW = "lapack: bad leading dimension of W" + badLdWH = "lapack: bad leading dimension of WH" + badLdWV = "lapack: bad leading dimension of WV" + badLdWork = "lapack: bad leading dimension of Work" + badLdX = "lapack: bad leading dimension of X" + badLdY = "lapack: bad leading dimension of Y" + badLdZ = "lapack: bad leading dimension of Z" + + // Panic strings for bad vector increments. + absIncNotOne = "lapack: increment not one or negative one" + badIncX = "lapack: incX <= 0" + badIncY = "lapack: incY <= 0" + zeroIncV = "lapack: incv == 0" +) diff --git a/lapack/netlib/generate.go b/lapack/netlib/generate.go new file mode 100644 index 00000000..5b891b2b --- /dev/null +++ b/lapack/netlib/generate.go @@ -0,0 +1,7 @@ +// Copyright ©2018 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. + +//go:generate go run generate_errors.go + +package netlib diff --git a/lapack/netlib/generate_errors.go b/lapack/netlib/generate_errors.go new file mode 100644 index 00000000..e54a4d3a --- /dev/null +++ b/lapack/netlib/generate_errors.go @@ -0,0 +1,103 @@ +// Copyright ©2018 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. + +// +build ignore + +package main + +import ( + "bytes" + "fmt" + "go/ast" + "go/parser" + "go/printer" + "go/token" + "log" + "os" + "os/exec" + "path/filepath" + "strings" +) + +const ( + srcModule = "gonum.org/v1/gonum" + errorFile = "lapack/gonum/errors.go" +) + +func main() { + path, err := pathTo(srcModule, errorFile) + if err != nil { + log.Fatalf("no source for %q: %v", errorFile, err) + } + + fset := token.NewFileSet() + f, err := parser.ParseFile(fset, path, nil, parser.ParseComments) + if err != nil { + log.Fatalf("failed to parse %q: %v", path, err) + } + + dst := filepath.Base(errorFile) + o, err := os.Create(dst) + if err != nil { + log.Fatalf("failed to create %q: %v", dst, err) + } + defer o.Close() + + fmt.Fprintln(o, header) + for _, cg := range f.Comments { + for _, c := range cg.List { + fmt.Fprintln(o, c.Text) + } + break + } + fmt.Fprintln(o, pkg) + p := printer.Config{ + Mode: printer.UseSpaces | printer.TabIndent, + Tabwidth: 8, + } + // Remove comment associated with the const block. + for _, d := range f.Decls { + if d, ok := d.(*ast.GenDecl); ok { + d.Doc = nil + } + } + p.Fprint(o, fset, f.Decls) + fmt.Fprintln(o) +} + +// pathTo returns the path to file within the given module. If running +// in module mode, this will look within the module in $GOPATH/pkg/mod +// at the correct version, otherwise it will find the version installed +// at $GOPATH/src/module/file. +func pathTo(module, file string) (string, error) { + gopath, ok := os.LookupEnv("GOPATH") + if !ok { + var err error + gopath, err = os.UserHomeDir() + if err != nil { + return "", err + } + gopath = filepath.Join(gopath, "go") + } + + cmd := exec.Command("go", "list", "-m", module) + var buf, stderr bytes.Buffer + cmd.Stdout = &buf + cmd.Stderr = &stderr + err := cmd.Run() + if err != nil { + return "", fmt.Errorf("module aware go list failed with stderr output %q: %w", stderr.String(), err) + } + version := strings.TrimSpace(strings.Join(strings.Split(buf.String(), " "), "@")) + return filepath.Join(gopath, "pkg", "mod", version, file), nil +} + +const ( + header = `// Code generated by "go generate gonum.org/v1/netlib/lapack/netlib”; DO NOT EDIT. +` + pkg = ` +package netlib + +// Copied from gonum/lapack/gonum. Keep in sync.` +) diff --git a/lapack/netlib/lapack.go b/lapack/netlib/lapack.go index 54b324e4..8e7b96b7 100644 --- a/lapack/netlib/lapack.go +++ b/lapack/netlib/lapack.go @@ -1,4 +1,4 @@ -// Copyright ©2015 The gonum Authors. All rights reserved. +// Copyright ©2015 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. @@ -13,106 +13,6 @@ import ( "gonum.org/v1/netlib/lapack/lapacke" ) -// Copied from lapack/native. Keep in sync. -const ( - absIncNotOne = "lapack: increment not one or negative one" - badAlpha = "lapack: bad alpha length" - badAuxv = "lapack: auxv has insufficient length" - badBeta = "lapack: bad beta length" - badD = "lapack: d has insufficient length" - badDecompUpdate = "lapack: bad decomp update" - badDiag = "lapack: bad diag" - badDims = "lapack: bad input dimensions" - badDirect = "lapack: bad direct" - badE = "lapack: e has insufficient length" - badEVComp = "lapack: bad EVComp" - badEVJob = "lapack: bad EVJob" - badEVSide = "lapack: bad EVSide" - badGSVDJob = "lapack: bad GSVDJob" - badHowMany = "lapack: bad HowMany" - badIlo = "lapack: ilo out of range" - badIhi = "lapack: ihi out of range" - badIpiv = "lapack: bad permutation length" - badJob = "lapack: bad Job" - badK1 = "lapack: k1 out of range" - badK2 = "lapack: k2 out of range" - badKperm = "lapack: incorrect permutation length" - badLdA = "lapack: index of a out of range" - badNb = "lapack: nb out of range" - badNorm = "lapack: bad norm" - badPivot = "lapack: bad pivot" - badS = "lapack: s has insufficient length" - badShifts = "lapack: bad shifts" - badSide = "lapack: bad side" - badSlice = "lapack: bad input slice length" - badSort = "lapack: bad Sort" - badStore = "lapack: bad store" - badTau = "lapack: tau has insufficient length" - badTauQ = "lapack: tauQ has insufficient length" - badTauP = "lapack: tauP has insufficient length" - badTrans = "lapack: bad trans" - badVn1 = "lapack: vn1 has insufficient length" - badVn2 = "lapack: vn2 has insufficient length" - badUplo = "lapack: illegal triangle" - badWork = "lapack: insufficient working memory" - badZ = "lapack: insufficient z length" - kGTM = "lapack: k > m" - kGTN = "lapack: k > n" - kLT0 = "lapack: k < 0" - mLT0 = "lapack: m < 0" - mLTN = "lapack: m < n" - nanScale = "lapack: NaN scale factor" - negDimension = "lapack: negative matrix dimension" - negZ = "lapack: negative z value" - nLT0 = "lapack: n < 0" - nLTM = "lapack: n < m" - offsetGTM = "lapack: offset > m" - shortWork = "lapack: working array shorter than declared" - zeroDiv = "lapack: zero divisor" -) - -func min(m, n int) int { - if m < n { - return m - } - return n -} - -func max(m, n int) int { - if m < n { - return n - } - return m -} - -// checkMatrix verifies the parameters of a matrix input. -// Copied from lapack/native. Keep in sync. -func checkMatrix(m, n int, a []float64, lda int) { - if m < 0 { - panic("lapack: has negative number of rows") - } - if n < 0 { - panic("lapack: has negative number of columns") - } - if lda < n { - panic("lapack: stride less than number of columns") - } - if len(a) < (m-1)*lda+n { - panic("lapack: insufficient matrix slice length") - } -} - -// checkVector verifies the parameters of a vector input. -// Copied from lapack/native. Keep in sync. -func checkVector(n int, v []float64, inc int) { - if n < 0 { - panic("lapack: negative vector length") - } - if (inc > 0 && (n-1)*inc >= len(v)) || (inc < 0 && (1-n)*inc >= len(v)) { - panic("lapack: insufficient vector slice length") - } -} - // Implementation is the cgo-based C implementation of LAPACK routines. type Implementation struct{} @@ -122,9 +22,13 @@ var _ lapack.Float64 = Implementation{} // m×n matrix A: A*P = Q*R using Level 3 BLAS. // // The matrix Q is represented as a product of elementary reflectors -// Q = H_0 H_1 . . . H_{k-1}, where k = min(m,n). +// +// Q = H_0 H_1 . . . H_{k-1}, where k = min(m,n). +// // Each H_i has the form -// H_i = I - tau * v * v^T +// +// H_i = I - tau * v * v^T +// // where tau and v are real vectors with v[0:i-1] = 0 and v[i] = 1; // v[i:m] is stored on exit in A[i:m, i], and tau in tau[i]. // @@ -149,15 +53,28 @@ var _ lapack.Float64 = Implementation{} // // Dgeqp3 is an internal routine. It is exported for testing purposes. func (impl Implementation) Dgeqp3(m, n int, a []float64, lda int, jpvt []int, tau, work []float64, lwork int) { - checkMatrix(m, n, a, lda) - if len(jpvt) != n { - panic(badIpiv) + minmn := min(m, n) + iws := 3*n + 1 + if minmn == 0 { + iws = 1 } - if len(tau) != min(m, n) { - panic(badTau) + switch { + case m < 0: + panic(mLT0) + case n < 0: + panic(nLT0) + case lda < max(1, n): + panic(badLdA) + case lwork < iws && lwork != -1: + panic(badLWork) + case len(work) < max(1, lwork): + panic(shortWork) } - if len(work) < max(1, lwork) { - panic(badWork) + + // Quick return if possible. + if minmn == 0 { + work[0] = 1 + return } // Don't update jpvt if querying lwkopt. @@ -166,24 +83,33 @@ func (impl Implementation) Dgeqp3(m, n int, a []float64, lda int, jpvt []int, ta return } - jpvt32 := make([]int32, len(jpvt)) + switch { + case len(a) < (m-1)*lda+n: + panic(shortA) + case len(jpvt) != n: + panic(badLenJpvt) + case len(tau) < minmn: + panic(shortTau) + } + + jpvt32 := make([]int32, n) for i, v := range jpvt { v++ if v != int(int32(v)) || v < 0 || n < v { - panic("lapack: jpvt element out of range") + panic(badJpvt) } jpvt32[i] = int32(v) } - lapacke.Dgeqp3(m, n, a, lda, jpvt32, tau, work, lwork) - for i, v := range jpvt32 { jpvt[i] = int(v - 1) } } // Dgerqf computes an RQ factorization of the m×n matrix A, -// A = R * Q. +// +// A = R * Q. +// // On exit, if m <= n, the upper triangle of the subarray // A[0:m, n-m:n] contains the m×m upper triangular matrix R. // If m >= n, the elements on and above the (m-n)-th subdiagonal @@ -193,9 +119,13 @@ func (impl Implementation) Dgeqp3(m, n int, a []float64, lda int, jpvt []int, ta // reflectors. // // The matrix Q is represented as a product of elementary reflectors -// Q = H_0 H_1 . . . H_{min(m,n)-1}. +// +// Q = H_0 H_1 . . . H_{min(m,n)-1}. +// // Each H(i) has the form -// H_i = I - tau_i * v * v^T +// +// H_i = I - tau_i * v * v^T +// // where v is a vector with v[0:n-k+i-1] stored in A[m-k+i, 0:n-k+i-1], // v[n-k+i:n] = 0 and v[n-k+i] = 1. // @@ -205,18 +135,36 @@ func (impl Implementation) Dgeqp3(m, n int, a []float64, lda int, jpvt []int, ta // // Dgerqf is an internal routine. It is exported for testing purposes. func (impl Implementation) Dgerqf(m, n int, a []float64, lda int, tau, work []float64, lwork int) { - checkMatrix(m, n, a, lda) - - if len(work) < max(1, lwork) { + switch { + case m < 0: + panic(mLT0) + case n < 0: + panic(nLT0) + case lda < max(1, n): + panic(badLdA) + case lwork < max(1, m) && lwork != -1: + panic(badLWork) + case len(work) < max(1, lwork): panic(shortWork) } - if lwork != -1 && lwork < max(1, m) { - panic(badWork) - } + // Quick return if possible. k := min(m, n) - if len(tau) != k { - panic(badTau) + if k == 0 { + work[0] = 1 + return + } + + if lwork == -1 { + lapacke.Dgerqf(m, n, a, lda, tau, work, -1) + return + } + + switch { + case len(a) < (m-1)*lda+n: + panic(shortA) + case len(tau) != k: + panic(badLenTau) } lapacke.Dgerqf(m, n, a, lda, tau, work, lwork) @@ -229,8 +177,10 @@ func (impl Implementation) Dgerqf(m, n int, a []float64, lda int, tau, work []fl // used on the next call. // On the initial call, kase must be 0. // In between calls, x must be overwritten by -// A * X if kase was returned as 1, -// A^T * X if kase was returned as 2, +// +// A * X if kase was returned as 1, +// A^T * X if kase was returned as 2, +// // and all other parameters must not be changed. // On the final return, kase is returned as 0, v contains A*W where W is a // vector, and est = norm(V)/norm(W) is a lower bound for 1-norm of A. @@ -240,25 +190,22 @@ func (impl Implementation) Dgerqf(m, n int, a []float64, lda int, tau, work []fl // // Dlacn2 is an internal routine. It is exported for testing purposes. func (impl Implementation) Dlacn2(n int, v, x []float64, isgn []int, est float64, kase int, isave *[3]int) (float64, int) { - if n < 1 { - panic("lapack: non-positive n") - } - checkVector(n, x, 1) - checkVector(n, v, 1) - if len(isgn) < n { - panic("lapack: insufficient isgn length") - } - if isave[0] < 0 || isave[0] > 5 { - panic("lapack: bad isave value") - } - if isave[0] == 0 && kase != 0 { - panic("lapack: bad isave value") + switch { + case n < 1: + panic(nLT1) + case len(v) < n: + panic(shortV) + case len(x) < n: + panic(shortX) + case len(isgn) < n: + panic(shortIsgn) + case isave[0] < 0 || 5 < isave[0]: + panic(badIsave) + case isave[0] == 0 && kase != 0: + panic(badIsave) } isgn32 := make([]int32, n) - for i, v := range isgn { - isgn32[i] = int32(v) - } pest := []float64{est} // Save one allocation by putting isave and kase into the same slice. isavekase := []int32{int32(isave[0]), int32(isave[1]), int32(isave[2]), int32(kase)} @@ -277,9 +224,85 @@ func (impl Implementation) Dlacn2(n int, v, x []float64, isgn []int, est float64 // a triangular portion with blas.Upper or blas.Lower, or can specify all of the // elemest with blas.All. func (impl Implementation) Dlacpy(uplo blas.Uplo, m, n int, a []float64, lda int, b []float64, ldb int) { - checkMatrix(m, n, a, lda) - checkMatrix(m, n, b, ldb) - lapacke.Dlacpy(uplo, m, n, a, lda, b, ldb) + switch { + case uplo != blas.Upper && uplo != blas.Lower && uplo != blas.All: + panic(badUplo) + case m < 0: + panic(mLT0) + case n < 0: + panic(nLT0) + case lda < max(1, n): + panic(badLdA) + case ldb < max(1, n): + panic(badLdB) + } + + if m == 0 || n == 0 { + return + } + + switch { + case len(a) < (m-1)*lda+n: + panic(shortA) + case len(b) < (m-1)*ldb+n: + panic(shortB) + } + + lapacke.Dlacpy(byte(uplo), m, n, a, lda, b, ldb) +} + +// Dlapmr rearranges the rows of the m×n matrix X as specified by the permutation +// k[0],k[1],...,k[m-1] of the integers 0,...,m-1. +// +// If forward is true, a forward permutation is applied: +// +// X[k[i],0:n] is moved to X[i,0:n] for i=0,1,...,m-1. +// +// If forward is false, a backward permutation is applied: +// +// X[i,0:n] is moved to X[k[i],0:n] for i=0,1,...,m-1. +// +// k must have length m, otherwise Dlapmr will panic. +func (impl Implementation) Dlapmr(forward bool, m, n int, x []float64, ldx int, k []int) { + switch { + case m < 0: + panic(mLT0) + case n < 0: + panic(nLT0) + case ldx < max(1, n): + panic(badLdX) + } + + // Quick return if possible. + if m == 0 || n == 0 { + return + } + + switch { + case len(x) < (m-1)*ldx+n: + panic(shortX) + case len(k) != m: + panic(badLenK) + } + + // Quick return if possible. + if m == 1 { + return + } + + var forwrd int32 + if forward { + forwrd = 1 + } + k32 := make([]int32, m) + for i, v := range k { + v++ // Convert to 1-based indexing. + if v != int(int32(v)) { + panic("lapack: k element out of range") + } + k32[i] = int32(v) + } + lapacke.Dlapmr(forwrd, m, n, x, ldx, k32) } // Dlapmt rearranges the columns of the m×n matrix X as specified by the @@ -287,20 +310,37 @@ func (impl Implementation) Dlacpy(uplo blas.Uplo, m, n int, a []float64, lda int // // If forward is true a forward permutation is performed: // -// X[0:m, k[j]] is moved to X[0:m, j] for j = 0, 1, ..., n-1. +// X[0:m, k[j]] is moved to X[0:m, j] for j = 0, 1, ..., n-1. // // otherwise a backward permutation is performed: // -// X[0:m, j] is moved to X[0:m, k[j]] for j = 0, 1, ..., n-1. +// X[0:m, j] is moved to X[0:m, k[j]] for j = 0, 1, ..., n-1. // // k must have length n, otherwise Dlapmt will panic. k is zero-indexed. func (impl Implementation) Dlapmt(forward bool, m, n int, x []float64, ldx int, k []int) { - checkMatrix(m, n, x, ldx) - if len(k) != n { - panic(badKperm) + switch { + case m < 0: + panic(mLT0) + case n < 0: + panic(nLT0) + case ldx < max(1, n): + panic(badLdX) } - if n <= 1 { + // Quick return if possible. + if m == 0 || n == 0 { + return + } + + switch { + case len(x) < (m-1)*ldx+n: + panic(shortX) + case len(k) != n: + panic(badLenK) + } + + // Quick return if possible. + if n == 1 { return } @@ -308,7 +348,7 @@ func (impl Implementation) Dlapmt(forward bool, m, n int, x []float64, ldx int, if forward { forwrd = 1 } - k32 := make([]int32, len(k)) + k32 := make([]int32, n) for i, v := range k { v++ // Convert to 1-based indexing. if v != int(int32(v)) { @@ -316,7 +356,6 @@ func (impl Implementation) Dlapmt(forward bool, m, n int, x []float64, ldx int, } k32[i] = int32(v) } - lapacke.Dlapmt(forwrd, m, n, x, ldx, k32) } @@ -330,36 +369,48 @@ func (Implementation) Dlapy2(x, y float64) float64 { // Dlarfb applies a block reflector to a matrix. // // In the call to Dlarfb, the mxn c is multiplied by the implicitly defined matrix h as follows: -// c = h * c if side == Left and trans == NoTrans -// c = c * h if side == Right and trans == NoTrans -// c = h^T * c if side == Left and trans == Trans -// c = c * h^T if side == Right and trans == Trans +// +// c = h * c if side == Left and trans == NoTrans +// c = c * h if side == Right and trans == NoTrans +// c = h^T * c if side == Left and trans == Trans +// c = c * h^T if side == Right and trans == Trans +// // h is a product of elementary reflectors. direct sets the direction of multiplication -// h = h_1 * h_2 * ... * h_k if direct == Forward -// h = h_k * h_k-1 * ... * h_1 if direct == Backward +// +// h = h_1 * h_2 * ... * h_k if direct == Forward +// h = h_k * h_k-1 * ... * h_1 if direct == Backward +// // The combination of direct and store defines the orientation of the elementary // reflectors. In all cases the ones on the diagonal are implicitly represented. // // If direct == lapack.Forward and store == lapack.ColumnWise -// V = [ 1 ] -// [v1 1 ] -// [v1 v2 1] -// [v1 v2 v3] -// [v1 v2 v3] +// +// V = [ 1 ] +// [v1 1 ] +// [v1 v2 1] +// [v1 v2 v3] +// [v1 v2 v3] +// // If direct == lapack.Forward and store == lapack.RowWise -// V = [ 1 v1 v1 v1 v1] -// [ 1 v2 v2 v2] -// [ 1 v3 v3] +// +// V = [ 1 v1 v1 v1 v1] +// [ 1 v2 v2 v2] +// [ 1 v3 v3] +// // If direct == lapack.Backward and store == lapack.ColumnWise -// V = [v1 v2 v3] -// [v1 v2 v3] -// [ 1 v2 v3] -// [ 1 v3] -// [ 1] +// +// V = [v1 v2 v3] +// [v1 v2 v3] +// [ 1 v2 v3] +// [ 1 v3] +// [ 1] +// // If direct == lapack.Backward and store == lapack.RowWise -// V = [v1 v1 1 ] -// [v2 v2 v2 1 ] -// [v3 v3 v3 v3 1] +// +// V = [v1 v1 1 ] +// [v2 v2 v2 1 ] +// [v3 v3 v3 v3 1] +// // An elementary reflector can be explicitly constructed by extracting the // corresponding elements of v, placing a 1 where the diagonal would be, and // placing zeros in the remaining elements. @@ -373,34 +424,58 @@ func (Implementation) Dlapy2(x, y float64) float64 { // // Dlarfb is an internal routine. It is exported for testing purposes. func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack.Direct, store lapack.StoreV, m, n, k int, v []float64, ldv int, t []float64, ldt int, c []float64, ldc int, work []float64, ldwork int) { - if side != blas.Left && side != blas.Right { - panic(badSide) + nv := m + if side == blas.Right { + nv = n } - if trans != blas.Trans && trans != blas.NoTrans { + switch { + case side != blas.Left && side != blas.Right: + panic(badSide) + case trans != blas.Trans && trans != blas.NoTrans: panic(badTrans) - } - if direct != lapack.Forward && direct != lapack.Backward { + case direct != lapack.Forward && direct != lapack.Backward: panic(badDirect) - } - if store != lapack.ColumnWise && store != lapack.RowWise { - panic(badStore) - } - checkMatrix(m, n, c, ldc) - if k < 0 { + case store != lapack.ColumnWise && store != lapack.RowWise: + panic(badStoreV) + case m < 0: + panic(mLT0) + case n < 0: + panic(nLT0) + case k < 0: panic(kLT0) + case store == lapack.ColumnWise && ldv < max(1, k): + panic(badLdV) + case store == lapack.RowWise && ldv < max(1, nv): + panic(badLdV) + case ldt < max(1, k): + panic(badLdT) + case ldc < max(1, n): + panic(badLdC) + case ldwork < max(1, k): + panic(badLdWork) } - checkMatrix(k, k, t, ldt) - nv := m + + if m == 0 || n == 0 { + return + } + nw := n if side == blas.Right { - nv = n nw = m } - if store == lapack.ColumnWise { - checkMatrix(nv, k, v, ldv) - } else { - checkMatrix(k, nv, v, ldv) + switch { + case store == lapack.ColumnWise && len(v) < (nv-1)*ldv+k: + panic(shortV) + case store == lapack.RowWise && len(v) < (k-1)*ldv+nv: + panic(shortV) + case len(t) < (k-1)*ldt+k: + panic(shortT) + case len(c) < (m-1)*ldc+n: + panic(shortC) + case len(work) < (nw-1)*ldwork+k: + panic(shortWork) } + // TODO(vladimir-ch): Replace the following two lines with // checkMatrix(nw, k, work, ldwork) // if and when the issue @@ -409,29 +484,45 @@ func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack ldwork = nw work = make([]float64, ldwork*k) - lapacke.Dlarfb(side, trans, byte(direct), byte(store), m, n, k, v, ldv, t, ldt, c, ldc, work, ldwork) + lapacke.Dlarfb(byte(side), byte(trans), byte(direct), byte(store), m, n, k, v, ldv, t, ldt, c, ldc, work, ldwork) } // Dlarfg generates an elementary reflector for a Householder matrix. It creates // a real elementary reflector of order n such that -// H * (alpha) = (beta) -// ( x) ( 0) -// H^T * H = I +// +// H * (alpha) = (beta) +// ( x) ( 0) +// H^T * H = I +// // H is represented in the form -// H = 1 - tau * (1; v) * (1 v^T) +// +// H = 1 - tau * (1; v) * (1 v^T) +// // where tau is a real scalar. // // On entry, x contains the vector x, on exit it contains v. // // Dlarfg is an internal routine. It is exported for testing purposes. func (impl Implementation) Dlarfg(n int, alpha float64, x []float64, incX int) (beta, tau float64) { - if n < 0 { + switch { + case n < 0: panic(nLT0) + case incX <= 0: + panic(badIncX) } + if n <= 1 { return alpha, 0 } - checkVector(n-1, x, incX) + + aincX := incX + if aincX < 0 { + aincX = -aincX + } + if len(x) < 1+(n-2)*aincX { + panic(shortX) + } + _alpha := []float64{alpha} _tau := []float64{0} lapacke.Dlarfg(n, _alpha, x, incX, _tau) @@ -440,11 +531,14 @@ func (impl Implementation) Dlarfg(n int, alpha float64, x []float64, incX int) ( // Dlarft forms the triangular factor T of a block reflector H, storing the answer // in t. -// H = I - V * T * V^T if store == lapack.ColumnWise -// H = I - V^T * T * V if store == lapack.RowWise +// +// H = I - V * T * V^T if store == lapack.ColumnWise +// H = I - V^T * T * V if store == lapack.RowWise +// // H is defined by a product of the elementary reflectors where -// H = H_0 * H_1 * ... * H_{k-1} if direct == lapack.Forward -// H = H_{k-1} * ... * H_1 * H_0 if direct == lapack.Backward +// +// H = H_0 * H_1 * ... * H_{k-1} if direct == lapack.Forward +// H = H_{k-1} * ... * H_1 * H_0 if direct == lapack.Backward // // t is a k×k triangular matrix. t is upper triangular if direct = lapack.Forward // and lower triangular otherwise. This function will panic if t is not of @@ -456,46 +550,72 @@ func (impl Implementation) Dlarfg(n int, alpha float64, x []float64, incX int) ( // tau contains the scalar factors of the elementary reflectors H_i. // // Dlarft is an internal routine. It is exported for testing purposes. -func (Implementation) Dlarft(direct lapack.Direct, store lapack.StoreV, n, k int, - v []float64, ldv int, tau []float64, t []float64, ldt int) { - if n == 0 { - return +func (Implementation) Dlarft(direct lapack.Direct, store lapack.StoreV, n, k int, v []float64, ldv int, tau []float64, t []float64, ldt int) { + mv, nv := n, k + if store == lapack.RowWise { + mv, nv = k, n } - if n < 0 || k < 0 { - panic(negDimension) - } - if direct != lapack.Forward && direct != lapack.Backward { + switch { + case direct != lapack.Forward && direct != lapack.Backward: panic(badDirect) + case store != lapack.RowWise && store != lapack.ColumnWise: + panic(badStoreV) + case n < 0: + panic(nLT0) + case k < 1: + panic(kLT1) + case ldv < max(1, nv): + panic(badLdV) + case len(tau) < k: + panic(shortTau) + case ldt < max(1, k): + panic(shortT) } - if store != lapack.RowWise && store != lapack.ColumnWise { - panic(badStore) + + if n == 0 { + return } - if len(tau) < k { - panic(badTau) + + switch { + case len(v) < (mv-1)*ldv+nv: + panic(shortV) + case len(t) < (k-1)*ldt+k: + panic(shortT) } - checkMatrix(k, k, t, ldt) lapacke.Dlarft(byte(direct), byte(store), n, k, v, ldv, tau, t, ldt) } // Dlange computes the matrix norm of the general m×n matrix a. The input norm // specifies the norm computed. -// lapack.MaxAbs: the maximum absolute value of an element. -// lapack.MaxColumnSum: the maximum column sum of the absolute values of the entries. -// lapack.MaxRowSum: the maximum row sum of the absolute values of the entries. -// lapack.NormFrob: the square root of the sum of the squares of the entries. +// +// lapack.MaxAbs: the maximum absolute value of an element. +// lapack.MaxColumnSum: the maximum column sum of the absolute values of the entries. +// lapack.MaxRowSum: the maximum row sum of the absolute values of the entries. +// lapack.Frobenius: the square root of the sum of the squares of the entries. +// // If norm == lapack.MaxColumnSum, work must be of length n, and this function will panic otherwise. // There are no restrictions on work for the other matrix norms. func (impl Implementation) Dlange(norm lapack.MatrixNorm, m, n int, a []float64, lda int, work []float64) float64 { - checkMatrix(m, n, a, lda) - switch norm { - case lapack.MaxRowSum, lapack.MaxColumnSum, lapack.NormFrob, lapack.MaxAbs: - default: + switch { + case norm != lapack.MaxRowSum && norm != lapack.MaxColumnSum && norm != lapack.Frobenius && norm != lapack.MaxAbs: panic(badNorm) + case lda < max(1, n): + panic(badLdA) } - if norm == lapack.MaxColumnSum && len(work) < n { - panic(badWork) + + // Quick return if possible. + if m == 0 || n == 0 { + return 0 } + + switch { + case len(a) < (m-1)*lda+n: + panic(badLdA) + case norm == lapack.MaxColumnSum && len(work) < n: + panic(shortWork) + } + return lapacke.Dlange(byte(norm), m, n, a, lda, work) } @@ -503,41 +623,74 @@ func (impl Implementation) Dlange(norm lapack.MatrixNorm, m, n int, a []float64, // norm == lapack.MaxColumnSum or norm == lapackMaxRowSum work must have length // at least n, otherwise work is unused. func (impl Implementation) Dlansy(norm lapack.MatrixNorm, uplo blas.Uplo, n int, a []float64, lda int, work []float64) float64 { - checkMatrix(n, n, a, lda) - switch norm { - case lapack.MaxRowSum, lapack.MaxColumnSum, lapack.NormFrob, lapack.MaxAbs: - default: + switch { + case norm != lapack.MaxRowSum && norm != lapack.MaxColumnSum && norm != lapack.Frobenius && norm != lapack.MaxAbs: panic(badNorm) + case uplo != blas.Upper && uplo != blas.Lower: + panic(badUplo) + case n < 0: + panic(nLT0) + case lda < max(1, n): + panic(badLdA) } - if (norm == lapack.MaxColumnSum || norm == lapack.MaxRowSum) && len(work) < n { - panic(badWork) + + // Quick return if possible. + if n == 0 { + return 0 } - if uplo != blas.Upper && uplo != blas.Lower { - panic(badUplo) + + switch { + case len(a) < (n-1)*lda+n: + panic(shortA) + case (norm == lapack.MaxColumnSum || norm == lapack.MaxRowSum) && len(work) < n: + panic(shortWork) } - return lapacke.Dlansy(byte(norm), uplo, n, a, lda, work) + + return lapacke.Dlansy(byte(norm), byte(uplo), n, a, lda, work) } // Dlantr computes the specified norm of an m×n trapezoidal matrix A. If // norm == lapack.MaxColumnSum work must have length at least n, otherwise work // is unused. func (impl Implementation) Dlantr(norm lapack.MatrixNorm, uplo blas.Uplo, diag blas.Diag, m, n int, a []float64, lda int, work []float64) float64 { - checkMatrix(m, n, a, lda) - switch norm { - case lapack.MaxRowSum, lapack.MaxColumnSum, lapack.NormFrob, lapack.MaxAbs: - default: + switch { + case norm != lapack.MaxRowSum && norm != lapack.MaxColumnSum && norm != lapack.Frobenius && norm != lapack.MaxAbs: panic(badNorm) - } - if uplo != blas.Upper && uplo != blas.Lower { + case uplo != blas.Upper && uplo != blas.Lower: panic(badUplo) - } - if diag != blas.Unit && diag != blas.NonUnit { + case diag != blas.Unit && diag != blas.NonUnit: panic(badDiag) + case m < 0: + panic(mLT0) + case uplo == blas.Upper && m > n: + panic(mGTN) + case n < 0: + panic(nLT0) + case uplo == blas.Lower && n > m: + panic(nGTM) + case lda < max(1, n): + panic(badLdA) } - if norm == lapack.MaxColumnSum && len(work) < n { - panic(badWork) + + // Quick return if possible. + minmn := min(m, n) + if minmn == 0 { + return 0 + } + + switch { + case len(a) < (m-1)*lda+n: + panic(shortA) + case norm == lapack.MaxColumnSum && len(work) < n: + panic(shortWork) + } + + if norm == lapack.MaxRowSum && len(work) < m { + // Allocate new work to be on the safe side because the expectation of LAPACKE on + // row-major input is unclear. + work = make([]float64, m) } - return lapacke.Dlantr(byte(norm), uplo, diag, m, n, a, lda, work) + return lapacke.Dlantr(byte(norm), byte(uplo), byte(diag), m, n, a, lda, work) } // Dlarfx applies an elementary reflector H to a real m×n matrix C, from either @@ -545,7 +698,9 @@ func (impl Implementation) Dlantr(norm lapack.MatrixNorm, uplo blas.Uplo, diag b // than 11. // // H is represented in the form -// H = I - tau * v * v^T, +// +// H = I - tau * v * v^T, +// // where tau is a real scalar and v is a real vector. If tau = 0, then H is // taken to be the identity matrix. // @@ -559,119 +714,481 @@ func (impl Implementation) Dlantr(norm lapack.MatrixNorm, uplo blas.Uplo, diag b // == blas.Right, otherwise Dlarfx will panic. work is not referenced if H has // order < 11. func (impl Implementation) Dlarfx(side blas.Side, m, n int, v []float64, tau float64, c []float64, ldc int, work []float64) { - checkMatrix(m, n, c, ldc) - switch side { - case blas.Left: - checkVector(m, v, 1) - if len(work) < n && m > 10 { - panic(badWork) + switch { + case side != blas.Left && side != blas.Right: + panic(badSide) + case m < 0: + panic(mLT0) + case n < 0: + panic(nLT0) + case ldc < max(1, n): + panic(badLdC) + } + + // Quick return if possible. + if m == 0 || n == 0 { + return + } + + nh := m + lwork := n + if side == blas.Right { + nh = n + lwork = m + } + switch { + case len(v) < nh: + panic(shortV) + case len(c) < (m-1)*ldc+n: + panic(shortC) + case nh > 10 && len(work) < lwork: + panic(shortWork) + } + + lapacke.Dlarfx(byte(side), m, n, v, tau, c, ldc, work) +} + +// Dlascl multiplies an m×n matrix by the scalar cto/cfrom. +// +// cfrom must not be zero, and cto and cfrom must not be NaN, otherwise Dlascl +// will panic. +// +// Dlascl is an internal routine. It is exported for testing purposes. +func (impl Implementation) Dlascl(kind lapack.MatrixType, kl, ku int, cfrom, cto float64, m, n int, a []float64, lda int) { + switch kind { + default: + panic(badMatrixType) + case 'H', 'B', 'Q', 'Z': // See dlascl.f. + case lapack.General, lapack.UpperTri, lapack.LowerTri: + if lda < max(1, n) { + panic(badLdA) } - case blas.Right: - checkVector(n, v, 1) - if len(work) < m && n > 10 { - panic(badWork) + } + switch { + case cfrom == 0: + panic(zeroCFrom) + case math.IsNaN(cfrom): + panic(nanCFrom) + case math.IsNaN(cto): + panic(nanCTo) + case m < 0: + panic(mLT0) + case n < 0: + panic(nLT0) + } + + if n == 0 || m == 0 { + return + } + + switch kind { + case lapack.General, lapack.UpperTri, lapack.LowerTri: + if len(a) < (m-1)*lda+n { + panic(shortA) } - default: - panic(badSide) } - lapacke.Dlarfx(side, m, n, v, tau, c, ldc, work) + lapacke.Dlascl(byte(kind), kl, ku, cfrom, cto, m, n, a, lda) +} + +// Dlaset sets the off-diagonal elements of A to alpha, and the diagonal +// elements to beta. If uplo == blas.Upper, only the elements in the upper +// triangular part are set. If uplo == blas.Lower, only the elements in the +// lower triangular part are set. If uplo is otherwise, all of the elements of A +// are set. +// +// Dlaset is an internal routine. It is exported for testing purposes. +func (impl Implementation) Dlaset(uplo blas.Uplo, m, n int, alpha, beta float64, a []float64, lda int) { + switch { + case m < 0: + panic(mLT0) + case n < 0: + panic(nLT0) + case lda < max(1, n): + panic(badLdA) + } + + minmn := min(m, n) + if minmn == 0 { + return + } + + if len(a) < (m-1)*lda+n { + panic(shortA) + } + + lapacke.Dlaset(byte(uplo), m, n, alpha, beta, a, lda) +} + +// Dlasrt sorts the numbers in the input slice d. If s == lapack.SortIncreasing, +// the elements are sorted in increasing order. If s == lapack.SortDecreasing, +// the elements are sorted in decreasing order. For other values of s Dlasrt +// will panic. +// +// Dlasrt is an internal routine. It is exported for testing purposes. +func (impl Implementation) Dlasrt(s lapack.Sort, n int, d []float64) { + switch { + case s != lapack.SortIncreasing && s != lapack.SortDecreasing: + panic(badSort) + case n < 0: + panic(nLT0) + case len(d) < n: + panic(shortD) + } + + lapacke.Dlasrt(byte(s), n, d[:n]) +} + +// Dlaswp swaps the rows k1 to k2 of a rectangular matrix A according to the +// indices in ipiv so that row k is swapped with ipiv[k]. +// +// n is the number of columns of A and incX is the increment for ipiv. If incX +// is 1, the swaps are applied from k1 to k2. If incX is -1, the swaps are +// applied in reverse order from k2 to k1. For other values of incX Dlaswp will +// panic. ipiv must have length k2+1, otherwise Dlaswp will panic. +// +// The indices k1, k2, and the elements of ipiv are zero-based. +// +// Dlaswp is an internal routine. It is exported for testing purposes. +func (impl Implementation) Dlaswp(n int, a []float64, lda, k1, k2 int, ipiv []int, incX int) { + switch { + case n < 0: + panic(nLT0) + case k2 < 0: + panic(badK2) + case k1 < 0 || k2 < k1: + panic(badK1) + case lda < max(1, n): + panic(badLdA) + case len(a) < (k2-1)*lda+n: + panic(shortA) + case len(ipiv) != k2+1: + panic(badLenIpiv) + case incX != 1 && incX != -1: + panic(absIncNotOne) + } + + if n == 0 { + return + } + + ipiv32 := make([]int32, k2+1) + for i, v := range ipiv { + v++ + if v != int(int32(v)) { + panic("lapack: ipiv element out of range") + } + ipiv32[i] = int32(v) + } + lapacke.Dlaswp(n, a, lda, k1+1, k2+1, ipiv32, incX) +} + +// Dpbcon returns an estimate of the reciprocal of the condition number (in the +// 1-norm) of an n×n symmetric positive definite band matrix using the Cholesky +// factorization +// +// A = Uᵀ*U if uplo == blas.Upper +// A = L*Lᵀ if uplo == blas.Lower +// +// computed by Dpbtrf. The estimate is obtained for norm(inv(A)), and the +// reciprocal of the condition number is computed as +// +// rcond = 1 / (anorm * norm(inv(A))). +// +// The length of work must be at least 3*n and the length of iwork must be at +// least n. +func (impl Implementation) Dpbcon(uplo blas.Uplo, n, kd int, ab []float64, ldab int, anorm float64, work []float64, iwork []int) (rcond float64) { + switch { + case uplo != blas.Upper && uplo != blas.Lower: + panic(badUplo) + case n < 0: + panic(nLT0) + case kd < 0: + panic(kdLT0) + case ldab < kd+1: + panic(badLdA) + case anorm < 0: + panic(badNorm) + } + + // Quick return if possible. + if n == 0 { + return 1 + } + + switch { + case len(ab) < (n-1)*ldab+kd+1: + panic(shortAB) + case len(work) < 3*n: + panic(shortWork) + case len(iwork) < n: + panic(shortIWork) + } + + _ldab := n + _ab := make([]float64, (kd+1)*_ldab) + bandTriToLapacke(uplo, n, kd, ab, ldab, _ab, _ldab) + _rcond := []float64{0} + _iwork := make([]int32, n) + lapacke.Dpbcon(byte(uplo), n, kd, _ab, _ldab, anorm, _rcond, work, _iwork) + return _rcond[0] +} + +// Dpbtrf computes the Cholesky factorization of an n×n symmetric positive +// definite band matrix +// +// A = U^T * U if uplo == blas.Upper +// A = L * L^T if uplo == blas.Lower +// +// where U is an upper triangular band matrix and L is lower triangular. kd is +// the number of super- or sub-diagonals of A. +// +// The band storage scheme is illustrated below when n = 6 and kd = 2. Elements +// marked * are not used by the function. +// +// uplo == blas.Upper +// On entry: On return: +// a00 a01 a02 u00 u01 u02 +// a11 a12 a13 u11 u12 u13 +// a22 a23 a24 u22 u23 u24 +// a33 a34 a35 u33 u34 u35 +// a44 a45 * u44 u45 * +// a55 * * u55 * * +// +// uplo == blas.Lower +// On entry: On return: +// * * a00 * * l00 +// * a10 a11 * l10 l11 +// a20 a21 a22 l20 l21 l22 +// a31 a32 a33 l31 l32 l33 +// a42 a43 a44 l42 l43 l44 +// a53 a54 a55 l53 l54 l55 +func (impl Implementation) Dpbtrf(uplo blas.Uplo, n, kd int, ab []float64, ldab int) (ok bool) { + switch { + case uplo != blas.Upper && uplo != blas.Lower: + panic(badUplo) + case n < 0: + panic(nLT0) + case kd < 0: + panic(kdLT0) + case ldab < kd+1: + panic(badLdA) + } + + // Quick return if possible. + if n == 0 { + return true + } + + if len(ab) < (n-1)*ldab+kd+1 { + panic(shortAB) + } + + ldabConv := n + abConv := make([]float64, (kd+1)*ldabConv) + bandTriToLapacke(uplo, n, kd, ab, ldab, abConv, ldabConv) + info := lapacke.Dpbtrf(byte(uplo), n, kd, abConv, ldabConv) + bandTriToGonum(uplo, n, kd, abConv, ldabConv, ab, ldab) + return info +} + +// Dpbtrs solves a system of linear equations A*X = B with an n×n symmetric +// positive definite band matrix A using the Cholesky factorization +// +// A = U^T * U if uplo == blas.Upper +// A = L * L^T if uplo == blas.Lower +// +// computed by Dpbtrf. kd is the number of super- or sub-diagonals of A. See the +// documentation for Dpbtrf for a description of the band storage format of A. +// +// On entry, b contains the n×nrhs right hand side matrix B. On return, it is +// overwritten with the solution matrix X. +func (Implementation) Dpbtrs(uplo blas.Uplo, n, kd, nrhs int, ab []float64, ldab int, b []float64, ldb int) { + switch { + case uplo != blas.Upper && uplo != blas.Lower: + panic(badUplo) + case n < 0: + panic(nLT0) + case kd < 0: + panic(kdLT0) + case nrhs < 0: + panic(nrhsLT0) + case ldab < kd+1: + panic(badLdA) + case ldb < max(1, nrhs): + panic(badLdB) + } + + // Quick return if possible. + if n == 0 || nrhs == 0 { + return + } + + if len(ab) < (n-1)*ldab+kd { + panic(shortAB) + } + if len(b) < (n-1)*ldb+nrhs { + panic(shortB) + } + + ldabConv := n + abConv := make([]float64, (kd+1)*ldabConv) + bandTriToLapacke(uplo, n, kd, ab, ldab, abConv, ldabConv) + lapacke.Dpbtrs(byte(uplo), n, kd, nrhs, abConv, ldabConv, b, ldb) +} + +// Dpotrf computes the Cholesky decomposition of the symmetric positive definite +// matrix a. If ul == blas.Upper, then a is stored as an upper-triangular matrix, +// and a = U U^T is stored in place into a. If ul == blas.Lower, then a = L L^T +// is computed and stored in-place into a. If a is not positive definite, false +// is returned. This is the blocked version of the algorithm. +func (impl Implementation) Dpotrf(ul blas.Uplo, n int, a []float64, lda int) (ok bool) { + switch { + case ul != blas.Upper && ul != blas.Lower: + panic(badUplo) + case n < 0: + panic(nLT0) + case lda < max(1, n): + panic(badLdA) + } + + // Quick return if possible. + if n == 0 { + return true + } + + if len(a) < (n-1)*lda+n { + panic(shortA) + } + + return lapacke.Dpotrf(byte(ul), n, a, lda) +} + +// Dpotri computes the inverse of a real symmetric positive definite matrix A +// using its Cholesky factorization. +// +// On entry, a contains the triangular factor U or L from the Cholesky +// factorization A = U^T*U or A = L*L^T, as computed by Dpotrf. +// On return, a contains the upper or lower triangle of the (symmetric) +// inverse of A, overwriting the input factor U or L. +func (impl Implementation) Dpotri(uplo blas.Uplo, n int, a []float64, lda int) (ok bool) { + switch { + case uplo != blas.Upper && uplo != blas.Lower: + panic(badUplo) + case n < 0: + panic(nLT0) + case lda < max(1, n): + panic(badLdA) + } + + // Quick return if possible. + if n == 0 { + return true + } + + if len(a) < (n-1)*lda+n { + panic(shortA) + } + + return lapacke.Dpotri(byte(uplo), n, a, lda) +} + +// Dpotrs solves a system of n linear equations A*X = B where A is an n×n +// symmetric positive definite matrix and B is an n×nrhs matrix. The matrix A is +// represented by its Cholesky factorization +// +// A = U^T*U if uplo == blas.Upper +// A = L*L^T if uplo == blas.Lower +// +// as computed by Dpotrf. On entry, B contains the right-hand side matrix B, on +// return it contains the solution matrix X. +func (Implementation) Dpotrs(uplo blas.Uplo, n, nrhs int, a []float64, lda int, b []float64, ldb int) { + switch { + case uplo != blas.Upper && uplo != blas.Lower: + panic(badUplo) + case n < 0: + panic(nLT0) + case nrhs < 0: + panic(nrhsLT0) + case lda < max(1, n): + panic(badLdA) + case ldb < max(1, nrhs): + panic(badLdB) + } + + // Quick return if possible. + if n == 0 || nrhs == 0 { + return + } + + switch { + case len(a) < (n-1)*lda+n: + panic(shortA) + case len(b) < (n-1)*ldb+nrhs: + panic(shortB) + } + + lapacke.Dpotrs(byte(uplo), n, nrhs, a, lda, b, ldb) } -// Dlascl multiplies an m×n matrix by the scalar cto/cfrom. +// Dpstrf computes the Cholesky factorization with complete pivoting of an n×n +// symmetric positive semidefinite matrix A. // -// cfrom must not be zero, and cto and cfrom must not be NaN, otherwise Dlascl -// will panic. +// The factorization has the form // -// Dlascl is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlascl(kind lapack.MatrixType, kl, ku int, cfrom, cto float64, m, n int, a []float64, lda int) { - checkMatrix(m, n, a, lda) - if cfrom == 0 { - panic(zeroDiv) - } - if math.IsNaN(cfrom) || math.IsNaN(cto) { - panic(nanScale) - } - lapacke.Dlascl(byte(kind), kl, ku, cfrom, cto, m, n, a, lda) -} - -// Dlaset sets the off-diagonal elements of A to alpha, and the diagonal -// elements to beta. If uplo == blas.Upper, only the elements in the upper -// triangular part are set. If uplo == blas.Lower, only the elements in the -// lower triangular part are set. If uplo is otherwise, all of the elements of A -// are set. +// Pᵀ * A * P = Uᵀ * U , if uplo = blas.Upper, +// Pᵀ * A * P = L * Lᵀ, if uplo = blas.Lower, // -// Dlaset is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlaset(uplo blas.Uplo, m, n int, alpha, beta float64, a []float64, lda int) { - checkMatrix(m, n, a, lda) - lapacke.Dlaset(uplo, m, n, alpha, beta, a, lda) -} - -// Dlasrt sorts the numbers in the input slice d. If s == lapack.SortIncreasing, -// the elements are sorted in increasing order. If s == lapack.SortDecreasing, -// the elements are sorted in decreasing order. For other values of s Dlasrt -// will panic. +// where U is an upper triangular matrix, L is lower triangular, and P is a +// permutation matrix. // -// Dlasrt is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlasrt(s lapack.Sort, n int, d []float64) { - checkVector(n, d, 1) - switch s { - default: - panic(badSort) - case lapack.SortIncreasing, lapack.SortDecreasing: - } - lapacke.Dlasrt(byte(s), n, d[:n]) -} - -// Dlaswp swaps the rows k1 to k2 of a rectangular matrix A according to the -// indices in ipiv so that row k is swapped with ipiv[k]. +// tol is a user-defined tolerance. The algorithm terminates if the pivot is +// less than or equal to tol. If tol is negative, then n*eps*max(A[k,k]) will be +// used instead. // -// n is the number of columns of A and incX is the increment for ipiv. If incX -// is 1, the swaps are applied from k1 to k2. If incX is -1, the swaps are -// applied in reverse order from k2 to k1. For other values of incX Dlaswp will -// panic. ipiv must have length k2+1, otherwise Dlaswp will panic. +// On return, A contains the factor U or L from the Cholesky factorization and +// piv contains P stored such that P[piv[k],k] = 1. // -// The indices k1, k2, and the elements of ipiv are zero-based. +// Dpstrf returns the computed rank of A and whether the factorization can be +// used to solve a system. Dpstrf does not attempt to check that A is positive +// semi-definite, so if ok is false, the matrix A is either rank deficient or is +// not positive semidefinite. // -// Dlaswp is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlaswp(n int, a []float64, lda, k1, k2 int, ipiv []int, incX int) { +// The length of piv must be n and the length of work must be at least 2*n, +// otherwise Dpstrf will panic. +// +// Dpstrf is an internal routine. It is exported for testing purposes. +func (impl Implementation) Dpstrf(uplo blas.Uplo, n int, a []float64, lda int, piv []int, tol float64, work []float64) (rank int, ok bool) { switch { + case uplo != blas.Upper && uplo != blas.Lower: + panic(badUplo) case n < 0: panic(nLT0) - case k2 < 0: - panic(badK2) - case k1 < 0 || k2 < k1: - panic(badK1) - case len(ipiv) != k2+1: - panic(badIpiv) - case incX != 1 && incX != -1: - panic(absIncNotOne) + case lda < max(1, n): + panic(badLdA) } - ipiv32 := make([]int32, len(ipiv)) - for i, v := range ipiv { - ipiv32[i] = int32(v + 1) + // Quick return if possible. + if n == 0 { + return 0, true } - lapacke.Dlaswp(n, a, lda, k1+1, k2+1, ipiv32, incX) -} -// Dpotrf computes the Cholesky decomposition of the symmetric positive definite -// matrix a. If ul == blas.Upper, then a is stored as an upper-triangular matrix, -// and a = U U^T is stored in place into a. If ul == blas.Lower, then a = L L^T -// is computed and stored in-place into a. If a is not positive definite, false -// is returned. This is the blocked version of the algorithm. -func (impl Implementation) Dpotrf(ul blas.Uplo, n int, a []float64, lda int) (ok bool) { - // ul is checked in lapacke.Dpotrf. - if n < 0 { - panic(nLT0) - } - if lda < n { - panic(badLdA) + switch { + case len(a) < (n-1)*lda+n: + panic(shortA) + case len(piv) != n: + panic(badLenPiv) + case len(work) < 2*n: + panic(shortWork) } - if n == 0 { - return true + + piv32 := make([]int32, n) + rank32 := make([]int32, 1) + ok = lapacke.Dpstrf(byte(uplo), n, a, lda, piv32, rank32, tol, work) + for i, v := range piv32 { + piv[i] = int(v) - 1 // Transform to zero-based indices. } - return lapacke.Dpotrf(ul, n, a, lda) + return int(rank32[0]), ok } // Dgebal balances an n×n matrix A. Balancing consists of two stages, permuting @@ -679,9 +1196,11 @@ func (impl Implementation) Dpotrf(ul blas.Uplo, n int, a []float64, lda int) (ok // // Permuting consists of applying a permutation matrix P such that the matrix // that results from P^T*A*P takes the upper block triangular form -// [ T1 X Y ] -// P^T A P = [ 0 B Z ], -// [ 0 0 T2 ] +// +// [ T1 X Y ] +// P^T A P = [ 0 B Z ], +// [ 0 0 T2 ] +// // where T1 and T2 are upper triangular matrices and B contains at least one // nonzero off-diagonal element in each row and column. The indices ilo and ihi // mark the starting and ending columns of the submatrix B. The eigenvalues of A @@ -691,9 +1210,11 @@ func (impl Implementation) Dpotrf(ul blas.Uplo, n int, a []float64, lda int) (ok // Scaling consists of applying a diagonal similarity transformation D such that // D^{-1}*B*D has the 1-norm of each row and its corresponding column nearly // equal. The output matrix is -// [ T1 X*D Y ] -// [ 0 inv(D)*B*D inv(D)*Z ]. -// [ 0 0 T2 ] +// +// [ T1 X*D Y ] +// [ 0 inv(D)*B*D inv(D)*Z ]. +// [ 0 0 T2 ] +// // Scaling may reduce the 1-norm of the matrix, and improve the accuracy of // the computed eigenvalues and/or eigenvectors. // @@ -704,33 +1225,51 @@ func (impl Implementation) Dpotrf(ul blas.Uplo, n int, a []float64, lda int) (ok // If job is lapack.PermuteScale, both permuting and scaling will be done. // // On return, if job is lapack.Permute or lapack.PermuteScale, it will hold that -// A[i,j] == 0, for i > j and j ∈ {0, ..., ilo-1, ihi+1, ..., n-1}. +// +// A[i,j] == 0, for i > j and j ∈ {0, ..., ilo-1, ihi+1, ..., n-1}. +// // If job is lapack.None or lapack.Scale, or if n == 0, it will hold that -// ilo == 0 and ihi == n-1. +// +// ilo == 0 and ihi == n-1. // // On return, scale will contain information about the permutations and scaling // factors applied to A. If π(j) denotes the index of the column interchanged // with column j, and D[j,j] denotes the scaling factor applied to column j, // then -// scale[j] == π(j), for j ∈ {0, ..., ilo-1, ihi+1, ..., n-1}, -// == D[j,j], for j ∈ {ilo, ..., ihi}. +// +// scale[j] == π(j), for j ∈ {0, ..., ilo-1, ihi+1, ..., n-1}, +// == D[j,j], for j ∈ {ilo, ..., ihi}. +// // scale must have length equal to n, otherwise Dgebal will panic. // // Dgebal is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dgebal(job lapack.Job, n int, a []float64, lda int, scale []float64) (ilo, ihi int) { - switch job { - default: - panic(badJob) - case lapack.None, lapack.Permute, lapack.Scale, lapack.PermuteScale: +func (impl Implementation) Dgebal(job lapack.BalanceJob, n int, a []float64, lda int, scale []float64) (ilo, ihi int) { + switch { + case job != lapack.BalanceNone && job != lapack.Permute && job != lapack.Scale && job != lapack.PermuteScale: + panic(badBalanceJob) + case n < 0: + panic(nLT0) + case lda < max(1, n): + panic(badLdA) + } + + ilo = 0 + ihi = n - 1 + + if n == 0 { + return ilo, ihi } - checkMatrix(n, n, a, lda) - if len(scale) != n { - panic("lapack: bad length of scale") + + switch { + case len(scale) != n: + panic(shortScale) + case len(a) < (n-1)*lda+n: + panic(shortA) } - ilo32 := make([]int32, 1) - ihi32 := make([]int32, 1) - lapacke.Dgebal(job, n, a, lda, ilo32, ihi32, scale) + ilo32 := []int32{0} + ihi32 := []int32{0} + lapacke.Dgebal(byte(job), n, a, lda, ilo32, ihi32, scale) ilo = int(ilo32[0]) - 1 ihi = int(ihi32[0]) - 1 for j := 0; j < ilo; j++ { @@ -743,8 +1282,10 @@ func (impl Implementation) Dgebal(job lapack.Job, n int, a []float64, lda int, s } // Dgebak transforms an n×m matrix V as -// V = P D V, if side == blas.Right, -// V = P D^{-1} V, if side == blas.Left, +// +// V = P D V, if side == blas.Right, +// V = P D^{-1} V, if side == blas.Left, +// // where P and D are n×n permutation and scaling matrices, respectively, // implicitly represented by job, scale, ilo and ihi as returned by Dgebal. // @@ -753,27 +1294,39 @@ func (impl Implementation) Dgebal(job lapack.Job, n int, a []float64, lda int, s // the eigenvectors of the original matrix. // // Dgebak is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dgebak(job lapack.Job, side lapack.EVSide, n, ilo, ihi int, scale []float64, m int, v []float64, ldv int) { - switch job { - default: - panic(badJob) - case lapack.None, lapack.Permute, lapack.Scale, lapack.PermuteScale: - } - var bside blas.Side - switch side { - default: - panic(badSide) - case lapack.LeftEV: - bside = blas.Left - case lapack.RightEV: - bside = blas.Right - } - checkMatrix(n, m, v, ldv) +func (impl Implementation) Dgebak(job lapack.BalanceJob, side lapack.EVSide, n, ilo, ihi int, scale []float64, m int, v []float64, ldv int) { switch { + case job != lapack.BalanceNone && job != lapack.Permute && job != lapack.Scale && job != lapack.PermuteScale: + panic(badBalanceJob) + case side != lapack.EVLeft && side != lapack.EVRight: + panic(badEVSide) + case n < 0: + panic(nLT0) case ilo < 0 || max(0, n-1) < ilo: panic(badIlo) case ihi < min(ilo, n-1) || n <= ihi: panic(badIhi) + case m < 0: + panic(mLT0) + case ldv < max(1, m): + panic(badLdV) + } + + // Quick return if possible. + if n == 0 || m == 0 { + return + } + + switch { + case len(scale) < n: + panic(shortScale) + case len(v) < (n-1)*ldv+m: + panic(shortV) + } + + // Quick return if possible. + if job == lapack.BalanceNone { + return } // Convert permutation indices to 1-based. @@ -783,7 +1336,7 @@ func (impl Implementation) Dgebak(job lapack.Job, side lapack.EVSide, n, ilo, ih for j := ihi + 1; j < n; j++ { scale[j]++ } - lapacke.Dgebak(job, bside, n, ilo+1, ihi+1, scale, m, v, ldv) + lapacke.Dgebak(byte(job), byte(side), n, ilo+1, ihi+1, scale, m, v, ldv) // Convert permutation indices back to 0-based. for j := 0; j < ilo; j++ { scale[j]-- @@ -796,7 +1349,9 @@ func (impl Implementation) Dgebak(job lapack.Job, side lapack.EVSide, n, ilo, ih // Dbdsqr performs a singular value decomposition of a real n×n bidiagonal matrix. // // The SVD of the bidiagonal matrix B is -// B = Q * S * P^T +// +// B = Q * S * P^T +// // where S is a diagonal matrix of singular values, Q is an orthogonal matrix of // left singular vectors, and P is an orthogonal matrix of right singular vectors. // @@ -806,7 +1361,8 @@ func (impl Implementation) Dgebak(job lapack.Job, side lapack.EVSide, n, ilo, ih // // Frequently Dbdsqr is used in conjunction with Dgebrd which reduces a general // matrix A into bidiagonal form. In this case, the SVD of A is -// A = (U * Q) * S * (P^T * VT) +// +// A = (U * Q) * S * (P^T * VT) // // This routine may also compute Q^T * C. // @@ -824,48 +1380,62 @@ func (impl Implementation) Dgebak(job lapack.Job, side lapack.EVSide, n, ilo, ih // C is a matrix of size n×ncc whose elements are stored in c. The elements // of c are modified to contain Q^T * C on exit. C is not used if ncc == 0. // -// work contains temporary storage and must have length at least 4*n. Dbdsqr +// work contains temporary storage and must have length at least 4*(n-1). Dbdsqr // will panic if there is insufficient working memory. // // Dbdsqr returns whether the decomposition was successful. func (impl Implementation) Dbdsqr(uplo blas.Uplo, n, ncvt, nru, ncc int, d, e, vt []float64, ldvt int, u []float64, ldu int, c []float64, ldc int, work []float64) (ok bool) { - if uplo != blas.Upper && uplo != blas.Lower { + switch { + case uplo != blas.Upper && uplo != blas.Lower: panic(badUplo) + case n < 0: + panic(nLT0) + case ncvt < 0: + panic(ncvtLT0) + case nru < 0: + panic(nruLT0) + case ncc < 0: + panic(nccLT0) + case ldvt < max(1, ncvt): + panic(badLdVT) + case (ldu < max(1, n) && nru > 0) || (ldu < 1 && nru == 0): + panic(badLdU) + case ldc < max(1, ncc): + panic(badLdC) + } + + // Quick return if possible. + if n == 0 { + return true } - if ncvt != 0 { - checkMatrix(n, ncvt, vt, ldvt) + + if len(vt) < (n-1)*ldvt+ncvt && ncvt != 0 { + panic(shortVT) } - if nru != 0 { - checkMatrix(nru, n, u, ldu) + if len(u) < (nru-1)*ldu+n && nru != 0 { + panic(shortU) } - if ncc != 0 { - checkMatrix(n, ncc, c, ldc) + if len(c) < (n-1)*ldc+ncc && ncc != 0 { + panic(shortC) } if len(d) < n { - panic(badD) + panic(shortD) } if len(e) < n-1 { - panic(badE) - } - if len(work) < 4*n { - panic(badWork) + panic(shortE) } - // An address must be passed to cgo. If lengths are zero, allocate a slice. - if len(vt) == 0 { - vt = make([]float64, 1) - } - if len(u) == 0 { - vt = make([]float64, 1) - } - if len(c) == 0 { - c = make([]float64, 1) + if len(work) < 4*(n-1) { + panic(shortWork) } - return lapacke.Dbdsqr(uplo, n, ncvt, nru, ncc, d, e, vt, ldvt, u, ldu, c, ldc, work) + + return lapacke.Dbdsqr(byte(uplo), n, ncvt, nru, ncc, d, e, vt, ldvt, u, ldu, c, ldc, work) } // Dgebrd reduces a general m×n matrix A to upper or lower bidiagonal form B by // an orthogonal transformation: -// Q^T * A * P = B. +// +// Q^T * A * P = B. +// // The diagonal elements of B are stored in d and the off-diagonal elements are // stored in e. These are additionally stored along the diagonal of A and the // off-diagonal of A. If m >= n B is an upper-bidiagonal matrix, and if m < n B @@ -873,27 +1443,33 @@ func (impl Implementation) Dbdsqr(uplo blas.Uplo, n, ncvt, nru, ncc int, d, e, v // // The remaining elements of A store the data needed to construct Q and P. // The matrices Q and P are products of elementary reflectors -// if m >= n, Q = H_0 * H_1 * ... * H_{n-1}, -// P = G_0 * G_1 * ... * G_{n-2}, -// if m < n, Q = H_0 * H_1 * ... * H_{m-2}, -// P = G_0 * G_1 * ... * G_{m-1}, +// +// if m >= n, Q = H_0 * H_1 * ... * H_{n-1}, +// P = G_0 * G_1 * ... * G_{n-2}, +// if m < n, Q = H_0 * H_1 * ... * H_{m-2}, +// P = G_0 * G_1 * ... * G_{m-1}, +// // where -// H_i = I - tauQ[i] * v_i * v_i^T, -// G_i = I - tauP[i] * u_i * u_i^T. +// +// H_i = I - tauQ[i] * v_i * v_i^T, +// G_i = I - tauP[i] * u_i * u_i^T. // // As an example, on exit the entries of A when m = 6, and n = 5 -// [ d e u1 u1 u1] -// [v1 d e u2 u2] -// [v1 v2 d e u3] -// [v1 v2 v3 d e] -// [v1 v2 v3 v4 d] -// [v1 v2 v3 v4 v5] +// +// [ d e u1 u1 u1] +// [v1 d e u2 u2] +// [v1 v2 d e u3] +// [v1 v2 v3 d e] +// [v1 v2 v3 v4 d] +// [v1 v2 v3 v4 v5] +// // and when m = 5, n = 6 -// [ d u1 u1 u1 u1 u1] -// [ e d u2 u2 u2 u2] -// [v1 e d u3 u3 u3] -// [v1 v2 e d u4 u4] -// [v1 v2 v3 e d u5] +// +// [ d u1 u1 u1 u1 u1] +// [ e d u2 u2 u2 u2] +// [v1 e d u3 u3 u3] +// [v1 v2 e d u4 u4] +// [v1 v2 v3 e d u5] // // d, tauQ, and tauP must all have length at least min(m,n), and e must have // length min(m,n) - 1, unless lwork is -1 when there is no check except for @@ -907,25 +1483,42 @@ func (impl Implementation) Dbdsqr(uplo blas.Uplo, n, ncvt, nru, ncc int, d, e, v // // Dgebrd is an internal routine. It is exported for testing purposes. func (impl Implementation) Dgebrd(m, n int, a []float64, lda int, d, e, tauQ, tauP, work []float64, lwork int) { - checkMatrix(m, n, a, lda) - minmn := min(m, n) - if len(d) < minmn { - panic(badD) - } - if len(e) < minmn-1 { - panic(badE) - } - if len(tauQ) < minmn { - panic(badTauQ) + switch { + case m < 0: + panic(mLT0) + case n < 0: + panic(nLT0) + case lda < max(1, n): + panic(badLdA) + case lwork < max(1, max(m, n)) && lwork != -1: + panic(badLWork) + case len(work) < max(1, lwork): + panic(shortWork) } - if len(tauP) < minmn { - panic(badTauP) + + // Quick return if possible. + minmn := min(m, n) + if minmn == 0 { + work[0] = 1 + return } - if lwork != -1 && lwork < max(1, max(m, n)) { - panic(badWork) + + if lwork == -1 { + lapacke.Dgebrd(m, n, a, lda, d, e, tauQ, tauP, work, -1) + return } - if len(work) < max(1, lwork) { - panic(badWork) + + switch { + case len(a) < (m-1)*lda+n: + panic(shortA) + case len(d) < minmn: + panic(shortD) + case len(e) < minmn-1: + panic(shortE) + case len(tauQ) < minmn: + panic(shortTauQ) + case len(tauP) < minmn: + panic(shortTauP) } lapacke.Dgebrd(m, n, a, lda, d, e, tauQ, tauP, work, lwork) @@ -942,30 +1535,33 @@ func (impl Implementation) Dgebrd(m, n int, a []float64, lda int, d, e, tauQ, ta // work is a temporary data slice of length at least 4*n and Dgecon will panic otherwise. // // iwork is a temporary data slice of length at least n and Dgecon will panic otherwise. -// Elements of iwork must fit within the int32 type or Dgecon will panic. func (impl Implementation) Dgecon(norm lapack.MatrixNorm, n int, a []float64, lda int, anorm float64, work []float64, iwork []int) float64 { - checkMatrix(n, n, a, lda) - if norm != lapack.MaxColumnSum && norm != lapack.MaxRowSum { - panic("bad norm") - } - if len(work) < 4*n { - panic(badWork) + switch { + case norm != lapack.MaxColumnSum && norm != lapack.MaxRowSum: + panic(badNorm) + case n < 0: + panic(nLT0) + case lda < max(1, n): + panic(badLdA) } - if len(iwork) < n { - panic(badWork) + + // Quick return if possible. + if n == 0 { + return 1 } - rcond := make([]float64, 1) - _iwork := make([]int32, len(iwork)) - for i, v := range iwork { - if v != int(int32(v)) { - panic("lapack: iwork element out of range") - } - _iwork[i] = int32(v) + + switch { + case len(a) < (n-1)*lda+n: + panic(shortA) + case len(work) < 4*n: + panic(shortWork) + case len(iwork) < n: + panic(shortIWork) } + + rcond := []float64{0} + _iwork := make([]int32, n) lapacke.Dgecon(byte(norm), n, a, lda, anorm, rcond, work, _iwork) - for i, v := range _iwork { - iwork[i] = int(v) - } return rcond[0] } @@ -982,18 +1578,37 @@ func (impl Implementation) Dgecon(norm lapack.MatrixNorm, n int, a []float64, ld // // See Dgeqr2 for a description of the elementary reflectors and orthonormal // matrix Q. Q is constructed as a product of these elementary reflectors, -// Q = H_{k-1} * ... * H_1 * H_0, +// +// Q = H_{k-1} * ... * H_1 * H_0, +// // where k = min(m,n). // // Work is temporary storage of length at least m and this function will panic otherwise. func (impl Implementation) Dgelq2(m, n int, a []float64, lda int, tau, work []float64) { - checkMatrix(m, n, a, lda) - if len(tau) < min(m, n) { - panic(badTau) + switch { + case m < 0: + panic(mLT0) + case n < 0: + panic(nLT0) + case lda < max(1, n): + panic(badLdA) + } + + // Quick return if possible. + k := min(m, n) + if k == 0 { + return } - if len(work) < m { - panic(badWork) + + switch { + case len(a) < (m-1)*lda+n: + panic(shortA) + case len(tau) < k: + panic(shortTau) + case len(work) < m: + panic(shortWork) } + lapacke.Dgelq2(m, n, a, lda, tau, work) } @@ -1009,20 +1624,37 @@ func (impl Implementation) Dgelq2(m, n int, a []float64, lda int, tau, work []fl // // tau must have length at least min(m,n), and this function will panic otherwise. func (impl Implementation) Dgelqf(m, n int, a []float64, lda int, tau, work []float64, lwork int) { - if lwork == -1 { - work[0] = float64(m) - return - } - checkMatrix(m, n, a, lda) - if len(work) < lwork { + switch { + case m < 0: + panic(mLT0) + case n < 0: + panic(nLT0) + case lda < max(1, n): + panic(badLdA) + case lwork < max(1, m) && lwork != -1: + panic(badLWork) + case len(work) < max(1, lwork): panic(shortWork) } - if lwork < m { - panic(badWork) + + k := min(m, n) + if k == 0 { + work[0] = 1 + return + } + + if lwork == -1 { + lapacke.Dgelqf(m, n, a, lda, tau, work, -1) + return } - if len(tau) < min(m, n) { - panic(badTau) + + switch { + case len(a) < (m-1)*lda+n: + panic(shortA) + case len(tau) < k: + panic(shortTau) } + lapacke.Dgelqf(m, n, a, lda, tau, work, lwork) } @@ -1039,9 +1671,11 @@ func (impl Implementation) Dgelqf(m, n int, a []float64, lda int, tau, work []fl // // The ith elementary reflector can be explicitly constructed by first extracting // the -// v[j] = 0 j < i -// v[j] = 1 j == i -// v[j] = a[j*lda+i] j > i +// +// v[j] = 0 j < i +// v[j] = 1 j == i +// v[j] = a[j*lda+i] j > i +// // and computing H_i = I - tau[i] * v * v^T. // // The orthonormal matrix Q can be constucted from a product of these elementary @@ -1049,14 +1683,30 @@ func (impl Implementation) Dgelqf(m, n int, a []float64, lda int, tau, work []fl // // Work is temporary storage of length at least n and this function will panic otherwise. func (impl Implementation) Dgeqr2(m, n int, a []float64, lda int, tau, work []float64) { - checkMatrix(m, n, a, lda) - if len(work) < n { - panic(badWork) + switch { + case m < 0: + panic(mLT0) + case n < 0: + panic(nLT0) + case lda < max(1, n): + panic(badLdA) + case len(work) < n: + panic(shortWork) } + + // Quick return if possible. k := min(m, n) - if len(tau) < k { - panic(badTau) + if k == 0 { + return + } + + switch { + case len(a) < (m-1)*lda+n: + panic(shortA) + case len(tau) < k: + panic(shortTau) } + lapacke.Dgeqr2(m, n, a, lda, tau, work) } @@ -1073,21 +1723,38 @@ func (impl Implementation) Dgeqr2(m, n int, a []float64, lda int, tau, work []fl // // tau must have length at least min(m,n), and this function will panic otherwise. func (impl Implementation) Dgeqrf(m, n int, a []float64, lda int, tau, work []float64, lwork int) { - if len(work) < max(1, lwork) { + switch { + case m < 0: + panic(mLT0) + case n < 0: + panic(nLT0) + case lda < max(1, n): + panic(badLdA) + case lwork < max(1, n) && lwork != -1: + panic(badLWork) + case len(work) < max(1, lwork): panic(shortWork) } - if lwork == -1 { - work[0] = float64(n) + + // Quick return if possible. + k := min(m, n) + if k == 0 { + work[0] = 1 return } - checkMatrix(m, n, a, lda) - if lwork < n { - panic(badWork) + + if lwork == -1 { + lapacke.Dgeqrf(m, n, a, lda, tau, work, -1) + return } - k := min(m, n) - if len(tau) < k { - panic(badTau) + + switch { + case len(a) < (m-1)*lda+n: + panic(shortA) + case len(tau) < k: + panic(shortTau) } + lapacke.Dgeqrf(m, n, a, lda, tau, work, lwork) } @@ -1096,9 +1763,13 @@ func (impl Implementation) Dgeqrf(m, n int, a []float64, lda int, tau, work []fl // // The matrix Q is represented as a product of (ihi-ilo) elementary // reflectors -// Q = H_{ilo} H_{ilo+1} ... H_{ihi-1}. +// +// Q = H_{ilo} H_{ilo+1} ... H_{ihi-1}. +// // Each H_i has the form -// H_i = I - tau[i] * v * v^T +// +// H_i = I - tau[i] * v * v^T +// // where v is a real vector with v[0:i+1] = 0, v[i+1] = 1 and v[ihi+1:n] = 0. // v[i+2:ihi+1] is stored on exit in A[i+2:ihi+1,i]. // @@ -1111,21 +1782,25 @@ func (impl Implementation) Dgeqrf(m, n int, a []float64, lda int, tau, work []fl // The contents of a are illustrated by the following example, with n = 7, ilo = // 1 and ihi = 5. // On entry, -// [ a a a a a a a ] -// [ a a a a a a ] -// [ a a a a a a ] -// [ a a a a a a ] -// [ a a a a a a ] -// [ a a a a a a ] -// [ a ] +// +// [ a a a a a a a ] +// [ a a a a a a ] +// [ a a a a a a ] +// [ a a a a a a ] +// [ a a a a a a ] +// [ a a a a a a ] +// [ a ] +// // on return, -// [ a a h h h h a ] -// [ a h h h h a ] -// [ h h h h h h ] -// [ v1 h h h h h ] -// [ v1 v2 h h h h ] -// [ v1 v2 v3 h h h ] -// [ a ] +// +// [ a a h h h h a ] +// [ a h h h h a ] +// [ h h h h h h ] +// [ v1 h h h h h ] +// [ v1 v2 h h h h ] +// [ v1 v2 v3 h h h ] +// [ a ] +// // where a denotes an element of the original matrix A, h denotes a // modified element of the upper Hessenberg matrix H, and vi denotes an // element of the vector defining H_i. @@ -1148,21 +1823,38 @@ func (impl Implementation) Dgeqrf(m, n int, a []float64, lda int, tau, work []fl // Dgehrd is an internal routine. It is exported for testing purposes. func (impl Implementation) Dgehrd(n, ilo, ihi int, a []float64, lda int, tau, work []float64, lwork int) { switch { + case n < 0: + panic(nLT0) case ilo < 0 || max(0, n-1) < ilo: panic(badIlo) case ihi < min(ilo, n-1) || n <= ihi: panic(badIhi) + case lda < max(1, n): + panic(badLdA) case lwork < max(1, n) && lwork != -1: - panic(badWork) + panic(badLWork) case len(work) < lwork: panic(shortWork) } - if lwork != -1 { - checkMatrix(n, n, a, lda) - if len(tau) != n-1 && n > 0 { - panic(badTau) - } + + // Quick return if possible. + if n == 0 { + work[0] = 1 + return + } + + if lwork == -1 { + lapacke.Dgehrd(n, ilo+1, ihi+1, a, lda, tau, work, -1) + return } + + switch { + case len(a) < (n-1)*lda+n: + panic(shortA) + case len(tau) != n-1: + panic(badLenTau) + } + lapacke.Dgehrd(n, ilo+1, ihi+1, a, lda, tau, work, lwork) } @@ -1180,6 +1872,7 @@ func (impl Implementation) Dgehrd(n, ilo, ihi int, a []float64, lda int, tau, wo // A^T * X = B. // 4. If m < n and trans == blas.Trans, Dgels finds X such that || A*X - B||_2 // is minimized. +// // Note that the least-squares solutions (cases 1 and 3) perform the minimization // per column of B. This is not the same as finding the minimum-norm matrix. // @@ -1197,27 +1890,53 @@ func (impl Implementation) Dgehrd(n, ilo, ihi int, a []float64, lda int, tau, wo // length. func (impl Implementation) Dgels(trans blas.Transpose, m, n, nrhs int, a []float64, lda int, b []float64, ldb int, work []float64, lwork int) bool { mn := min(m, n) - if lwork == -1 { - work[0] = float64(mn + max(mn, nrhs)) + minwrk := mn + max(mn, nrhs) + switch { + case trans != blas.NoTrans && trans != blas.Trans && trans != blas.ConjTrans: + panic(badTrans) + case m < 0: + panic(mLT0) + case n < 0: + panic(nLT0) + case nrhs < 0: + panic(nrhsLT0) + case lda < max(1, n): + panic(badLdA) + case ldb < max(1, nrhs): + panic(badLdB) + case lwork < max(1, minwrk) && lwork != -1: + panic(badLWork) + case len(work) < max(1, lwork): + panic(shortWork) + } + + // Quick return if possible. + if mn == 0 || nrhs == 0 { + impl.Dlaset(blas.All, max(m, n), nrhs, 0, 0, b, ldb) + work[0] = 1 return true } - checkMatrix(m, n, a, lda) - checkMatrix(max(m, n), nrhs, b, ldb) - if len(work) < lwork { - panic(shortWork) + + if lwork == -1 { + return lapacke.Dgels(byte(trans), m, n, nrhs, a, lda, b, ldb, work, -1) } - if lwork < mn+max(mn, nrhs) { - panic(badWork) + + switch { + case len(a) < (m-1)*lda+n: + panic(shortA) + case len(b) < (max(m, n)-1)*ldb+nrhs: + panic(shortB) } - return lapacke.Dgels(trans, m, n, nrhs, a, lda, b, ldb, work, lwork) -} -const noSVDO = "dgesvd: not coded for overwrite" + return lapacke.Dgels(byte(trans), m, n, nrhs, a, lda, b, ldb, work, lwork) +} // Dgesvd computes the singular value decomposition of the input matrix A. // // The singular value decomposition is -// A = U * Sigma * V^T +// +// A = U * Sigma * V^T +// // where Sigma is an m×n diagonal matrix containing the singular values of A, // U is an m×m orthogonal matrix and V is an n×n orthogonal matrix. The first // min(m,n) columns of U and V are the left and right singular vectors of A @@ -1225,10 +1944,12 @@ const noSVDO = "dgesvd: not coded for overwrite" // // jobU and jobVT are options for computing the singular vectors. The behavior // is as follows -// jobU == lapack.SVDAll All m columns of U are returned in u -// jobU == lapack.SVDInPlace The first min(m,n) columns are returned in u -// jobU == lapack.SVDOverwrite The first min(m,n) columns of U are written into a -// jobU == lapack.SVDNone The columns of U are not computed. +// +// jobU == lapack.SVDAll All m columns of U are returned in u +// jobU == lapack.SVDStore The first min(m,n) columns are returned in u +// jobU == lapack.SVDOverwrite The first min(m,n) columns of U are written into a +// jobU == lapack.SVDNone The columns of U are not computed. +// // The behavior is the same for jobVT and the rows of V^T. At most one of jobU // and jobVT can equal lapack.SVDOverwrite, and Dgesvd will panic otherwise. // @@ -1240,12 +1961,12 @@ const noSVDO = "dgesvd: not coded for overwrite" // values in decreasing order. // // u contains the left singular vectors on exit, stored column-wise. If -// jobU == lapack.SVDAll, u is of size m×m. If jobU == lapack.SVDInPlace u is +// jobU == lapack.SVDAll, u is of size m×m. If jobU == lapack.SVDStore u is // of size m×min(m,n). If jobU == lapack.SVDOverwrite or lapack.SVDNone, u is // not used. // // vt contains the left singular vectors on exit, stored rowwise. If -// jobV == lapack.SVDAll, vt is of size n×m. If jobVT == lapack.SVDInPlace vt is +// jobV == lapack.SVDAll, vt is of size n×m. If jobVT == lapack.SVDStore vt is // of size min(m,n)×n. If jobVT == lapack.SVDOverwrite or lapack.SVDNone, vt is // not used. // @@ -1257,45 +1978,78 @@ const noSVDO = "dgesvd: not coded for overwrite" // // Dgesvd returns whether the decomposition successfully completed. func (impl Implementation) Dgesvd(jobU, jobVT lapack.SVDJob, m, n int, a []float64, lda int, s, u []float64, ldu int, vt []float64, ldvt int, work []float64, lwork int) (ok bool) { - checkMatrix(m, n, a, lda) - if jobU == lapack.SVDAll { - checkMatrix(m, m, u, ldu) - } else if jobU == lapack.SVDInPlace { - checkMatrix(m, min(m, n), u, ldu) - } - if jobVT == lapack.SVDAll { - checkMatrix(n, n, vt, ldvt) - } else if jobVT == lapack.SVDInPlace { - checkMatrix(min(m, n), n, vt, ldvt) - } - if jobU == lapack.SVDOverwrite && jobVT == lapack.SVDOverwrite { - panic(noSVDO) - } - if len(s) < min(m, n) { - panic(badS) - } - if jobU == lapack.SVDOverwrite || jobVT == lapack.SVDOverwrite { - panic("lapack: SVD not coded to overwrite original matrix") - } - minWork := max(5*min(m, n), 3*min(m, n)+max(m, n)) - if lwork != -1 { - if len(work) < lwork { - panic(badWork) - } - if lwork < minWork { - panic(badWork) - } + wantua := jobU == lapack.SVDAll + wantus := jobU == lapack.SVDStore + wantuo := jobU == lapack.SVDOverwrite + wantun := jobU == lapack.SVDNone + if !(wantua || wantus || wantuo || wantun) { + panic(badSVDJob) } - if lwork == -1 { - work[0] = float64(minWork) + + wantva := jobVT == lapack.SVDAll + wantvs := jobVT == lapack.SVDStore + wantvas := wantva || wantvs + wantvo := jobVT == lapack.SVDOverwrite + wantvn := jobVT == lapack.SVDNone + if !(wantva || wantvs || wantvo || wantvn) { + panic(badSVDJob) + } + + if wantuo && wantvo { + panic(bothSVDOver) + } + + minmn := min(m, n) + minwork := 1 + if minmn > 0 { + minwork = max(3*minmn+max(m, n), 5*minmn) + } + switch { + case m < 0: + panic(mLT0) + case n < 0: + panic(nLT0) + case lda < max(1, n): + panic(badLdA) + case ldu < 1, wantua && ldu < m, wantus && ldu < minmn: + panic(badLdU) + case ldvt < 1 || (wantvas && ldvt < n): + panic(badLdVT) + case lwork < minwork && lwork != -1: + panic(badLWork) + case len(work) < max(1, lwork): + panic(shortWork) + } + + // Quick return if possible. + if minmn == 0 { + work[0] = 1 return true } - return lapacke.Dgesvd(lapack.Job(jobU), lapack.Job(jobVT), m, n, a, lda, s, u, ldu, vt, ldvt, work, lwork) + + if lwork == -1 { + return lapacke.Dgesvd(byte(jobU), byte(jobVT), m, n, a, lda, s, u, ldu, vt, ldvt, work, -1) + } + + switch { + case len(a) < (m-1)*lda+n: + panic(shortA) + case len(s) < minmn: + panic(shortS) + case (len(u) < (m-1)*ldu+m && wantua) || (len(u) < (m-1)*ldu+minmn && wantus): + panic(shortU) + case (len(vt) < (n-1)*ldvt+n && wantva) || (len(vt) < (minmn-1)*ldvt+n && wantvs): + panic(shortVT) + } + + return lapacke.Dgesvd(byte(jobU), byte(jobVT), m, n, a, lda, s, u, ldu, vt, ldvt, work, lwork) } // Dgetf2 computes the LU decomposition of the m×n matrix A. // The LU decomposition is a factorization of a into -// A = P * L * U +// +// A = P * L * U +// // where P is a permutation matrix, L is a unit lower triangular matrix, and // U is a (usually) non-unit upper triangular matrix. On exit, L and U are stored // in place into a. @@ -1310,11 +2064,28 @@ func (impl Implementation) Dgesvd(jobU, jobVT lapack.SVDJob, m, n int, a []float // system of equations. func (Implementation) Dgetf2(m, n int, a []float64, lda int, ipiv []int) (ok bool) { mn := min(m, n) - checkMatrix(m, n, a, lda) - if len(ipiv) < mn { - panic(badIpiv) + switch { + case m < 0: + panic(mLT0) + case n < 0: + panic(nLT0) + case lda < max(1, n): + panic(badLdA) + } + + // Quick return if possible. + if mn == 0 { + return true + } + + switch { + case len(a) < (m-1)*lda+n: + panic(shortA) + case len(ipiv) != mn: + panic(badLenIpiv) } - ipiv32 := make([]int32, len(ipiv)) + + ipiv32 := make([]int32, mn) ok = lapacke.Dgetf2(m, n, a, lda, ipiv32) for i, v := range ipiv32 { ipiv[i] = int(v) - 1 // Transform to zero-indexed. @@ -1324,7 +2095,9 @@ func (Implementation) Dgetf2(m, n int, a []float64, lda int, ipiv []int) (ok boo // Dgetrf computes the LU decomposition of the m×n matrix A. // The LU decomposition is a factorization of A into -// A = P * L * U +// +// A = P * L * U +// // where P is a permutation matrix, L is a unit lower triangular matrix, and // U is a (usually) non-unit upper triangular matrix. On exit, L and U are stored // in place into a. @@ -1341,11 +2114,28 @@ func (Implementation) Dgetf2(m, n int, a []float64, lda int, ipiv []int) (ok boo // system of equations. func (impl Implementation) Dgetrf(m, n int, a []float64, lda int, ipiv []int) (ok bool) { mn := min(m, n) - checkMatrix(m, n, a, lda) - if len(ipiv) < mn { - panic(badIpiv) + switch { + case m < 0: + panic(mLT0) + case n < 0: + panic(nLT0) + case lda < max(1, n): + panic(badLdA) + } + + // Quick return if possible. + if mn == 0 { + return true + } + + switch { + case len(a) < (m-1)*lda+n: + panic(shortA) + case len(ipiv) != mn: + panic(badLenIpiv) } - ipiv32 := make([]int32, len(ipiv)) + + ipiv32 := make([]int32, mn) ok = lapacke.Dgetrf(m, n, a, lda, ipiv32) for i, v := range ipiv32 { ipiv[i] = int(v) - 1 // Transform to zero-indexed. @@ -1366,31 +2156,51 @@ func (impl Implementation) Dgetrf(m, n int, a []float64, lda int, ipiv []int) (o // by the temporary space available. If lwork == -1, instead of performing Dgetri, // the optimal work length will be stored into work[0]. func (impl Implementation) Dgetri(n int, a []float64, lda int, ipiv []int, work []float64, lwork int) (ok bool) { - checkMatrix(n, n, a, lda) - if len(ipiv) < n { - panic(badIpiv) + iws := max(1, n) + switch { + case n < 0: + panic(nLT0) + case lda < max(1, n): + panic(badLdA) + case lwork < iws && lwork != -1: + panic(badLWork) + case len(work) < max(1, lwork): + panic(shortWork) } - if lwork == -1 { - work[0] = float64(n) + + if n == 0 { + work[0] = 1 return true } - if lwork < n { - panic(badWork) + + if lwork == -1 { + return lapacke.Dgetri(n, a, lda, nil, work, -1) } - if len(work) < lwork { - panic(badWork) + + switch { + case len(a) < (n-1)*lda+n: + panic(shortA) + case len(ipiv) != n: + panic(badLenIpiv) } - ipiv32 := make([]int32, len(ipiv)) + + ipiv32 := make([]int32, n) for i, v := range ipiv { - ipiv32[i] = int32(v) + 1 // Transform to one-indexed. + v++ // Transform to one-indexed. + if v != int(int32(v)) { + panic("lapack: ipiv element out of range") + } + ipiv32[i] = int32(v) } return lapacke.Dgetri(n, a, lda, ipiv32, work, lwork) } // Dgetrs solves a system of equations using an LU factorization. // The system of equations solved is -// A * X = B if trans == blas.Trans -// A^T * X = B if trans == blas.NoTrans +// +// A * X = B if trans == blas.Trans +// A^T * X = B if trans == blas.NoTrans +// // A is a general n×n matrix with stride lda. B is a general matrix of size n×nrhs. // // On entry b contains the elements of the matrix B. On exit, b contains the @@ -1399,23 +2209,51 @@ func (impl Implementation) Dgetri(n int, a []float64, lda int, ipiv []int, work // a and ipiv contain the LU factorization of A and the permutation indices as // computed by Dgetrf. ipiv is zero-indexed. func (impl Implementation) Dgetrs(trans blas.Transpose, n, nrhs int, a []float64, lda int, ipiv []int, b []float64, ldb int) { - checkMatrix(n, n, a, lda) - checkMatrix(n, nrhs, b, ldb) - if len(ipiv) < n { - panic(badIpiv) + switch { + case trans != blas.NoTrans && trans != blas.Trans && trans != blas.ConjTrans: + panic(badTrans) + case n < 0: + panic(nLT0) + case nrhs < 0: + panic(nrhsLT0) + case lda < max(1, n): + panic(badLdA) + case ldb < max(1, nrhs): + panic(badLdB) + } + + // Quick return if possible. + if n == 0 || nrhs == 0 { + return + } + + switch { + case len(a) < (n-1)*lda+n: + panic(shortA) + case len(b) < (n-1)*ldb+nrhs: + panic(shortB) + case len(ipiv) != n: + panic(badLenIpiv) } - ipiv32 := make([]int32, len(ipiv)) + + ipiv32 := make([]int32, n) for i, v := range ipiv { - ipiv32[i] = int32(v) + 1 // Transform to one-indexed. + v++ // Transform to one-indexed. + if v != int(int32(v)) { + panic("lapack: ipiv element out of range") + } + ipiv32[i] = int32(v) } - lapacke.Dgetrs(trans, n, nrhs, a, lda, ipiv32, b, ldb) + lapacke.Dgetrs(byte(trans), n, nrhs, a, lda, ipiv32, b, ldb) } // Dggsvd3 computes the generalized singular value decomposition (GSVD) // of an m×n matrix A and p×n matrix B: -// U^T*A*Q = D1*[ 0 R ] // -// V^T*B*Q = D2*[ 0 R ] +// U^T*A*Q = D1*[ 0 R ] +// +// V^T*B*Q = D2*[ 0 R ] +// // where U, V and Q are orthogonal matrices. // // Dggsvd3 returns k and l, the dimensions of the sub-blocks. k+l @@ -1426,62 +2264,69 @@ func (impl Implementation) Dgetrs(trans blas.Transpose, n, nrhs int, a []float64 // // If m-k-l >= 0, // -// k l -// D1 = k [ I 0 ] -// l [ 0 C ] -// m-k-l [ 0 0 ] +// k l +// D1 = k [ I 0 ] +// l [ 0 C ] +// m-k-l [ 0 0 ] // -// k l -// D2 = l [ 0 S ] -// p-l [ 0 0 ] +// k l +// D2 = l [ 0 S ] +// p-l [ 0 0 ] // -// n-k-l k l -// [ 0 R ] = k [ 0 R11 R12 ] k -// l [ 0 0 R22 ] l +// n-k-l k l +// [ 0 R ] = k [ 0 R11 R12 ] k +// l [ 0 0 R22 ] l // // where // -// C = diag( alpha_k, ... , alpha_{k+l} ), -// S = diag( beta_k, ... , beta_{k+l} ), -// C^2 + S^2 = I. +// C = diag( alpha_k, ... , alpha_{k+l} ), +// S = diag( beta_k, ... , beta_{k+l} ), +// C^2 + S^2 = I. // // R is stored in -// A[0:k+l, n-k-l:n] +// +// A[0:k+l, n-k-l:n] +// // on exit. // // If m-k-l < 0, // -// k m-k k+l-m -// D1 = k [ I 0 0 ] -// m-k [ 0 C 0 ] +// k m-k k+l-m +// D1 = k [ I 0 0 ] +// m-k [ 0 C 0 ] // -// k m-k k+l-m -// D2 = m-k [ 0 S 0 ] -// k+l-m [ 0 0 I ] -// p-l [ 0 0 0 ] +// k m-k k+l-m +// D2 = m-k [ 0 S 0 ] +// k+l-m [ 0 0 I ] +// p-l [ 0 0 0 ] // -// n-k-l k m-k k+l-m -// [ 0 R ] = k [ 0 R11 R12 R13 ] -// m-k [ 0 0 R22 R23 ] -// k+l-m [ 0 0 0 R33 ] +// n-k-l k m-k k+l-m +// [ 0 R ] = k [ 0 R11 R12 R13 ] +// m-k [ 0 0 R22 R23 ] +// k+l-m [ 0 0 0 R33 ] // // where -// C = diag( alpha_k, ... , alpha_m ), -// S = diag( beta_k, ... , beta_m ), -// C^2 + S^2 = I. // -// R = [ R11 R12 R13 ] is stored in A[1:m, n-k-l+1:n] -// [ 0 R22 R23 ] +// C = diag( alpha_k, ... , alpha_m ), +// S = diag( beta_k, ... , beta_m ), +// C^2 + S^2 = I. +// +// R = [ R11 R12 R13 ] is stored in A[1:m, n-k-l+1:n] +// [ 0 R22 R23 ] +// // and R33 is stored in -// B[m-k:l, n+m-k-l:n] on exit. +// +// B[m-k:l, n+m-k-l:n] on exit. // // Dggsvd3 computes C, S, R, and optionally the orthogonal transformation // matrices U, V and Q. // // jobU, jobV and jobQ are options for computing the orthogonal matrices. The behavior // is as follows -// jobU == lapack.GSVDU Compute orthogonal matrix U -// jobU == lapack.GSVDNone Do not compute orthogonal matrix. +// +// jobU == lapack.GSVDU Compute orthogonal matrix U +// jobU == lapack.GSVDNone Do not compute orthogonal matrix. +// // The behavior is the same for jobV and jobQ with the exception that instead of // lapack.GSVDU these accept lapack.GSVDV and lapack.GSVDQ respectively. // The matrices U, V and Q must be m×m, p×p and n×n respectively unless the @@ -1489,17 +2334,24 @@ func (impl Implementation) Dgetrs(trans blas.Transpose, n, nrhs int, a []float64 // // alpha and beta must have length n or Dggsvd3 will panic. On exit, alpha and // beta contain the generalized singular value pairs of A and B -// alpha[0:k] = 1, -// beta[0:k] = 0, +// +// alpha[0:k] = 1, +// beta[0:k] = 0, +// // if m-k-l >= 0, -// alpha[k:k+l] = diag(C), -// beta[k:k+l] = diag(S), +// +// alpha[k:k+l] = diag(C), +// beta[k:k+l] = diag(S), +// // if m-k-l < 0, -// alpha[k:m]= C, alpha[m:k+l]= 0 -// beta[k:m] = S, beta[m:k+l] = 1. +// +// alpha[k:m]= C, alpha[m:k+l]= 0 +// beta[k:m] = S, beta[m:k+l] = 1. +// // if k+l < n, -// alpha[k+l:n] = 0 and -// beta[k+l:n] = 0. +// +// alpha[k+l:n] = 0 and +// beta[k+l:n] = 0. // // On exit, iwork contains the permutation required to sort alpha descending. // @@ -1508,59 +2360,67 @@ func (impl Implementation) Dgetrs(trans blas.Transpose, n, nrhs int, a []float64 // lwork is -1, work[0] holds the optimal lwork on return, but Dggsvd3 does // not perform the GSVD. func (impl Implementation) Dggsvd3(jobU, jobV, jobQ lapack.GSVDJob, m, n, p int, a []float64, lda int, b []float64, ldb int, alpha, beta, u []float64, ldu int, v []float64, ldv int, q []float64, ldq int, work []float64, lwork int, iwork []int) (k, l int, ok bool) { - checkMatrix(m, n, a, lda) - checkMatrix(p, n, b, ldb) - - switch jobU { - case lapack.GSVDU: - checkMatrix(m, m, u, ldu) - case lapack.GSVDNone: - default: + wantu := jobU == lapack.GSVDU + wantv := jobV == lapack.GSVDV + wantq := jobQ == lapack.GSVDQ + switch { + case !wantu && jobU != lapack.GSVDNone: panic(badGSVDJob + "U") - } - switch jobV { - case lapack.GSVDV: - checkMatrix(p, p, v, ldv) - case lapack.GSVDNone: - default: + case !wantv && jobV != lapack.GSVDNone: panic(badGSVDJob + "V") - } - switch jobQ { - case lapack.GSVDQ: - checkMatrix(n, n, q, ldq) - case lapack.GSVDNone: - default: + case !wantq && jobQ != lapack.GSVDNone: panic(badGSVDJob + "Q") + case m < 0: + panic(mLT0) + case n < 0: + panic(nLT0) + case p < 0: + panic(pLT0) + case lda < max(1, n): + panic(badLdA) + case ldb < max(1, n): + panic(badLdB) + case ldu < 1, wantu && ldu < m: + panic(badLdU) + case ldv < 1, wantv && ldv < p: + panic(badLdV) + case ldq < 1, wantq && ldq < n: + panic(badLdQ) + case len(iwork) < n: + panic(shortWork) + case lwork < 1 && lwork != -1: + panic(badLWork) + case len(work) < max(1, lwork): + panic(shortWork) } - if len(alpha) != n { - panic(badAlpha) - } - if len(beta) != n { - panic(badBeta) + // Determine optimal work length. + if lwork == -1 { + lapacke.Dggsvd3(byte(jobU), byte(jobV), byte(jobQ), m, n, p, nil, nil, a, lda, b, ldb, alpha, beta, u, ldu, v, ldv, q, ldq, work, -1, nil) + return 0, 0, true } - if lwork != -1 && lwork <= n { - panic(badWork) - } - if len(work) < max(1, lwork) { - panic(shortWork) - } - if len(iwork) < n { - panic(badWork) + switch { + case len(a) < (m-1)*lda+n: + panic(shortA) + case len(b) < (p-1)*ldb+n: + panic(shortB) + case wantu && len(u) < (m-1)*ldu+m: + panic(shortU) + case wantv && len(v) < (p-1)*ldv+p: + panic(shortV) + case wantq && len(q) < (n-1)*ldq+n: + panic(shortQ) + case len(alpha) != n: + panic(badLenAlpha) + case len(beta) != n: + panic(badLenBeta) } _k := []int32{0} _l := []int32{0} - _iwork := make([]int32, len(iwork)) - for i, v := range iwork { - v++ - if v != int(int32(v)) { - panic("lapack: iwork element out of range") - } - _iwork[i] = int32(v) - } - ok = lapacke.Dggsvd3(lapack.Job(jobU), lapack.Job(jobV), lapack.Job(jobQ), m, n, p, _k, _l, a, lda, b, ldb, alpha, beta, u, ldu, v, ldv, q, ldq, work, lwork, _iwork) + _iwork := make([]int32, n) + ok = lapacke.Dggsvd3(byte(jobU), byte(jobV), byte(jobQ), m, n, p, _k, _l, a, lda, b, ldb, alpha, beta, u, ldu, v, ldv, q, ldq, work, lwork, _iwork) for i, v := range _iwork { iwork[i] = int(v - 1) } @@ -1570,18 +2430,18 @@ func (impl Implementation) Dggsvd3(jobU, jobV, jobQ lapack.GSVDJob, m, n, p int, // Dggsvp3 computes orthogonal matrices U, V and Q such that // -// n-k-l k l -// U^T*A*Q = k [ 0 A12 A13 ] if m-k-l >= 0; -// l [ 0 0 A23 ] -// m-k-l [ 0 0 0 ] +// n-k-l k l +// U^T*A*Q = k [ 0 A12 A13 ] if m-k-l >= 0; +// l [ 0 0 A23 ] +// m-k-l [ 0 0 0 ] // -// n-k-l k l -// U^T*A*Q = k [ 0 A12 A13 ] if m-k-l < 0; -// m-k [ 0 0 A23 ] +// n-k-l k l +// U^T*A*Q = k [ 0 A12 A13 ] if m-k-l < 0; +// m-k [ 0 0 A23 ] // -// n-k-l k l -// V^T*B*Q = l [ 0 0 B13 ] -// p-l [ 0 0 0 ] +// n-k-l k l +// V^T*B*Q = l [ 0 0 B13 ] +// p-l [ 0 0 0 ] // // where the k×k matrix A12 and l×l matrix B13 are non-singular // upper triangular. A23 is l×l upper triangular if m-k-l >= 0, @@ -1592,8 +2452,10 @@ func (impl Implementation) Dggsvd3(jobU, jobV, jobQ lapack.GSVDJob, m, n, p int, // // jobU, jobV and jobQ are options for computing the orthogonal matrices. The behavior // is as follows -// jobU == lapack.GSVDU Compute orthogonal matrix U -// jobU == lapack.GSVDNone Do not compute orthogonal matrix. +// +// jobU == lapack.GSVDU Compute orthogonal matrix U +// jobU == lapack.GSVDNone Do not compute orthogonal matrix. +// // The behavior is the same for jobV and jobQ with the exception that instead of // lapack.GSVDU these accept lapack.GSVDV and lapack.GSVDQ respectively. // The matrices U, V and Q must be m×m, p×p and n×n respectively unless the @@ -1602,8 +2464,10 @@ func (impl Implementation) Dggsvd3(jobU, jobV, jobQ lapack.GSVDJob, m, n, p int, // tola and tolb are the convergence criteria for the Jacobi-Kogbetliantz // iteration procedure. Generally, they are the same as used in the preprocessing // step, for example, -// tola = max(m, n)*norm(A)*eps, -// tolb = max(p, n)*norm(B)*eps. +// +// tola = max(m, n)*norm(A)*eps, +// tolb = max(p, n)*norm(B)*eps. +// // Where eps is the machine epsilon. // // iwork must have length n, work must have length at least max(1, lwork), and @@ -1611,61 +2475,67 @@ func (impl Implementation) Dggsvd3(jobU, jobV, jobQ lapack.GSVDJob, m, n, p int, // // Dggsvp3 is an internal routine. It is exported for testing purposes. func (impl Implementation) Dggsvp3(jobU, jobV, jobQ lapack.GSVDJob, m, p, n int, a []float64, lda int, b []float64, ldb int, tola, tolb float64, u []float64, ldu int, v []float64, ldv int, q []float64, ldq int, iwork []int, tau, work []float64, lwork int) (k, l int) { - checkMatrix(m, n, a, lda) - checkMatrix(p, n, b, ldb) - wantu := jobU == lapack.GSVDU - if !wantu && jobU != lapack.GSVDNone { - panic(badGSVDJob + "U") - } - if jobU != lapack.GSVDNone { - checkMatrix(m, m, u, ldu) - } - wantv := jobV == lapack.GSVDV - if !wantv && jobV != lapack.GSVDNone { - panic(badGSVDJob + "V") - } - if jobV != lapack.GSVDNone { - checkMatrix(p, p, v, ldv) - } - wantq := jobQ == lapack.GSVDQ - if !wantq && jobQ != lapack.GSVDNone { + switch { + case !wantu && jobU != lapack.GSVDNone: + panic(badGSVDJob + "U") + case !wantv && jobV != lapack.GSVDNone: + panic(badGSVDJob + "V") + case !wantq && jobQ != lapack.GSVDNone: panic(badGSVDJob + "Q") - } - if jobQ != lapack.GSVDNone { - checkMatrix(n, n, q, ldq) + case m < 0: + panic(mLT0) + case p < 0: + panic(pLT0) + case n < 0: + panic(nLT0) + case lda < max(1, n): + panic(badLdA) + case ldb < max(1, n): + panic(badLdB) + case ldu < 1, wantu && ldu < m: + panic(badLdU) + case ldv < 1, wantv && ldv < p: + panic(badLdV) + case ldq < 1, wantq && ldq < n: + panic(badLdQ) + case len(iwork) != n: + panic(shortWork) + case lwork < 1 && lwork != -1: + panic(badLWork) + case len(work) < max(1, lwork): + panic(shortWork) } - if len(tau) < n { - panic(badTau) - } - if len(iwork) != n { - panic(badWork) - } - if lwork != -1 && lwork < 1 { - panic(badWork) + if lwork == -1 { + lapacke.Dggsvp3(byte(jobU), byte(jobV), byte(jobQ), m, p, n, a, lda, b, ldb, tola, tolb, nil, nil, u, ldu, v, ldv, q, ldq, nil, tau, work, -1) + return 0, 0 } - if len(work) < max(1, lwork) { - panic(shortWork) + + switch { + case len(a) < (m-1)*lda+n: + panic(shortA) + case len(b) < (p-1)*ldb+n: + panic(shortB) + case wantu && len(u) < (m-1)*ldu+m: + panic(shortU) + case wantv && len(v) < (p-1)*ldv+p: + panic(shortV) + case wantq && len(q) < (n-1)*ldq+n: + panic(shortQ) + case len(tau) < n: + // tau check must come after lwkopt query since + // the Dggsvd3 call for lwkopt query may have + // lwork == -1, and tau is provided by work. + panic(shortTau) } _k := []int32{0} _l := []int32{0} - _iwork := make([]int32, len(iwork)) - for i, v := range iwork { - v++ - if v != int(int32(v)) { - panic("lapack: iwork element out of range") - } - _iwork[i] = int32(v) - } - lapacke.Dggsvp3(lapack.Job(jobU), lapack.Job(jobV), lapack.Job(jobQ), m, p, n, a, lda, b, ldb, tola, tolb, _k, _l, u, ldu, v, ldv, q, ldq, _iwork, tau, work, lwork) - for i, v := range _iwork { - iwork[i] = int(v - 1) - } - + _iwork := make([]int32, n) + lapacke.Dggsvp3(byte(jobU), byte(jobV), byte(jobQ), m, p, n, a, lda, b, ldb, tola, tolb, _k, _l, u, ldu, v, ldv, q, ldq, _iwork, tau, work, lwork) return int(_k[0]), int(_l[0]) } @@ -1679,39 +2549,61 @@ func (impl Implementation) Dggsvp3(jobU, jobV, jobQ lapack.GSVDJob, m, p, n int, // If vect == lapack.ApplyP, then A is assumed to have been a k×n matrix, and // P^T is of order n. If k < n, then Dorgbr returns the first m rows of P^T, // where n >= m >= k. If k >= n, then Dorgbr returns P^T as an n×n matrix. -func (impl Implementation) Dorgbr(vect lapack.DecompUpdate, m, n, k int, a []float64, lda int, tau, work []float64, lwork int) { +func (impl Implementation) Dorgbr(vect lapack.GenOrtho, m, n, k int, a []float64, lda int, tau, work []float64, lwork int) { + wantq := vect == lapack.GenerateQ mn := min(m, n) - wantq := vect == lapack.ApplyQ - if wantq { - if m < n || n < min(m, k) || m < min(m, k) { - panic(badDims) - } - } else { - if n < m || m < min(n, k) || n < min(n, k) { - panic(badDims) - } + switch { + case vect != lapack.GenerateQ && vect != lapack.GeneratePT: + panic(badGenOrtho) + case m < 0: + panic(mLT0) + case n < 0: + panic(nLT0) + case k < 0: + panic(kLT0) + case wantq && n > m: + panic(nGTM) + case wantq && n < min(m, k): + panic("lapack: n < min(m,k)") + case !wantq && m > n: + panic(mGTN) + case !wantq && m < min(n, k): + panic("lapack: m < min(n,k)") + case lda < max(1, n): + panic(badLdA) + case lwork < max(1, mn) && lwork != -1: + panic(badLWork) + case len(work) < max(1, lwork): + panic(shortWork) } - if wantq { - checkMatrix(m, k, a, lda) - } else { - checkMatrix(k, n, a, lda) + + // Quick return if possible. + if m == 0 || n == 0 { + work[0] = 1 + return } + if lwork == -1 { - work[0] = float64(mn) + lapacke.Dorgbr(byte(vect), m, n, k, a, lda, tau, work, -1) return } - if len(work) < lwork { - panic(badWork) - } - if lwork < mn { - panic(badWork) + + switch { + case len(a) < (m-1)*lda+n: + panic(shortA) + case wantq && len(tau) < min(m, k): + panic(shortTau) + case !wantq && len(tau) < min(n, k): + panic(shortTau) } + lapacke.Dorgbr(byte(vect), m, n, k, a, lda, tau, work, lwork) } // Dorghr generates an n×n orthogonal matrix Q which is defined as the product // of ihi-ilo elementary reflectors: -// Q = H_{ilo} H_{ilo+1} ... H_{ihi-1}. +// +// Q = H_{ilo} H_{ilo+1} ... H_{ihi-1}. // // a and lda represent an n×n matrix that contains the elementary reflectors, as // returned by Dgehrd. On return, a is overwritten by the n×n orthogonal matrix @@ -1720,8 +2612,9 @@ func (impl Implementation) Dorgbr(vect lapack.DecompUpdate, m, n, k int, a []flo // // ilo and ihi must have the same values as in the previous call of Dgehrd. It // must hold that -// 0 <= ilo <= ihi < n, if n > 0, -// ilo = 0, ihi = -1, if n == 0. +// +// 0 <= ilo <= ihi < n, if n > 0, +// ilo = 0, ihi = -1, if n == 0. // // tau contains the scalar factors of the elementary reflectors, as returned by // Dgehrd. tau must have length n-1. @@ -1738,24 +2631,46 @@ func (impl Implementation) Dorgbr(vect lapack.DecompUpdate, m, n, k int, a []flo // // Dorghr is an internal routine. It is exported for testing purposes. func (impl Implementation) Dorghr(n, ilo, ihi int, a []float64, lda int, tau, work []float64, lwork int) { - checkMatrix(n, n, a, lda) nh := ihi - ilo switch { case ilo < 0 || max(1, n) <= ilo: panic(badIlo) case ihi < min(ilo, n-1) || n <= ihi: panic(badIhi) + case lda < max(1, n): + panic(badLdA) case lwork < max(1, nh) && lwork != -1: - panic(badWork) + panic(badLWork) case len(work) < max(1, lwork): panic(shortWork) } + + // Quick return if possible. + if n == 0 { + work[0] = 1 + return + } + + if lwork == -1 { + lapacke.Dorghr(n, ilo+1, ihi+1, a, lda, tau, work, -1) + return + } + + switch { + case len(a) < (n-1)*lda+n: + panic(shortA) + case len(tau) < n-1: + panic(shortTau) + } + lapacke.Dorghr(n, ilo+1, ihi+1, a, lda, tau, work, lwork) } // Dorglq generates an m×n matrix Q with orthonormal rows defined by the product // of elementary reflectors -// Q = H_{k-1} * ... * H_1 * H_0 +// +// Q = H_{k-1} * ... * H_1 * H_0 +// // as computed by Dgelqf. Dorglq is the blocked version of Dorgl2 that makes // greater use of level-3 BLAS routines. // @@ -1770,38 +2685,52 @@ func (impl Implementation) Dorghr(n, ilo, ihi int, a []float64, lda int, tau, wo // // Dorglq is an internal routine. It is exported for testing purposes. func (impl Implementation) Dorglq(m, n, k int, a []float64, lda int, tau, work []float64, lwork int) { - if lwork == -1 { - work[0] = float64(m) - return - } - checkMatrix(m, n, a, lda) - if k < 0 { + switch { + case m < 0: + panic(mLT0) + case n < m: + panic(nLTM) + case k < 0: panic(kLT0) - } - if k > m { + case k > m: panic(kGTM) + case lda < max(1, n): + panic(badLdA) + case lwork < max(1, m) && lwork != -1: + panic(badLWork) + case len(work) < max(1, lwork): + panic(shortWork) } - if m > n { - panic(nLTM) - } - if len(tau) < k { - panic(badTau) + + if m == 0 { + work[0] = 1 + return } - if len(work) < lwork { - panic(shortWork) + + if lwork == -1 { + lapacke.Dorglq(m, n, k, a, lda, tau, work, -1) + return } - if lwork < m { - panic(badWork) + + switch { + case len(a) < (m-1)*lda+n: + panic(shortA) + case len(tau) < k: + panic(shortTau) } + lapacke.Dorglq(m, n, k, a, lda, tau, work, lwork) } // Dorgql generates the m×n matrix Q with orthonormal columns defined as the // last n columns of a product of k elementary reflectors of order m -// Q = H_{k-1} * ... * H_1 * H_0. +// +// Q = H_{k-1} * ... * H_1 * H_0. // // It must hold that -// 0 <= k <= n <= m, +// +// 0 <= k <= n <= m, +// // and Dorgql will panic otherwise. // // On entry, the (n-k+i)-th column of A must contain the vector which defines @@ -1820,24 +2749,40 @@ func (impl Implementation) Dorglq(m, n, k int, a []float64, lda int, tau, work [ // Dorgql is an internal routine. It is exported for testing purposes. func (impl Implementation) Dorgql(m, n, k int, a []float64, lda int, tau, work []float64, lwork int) { switch { + case m < 0: + panic(mLT0) case n < 0: panic(nLT0) - case m < n: - panic(mLTN) + case n > m: + panic(nGTM) case k < 0: panic(kLT0) case k > n: panic(kGTN) + case lda < max(1, n): + panic(badLdA) case lwork < max(1, n) && lwork != -1: - panic(badWork) - case len(work) < lwork: + panic(badLWork) + case len(work) < max(1, lwork): panic(shortWork) } - if lwork != -1 { - checkMatrix(m, n, a, lda) - if len(tau) < k { - panic(badTau) - } + + // Quick return if possible. + if n == 0 { + work[0] = 1 + return + } + + if lwork == -1 { + lapacke.Dorgql(m, n, k, a, lda, tau, work, -1) + return + } + + switch { + case len(a) < (m-1)*lda+n: + panic(shortA) + case len(tau) < k: + panic(shortTau) } lapacke.Dorgql(m, n, k, a, lda, tau, work, lwork) @@ -1845,7 +2790,9 @@ func (impl Implementation) Dorgql(m, n, k int, a []float64, lda int, tau, work [ // Dorgqr generates an m×n matrix Q with orthonormal columns defined by the // product of elementary reflectors -// Q = H_0 * H_1 * ... * H_{k-1} +// +// Q = H_0 * H_1 * ... * H_{k-1} +// // as computed by Dgeqrf. Dorgqr is the blocked version of Dorg2r that makes // greater use of level-3 BLAS routines. // @@ -1861,29 +2808,42 @@ func (impl Implementation) Dorgql(m, n, k int, a []float64, lda int, tau, work [ // // Dorgqr is an internal routine. It is exported for testing purposes. func (impl Implementation) Dorgqr(m, n, k int, a []float64, lda int, tau, work []float64, lwork int) { - if lwork == -1 { - work[0] = float64(n) - return - } - checkMatrix(m, n, a, lda) - if k < 0 { + switch { + case m < 0: + panic(mLT0) + case n < 0: + panic(nLT0) + case n > m: + panic(nGTM) + case k < 0: panic(kLT0) - } - if k > n { + case k > n: panic(kGTN) + case lda < max(1, n): + panic(badLdA) + case lwork < max(1, n) && lwork != -1: + panic(badLWork) + case len(work) < max(1, lwork): + panic(shortWork) } - if n > m { - panic(mLTN) - } - if len(tau) < k { - panic(badTau) + + if n == 0 { + work[0] = 1 + return } - if len(work) < lwork { - panic(shortWork) + + if lwork == -1 { + lapacke.Dorgqr(m, n, k, a, lda, tau, work, -1) + return } - if lwork < n { - panic(badWork) + + switch { + case len(a) < (m-1)*lda+n: + panic(shortA) + case len(tau) < k: + panic(shortTau) } + lapacke.Dorgqr(m, n, k, a, lda, tau, work, lwork) } @@ -1891,8 +2851,10 @@ func (impl Implementation) Dorgqr(m, n, k int, a []float64, lda int, tau, work [ // of n-1 elementary reflectors of order n as returned by Dsytrd. // // The construction of Q depends on the value of uplo: -// Q = H_{n-1} * ... * H_1 * H_0 if uplo == blas.Upper -// Q = H_0 * H_1 * ... * H_{n-1} if uplo == blas.Lower +// +// Q = H_{n-1} * ... * H_1 * H_0 if uplo == blas.Upper +// Q = H_0 * H_1 * ... * H_{n-1} if uplo == blas.Lower +// // where H_i is constructed from the elementary reflectors as computed by Dsytrd. // See the documentation for Dsytrd for more information. // @@ -1906,36 +2868,54 @@ func (impl Implementation) Dorgqr(m, n, k int, a []float64, lda int, tau, work [ // // Dorgtr is an internal routine. It is exported for testing purposes. func (impl Implementation) Dorgtr(uplo blas.Uplo, n int, a []float64, lda int, tau, work []float64, lwork int) { - checkMatrix(n, n, a, lda) - if len(tau) < n-1 { - panic(badTau) + switch { + case uplo != blas.Upper && uplo != blas.Lower: + panic(badUplo) + case n < 0: + panic(nLT0) + case lda < max(1, n): + panic(badLdA) + case lwork < max(1, n-1) && lwork != -1: + panic(badLWork) + case len(work) < max(1, lwork): + panic(shortWork) } - if len(work) < lwork { - panic(badWork) + + if n == 0 { + work[0] = 1 + return } - if lwork < n-1 && lwork != -1 { - panic(badWork) + + if lwork == -1 { + lapacke.Dorgtr(byte(uplo), n, a, lda, tau, work, -1) + return } - upper := uplo == blas.Upper - if !upper && uplo != blas.Lower { - panic(badUplo) + + switch { + case len(a) < (n-1)*lda+n: + panic(shortA) + case len(tau) < n-1: + panic(shortTau) } - lapacke.Dorgtr(uplo, n, a, lda, tau, work, lwork) + + lapacke.Dorgtr(byte(uplo), n, a, lda, tau, work, lwork) } // Dormbr applies a multiplicative update to the matrix C based on a // decomposition computed by Dgebrd. // // Dormbr overwrites the m×n matrix C with -// Q * C if vect == lapack.ApplyQ, side == blas.Left, and trans == blas.NoTrans -// C * Q if vect == lapack.ApplyQ, side == blas.Right, and trans == blas.NoTrans -// Q^T * C if vect == lapack.ApplyQ, side == blas.Left, and trans == blas.Trans -// C * Q^T if vect == lapack.ApplyQ, side == blas.Right, and trans == blas.Trans -// -// P * C if vect == lapack.ApplyP, side == blas.Left, and trans == blas.NoTrans -// C * P if vect == lapack.ApplyP, side == blas.Right, and trans == blas.NoTrans -// P^T * C if vect == lapack.ApplyP, side == blas.Left, and trans == blas.Trans -// C * P^T if vect == lapack.ApplyP, side == blas.Right, and trans == blas.Trans +// +// Q * C if vect == lapack.ApplyQ, side == blas.Left, and trans == blas.NoTrans +// C * Q if vect == lapack.ApplyQ, side == blas.Right, and trans == blas.NoTrans +// Q^T * C if vect == lapack.ApplyQ, side == blas.Left, and trans == blas.Trans +// C * Q^T if vect == lapack.ApplyQ, side == blas.Right, and trans == blas.Trans +// +// P * C if vect == lapack.ApplyP, side == blas.Left, and trans == blas.NoTrans +// C * P if vect == lapack.ApplyP, side == blas.Right, and trans == blas.NoTrans +// P^T * C if vect == lapack.ApplyP, side == blas.Left, and trans == blas.Trans +// C * P^T if vect == lapack.ApplyP, side == blas.Right, and trans == blas.Trans +// // where P and Q are the orthogonal matrices determined by Dgebrd when reducing // a matrix A to bidiagonal form: A = Q * B * P^T. See Dgebrd for the // definitions of Q and P. @@ -1958,59 +2938,89 @@ func (impl Implementation) Dorgtr(uplo blas.Uplo, n int, a []float64, lda int, t // returns it in work[0]. // // Dormbr is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dormbr(vect lapack.DecompUpdate, side blas.Side, trans blas.Transpose, m, n, k int, a []float64, lda int, tau, c []float64, ldc int, work []float64, lwork int) { - if side != blas.Left && side != blas.Right { - panic(badSide) - } - if trans != blas.NoTrans && trans != blas.Trans { - panic(badTrans) - } - if vect != lapack.ApplyP && vect != lapack.ApplyQ { - panic(badDecompUpdate) - } +func (impl Implementation) Dormbr(vect lapack.ApplyOrtho, side blas.Side, trans blas.Transpose, m, n, k int, a []float64, lda int, tau, c []float64, ldc int, work []float64, lwork int) { nq := n nw := m if side == blas.Left { nq = m nw = n } - if vect == lapack.ApplyQ { - checkMatrix(nq, min(nq, k), a, lda) - } else { - checkMatrix(min(nq, k), nq, a, lda) + applyQ := vect == lapack.ApplyQ + switch { + case !applyQ && vect != lapack.ApplyP: + panic(badApplyOrtho) + case side != blas.Left && side != blas.Right: + panic(badSide) + case trans != blas.NoTrans && trans != blas.Trans: + panic(badTrans) + case m < 0: + panic(mLT0) + case n < 0: + panic(nLT0) + case k < 0: + panic(kLT0) + case applyQ && lda < max(1, min(nq, k)): + panic(badLdA) + case !applyQ && lda < max(1, nq): + panic(badLdA) + case ldc < max(1, n): + panic(badLdC) + case lwork < max(1, nw) && lwork != -1: + panic(badLWork) + case len(work) < max(1, lwork): + panic(shortWork) } - if len(tau) < min(nq, k) { - panic(badTau) + + // Quick return if possible. + if m == 0 || n == 0 { + work[0] = 1 + return } - checkMatrix(m, n, c, ldc) - if len(work) < lwork { - panic(shortWork) + + if lwork == -1 { + lapacke.Dormbr(byte(vect), byte(side), byte(trans), m, n, k, a, lda, tau, c, ldc, work, -1) + return } - if lwork < max(1, nw) && lwork != -1 { - panic(badWork) + + minnqk := min(nq, k) + switch { + case applyQ && len(a) < (nq-1)*lda+minnqk: + panic(shortA) + case !applyQ && len(a) < (minnqk-1)*lda+nq: + panic(shortA) + case len(tau) < minnqk: + panic(shortTau) + case len(c) < (m-1)*ldc+n: + panic(shortC) } - lapacke.Dormbr(byte(vect), side, trans, m, n, k, a, lda, tau, c, ldc, work, lwork) + + lapacke.Dormbr(byte(vect), byte(side), byte(trans), m, n, k, a, lda, tau, c, ldc, work, lwork) } // Dormhr multiplies an m×n general matrix C with an nq×nq orthogonal matrix Q -// Q * C, if side == blas.Left and trans == blas.NoTrans, -// Q^T * C, if side == blas.Left and trans == blas.Trans, -// C * Q, if side == blas.Right and trans == blas.NoTrans, -// C * Q^T, if side == blas.Right and trans == blas.Trans, +// +// Q * C, if side == blas.Left and trans == blas.NoTrans, +// Q^T * C, if side == blas.Left and trans == blas.Trans, +// C * Q, if side == blas.Right and trans == blas.NoTrans, +// C * Q^T, if side == blas.Right and trans == blas.Trans, +// // where nq == m if side == blas.Left and nq == n if side == blas.Right. // // Q is defined implicitly as the product of ihi-ilo elementary reflectors, as // returned by Dgehrd: -// Q = H_{ilo} H_{ilo+1} ... H_{ihi-1}. +// +// Q = H_{ilo} H_{ilo+1} ... H_{ihi-1}. +// // Q is equal to the identity matrix except in the submatrix // Q[ilo+1:ihi+1,ilo+1:ihi+1]. // // ilo and ihi must have the same values as in the previous call of Dgehrd. It // must hold that -// 0 <= ilo <= ihi < m, if m > 0 and side == blas.Left, -// ilo = 0 and ihi = -1, if m = 0 and side == blas.Left, -// 0 <= ilo <= ihi < n, if n > 0 and side == blas.Right, -// ilo = 0 and ihi = -1, if n = 0 and side == blas.Right. +// +// 0 <= ilo <= ihi < m, if m > 0 and side == blas.Left, +// ilo = 0 and ihi = -1, if m = 0 and side == blas.Left, +// 0 <= ilo <= ihi < n, if n > 0 and side == blas.Right, +// ilo = 0 and ihi = -1, if n = 0 and side == blas.Right. // // a and lda represent an m×m matrix if side == blas.Left and an n×n matrix if // side == blas.Right. The matrix contains vectors which define the elementary @@ -2036,48 +3046,64 @@ func (impl Implementation) Dormbr(vect lapack.DecompUpdate, side blas.Side, tran // // Dormhr is an internal routine. It is exported for testing purposes. func (impl Implementation) Dormhr(side blas.Side, trans blas.Transpose, m, n, ilo, ihi int, a []float64, lda int, tau, c []float64, ldc int, work []float64, lwork int) { - var ( - nq int // The order of Q. - nw int // The minimum length of work. - ) - switch side { - case blas.Left: + nq := n // The order of Q. + nw := m // The minimum length of work. + if side == blas.Left { nq = m nw = n - case blas.Right: - nq = n - nw = m - default: - panic(badSide) } switch { + case side != blas.Left && side != blas.Right: + panic(badSide) case trans != blas.NoTrans && trans != blas.Trans: panic(badTrans) + case m < 0: + panic(mLT0) + case n < 0: + panic(nLT0) case ilo < 0 || max(1, nq) <= ilo: panic(badIlo) case ihi < min(ilo, nq-1) || nq <= ihi: panic(badIhi) + case lda < max(1, nq): + panic(badLdA) case lwork < max(1, nw) && lwork != -1: - panic(badWork) + panic(badLWork) case len(work) < max(1, lwork): panic(shortWork) } - if lwork != -1 { - checkMatrix(m, n, c, ldc) - checkMatrix(nq, nq, a, lda) - if len(tau) != nq-1 && nq > 0 { - panic(badTau) - } + + // Quick return if possible. + if m == 0 || n == 0 { + work[0] = 1 + return + } + + if lwork == -1 { + lapacke.Dormhr(byte(side), byte(trans), m, n, ilo+1, ihi+1, a, lda, tau, c, ldc, work, -1) + return + } + + switch { + case len(a) < (nq-1)*lda+nq: + panic(shortA) + case len(c) < (m-1)*ldc+n: + panic(shortC) + case len(tau) != nq-1: + panic(badLenTau) } - lapacke.Dormhr(side, trans, m, n, ilo+1, ihi+1, a, lda, tau, c, ldc, work, lwork) + + lapacke.Dormhr(byte(side), byte(trans), m, n, ilo+1, ihi+1, a, lda, tau, c, ldc, work, lwork) } // Dormlq multiplies the matrix C by the orthogonal matrix Q defined by the // slices a and tau. A and tau are as returned from Dgelqf. -// C = Q * C if side == blas.Left and trans == blas.NoTrans -// C = Q^T * C if side == blas.Left and trans == blas.Trans -// C = C * Q if side == blas.Right and trans == blas.NoTrans -// C = C * Q^T if side == blas.Right and trans == blas.Trans +// +// C = Q * C if side == blas.Left and trans == blas.NoTrans +// C = Q^T * C if side == blas.Left and trans == blas.Trans +// C = C * Q if side == blas.Right and trans == blas.NoTrans +// C = C * Q^T if side == blas.Right and trans == blas.Trans +// // If side == blas.Left, A is a matrix of side k×m, and if side == blas.Right // A is of size k×n. This uses a blocked algorithm. // @@ -2091,43 +3117,71 @@ func (impl Implementation) Dormhr(side blas.Side, trans blas.Transpose, m, n, il // tau contains the Householder scales and must have length at least k, and // this function will panic otherwise. func (impl Implementation) Dormlq(side blas.Side, trans blas.Transpose, m, n, k int, a []float64, lda int, tau, c []float64, ldc int, work []float64, lwork int) { - if side != blas.Left && side != blas.Right { - panic(badSide) - } - if trans != blas.Trans && trans != blas.NoTrans { - panic(badTrans) - } left := side == blas.Left + nw := m if left { - checkMatrix(k, m, a, lda) - } else { - checkMatrix(k, n, a, lda) - } - checkMatrix(m, n, c, ldc) - if len(tau) < k { - panic(badTau) + nw = n } - if len(work) < lwork { + switch { + case !left && side != blas.Right: + panic(badSide) + case trans != blas.Trans && trans != blas.NoTrans: + panic(badTrans) + case m < 0: + panic(mLT0) + case n < 0: + panic(nLT0) + case k < 0: + panic(kLT0) + case left && k > m: + panic(kGTM) + case !left && k > n: + panic(kGTN) + case left && lda < max(1, m): + panic(badLdA) + case !left && lda < max(1, n): + panic(badLdA) + case lwork < max(1, nw) && lwork != -1: + panic(badLWork) + case len(work) < max(1, lwork): panic(shortWork) } - nw := m - if left { - nw = n + + // Quick return if possible. + if m == 0 || n == 0 || k == 0 { + work[0] = 1 + return + } + + if lwork == -1 { + lapacke.Dormlq(byte(side), byte(trans), m, n, k, a, lda, tau, c, ldc, work, -1) + return } - if lwork < max(1, nw) && lwork != -1 { - panic(badWork) + + switch { + case left && len(a) < (k-1)*lda+m: + panic(shortA) + case !left && len(a) < (k-1)*lda+n: + panic(shortA) + case len(tau) < k: + panic(shortTau) + case len(c) < (m-1)*ldc+n: + panic(shortC) } - lapacke.Dormlq(side, trans, m, n, k, a, lda, tau, c, ldc, work, lwork) + lapacke.Dormlq(byte(side), byte(trans), m, n, k, a, lda, tau, c, ldc, work, lwork) } // Dormqr multiplies an m×n matrix C by an orthogonal matrix Q as -// C = Q * C, if side == blas.Left and trans == blas.NoTrans, -// C = Q^T * C, if side == blas.Left and trans == blas.Trans, -// C = C * Q, if side == blas.Right and trans == blas.NoTrans, -// C = C * Q^T, if side == blas.Right and trans == blas.Trans, +// +// C = Q * C, if side == blas.Left and trans == blas.NoTrans, +// C = Q^T * C, if side == blas.Left and trans == blas.Trans, +// C = C * Q, if side == blas.Right and trans == blas.NoTrans, +// C = C * Q^T, if side == blas.Right and trans == blas.Trans, +// // where Q is defined as the product of k elementary reflectors -// Q = H_0 * H_1 * ... * H_{k-1}. +// +// Q = H_0 * H_1 * ... * H_{k-1}. // // If side == blas.Left, A is an m×k matrix and 0 <= k <= m. // If side == blas.Right, A is an n×k matrix and 0 <= k <= n. @@ -2149,38 +3203,59 @@ func (impl Implementation) Dormlq(side blas.Side, trans blas.Transpose, m, n, k // If lwork is -1, instead of performing Dormqr, the optimal workspace size will // be stored into work[0]. func (impl Implementation) Dormqr(side blas.Side, trans blas.Transpose, m, n, k int, a []float64, lda int, tau, c []float64, ldc int, work []float64, lwork int) { - var nq, nw int - switch side { - default: - panic(badSide) - case blas.Left: + left := side == blas.Left + nq := n + nw := m + if left { nq = m nw = n - case blas.Right: - nq = n - nw = m } switch { + case !left && side != blas.Right: + panic(badSide) case trans != blas.NoTrans && trans != blas.Trans: panic(badTrans) - case m < 0 || n < 0: - panic(negDimension) - case k < 0 || nq < k: - panic("lapack: invalid value of k") - case len(work) < lwork: - panic(shortWork) + case m < 0: + panic(mLT0) + case n < 0: + panic(nLT0) + case k < 0: + panic(kLT0) + case left && k > m: + panic(kGTM) + case !left && k > n: + panic(kGTN) + case lda < max(1, k): + panic(badLdA) + case ldc < max(1, n): + panic(badLdC) case lwork < max(1, nw) && lwork != -1: - panic(badWork) + panic(badLWork) + case len(work) < max(1, lwork): + panic(shortWork) } - if lwork != -1 { - checkMatrix(nq, k, a, lda) - checkMatrix(m, n, c, ldc) - if len(tau) != k { - panic(badTau) - } + + // Quick return if possible. + if m == 0 || n == 0 || k == 0 { + work[0] = 1 + return + } + + if lwork == -1 { + lapacke.Dormqr(byte(side), byte(trans), m, n, k, a, lda, tau, c, ldc, work, -1) + return + } + + switch { + case len(a) < (nq-1)*lda+k: + panic(shortA) + case len(tau) != k: + panic(badLenTau) + case len(c) < (m-1)*ldc+n: + panic(shortC) } - lapacke.Dormqr(side, trans, m, n, k, a, lda, tau, c, ldc, work, lwork) + lapacke.Dormqr(byte(side), byte(trans), m, n, k, a, lda, tau, c, ldc, work, lwork) } // Dpocon estimates the reciprocal of the condition number of a positive-definite @@ -2192,30 +3267,35 @@ func (impl Implementation) Dormqr(side blas.Side, trans blas.Transpose, m, n, k // work is a temporary data slice of length at least 3*n and Dpocon will panic otherwise. // // iwork is a temporary data slice of length at least n and Dpocon will panic otherwise. -// Elements of iwork must fit within the int32 type or Dpocon will panic. func (impl Implementation) Dpocon(uplo blas.Uplo, n int, a []float64, lda int, anorm float64, work []float64, iwork []int) float64 { - checkMatrix(n, n, a, lda) - if uplo != blas.Upper && uplo != blas.Lower { + switch { + case uplo != blas.Upper && uplo != blas.Lower: panic(badUplo) + case n < 0: + panic(nLT0) + case lda < max(1, n): + panic(badLdA) + case anorm < 0: + panic(negANorm) } - if len(work) < 3*n { - panic(badWork) - } - if len(iwork) < n { - panic(badWork) - } - rcond := make([]float64, 1) - _iwork := make([]int32, len(iwork)) - for i, v := range iwork { - if v != int(int32(v)) { - panic("lapack: iwork element out of range") - } - _iwork[i] = int32(v) + + // Quick return if possible. + if n == 0 { + return 1 } - lapacke.Dpocon(uplo, n, a, lda, anorm, rcond, work, _iwork) - for i, v := range _iwork { - iwork[i] = int(v) + + switch { + case len(a) < (n-1)*lda+n: + panic(shortA) + case len(work) < 3*n: + panic(shortWork) + case len(iwork) < n: + panic(shortIWork) } + + rcond := []float64{0} + _iwork := make([]int32, n) + lapacke.Dpocon(byte(uplo), n, a, lda, anorm, rcond, work, _iwork) return rcond[0] } @@ -2244,26 +3324,32 @@ func (impl Implementation) Dpocon(uplo blas.Uplo, n int, a []float64, lda int, a // // Dsteqr is an internal routine. It is exported for testing purposes. func (impl Implementation) Dsteqr(compz lapack.EVComp, n int, d, e, z []float64, ldz int, work []float64) (ok bool) { - if n < 0 { + switch { + case compz != lapack.EVCompNone && compz != lapack.EVTridiag && compz != lapack.EVOrig: + panic(badEVComp) + case n < 0: panic(nLT0) + case ldz < 1, compz != lapack.EVCompNone && ldz < n: + panic(badLdZ) } - if len(d) < n { - panic(badD) - } - if len(e) < n-1 { - panic(badE) - } - if compz != lapack.None && compz != lapack.TridiagEV && compz != lapack.OriginalEV { - panic(badEVComp) + + // Quick return if possible. + if n == 0 { + return true } - if compz != lapack.None { - if len(work) < max(1, 2*n-2) { - panic(badWork) - } - checkMatrix(n, n, z, ldz) + + switch { + case len(d) < n: + panic(shortD) + case len(e) < n-1: + panic(shortE) + case compz != lapack.EVCompNone && len(z) < (n-1)*ldz+n: + panic(shortZ) + case compz != lapack.EVCompNone && len(work) < max(1, 2*n-2): + panic(shortWork) } - return lapacke.Dsteqr(lapack.Comp(compz), n, d, e, z, ldz, work) + return lapacke.Dsteqr(byte(compz), n, d, e, z, ldz, work) } // Dsterf computes all eigenvalues of a symmetric tridiagonal matrix using the @@ -2282,14 +3368,17 @@ func (impl Implementation) Dsterf(n int, d, e []float64) (ok bool) { if n < 0 { panic(nLT0) } + + // Quick return if possible. if n == 0 { return true } - if len(d) < n { - panic(badD) - } - if len(e) < n-1 { - panic(badE) + + switch { + case len(d) < n: + panic(shortD) + case len(e) < n-1: + panic(shortE) } return lapacke.Dsterf(n, d, e) @@ -2311,23 +3400,45 @@ func (impl Implementation) Dsterf(n int, d, e []float64) (ok bool) { // limited by the usable length. If lwork == -1, instead of computing Dsyev the // optimal work length is stored into work[0]. func (impl Implementation) Dsyev(jobz lapack.EVJob, uplo blas.Uplo, n int, a []float64, lda int, w, work []float64, lwork int) (ok bool) { - checkMatrix(n, n, a, lda) - if lwork == -1 { - work[0] = 3*float64(n) - 1 - return + switch { + case jobz != lapack.EVNone && jobz != lapack.EVCompute: + panic(badEVJob) + case uplo != blas.Upper && uplo != blas.Lower: + panic(badUplo) + case n < 0: + panic(nLT0) + case lda < max(1, n): + panic(badLdA) + case lwork < max(1, 3*n-1) && lwork != -1: + panic(badLWork) + case len(work) < max(1, lwork): + panic(shortWork) + } + + // Quick return if possible. + if n == 0 { + return true } - if len(work) < lwork { - panic(badWork) + + if lwork == -1 { + return lapacke.Dsyev(byte(jobz), byte(uplo), n, a, lda, w, work, -1) } - if lwork < 3*n-1 { - panic(badWork) + + switch { + case len(a) < (n-1)*lda+n: + panic(shortA) + case len(w) < n: + panic(shortW) } - return lapacke.Dsyev(lapack.Job(jobz), uplo, n, a, lda, w, work, lwork) + + return lapacke.Dsyev(byte(jobz), byte(uplo), n, a, lda, w, work, lwork) } // Dsytrd reduces a symmetric n×n matrix A to symmetric tridiagonal form by an // orthogonal similarity transformation -// Q^T * A * Q = T +// +// Q^T * A * Q = T +// // where Q is an orthonormal matrix and T is symmetric and tridiagonal. // // On entry, a contains the elements of the input matrix in the triangle specified @@ -2337,28 +3448,38 @@ func (impl Implementation) Dsyev(jobz lapack.EVJob, uplo blas.Uplo, n int, a []f // the product of elementary reflectors. // // If uplo == blas.Upper, Q is constructed with -// Q = H_{n-2} * ... * H_1 * H_0 +// +// Q = H_{n-2} * ... * H_1 * H_0 +// // where -// H_i = I - tau_i * v * v^T +// +// H_i = I - tau_i * v * v^T +// // v is constructed as v[i+1:n] = 0, v[i] = 1, v[0:i-1] is stored in A[0:i-1, i+1]. // The elements of A are -// [ d e v1 v2 v3] -// [ d e v2 v3] -// [ d e v3] -// [ d e] -// [ e] +// +// [ d e v1 v2 v3] +// [ d e v2 v3] +// [ d e v3] +// [ d e] +// [ e] // // If uplo == blas.Lower, Q is constructed with -// Q = H_0 * H_1 * ... * H_{n-2} +// +// Q = H_0 * H_1 * ... * H_{n-2} +// // where -// H_i = I - tau_i * v * v^T +// +// H_i = I - tau_i * v * v^T +// // v is constructed as v[0:i+1] = 0, v[i+1] = 1, v[i+2:n] is stored in A[i+2:n, i]. // The elements of A are -// [ d ] -// [ e d ] -// [v0 e d ] -// [v0 v1 e d ] -// [v0 v1 v2 e d] +// +// [ d ] +// [ e d ] +// [v0 e d ] +// [v0 v1 e d ] +// [v0 v1 v2 e d] // // d must have length n, and e and tau must have length n-1. Dsytrd will panic if // these conditions are not met. @@ -2371,27 +3492,90 @@ func (impl Implementation) Dsyev(jobz lapack.EVJob, uplo blas.Uplo, n int, a []f // // Dsytrd is an internal routine. It is exported for testing purposes. func (impl Implementation) Dsytrd(uplo blas.Uplo, n int, a []float64, lda int, d, e, tau, work []float64, lwork int) { - checkMatrix(n, n, a, lda) - if len(d) < n { - panic(badD) - } - if len(e) < n-1 { - panic(badE) + switch { + case uplo != blas.Upper && uplo != blas.Lower: + panic(badUplo) + case n < 0: + panic(nLT0) + case lda < max(1, n): + panic(badLdA) + case lwork < 1 && lwork != -1: + panic(badLWork) + case len(work) < max(1, lwork): + panic(shortWork) } - if len(tau) < n-1 { - panic(badTau) + + // Quick return if possible. + if n == 0 { + work[0] = 1 + return } - if len(work) < lwork { - panic(shortWork) + + if lwork == -1 { + lapacke.Dsytrd(byte(uplo), n, a, lda, d, e, tau, work, -1) + return } - if lwork != -1 && lwork < 1 { - panic(badWork) + + switch { + case len(a) < (n-1)*lda+n: + panic(shortA) + case len(d) < n: + panic(shortD) + case len(e) < n-1: + panic(shortE) + case len(tau) < n-1: + panic(shortTau) } - if uplo != blas.Upper && uplo != blas.Lower { + + lapacke.Dsytrd(byte(uplo), n, a, lda, d, e, tau, work, lwork) +} + +// Dtbtrs solves a triangular system of the form +// +// A * X = B if trans == blas.NoTrans +// Aᵀ * X = B if trans == blas.Trans or blas.ConjTrans +// +// where A is an n×n triangular band matrix with kd super- or subdiagonals, and +// B is an n×nrhs matrix. +// +// Dtbtrs returns whether A is non-singular. If A is singular, no solution X is +// computed. +func (impl Implementation) Dtbtrs(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n, kd, nrhs int, a []float64, lda int, b []float64, ldb int) (ok bool) { + switch { + case uplo != blas.Upper && uplo != blas.Lower: panic(badUplo) + case trans != blas.NoTrans && trans != blas.Trans && trans != blas.ConjTrans: + panic(badTrans) + case diag != blas.NonUnit && diag != blas.Unit: + panic(badDiag) + case n < 0: + panic(nLT0) + case kd < 0: + panic(kdLT0) + case nrhs < 0: + panic(nrhsLT0) + case lda < kd+1: + panic(badLdA) + case ldb < max(1, nrhs): + panic(badLdB) + } + + // Quick return if possible. + if n == 0 { + return true } - lapacke.Dsytrd(uplo, n, a, lda, d, e, tau, work, lwork) + switch { + case len(a) < (n-1)*lda+kd+1: + panic(shortA) + case len(b) < (n-1)*ldb+nrhs: + panic(shortB) + } + + ldaConv := n + aConv := make([]float64, (kd+1)*ldaConv) + bandTriToLapacke(uplo, n, kd, a, lda, aConv, ldaConv) + return lapacke.Dtbtrs(byte(uplo), byte(trans), byte(diag), n, kd, nrhs, aConv, ldaConv, b, ldb) } // Dtrcon estimates the reciprocal of the condition number of a triangular matrix A. @@ -2400,40 +3584,43 @@ func (impl Implementation) Dsytrd(uplo blas.Uplo, n int, a []float64, lda int, d // work is a temporary data slice of length at least 3*n and Dtrcon will panic otherwise. // // iwork is a temporary data slice of length at least n and Dtrcon will panic otherwise. -// Elements of iwork must fit within the int32 type or Dtrcon will panic. func (impl Implementation) Dtrcon(norm lapack.MatrixNorm, uplo blas.Uplo, diag blas.Diag, n int, a []float64, lda int, work []float64, iwork []int) float64 { - if norm != lapack.MaxColumnSum && norm != lapack.MaxRowSum { + switch { + case norm != lapack.MaxColumnSum && norm != lapack.MaxRowSum: panic(badNorm) - } - if uplo != blas.Upper && uplo != blas.Lower { + case uplo != blas.Upper && uplo != blas.Lower: panic(badUplo) - } - if diag != blas.NonUnit && diag != blas.Unit { + case diag != blas.NonUnit && diag != blas.Unit: panic(badDiag) + case n < 0: + panic(nLT0) + case lda < max(1, n): + panic(badLdA) } - if len(work) < 3*n { - panic(badWork) + + if n == 0 { + return 1 } - if len(iwork) < n { - panic(badWork) + + switch { + case len(a) < (n-1)*lda+n: + panic(shortA) + case len(work) < 3*n: + panic(shortWork) + case len(iwork) < n: + panic(shortIWork) } + rcond := []float64{0} - _iwork := make([]int32, len(iwork)) - for i, v := range iwork { - if v != int(int32(v)) { - panic("lapack: iwork element out of range") - } - _iwork[i] = int32(v) - } - lapacke.Dtrcon(byte(norm), uplo, diag, n, a, lda, rcond, work, _iwork) - for i, v := range _iwork { - iwork[i] = int(v) - } + _iwork := make([]int32, n) + lapacke.Dtrcon(byte(norm), byte(uplo), byte(diag), n, a, lda, rcond, work, _iwork) return rcond[0] } // Dtrexc reorders the real Schur factorization of a n×n real matrix -// A = Q*T*Q^T +// +// A = Q*T*Q^T +// // so that the diagonal block of T with row index ifst is moved to row ilst. // // On entry, T must be in Schur canonical form, that is, block upper triangular @@ -2460,7 +3647,9 @@ func (impl Implementation) Dtrcon(norm lapack.MatrixNorm, uplo blas.Uplo, diag b // is true, ilstOut may differ from ilst by +1 or -1. // // It must hold that -// 0 <= ifst < n, and 0 <= ilst < n, +// +// 0 <= ifst < n, and 0 <= ilst < n, +// // otherwise Dtrexc will panic. // // If ok is false, two adjacent blocks were too close to swap because the @@ -2471,36 +3660,44 @@ func (impl Implementation) Dtrcon(norm lapack.MatrixNorm, uplo blas.Uplo, diag b // work must have length at least n, otherwise Dtrexc will panic. // // Dtrexc is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dtrexc(compq lapack.EVComp, n int, t []float64, ldt int, q []float64, ldq int, ifst, ilst int, work []float64) (ifstOut, ilstOut int, ok bool) { - checkMatrix(n, n, t, ldt) - switch compq { - default: - panic("lapack: bad value of compq") - case lapack.None: - // q is not referenced but LAPACKE checks that ldq >= n always. - q = nil - ldq = max(1, n) - case lapack.UpdateSchur: - checkMatrix(n, n, q, ldq) - } - if (ifst < 0 || n <= ifst) && n > 0 { - panic("lapack: ifst out of range") +func (impl Implementation) Dtrexc(compq lapack.UpdateSchurComp, n int, t []float64, ldt int, q []float64, ldq int, ifst, ilst int, work []float64) (ifstOut, ilstOut int, ok bool) { + switch { + case compq != lapack.UpdateSchur && compq != lapack.UpdateSchurNone: + panic(badUpdateSchurComp) + case n < 0: + panic(nLT0) + case ldt < max(1, n): + panic(badLdT) + case ldq < 1, compq == lapack.UpdateSchur && ldq < n: + panic(badLdQ) + case (ifst < 0 || n <= ifst) && n > 0: + panic(badIfst) + case (ilst < 0 || n <= ilst) && n > 0: + panic(badIlst) } - if (ilst < 0 || n <= ilst) && n > 0 { - panic("lapack: ilst out of range") + + // Quick return if possible. + if n == 0 { + return ifst, ilst, true } - if len(work) < n { - panic(badWork) + + switch { + case len(t) < (n-1)*ldt+n: + panic(shortT) + case compq == lapack.UpdateSchur && len(q) < (n-1)*ldq+n: + panic(shortQ) + case len(work) < n: + panic(shortWork) } // Quick return if possible. - if n <= 1 { + if n == 1 { return ifst, ilst, true } ifst32 := []int32{int32(ifst + 1)} ilst32 := []int32{int32(ilst + 1)} - ok = lapacke.Dtrexc(lapack.Comp(compq), n, t, ldt, q, ldq, ifst32, ilst32, work) + ok = lapacke.Dtrexc(byte(compq), n, t, ldt, q, ldq, ifst32, ilst32, work) ifst = int(ifst32[0] - 1) ilst = int(ilst32[0] - 1) return ifst, ilst, ok @@ -2513,33 +3710,76 @@ func (impl Implementation) Dtrexc(compq lapack.EVComp, n int, t []float64, ldt i // Dtrtri returns whether the matrix a is singular. // If the matrix is singular, the inversion is not performed. func (impl Implementation) Dtrtri(uplo blas.Uplo, diag blas.Diag, n int, a []float64, lda int) (ok bool) { - checkMatrix(n, n, a, lda) - if uplo != blas.Upper && uplo != blas.Lower { + switch { + case uplo != blas.Upper && uplo != blas.Lower: panic(badUplo) - } - if diag != blas.NonUnit && diag != blas.Unit { + case diag != blas.NonUnit && diag != blas.Unit: panic(badDiag) + case n < 0: + panic(nLT0) + case lda < max(1, n): + panic(badLdA) + } + + if n == 0 { + return true + } + + if len(a) < (n-1)*lda+n { + panic(shortA) } - return lapacke.Dtrtri(uplo, diag, n, a, lda) + + return lapacke.Dtrtri(byte(uplo), byte(diag), n, a, lda) } // Dtrtrs solves a triangular system of the form A * X = B or A^T * X = B. // Dtrtrs returns whether the solve completed successfully. // If A is singular, no solve is performed. func (impl Implementation) Dtrtrs(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n, nrhs int, a []float64, lda int, b []float64, ldb int) (ok bool) { - return lapacke.Dtrtrs(uplo, trans, diag, n, nrhs, a, lda, b, ldb) + switch { + case uplo != blas.Upper && uplo != blas.Lower: + panic(badUplo) + case trans != blas.NoTrans && trans != blas.Trans && trans != blas.ConjTrans: + panic(badTrans) + case diag != blas.NonUnit && diag != blas.Unit: + panic(badDiag) + case n < 0: + panic(nLT0) + case nrhs < 0: + panic(nrhsLT0) + case lda < max(1, n): + panic(badLdA) + case ldb < max(1, nrhs): + panic(badLdB) + } + + if n == 0 { + return true + } + + switch { + case len(a) < (n-1)*lda+n: + panic(shortA) + case len(b) < (n-1)*ldb+nrhs: + panic(shortB) + } + + return lapacke.Dtrtrs(byte(uplo), byte(trans), byte(diag), n, nrhs, a, lda, b, ldb) } // Dhseqr computes the eigenvalues of an n×n Hessenberg matrix H and, // optionally, the matrices T and Z from the Schur decomposition -// H = Z T Z^T, +// +// H = Z T Z^T, +// // where T is an n×n upper quasi-triangular matrix (the Schur form), and Z is // the n×n orthogonal matrix of Schur vectors. // // Optionally Z may be postmultiplied into an input orthogonal matrix Q so that // this routine can give the Schur factorization of a matrix A which has been // reduced to the Hessenberg form H by the orthogonal matrix Q: -// A = Q H Q^T = (QZ) T (QZ)^T. +// +// A = Q H Q^T = (QZ) T (QZ)^T. // // If job == lapack.EigenvaluesOnly, only the eigenvalues will be computed. // If job == lapack.EigenvaluesAndSchur, the eigenvalues and the Schur form T will @@ -2557,13 +3797,16 @@ func (impl Implementation) Dtrtrs(uplo blas.Uplo, trans blas.Transpose, diag bla // ilo and ihi determine the block of H on which Dhseqr operates. It is assumed // that H is already upper triangular in rows and columns [0:ilo] and [ihi+1:n], // although it will be only checked that the block is isolated, that is, -// ilo == 0 or H[ilo,ilo-1] == 0, -// ihi == n-1 or H[ihi+1,ihi] == 0, +// +// ilo == 0 or H[ilo,ilo-1] == 0, +// ihi == n-1 or H[ihi+1,ihi] == 0, +// // and Dhseqr will panic otherwise. ilo and ihi are typically set by a previous // call to Dgebal, otherwise they should be set to 0 and n-1, respectively. It // must hold that -// 0 <= ilo <= ihi < n, if n > 0, -// ilo == 0 and ihi == -1, if n == 0. +// +// 0 <= ilo <= ihi < n, if n > 0, +// ilo == 0 and ihi == -1, if n == 0. // // wr and wi must have length n. // @@ -2588,15 +3831,22 @@ func (impl Implementation) Dtrtrs(uplo blas.Uplo, trans blas.Transpose, diag bla // contain the upper quasi-triangular matrix T from the Schur decomposition (the // Schur form). 2×2 diagonal blocks (corresponding to complex conjugate pairs of // eigenvalues) will be returned in standard form, with -// H[i,i] == H[i+1,i+1], +// +// H[i,i] == H[i+1,i+1], +// // and -// H[i+1,i]*H[i,i+1] < 0. +// +// H[i+1,i]*H[i,i+1] < 0. +// // The eigenvalues will be stored in wr and wi in the same order as on the // diagonal of the Schur form returned in H, with -// wr[i] = H[i,i], +// +// wr[i] = H[i,i], +// // and, if H[i:i+2,i:i+2] is a 2×2 diagonal block, -// wi[i] = sqrt(-H[i+1,i]*H[i,i+1]), -// wi[i+1] = -wi[i]. +// +// wi[i] = sqrt(-H[i+1,i]*H[i,i+1]), +// wi[i+1] = -wi[i]. // // If unconverged == 0 and job == lapack.EigenvaluesOnly, the contents of h // on return is unspecified. @@ -2611,72 +3861,86 @@ func (impl Implementation) Dtrtrs(uplo blas.Uplo, trans blas.Transpose, diag bla // // If unconverged > 0 and job == lapack.EigenvaluesAndSchur, then on // return -// (initial H) U = U (final H), (*) +// +// (initial H) U = U (final H), (*) +// // where U is an orthogonal matrix. The final H is upper Hessenberg and // H[unconverged:ihi+1,unconverged:ihi+1] is upper quasi-triangular. // // If unconverged > 0 and compz == lapack.OriginalEV, then on return -// (final Z) = (initial Z) U, +// +// (final Z) = (initial Z) U, +// // where U is the orthogonal matrix in (*) regardless of the value of job. // // If unconverged > 0 and compz == lapack.InitZ, then on return -// (final Z) = U, +// +// (final Z) = U, +// // where U is the orthogonal matrix in (*) regardless of the value of job. // // References: -// [1] R. Byers. LAPACK 3.1 xHSEQR: Tuning and Implementation Notes on the -// Small Bulge Multi-Shift QR Algorithm with Aggressive Early Deflation. -// LAPACK Working Note 187 (2007) -// URL: http://www.netlib.org/lapack/lawnspdf/lawn187.pdf -// [2] K. Braman, R. Byers, R. Mathias. The Multishift QR Algorithm. Part I: -// Maintaining Well-Focused Shifts and Level 3 Performance. SIAM J. Matrix -// Anal. Appl. 23(4) (2002), pp. 929—947 -// URL: http://dx.doi.org/10.1137/S0895479801384573 -// [3] K. Braman, R. Byers, R. Mathias. The Multishift QR Algorithm. Part II: -// Aggressive Early Deflation. SIAM J. Matrix Anal. Appl. 23(4) (2002), pp. 948—973 -// URL: http://dx.doi.org/10.1137/S0895479801384585 +// +// [1] R. Byers. LAPACK 3.1 xHSEQR: Tuning and Implementation Notes on the +// Small Bulge Multi-Shift QR Algorithm with Aggressive Early Deflation. +// LAPACK Working Note 187 (2007) +// URL: http://www.netlib.org/lapack/lawnspdf/lawn187.pdf +// [2] K. Braman, R. Byers, R. Mathias. The Multishift QR Algorithm. Part I: +// Maintaining Well-Focused Shifts and Level 3 Performance. SIAM J. Matrix +// Anal. Appl. 23(4) (2002), pp. 929—947 +// URL: http://dx.doi.org/10.1137/S0895479801384573 +// [3] K. Braman, R. Byers, R. Mathias. The Multishift QR Algorithm. Part II: +// Aggressive Early Deflation. SIAM J. Matrix Anal. Appl. 23(4) (2002), pp. 948—973 +// URL: http://dx.doi.org/10.1137/S0895479801384585 // // Dhseqr is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dhseqr(job lapack.EVJob, compz lapack.EVComp, n, ilo, ihi int, h []float64, ldh int, wr, wi []float64, z []float64, ldz int, work []float64, lwork int) (unconverged int) { - switch job { - default: - panic(badEVJob) - case lapack.EigenvaluesOnly, lapack.EigenvaluesAndSchur: - } - var wantz bool - switch compz { - default: - panic(badEVComp) - case lapack.None: - case lapack.HessEV, lapack.OriginalEV: - wantz = true - } +func (impl Implementation) Dhseqr(job lapack.SchurJob, compz lapack.SchurComp, n, ilo, ihi int, h []float64, ldh int, wr, wi []float64, z []float64, ldz int, work []float64, lwork int) (unconverged int) { + wantz := compz == lapack.SchurHess || compz == lapack.SchurOrig + switch { + case job != lapack.EigenvaluesOnly && job != lapack.EigenvaluesAndSchur: + panic(badSchurJob) + case compz != lapack.SchurNone && compz != lapack.SchurHess && compz != lapack.SchurOrig: + panic(badSchurComp) case n < 0: panic(nLT0) case ilo < 0 || max(0, n-1) < ilo: panic(badIlo) case ihi < min(ilo, n-1) || n <= ihi: panic(badIhi) - case len(work) < lwork: - panic(shortWork) + case ldh < max(1, n): + panic(badLdH) + case ldz < 1, wantz && ldz < n: + panic(badLdZ) case lwork < max(1, n) && lwork != -1: - panic(badWork) - } - if lwork != -1 { - checkMatrix(n, n, h, ldh) - switch { - case wantz: - checkMatrix(n, n, z, ldz) - case len(wr) < n: - panic("lapack: wr has insufficient length") - case len(wi) < n: - panic("lapack: wi has insufficient length") - } + panic(badLWork) + case len(work) < max(1, lwork): + panic(shortWork) + } + + // Quick return if possible. + if n == 0 { + work[0] = 1 + return 0 + } + + // Quick return in case of a workspace query. + if lwork == -1 { + return lapacke.Dhseqr(byte(job), byte(compz), n, ilo+1, ihi+1, h, ldh, wr, wi, z, ldz, work, -1) + } + + switch { + case len(h) < (n-1)*ldh+n: + panic(shortH) + case wantz && len(z) < (n-1)*ldz+n: + panic(shortZ) + case len(wr) < n: + panic(shortWr) + case len(wi) < n: + panic(shortWi) } - return lapacke.Dhseqr(lapack.Job(job), lapack.Comp(compz), n, ilo+1, ihi+1, - h, ldh, wr, wi, z, ldz, work, lwork) + return lapacke.Dhseqr(byte(job), byte(compz), n, ilo+1, ihi+1, h, ldh, wr, wi, z, ldz, work, lwork) } // Dgeev computes the eigenvalues and, optionally, the left and/or right @@ -2684,22 +3948,30 @@ func (impl Implementation) Dhseqr(job lapack.EVJob, compz lapack.EVComp, n, ilo, // // The right eigenvector v_j of A corresponding to an eigenvalue λ_j // is defined by -// A v_j = λ_j v_j, +// +// A v_j = λ_j v_j, +// // and the left eigenvector u_j corresponding to an eigenvalue λ_j is defined by -// u_j^H A = λ_j u_j^H, +// +// u_j^H A = λ_j u_j^H, +// // where u_j^H is the conjugate transpose of u_j. // // On return, A will be overwritten and the left and right eigenvectors will be // stored, respectively, in the columns of the n×n matrices VL and VR in the // same order as their eigenvalues. If the j-th eigenvalue is real, then -// u_j = VL[:,j], -// v_j = VR[:,j], +// +// u_j = VL[:,j], +// v_j = VR[:,j], +// // and if it is not real, then j and j+1 form a complex conjugate pair and the // eigenvectors can be recovered as -// u_j = VL[:,j] + i*VL[:,j+1], -// u_{j+1} = VL[:,j] - i*VL[:,j+1], -// v_j = VR[:,j] + i*VR[:,j+1], -// v_{j+1} = VR[:,j] - i*VR[:,j+1]. +// +// u_j = VL[:,j] + i*VL[:,j+1], +// u_{j+1} = VL[:,j] - i*VL[:,j+1], +// v_j = VR[:,j] + i*VR[:,j+1], +// v_{j+1} = VR[:,j] - i*VR[:,j+1]. +// // where i is the imaginary unit. The computed eigenvectors are normalized to // have Euclidean norm equal to 1 and largest component real. // @@ -2727,52 +3999,31 @@ func (impl Implementation) Dhseqr(job lapack.EVJob, compz lapack.EVComp, n, ilo, // computed and wr[first:] and wi[first:] contain those eigenvalues which have // converged. func (impl Implementation) Dgeev(jobvl lapack.LeftEVJob, jobvr lapack.RightEVJob, n int, a []float64, lda int, wr, wi []float64, vl []float64, ldvl int, vr []float64, ldvr int, work []float64, lwork int) (first int) { - var wantvl bool - switch jobvl { - default: - panic("lapack: invalid LeftEVJob") - case lapack.ComputeLeftEV: - wantvl = true - case lapack.None: - wantvl = false - } - var wantvr bool - switch jobvr { - default: - panic("lapack: invalid RightEVJob") - case lapack.ComputeRightEV: - wantvr = true - case lapack.None: - wantvr = false - } - switch { - case n < 0: - panic(nLT0) - case len(work) < lwork: - panic(shortWork) - } + wantvl := jobvl == lapack.LeftEVCompute + wantvr := jobvr == lapack.RightEVCompute var minwrk int if wantvl || wantvr { minwrk = max(1, 4*n) } else { minwrk = max(1, 3*n) } - if lwork != -1 { - checkMatrix(n, n, a, lda) - if wantvl { - checkMatrix(n, n, vl, ldvl) - } - if wantvr { - checkMatrix(n, n, vr, ldvr) - } - switch { - case len(wr) != n: - panic("lapack: bad length of wr") - case len(wi) != n: - panic("lapack: bad length of wi") - case lwork < minwrk: - panic(badWork) - } + switch { + case jobvl != lapack.LeftEVCompute && jobvl != lapack.LeftEVNone: + panic(badLeftEVJob) + case jobvr != lapack.RightEVCompute && jobvr != lapack.RightEVNone: + panic(badRightEVJob) + case n < 0: + panic(nLT0) + case lda < max(1, n): + panic(badLdA) + case ldvl < 1 || (ldvl < n && wantvl): + panic(badLdVL) + case ldvr < 1 || (ldvr < n && wantvr): + panic(badLdVR) + case lwork < minwrk && lwork != -1: + panic(badLWork) + case len(work) < lwork: + panic(shortWork) } // Quick return if possible. @@ -2781,12 +4032,31 @@ func (impl Implementation) Dgeev(jobvl lapack.LeftEVJob, jobvr lapack.RightEVJob return 0 } - first = lapacke.Dgeev(lapack.Job(jobvl), lapack.Job(jobvr), n, a, max(n, lda), wr, wi, - vl, max(n, ldvl), vr, max(n, ldvr), work, lwork) - if lwork == -1 && int(work[0]) < minwrk { - work[0] = float64(minwrk) + // TODO(vladimir-ch): The calls to lapacke.Dgeev below require max(n,ldvl) and + // max(n,ldvr) because the leading dimension checks in + // LAPACKE_dgeev_work are too strict. This has been reported in + // https://github.com/Reference-LAPACK/lapack/issues/327 + // Remove the calls to max if and when the upstream fixes this. + + if lwork == -1 { + lapacke.Dgeev(byte(jobvl), byte(jobvr), n, a, lda, wr, wi, vl, max(n, ldvl), vr, max(n, ldvr), work, -1) + return 0 + } + + switch { + case len(a) < (n-1)*lda+n: + panic(shortA) + case len(wr) != n: + panic(badLenWr) + case len(wi) != n: + panic(badLenWi) + case len(vl) < (n-1)*ldvl+n && wantvl: + panic(shortVL) + case len(vr) < (n-1)*ldvr+n && wantvr: + panic(shortVR) } - return first + + return lapacke.Dgeev(byte(jobvl), byte(jobvr), n, a, lda, wr, wi, vl, max(n, ldvl), vr, max(n, ldvr), work, lwork) } // Dtgsja computes the generalized singular value decomposition (GSVD) @@ -2796,18 +4066,18 @@ func (impl Implementation) Dgeev(jobvl lapack.LeftEVJob, jobvr lapack.RightEVJob // preprocessing subroutine Dggsvp from a general m×n matrix A and p×n // matrix B: // -// n-k-l k l -// A = k [ 0 A12 A13 ] if m-k-l >= 0; -// l [ 0 0 A23 ] -// m-k-l [ 0 0 0 ] +// n-k-l k l +// A = k [ 0 A12 A13 ] if m-k-l >= 0; +// l [ 0 0 A23 ] +// m-k-l [ 0 0 0 ] // -// n-k-l k l -// A = k [ 0 A12 A13 ] if m-k-l < 0; -// m-k [ 0 0 A23 ] +// n-k-l k l +// A = k [ 0 A12 A13 ] if m-k-l < 0; +// m-k [ 0 0 A23 ] // -// n-k-l k l -// B = l [ 0 0 B13 ] -// p-l [ 0 0 0 ] +// n-k-l k l +// B = l [ 0 0 B13 ] +// p-l [ 0 0 0 ] // // where the k×k matrix A12 and l×l matrix B13 are non-singular // upper triangular. A23 is l×l upper triangular if m-k-l >= 0, @@ -2815,7 +4085,7 @@ func (impl Implementation) Dgeev(jobvl lapack.LeftEVJob, jobvr lapack.RightEVJob // // On exit, // -// U^T*A*Q = D1*[ 0 R ], V^T*B*Q = D2*[ 0 R ], +// U^T*A*Q = D1*[ 0 R ], V^T*B*Q = D2*[ 0 R ], // // where U, V and Q are orthogonal matrices. // R is a non-singular upper triangular matrix, and D1 and D2 are @@ -2823,54 +4093,59 @@ func (impl Implementation) Dgeev(jobvl lapack.LeftEVJob, jobvr lapack.RightEVJob // // If m-k-l >= 0, // -// k l -// D1 = k [ I 0 ] -// l [ 0 C ] -// m-k-l [ 0 0 ] +// k l +// D1 = k [ I 0 ] +// l [ 0 C ] +// m-k-l [ 0 0 ] // -// k l -// D2 = l [ 0 S ] -// p-l [ 0 0 ] +// k l +// D2 = l [ 0 S ] +// p-l [ 0 0 ] // -// n-k-l k l -// [ 0 R ] = k [ 0 R11 R12 ] k -// l [ 0 0 R22 ] l +// n-k-l k l +// [ 0 R ] = k [ 0 R11 R12 ] k +// l [ 0 0 R22 ] l // // where // -// C = diag( alpha_k, ... , alpha_{k+l} ), -// S = diag( beta_k, ... , beta_{k+l} ), -// C^2 + S^2 = I. +// C = diag( alpha_k, ... , alpha_{k+l} ), +// S = diag( beta_k, ... , beta_{k+l} ), +// C^2 + S^2 = I. // // R is stored in -// A[0:k+l, n-k-l:n] +// +// A[0:k+l, n-k-l:n] +// // on exit. // // If m-k-l < 0, // -// k m-k k+l-m -// D1 = k [ I 0 0 ] -// m-k [ 0 C 0 ] +// k m-k k+l-m +// D1 = k [ I 0 0 ] +// m-k [ 0 C 0 ] // -// k m-k k+l-m -// D2 = m-k [ 0 S 0 ] -// k+l-m [ 0 0 I ] -// p-l [ 0 0 0 ] +// k m-k k+l-m +// D2 = m-k [ 0 S 0 ] +// k+l-m [ 0 0 I ] +// p-l [ 0 0 0 ] // -// n-k-l k m-k k+l-m -// [ 0 R ] = k [ 0 R11 R12 R13 ] -// m-k [ 0 0 R22 R23 ] -// k+l-m [ 0 0 0 R33 ] +// n-k-l k m-k k+l-m +// [ 0 R ] = k [ 0 R11 R12 R13 ] +// m-k [ 0 0 R22 R23 ] +// k+l-m [ 0 0 0 R33 ] // // where -// C = diag( alpha_k, ... , alpha_m ), -// S = diag( beta_k, ... , beta_m ), -// C^2 + S^2 = I. // -// R = [ R11 R12 R13 ] is stored in A[1:m, n-k-l+1:n] -// [ 0 R22 R23 ] +// C = diag( alpha_k, ... , alpha_m ), +// S = diag( beta_k, ... , beta_m ), +// C^2 + S^2 = I. +// +// R = [ R11 R12 R13 ] is stored in A[1:m, n-k-l+1:n] +// [ 0 R22 R23 ] +// // and R33 is stored in -// B[m-k:l, n+m-k-l:n] on exit. +// +// B[m-k:l, n+m-k-l:n] on exit. // // The computation of the orthogonal transformation matrices U, V or Q // is optional. These matrices may either be formed explicitly, or they @@ -2880,51 +4155,64 @@ func (impl Implementation) Dgeev(jobvl lapack.LeftEVJob, jobvr lapack.RightEVJob // min(l,m-k)×l triangular or trapezoidal matrix A23 and l×l // matrix B13 to the form: // -// U1^T*A13*Q1 = C1*R1; V1^T*B13*Q1 = S1*R1, +// U1^T*A13*Q1 = C1*R1; V1^T*B13*Q1 = S1*R1, // // where U1, V1 and Q1 are orthogonal matrices. C1 and S1 are diagonal // matrices satisfying // -// C1^2 + S1^2 = I, +// C1^2 + S1^2 = I, // // and R1 is an l×l non-singular upper triangular matrix. // // jobU, jobV and jobQ are options for computing the orthogonal matrices. The behavior // is as follows -// jobU == lapack.GSVDU Compute orthogonal matrix U -// jobU == lapack.GSVDUnit Use unit-initialized matrix -// jobU == lapack.GSVDNone Do not compute orthogonal matrix. +// +// jobU == lapack.GSVDU Compute orthogonal matrix U +// jobU == lapack.GSVDUnit Use unit-initialized matrix +// jobU == lapack.GSVDNone Do not compute orthogonal matrix. +// // The behavior is the same for jobV and jobQ with the exception that instead of // lapack.GSVDU these accept lapack.GSVDV and lapack.GSVDQ respectively. // The matrices U, V and Q must be m×m, p×p and n×n respectively unless the // relevant job parameter is lapack.GSVDNone. // // k and l specify the sub-blocks in the input matrices A and B: -// A23 = A[k:min(k+l,m), n-l:n) and B13 = B[0:l, n-l:n] +// +// A23 = A[k:min(k+l,m), n-l:n) and B13 = B[0:l, n-l:n] +// // of A and B, whose GSVD is going to be computed by Dtgsja. // // tola and tolb are the convergence criteria for the Jacobi-Kogbetliantz // iteration procedure. Generally, they are the same as used in the preprocessing // step, for example, -// tola = max(m, n)*norm(A)*eps, -// tolb = max(p, n)*norm(B)*eps, +// +// tola = max(m, n)*norm(A)*eps, +// tolb = max(p, n)*norm(B)*eps, +// // where eps is the machine epsilon. // // work must have length at least 2*n, otherwise Dtgsja will panic. // // alpha and beta must have length n or Dtgsja will panic. On exit, alpha and // beta contain the generalized singular value pairs of A and B -// alpha[0:k] = 1, -// beta[0:k] = 0, +// +// alpha[0:k] = 1, +// beta[0:k] = 0, +// // if m-k-l >= 0, -// alpha[k:k+l] = diag(C), -// beta[k:k+l] = diag(S), +// +// alpha[k:k+l] = diag(C), +// beta[k:k+l] = diag(S), +// // if m-k-l < 0, -// alpha[k:m]= C, alpha[m:k+l]= 0 -// beta[k:m] = S, beta[m:k+l] = 1. +// +// alpha[k:m]= C, alpha[m:k+l]= 0 +// beta[k:m] = S, beta[m:k+l] = 1. +// // if k+l < n, -// alpha[k+l:n] = 0 and -// beta[k+l:n] = 0. +// +// alpha[k+l:n] = 0 and +// beta[k+l:n] = 0. // // On exit, A[n-k:n, 0:min(k+l,m)] contains the triangular matrix R or part of R // and if necessary, B[m-k:l, n+m-k-l:n] contains a part of R. @@ -2934,48 +4222,78 @@ func (impl Implementation) Dgeev(jobvl lapack.LeftEVJob, jobvr lapack.RightEVJob // // Dtgsja is an internal routine. It is exported for testing purposes. func (impl Implementation) Dtgsja(jobU, jobV, jobQ lapack.GSVDJob, m, p, n, k, l int, a []float64, lda int, b []float64, ldb int, tola, tolb float64, alpha, beta, u []float64, ldu int, v []float64, ldv int, q []float64, ldq int, work []float64) (cycles int, ok bool) { - checkMatrix(m, n, a, lda) - checkMatrix(p, n, b, ldb) - - if len(alpha) != n { - panic(badAlpha) - } - if len(beta) != n { - panic(badBeta) - } - initu := jobU == lapack.GSVDUnit wantu := initu || jobU == lapack.GSVDU - if !initu && !wantu && jobU != lapack.GSVDNone { - panic(badGSVDJob + "U") - } - if jobU != lapack.GSVDNone { - checkMatrix(m, m, u, ldu) - } initv := jobV == lapack.GSVDUnit wantv := initv || jobV == lapack.GSVDV - if !initv && !wantv && jobV != lapack.GSVDNone { - panic(badGSVDJob + "V") - } - if jobV != lapack.GSVDNone { - checkMatrix(p, p, v, ldv) - } initq := jobQ == lapack.GSVDUnit wantq := initq || jobQ == lapack.GSVDQ - if !initq && !wantq && jobQ != lapack.GSVDNone { + + switch { + case !initu && !wantu && jobU != lapack.GSVDNone: + panic(badGSVDJob + "U") + case !initv && !wantv && jobV != lapack.GSVDNone: + panic(badGSVDJob + "V") + case !initq && !wantq && jobQ != lapack.GSVDNone: panic(badGSVDJob + "Q") - } - if jobQ != lapack.GSVDNone { - checkMatrix(n, n, q, ldq) - } + case m < 0: + panic(mLT0) + case p < 0: + panic(pLT0) + case n < 0: + panic(nLT0) + + case lda < max(1, n): + panic(badLdA) + case len(a) < (m-1)*lda+n: + panic(shortA) + + case ldb < max(1, n): + panic(badLdB) + case len(b) < (p-1)*ldb+n: + panic(shortB) + + case len(alpha) != n: + panic(badLenAlpha) + case len(beta) != n: + panic(badLenBeta) + + case ldu < 1, wantu && ldu < m: + panic(badLdU) + case wantu && len(u) < (m-1)*ldu+m: + panic(shortU) + + case ldv < 1, wantv && ldv < p: + panic(badLdV) + case wantv && len(v) < (p-1)*ldv+p: + panic(shortV) - if len(work) < 2*n { - panic(badWork) + case ldq < 1, wantq && ldq < n: + panic(badLdQ) + case wantq && len(q) < (n-1)*ldq+n: + panic(shortQ) + + case len(work) < 2*n: + panic(shortWork) } ncycle := []int32{0} - ok = lapacke.Dtgsja(lapack.Job(jobU), lapack.Job(jobV), lapack.Job(jobQ), m, p, n, k, l, a, lda, b, ldb, tola, tolb, alpha, beta, u, ldu, v, ldv, q, ldq, work, ncycle) + ok = lapacke.Dtgsja(byte(jobU), byte(jobV), byte(jobQ), m, p, n, k, l, a, lda, b, ldb, tola, tolb, alpha, beta, u, ldu, v, ldv, q, ldq, work, ncycle) return int(ncycle[0]), ok } + +func min(m, n int) int { + if m < n { + return m + } + return n +} + +func max(m, n int) int { + if m < n { + return n + } + return m +} diff --git a/lapack/netlib/lapack_test.go b/lapack/netlib/lapack_test.go index 2955de0e..f5f444ed 100644 --- a/lapack/netlib/lapack_test.go +++ b/lapack/netlib/lapack_test.go @@ -1,4 +1,4 @@ -// Copyright ©2015 The gonum Authors. All rights reserved. +// Copyright ©2015 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. @@ -64,6 +64,14 @@ func TestDlange(t *testing.T) { testlapack.DlangeTest(t, impl) } +func TestDlansy(t *testing.T) { + testlapack.DlansyTest(t, impl) +} + +func TestDlantr(t *testing.T) { + testlapack.DlantrTest(t, impl) +} + func TestDlarfb(t *testing.T) { testlapack.DlarfbTest(t, impl) } @@ -76,8 +84,8 @@ func TestDlarft(t *testing.T) { testlapack.DlarftTest(t, impl) } -func TestDlantr(t *testing.T) { - testlapack.DlantrTest(t, impl) +func TestDlapmr(t *testing.T) { + testlapack.DlapmrTest(t, impl) } func TestDlapmt(t *testing.T) { @@ -104,10 +112,34 @@ func TestDlaswp(t *testing.T) { testlapack.DlaswpTest(t, impl) } +func TestDpbcon(t *testing.T) { + testlapack.DpbconTest(t, impl) +} + +func TestDpbtrf(t *testing.T) { + testlapack.DpbtrfTest(t, impl) +} + +func TestDpbtrs(t *testing.T) { + testlapack.DpbtrsTest(t, impl) +} + func TestDpotrf(t *testing.T) { testlapack.DpotrfTest(t, impl) } +func TestDpotri(t *testing.T) { + testlapack.DpotriTest(t, impl) +} + +func TestDpotrs(t *testing.T) { + testlapack.DpotrsTest(t, impl) +} + +func TestDpstrf(t *testing.T) { + testlapack.DpstrfTest(t, impl) +} + func TestDgebak(t *testing.T) { testlapack.DgebakTest(t, impl) } @@ -157,7 +189,8 @@ func TestDgerqf(t *testing.T) { } func TestDgesvd(t *testing.T) { - testlapack.DgesvdTest(t, impl) + const tol = 1e-12 + testlapack.DgesvdTest(t, impl, tol) } func TestDgetf2(t *testing.T) { @@ -260,6 +293,11 @@ func TestDtgsja(t *testing.T) { testlapack.DtgsjaTest(t, impl) } +func TestDtbtrs(t *testing.T) { + t.Parallel() + testlapack.DtbtrsTest(t, impl) +} + func TestDtrexc(t *testing.T) { testlapack.DtrexcTest(t, impl) }