From f66ef23c1182e72db9cbb80f6df4186a326374c0 Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Fri, 10 Jan 2020 15:26:48 -0500 Subject: [PATCH] update gonum.org/v1/gonum to v0.6.2 --- go.mod | 10 +- go.sum | 10 +- .../src/k8s.io/apiextensions-apiserver/go.sum | 12 + staging/src/k8s.io/code-generator/go.mod | 2 +- staging/src/k8s.io/code-generator/go.sum | 12 + staging/src/k8s.io/kube-aggregator/go.sum | 12 + staging/src/k8s.io/kubectl/go.sum | 11 + staging/src/k8s.io/metrics/go.sum | 12 + staging/src/k8s.io/node-api/go.sum | 12 + staging/src/k8s.io/sample-apiserver/go.sum | 12 + staging/src/k8s.io/sample-controller/go.sum | 12 + vendor/gonum.org/v1/gonum/AUTHORS | 8 + vendor/gonum.org/v1/gonum/CONTRIBUTORS | 8 + .../gonum.org/v1/gonum/blas/blas64/blas64.go | 79 +-- vendor/gonum.org/v1/gonum/blas/blas64/conv.go | 2 +- .../v1/gonum/blas/cblas128/cblas128.go | 178 ++++--- .../gonum.org/v1/gonum/blas/cblas128/conv.go | 2 +- vendor/gonum.org/v1/gonum/blas/gonum/dgemm.go | 12 +- vendor/gonum.org/v1/gonum/blas/gonum/gemv.go | 8 +- .../v1/gonum/blas/gonum/level1cmplx128.go | 4 +- .../v1/gonum/blas/gonum/level1cmplx64.go | 4 +- .../v1/gonum/blas/gonum/level2cmplx128.go | 80 ++-- .../v1/gonum/blas/gonum/level2cmplx64.go | 80 ++-- .../v1/gonum/blas/gonum/level2float32.go | 38 +- .../v1/gonum/blas/gonum/level2float64.go | 38 +- .../v1/gonum/blas/gonum/level3cmplx128.go | 70 +-- .../v1/gonum/blas/gonum/level3cmplx64.go | 70 +-- .../v1/gonum/blas/gonum/level3float32.go | 24 +- .../v1/gonum/blas/gonum/level3float64.go | 24 +- vendor/gonum.org/v1/gonum/blas/gonum/sgemm.go | 12 +- .../v1/gonum/graph/encoding/dot/encode.go | 5 +- .../v1/gonum/graph/iterator/nodes.go | 57 ++- .../v1/gonum/graph/simple/directed.go | 16 +- .../v1/gonum/graph/simple/undirected.go | 13 +- .../gonum/graph/simple/weighted_directed.go | 18 +- .../gonum/graph/simple/weighted_undirected.go | 13 +- .../gonum/internal/asm/c128/axpyinc_amd64.s | 2 +- .../gonum/internal/asm/c128/axpyincto_amd64.s | 2 +- .../internal/asm/c128/axpyunitary_amd64.s | 2 +- .../internal/asm/c128/axpyunitaryto_amd64.s | 2 +- .../gonum/internal/asm/c128/dotcinc_amd64.s | 2 +- .../internal/asm/c128/dotcunitary_amd64.s | 2 +- .../gonum/internal/asm/c128/dotuinc_amd64.s | 2 +- .../internal/asm/c128/dotuunitary_amd64.s | 2 +- .../gonum/internal/asm/c128/dscalinc_amd64.s | 2 +- .../internal/asm/c128/dscalunitary_amd64.s | 2 +- .../internal/asm/c128/scalUnitary_amd64.s | 2 +- .../gonum/internal/asm/c128/scalinc_amd64.s | 2 +- .../v1/gonum/internal/asm/c64/axpyinc_amd64.s | 2 +- .../gonum/internal/asm/c64/axpyincto_amd64.s | 2 +- .../internal/asm/c64/axpyunitary_amd64.s | 2 +- .../internal/asm/c64/axpyunitaryto_amd64.s | 2 +- .../v1/gonum/internal/asm/c64/dotcinc_amd64.s | 2 +- .../internal/asm/c64/dotcunitary_amd64.s | 2 +- .../v1/gonum/internal/asm/c64/dotuinc_amd64.s | 2 +- .../internal/asm/c64/dotuunitary_amd64.s | 2 +- .../v1/gonum/internal/asm/f32/axpyinc_amd64.s | 2 +- .../gonum/internal/asm/f32/axpyincto_amd64.s | 2 +- .../internal/asm/f32/axpyunitary_amd64.s | 2 +- .../internal/asm/f32/axpyunitaryto_amd64.s | 2 +- .../v1/gonum/internal/asm/f32/ddotinc_amd64.s | 2 +- .../internal/asm/f32/ddotunitary_amd64.s | 2 +- .../v1/gonum/internal/asm/f32/dotinc_amd64.s | 2 +- .../gonum/internal/asm/f32/dotunitary_amd64.s | 2 +- .../v1/gonum/internal/asm/f32/ge_amd64.go | 2 +- .../v1/gonum/internal/asm/f32/ge_amd64.s | 2 +- .../v1/gonum/internal/asm/f32/ge_noasm.go | 2 +- .../v1/gonum/internal/asm/f64/axpyinc_amd64.s | 2 +- .../gonum/internal/asm/f64/axpyincto_amd64.s | 2 +- .../internal/asm/f64/axpyunitary_amd64.s | 2 +- .../internal/asm/f64/axpyunitaryto_amd64.s | 2 +- .../v1/gonum/internal/asm/f64/dot_amd64.s | 2 +- .../v1/gonum/internal/asm/f64/ge_amd64.go | 4 +- .../v1/gonum/internal/asm/f64/ge_noasm.go | 4 +- .../v1/gonum/internal/asm/f64/gemvN_amd64.s | 2 +- .../v1/gonum/internal/asm/f64/gemvT_amd64.s | 2 +- .../v1/gonum/internal/asm/f64/ger_amd64.s | 2 +- .../v1/gonum/internal/asm/f64/scalinc_amd64.s | 2 +- .../gonum/internal/asm/f64/scalincto_amd64.s | 2 +- .../internal/asm/f64/scalunitary_amd64.s | 2 +- .../internal/asm/f64/scalunitaryto_amd64.s | 2 +- vendor/gonum.org/v1/gonum/lapack/gonum/BUILD | 6 + .../gonum.org/v1/gonum/lapack/gonum/dbdsqr.go | 12 +- .../v1/gonum/lapack/gonum/dcombssq.go | 21 + .../gonum.org/v1/gonum/lapack/gonum/dgebak.go | 4 +- .../gonum.org/v1/gonum/lapack/gonum/dgebal.go | 8 +- .../gonum.org/v1/gonum/lapack/gonum/dgebd2.go | 2 +- .../gonum.org/v1/gonum/lapack/gonum/dgebrd.go | 6 +- .../gonum.org/v1/gonum/lapack/gonum/dgeev.go | 4 +- .../gonum.org/v1/gonum/lapack/gonum/dgehd2.go | 4 +- .../gonum.org/v1/gonum/lapack/gonum/dgehrd.go | 8 +- .../gonum.org/v1/gonum/lapack/gonum/dgels.go | 2 +- .../gonum.org/v1/gonum/lapack/gonum/dgeql2.go | 2 +- .../gonum.org/v1/gonum/lapack/gonum/dgeqp3.go | 2 +- .../gonum.org/v1/gonum/lapack/gonum/dgeqr2.go | 2 +- .../gonum.org/v1/gonum/lapack/gonum/dgeqrf.go | 2 +- .../gonum.org/v1/gonum/lapack/gonum/dgerq2.go | 2 +- .../gonum.org/v1/gonum/lapack/gonum/dgerqf.go | 2 +- .../gonum.org/v1/gonum/lapack/gonum/dgesvd.go | 4 +- .../gonum.org/v1/gonum/lapack/gonum/dgetrs.go | 10 +- .../v1/gonum/lapack/gonum/dggsvd3.go | 6 +- .../v1/gonum/lapack/gonum/dggsvp3.go | 18 +- .../gonum.org/v1/gonum/lapack/gonum/dhseqr.go | 8 +- .../gonum.org/v1/gonum/lapack/gonum/dlabrd.go | 6 +- .../gonum.org/v1/gonum/lapack/gonum/dlacn2.go | 2 +- .../gonum.org/v1/gonum/lapack/gonum/dlags2.go | 40 +- .../gonum.org/v1/gonum/lapack/gonum/dlahr2.go | 18 +- .../gonum.org/v1/gonum/lapack/gonum/dlaln2.go | 6 +- .../gonum.org/v1/gonum/lapack/gonum/dlange.go | 49 +- .../gonum.org/v1/gonum/lapack/gonum/dlansb.go | 135 ++++++ .../gonum.org/v1/gonum/lapack/gonum/dlansy.go | 42 +- .../gonum.org/v1/gonum/lapack/gonum/dlantr.go | 46 +- .../gonum.org/v1/gonum/lapack/gonum/dlaqp2.go | 2 +- .../gonum.org/v1/gonum/lapack/gonum/dlaqps.go | 10 +- .../v1/gonum/lapack/gonum/dlaqr04.go | 10 +- .../v1/gonum/lapack/gonum/dlaqr23.go | 4 +- .../gonum.org/v1/gonum/lapack/gonum/dlaqr5.go | 6 +- .../gonum.org/v1/gonum/lapack/gonum/dlarf.go | 8 +- .../gonum.org/v1/gonum/lapack/gonum/dlarfb.go | 102 ++-- .../gonum.org/v1/gonum/lapack/gonum/dlarfg.go | 4 +- .../gonum.org/v1/gonum/lapack/gonum/dlarft.go | 4 +- .../gonum.org/v1/gonum/lapack/gonum/dlarfx.go | 2 +- .../gonum.org/v1/gonum/lapack/gonum/dlasr.go | 2 +- .../gonum.org/v1/gonum/lapack/gonum/dlasy2.go | 8 +- .../gonum.org/v1/gonum/lapack/gonum/dlatbs.go | 452 ++++++++++++++++++ .../gonum.org/v1/gonum/lapack/gonum/dlatrd.go | 6 +- .../gonum.org/v1/gonum/lapack/gonum/dlatrs.go | 2 +- .../gonum.org/v1/gonum/lapack/gonum/dlauu2.go | 8 +- .../gonum.org/v1/gonum/lapack/gonum/dlauum.go | 8 +- .../gonum.org/v1/gonum/lapack/gonum/dorgbr.go | 12 +- .../gonum.org/v1/gonum/lapack/gonum/dorghr.go | 4 +- .../gonum.org/v1/gonum/lapack/gonum/dorm2r.go | 8 +- .../gonum.org/v1/gonum/lapack/gonum/dormbr.go | 10 +- .../gonum.org/v1/gonum/lapack/gonum/dormhr.go | 16 +- .../gonum.org/v1/gonum/lapack/gonum/dorml2.go | 8 +- .../gonum.org/v1/gonum/lapack/gonum/dormlq.go | 8 +- .../gonum.org/v1/gonum/lapack/gonum/dormqr.go | 8 +- .../gonum.org/v1/gonum/lapack/gonum/dormr2.go | 8 +- .../gonum.org/v1/gonum/lapack/gonum/dpbcon.go | 108 +++++ .../gonum.org/v1/gonum/lapack/gonum/dpbtf2.go | 26 +- .../gonum.org/v1/gonum/lapack/gonum/dpbtrf.go | 214 +++++++++ .../gonum.org/v1/gonum/lapack/gonum/dpbtrs.go | 67 +++ .../gonum.org/v1/gonum/lapack/gonum/dpotf2.go | 2 +- .../gonum.org/v1/gonum/lapack/gonum/dpotrf.go | 2 +- .../gonum.org/v1/gonum/lapack/gonum/dpotri.go | 4 +- .../gonum.org/v1/gonum/lapack/gonum/dpotrs.go | 12 +- .../gonum.org/v1/gonum/lapack/gonum/dsytd2.go | 16 +- .../gonum.org/v1/gonum/lapack/gonum/dsytrd.go | 10 +- .../gonum.org/v1/gonum/lapack/gonum/dtgsja.go | 8 +- .../v1/gonum/lapack/gonum/dtrevc3.go | 22 +- .../gonum.org/v1/gonum/lapack/gonum/dtrexc.go | 4 +- .../gonum.org/v1/gonum/lapack/gonum/dtrtrs.go | 2 +- .../gonum.org/v1/gonum/lapack/gonum/ilaenv.go | 4 +- .../gonum.org/v1/gonum/lapack/gonum/lapack.go | 4 + vendor/gonum.org/v1/gonum/lapack/lapack.go | 6 +- .../v1/gonum/lapack/lapack64/lapack64.go | 48 +- vendor/gonum.org/v1/gonum/mat/BUILD | 2 + vendor/gonum.org/v1/gonum/mat/band.go | 42 +- vendor/gonum.org/v1/gonum/mat/cdense.go | 48 +- vendor/gonum.org/v1/gonum/mat/cholesky.go | 115 +++-- vendor/gonum.org/v1/gonum/mat/cmatrix.go | 7 + vendor/gonum.org/v1/gonum/mat/dense.go | 82 ++-- .../v1/gonum/mat/dense_arithmetic.go | 259 +++++----- vendor/gonum.org/v1/gonum/mat/diagonal.go | 33 +- vendor/gonum.org/v1/gonum/mat/doc.go | 51 +- vendor/gonum.org/v1/gonum/mat/eigen.go | 74 +-- vendor/gonum.org/v1/gonum/mat/errors.go | 44 +- vendor/gonum.org/v1/gonum/mat/gsvd.go | 127 +++-- vendor/gonum.org/v1/gonum/mat/hogsvd.go | 52 +- vendor/gonum.org/v1/gonum/mat/inner.go | 9 +- vendor/gonum.org/v1/gonum/mat/io.go | 33 +- vendor/gonum.org/v1/gonum/mat/lq.go | 63 +-- vendor/gonum.org/v1/gonum/mat/lu.go | 63 ++- vendor/gonum.org/v1/gonum/mat/matrix.go | 91 +++- vendor/gonum.org/v1/gonum/mat/offset.go | 11 + .../v1/gonum/mat/offset_appengine.go | 15 + vendor/gonum.org/v1/gonum/mat/pool.go | 14 +- vendor/gonum.org/v1/gonum/mat/product.go | 6 +- vendor/gonum.org/v1/gonum/mat/qr.go | 60 +-- vendor/gonum.org/v1/gonum/mat/shadow.go | 150 +++--- .../gonum.org/v1/gonum/mat/shadow_common.go | 54 +++ .../gonum.org/v1/gonum/mat/shadow_complex.go | 72 +++ vendor/gonum.org/v1/gonum/mat/solve.go | 6 +- vendor/gonum.org/v1/gonum/mat/svd.go | 50 +- vendor/gonum.org/v1/gonum/mat/symband.go | 32 ++ vendor/gonum.org/v1/gonum/mat/symmetric.go | 152 ++++-- vendor/gonum.org/v1/gonum/mat/triangular.go | 120 ++++- vendor/gonum.org/v1/gonum/mat/triband.go | 28 +- vendor/gonum.org/v1/gonum/mat/vector.go | 209 ++++---- vendor/modules.txt | 2 +- 190 files changed, 3451 insertions(+), 1557 deletions(-) create mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dcombssq.go create mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlansb.go create mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlatbs.go create mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dpbcon.go create mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dpbtrf.go create mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dpbtrs.go create mode 100644 vendor/gonum.org/v1/gonum/mat/shadow_common.go create mode 100644 vendor/gonum.org/v1/gonum/mat/shadow_complex.go diff --git a/go.mod b/go.mod index dab4a1a0831..193ed25870f 100644 --- a/go.mod +++ b/go.mod @@ -126,7 +126,7 @@ require ( golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456 golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72 - gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485 + gonum.org/v1/gonum v0.6.2 google.golang.org/api v0.6.1-0.20190607001116-5213b8090861 google.golang.org/grpc v1.23.1 gopkg.in/gcfg.v1 v1.2.0 @@ -194,6 +194,7 @@ replace ( github.com/Rican7/retry => github.com/Rican7/retry v0.1.0 github.com/StackExchange/wmi => github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 github.com/agnivade/levenshtein => github.com/agnivade/levenshtein v1.0.1 + github.com/ajstarks/svgo => github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af github.com/alecthomas/template => github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc github.com/alecthomas/units => github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf github.com/andreyvit/diff => github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 @@ -256,6 +257,7 @@ replace ( github.com/fatih/camelcase => github.com/fatih/camelcase v1.0.0 github.com/fatih/color => github.com/fatih/color v1.7.0 github.com/flynn/go-shlex => github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 + github.com/fogleman/gg => github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90 github.com/fsnotify/fsnotify => github.com/fsnotify/fsnotify v1.4.7 github.com/ghodss/yaml => github.com/ghodss/yaml v1.0.0 github.com/gliderlabs/ssh => github.com/gliderlabs/ssh v0.1.1 @@ -291,6 +293,7 @@ replace ( github.com/gobwas/glob => github.com/gobwas/glob v0.2.3 github.com/godbus/dbus => github.com/godbus/dbus v0.0.0-20181101234600-2ff6f7ffd60f github.com/gogo/protobuf => github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d + github.com/golang/freetype => github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 github.com/golang/glog => github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b github.com/golang/groupcache => github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903 github.com/golang/mock => github.com/golang/mock v1.2.0 @@ -353,6 +356,7 @@ replace ( github.com/jstemmer/go-junit-report => github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024 github.com/jtolds/gls => github.com/jtolds/gls v4.20.0+incompatible github.com/julienschmidt/httprouter => github.com/julienschmidt/httprouter v1.2.0 + github.com/jung-kurt/gofpdf => github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5 github.com/karrick/godirwalk => github.com/karrick/godirwalk v1.7.5 github.com/kisielk/errcheck => github.com/kisielk/errcheck v1.2.0 github.com/kisielk/gotool => github.com/kisielk/gotool v1.0.0 @@ -497,8 +501,9 @@ replace ( golang.org/x/time => golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 golang.org/x/tools => golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7 // pinned to release-branch.go1.13 golang.org/x/xerrors => golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7 - gonum.org/v1/gonum => gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485 + gonum.org/v1/gonum => gonum.org/v1/gonum v0.6.2 gonum.org/v1/netlib => gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e + gonum.org/v1/plot => gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b google.golang.org/api => google.golang.org/api v0.6.1-0.20190607001116-5213b8090861 google.golang.org/appengine => google.golang.org/appengine v1.5.0 google.golang.org/genproto => google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873 @@ -562,6 +567,7 @@ replace ( mvdan.cc/interfacer => mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed mvdan.cc/lint => mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b mvdan.cc/unparam => mvdan.cc/unparam v0.0.0-20190209190245-fbb59629db34 + rsc.io/pdf => rsc.io/pdf v0.1.1 sigs.k8s.io/kustomize => sigs.k8s.io/kustomize v2.0.3+incompatible sigs.k8s.io/structured-merge-diff => sigs.k8s.io/structured-merge-diff v1.0.1-0.20191108220359-b1b620dd3f06 sigs.k8s.io/yaml => sigs.k8s.io/yaml v1.1.0 diff --git a/go.sum b/go.sum index 80e94f59171..6615762b0ec 100644 --- a/go.sum +++ b/go.sum @@ -46,6 +46,7 @@ github.com/Rican7/retry v0.1.0 h1:FqK94z34ly8Baa6K+G8Mmza9rYWTKOJk+yckIBB5qVk= github.com/Rican7/retry v0.1.0/go.mod h1:FgOROf8P5bebcC1DS0PdOQiqGUridaZvikzUmkFW6gg= github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= +github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= @@ -156,6 +157,7 @@ github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwo github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= +github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= @@ -208,6 +210,7 @@ github.com/godbus/dbus v0.0.0-20181101234600-2ff6f7ffd60f h1:zlOR3rOlPAVvtfuxGKo github.com/godbus/dbus v0.0.0-20181101234600-2ff6f7ffd60f/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d h1:3PaI8p3seN09VjbTYC/QWlUZdZ1qS1zGjy7LH2Wt07I= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903 h1:LbsanbbD6LieFkXbj9YNNBupiGHJgFeLpO0j0Fza1h8= @@ -303,6 +306,7 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1 github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/karrick/godirwalk v1.7.5 h1:VbzFqwXwNbAZoA6W5odrLr+hKK197CcENcPh6E/gJ0M= github.com/karrick/godirwalk v1.7.5/go.mod h1:2c9FRhkDxdIbgkOnCEvnSWs71Bhugbl46shStcFDJ34= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= @@ -538,10 +542,11 @@ golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7 h1:PVCvyir09Xgta5zksNZDkrL+eSm/Y+gQxRG3IfqNQ3A= golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485 h1:OB/uP/Puiu5vS5QMRPrXCDWUPb+kt8f1KW8oQzFejQw= -gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= +gonum.org/v1/gonum v0.6.2 h1:4r+yNT0+8SWcOkXP+63H2zQbN+USnC73cjGUxnDF94Q= +gonum.org/v1/gonum v0.6.2/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e h1:jRyg0XfpwWlhEV8mDfdNGBeSJM2fuyh9Yjrnd8kF2Ts= gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= +gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= google.golang.org/api v0.6.1-0.20190607001116-5213b8090861 h1:ppLucX0K/60T3t6LPZQzTOkt5PytkEbQLIaSteq+TpE= google.golang.org/api v0.6.1-0.20190607001116-5213b8090861/go.mod h1:btoxGiFvQNVUZQ8W08zLtrVS08CNpINPEfxXxgJL1Q4= google.golang.org/appengine v1.5.0 h1:KxkO13IPW4Lslp2bz+KHP2E3gtFlrIGNThxkZQ3g+4c= @@ -604,6 +609,7 @@ modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc= mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4= mvdan.cc/unparam v0.0.0-20190209190245-fbb59629db34/go.mod h1:H6SUd1XjIs+qQCyskXg5OFSrilMRUkD8ePJpHKDPaeY= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= sigs.k8s.io/kustomize v2.0.3+incompatible h1:JUufWFNlI44MdtnjUqVnvh29rR37PQFzPbLXqhyOyX0= sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU= sigs.k8s.io/structured-merge-diff v1.0.1-0.20191108220359-b1b620dd3f06 h1:zD2IemQ4LmOcAumeiyDWXKUI2SO0NYDe3H6QGvPOVgU= diff --git a/staging/src/k8s.io/apiextensions-apiserver/go.sum b/staging/src/k8s.io/apiextensions-apiserver/go.sum index ecddcbf0981..0401f05968a 100644 --- a/staging/src/k8s.io/apiextensions-apiserver/go.sum +++ b/staging/src/k8s.io/apiextensions-apiserver/go.sum @@ -22,6 +22,7 @@ github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdko github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= +github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= @@ -74,6 +75,7 @@ github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT github.com/evanphx/json-patch v4.2.0+incompatible h1:fUDGZCv/7iAN7u0puUVhvKCcsR6vRfwrJatElLBEf0I= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -151,6 +153,7 @@ github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d h1:3PaI8p3seN09VjbTYC/QWlUZdZ1qS1zGjy7LH2Wt07I= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903 h1:LbsanbbD6LieFkXbj9YNNBupiGHJgFeLpO0j0Fza1h8= @@ -214,6 +217,7 @@ github.com/json-iterator/go v1.1.8 h1:QiWkFLKq0T7mpzwOTu6BzNDbfTE8OLrYhVKYMLF46O github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= @@ -355,10 +359,13 @@ golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586 h1:7KByu05hhLed2MO29w7p1XfZvZ13m8mub3shuVftRs0= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +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-20190121172915-509febef88a4/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-20190312203227-4b39c73a6495 h1:I6A9Ag9FpEKOjcKrRNjQkPHawoXIhKyTGfvvjFAiiAk= golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +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/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= @@ -409,11 +416,15 @@ golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7 h1:PVCvyir09Xgta5zksNZDkrL+eSm/Y+gQxRG3IfqNQ3A= golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/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.0.0-20190331200053-3d26580ed485 h1:OB/uP/Puiu5vS5QMRPrXCDWUPb+kt8f1KW8oQzFejQw= gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= +gonum.org/v1/gonum v0.6.2 h1:4r+yNT0+8SWcOkXP+63H2zQbN+USnC73cjGUxnDF94Q= +gonum.org/v1/gonum v0.6.2/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e h1:jRyg0XfpwWlhEV8mDfdNGBeSJM2fuyh9Yjrnd8kF2Ts= gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= +gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -472,6 +483,7 @@ modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e h1:4Z09Hglb792X0kfOBBJUPFEyvVfQWrYT/l8h5EKA6JQ= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/structured-merge-diff v1.0.1-0.20191108220359-b1b620dd3f06 h1:zD2IemQ4LmOcAumeiyDWXKUI2SO0NYDe3H6QGvPOVgU= diff --git a/staging/src/k8s.io/code-generator/go.mod b/staging/src/k8s.io/code-generator/go.mod index a0afb37a93a..78b7f079f22 100644 --- a/staging/src/k8s.io/code-generator/go.mod +++ b/staging/src/k8s.io/code-generator/go.mod @@ -16,7 +16,7 @@ require ( github.com/stretchr/testify v1.4.0 // indirect golang.org/x/net v0.0.0-20191004110552-13f9640d40b9 // indirect golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72 // indirect - gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485 + gonum.org/v1/gonum v0.6.2 gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e // indirect gopkg.in/yaml.v2 v2.2.4 // indirect k8s.io/gengo v0.0.0-20190822140433-26a664648505 diff --git a/staging/src/k8s.io/code-generator/go.sum b/staging/src/k8s.io/code-generator/go.sum index 7bab2c9efd3..ee227d4cf48 100644 --- a/staging/src/k8s.io/code-generator/go.sum +++ b/staging/src/k8s.io/code-generator/go.sum @@ -6,6 +6,7 @@ github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbt github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -13,6 +14,7 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao2r4iyvLdACqsl/Ljk= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= @@ -35,6 +37,7 @@ github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tF github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d h1:3PaI8p3seN09VjbTYC/QWlUZdZ1qS1zGjy7LH2Wt07I= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -42,6 +45,7 @@ github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsC github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.8 h1:QiWkFLKq0T7mpzwOTu6BzNDbfTE8OLrYhVKYMLF46Ok= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= @@ -82,9 +86,12 @@ github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJy github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +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-20190312203227-4b39c73a6495 h1:I6A9Ag9FpEKOjcKrRNjQkPHawoXIhKyTGfvvjFAiiAk= golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +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/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -103,11 +110,15 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7 h1:PVCvyir09Xgta5zksNZDkrL+eSm/Y+gQxRG3IfqNQ3A= golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/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.0.0-20190331200053-3d26580ed485 h1:OB/uP/Puiu5vS5QMRPrXCDWUPb+kt8f1KW8oQzFejQw= gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= +gonum.org/v1/gonum v0.6.2 h1:4r+yNT0+8SWcOkXP+63H2zQbN+USnC73cjGUxnDF94Q= +gonum.org/v1/gonum v0.6.2/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e h1:jRyg0XfpwWlhEV8mDfdNGBeSJM2fuyh9Yjrnd8kF2Ts= gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= +gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -130,5 +141,6 @@ modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= diff --git a/staging/src/k8s.io/kube-aggregator/go.sum b/staging/src/k8s.io/kube-aggregator/go.sum index 315236341fa..fdbfdf9658c 100644 --- a/staging/src/k8s.io/kube-aggregator/go.sum +++ b/staging/src/k8s.io/kube-aggregator/go.sum @@ -20,6 +20,7 @@ github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbt github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= @@ -67,6 +68,7 @@ github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT github.com/evanphx/json-patch v4.2.0+incompatible h1:fUDGZCv/7iAN7u0puUVhvKCcsR6vRfwrJatElLBEf0I= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -97,6 +99,7 @@ github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d h1:3PaI8p3seN09VjbTYC/QWlUZdZ1qS1zGjy7LH2Wt07I= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903 h1:LbsanbbD6LieFkXbj9YNNBupiGHJgFeLpO0j0Fza1h8= @@ -160,6 +163,7 @@ github.com/json-iterator/go v1.1.8 h1:QiWkFLKq0T7mpzwOTu6BzNDbfTE8OLrYhVKYMLF46O github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= @@ -288,10 +292,13 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586 h1:7KByu05hhLed2MO29w7p1XfZvZ13m8mub3shuVftRs0= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +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-20190121172915-509febef88a4/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-20190312203227-4b39c73a6495 h1:I6A9Ag9FpEKOjcKrRNjQkPHawoXIhKyTGfvvjFAiiAk= golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +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/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= @@ -340,11 +347,15 @@ golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7 h1:PVCvyir09Xgta5zksNZDkrL+eSm/Y+gQxRG3IfqNQ3A= golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/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.0.0-20190331200053-3d26580ed485 h1:OB/uP/Puiu5vS5QMRPrXCDWUPb+kt8f1KW8oQzFejQw= gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= +gonum.org/v1/gonum v0.6.2 h1:4r+yNT0+8SWcOkXP+63H2zQbN+USnC73cjGUxnDF94Q= +gonum.org/v1/gonum v0.6.2/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e h1:jRyg0XfpwWlhEV8mDfdNGBeSJM2fuyh9Yjrnd8kF2Ts= gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= +gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -403,6 +414,7 @@ modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e h1:4Z09Hglb792X0kfOBBJUPFEyvVfQWrYT/l8h5EKA6JQ= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/structured-merge-diff v1.0.1-0.20191108220359-b1b620dd3f06 h1:zD2IemQ4LmOcAumeiyDWXKUI2SO0NYDe3H6QGvPOVgU= diff --git a/staging/src/k8s.io/kubectl/go.sum b/staging/src/k8s.io/kubectl/go.sum index 78cdbcda2d6..ccbeaada023 100644 --- a/staging/src/k8s.io/kubectl/go.sum +++ b/staging/src/k8s.io/kubectl/go.sum @@ -21,6 +21,7 @@ github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbt github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= @@ -58,6 +59,7 @@ github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d h1:105gxyaGwC github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4= github.com/fatih/camelcase v1.0.0 h1:hxNvNX/xYBp0ovncs8WyWZrOrpBNub/JfaMvbURyft8= github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= +github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -88,6 +90,7 @@ github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/me github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d h1:3PaI8p3seN09VjbTYC/QWlUZdZ1qS1zGjy7LH2Wt07I= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903 h1:LbsanbbD6LieFkXbj9YNNBupiGHJgFeLpO0j0Fza1h8= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -144,6 +147,7 @@ github.com/json-iterator/go v1.1.8 h1:QiWkFLKq0T7mpzwOTu6BzNDbfTE8OLrYhVKYMLF46O github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= @@ -247,9 +251,12 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586 h1:7KByu05hhLed2MO29w7p1XfZvZ13m8mub3shuVftRs0= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +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-20190121172915-509febef88a4/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-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +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/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= @@ -291,9 +298,12 @@ golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZe golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/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.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= +gonum.org/v1/gonum v0.6.2/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= +gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -338,6 +348,7 @@ modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= sigs.k8s.io/kustomize v2.0.3+incompatible h1:JUufWFNlI44MdtnjUqVnvh29rR37PQFzPbLXqhyOyX0= sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= diff --git a/staging/src/k8s.io/metrics/go.sum b/staging/src/k8s.io/metrics/go.sum index 9d35a3e6f9d..54a0a4d3812 100644 --- a/staging/src/k8s.io/metrics/go.sum +++ b/staging/src/k8s.io/metrics/go.sum @@ -17,6 +17,7 @@ github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbt github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -30,6 +31,7 @@ github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/evanphx/json-patch v4.2.0+incompatible h1:fUDGZCv/7iAN7u0puUVhvKCcsR6vRfwrJatElLBEf0I= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -54,6 +56,7 @@ github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tF github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d h1:3PaI8p3seN09VjbTYC/QWlUZdZ1qS1zGjy7LH2Wt07I= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= @@ -87,6 +90,7 @@ github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBv github.com/json-iterator/go v1.1.8 h1:QiWkFLKq0T7mpzwOTu6BzNDbfTE8OLrYhVKYMLF46Ok= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= @@ -140,10 +144,13 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586 h1:7KByu05hhLed2MO29w7p1XfZvZ13m8mub3shuVftRs0= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +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-20190121172915-509febef88a4/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-20190312203227-4b39c73a6495 h1:I6A9Ag9FpEKOjcKrRNjQkPHawoXIhKyTGfvvjFAiiAk= golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +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/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= @@ -183,11 +190,15 @@ golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7 h1:PVCvyir09Xgta5zksNZDkrL+eSm/Y+gQxRG3IfqNQ3A= golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/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.0.0-20190331200053-3d26580ed485 h1:OB/uP/Puiu5vS5QMRPrXCDWUPb+kt8f1KW8oQzFejQw= gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= +gonum.org/v1/gonum v0.6.2 h1:4r+yNT0+8SWcOkXP+63H2zQbN+USnC73cjGUxnDF94Q= +gonum.org/v1/gonum v0.6.2/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e h1:jRyg0XfpwWlhEV8mDfdNGBeSJM2fuyh9Yjrnd8kF2Ts= gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= +gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -232,6 +243,7 @@ modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= diff --git a/staging/src/k8s.io/node-api/go.sum b/staging/src/k8s.io/node-api/go.sum index e2f0f0023a6..0233657085a 100644 --- a/staging/src/k8s.io/node-api/go.sum +++ b/staging/src/k8s.io/node-api/go.sum @@ -17,6 +17,7 @@ github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbt github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -30,6 +31,7 @@ github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/evanphx/json-patch v4.2.0+incompatible h1:fUDGZCv/7iAN7u0puUVhvKCcsR6vRfwrJatElLBEf0I= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -54,6 +56,7 @@ github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tF github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d h1:3PaI8p3seN09VjbTYC/QWlUZdZ1qS1zGjy7LH2Wt07I= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903 h1:LbsanbbD6LieFkXbj9YNNBupiGHJgFeLpO0j0Fza1h8= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -91,6 +94,7 @@ github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBv github.com/json-iterator/go v1.1.8 h1:QiWkFLKq0T7mpzwOTu6BzNDbfTE8OLrYhVKYMLF46Ok= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= @@ -144,10 +148,13 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586 h1:7KByu05hhLed2MO29w7p1XfZvZ13m8mub3shuVftRs0= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +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-20190121172915-509febef88a4/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-20190312203227-4b39c73a6495 h1:I6A9Ag9FpEKOjcKrRNjQkPHawoXIhKyTGfvvjFAiiAk= golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +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/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= @@ -187,11 +194,15 @@ golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7 h1:PVCvyir09Xgta5zksNZDkrL+eSm/Y+gQxRG3IfqNQ3A= golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/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.0.0-20190331200053-3d26580ed485 h1:OB/uP/Puiu5vS5QMRPrXCDWUPb+kt8f1KW8oQzFejQw= gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= +gonum.org/v1/gonum v0.6.2 h1:4r+yNT0+8SWcOkXP+63H2zQbN+USnC73cjGUxnDF94Q= +gonum.org/v1/gonum v0.6.2/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e h1:jRyg0XfpwWlhEV8mDfdNGBeSJM2fuyh9Yjrnd8kF2Ts= gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= +gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -236,6 +247,7 @@ modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= diff --git a/staging/src/k8s.io/sample-apiserver/go.sum b/staging/src/k8s.io/sample-apiserver/go.sum index 470f96173db..b1cbdd89f78 100644 --- a/staging/src/k8s.io/sample-apiserver/go.sum +++ b/staging/src/k8s.io/sample-apiserver/go.sum @@ -20,6 +20,7 @@ github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbt github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= @@ -65,6 +66,7 @@ github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT github.com/evanphx/json-patch v4.2.0+incompatible h1:fUDGZCv/7iAN7u0puUVhvKCcsR6vRfwrJatElLBEf0I= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -95,6 +97,7 @@ github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d h1:3PaI8p3seN09VjbTYC/QWlUZdZ1qS1zGjy7LH2Wt07I= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903 h1:LbsanbbD6LieFkXbj9YNNBupiGHJgFeLpO0j0Fza1h8= @@ -158,6 +161,7 @@ github.com/json-iterator/go v1.1.8 h1:QiWkFLKq0T7mpzwOTu6BzNDbfTE8OLrYhVKYMLF46O github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= @@ -285,10 +289,13 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586 h1:7KByu05hhLed2MO29w7p1XfZvZ13m8mub3shuVftRs0= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +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-20190121172915-509febef88a4/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-20190312203227-4b39c73a6495 h1:I6A9Ag9FpEKOjcKrRNjQkPHawoXIhKyTGfvvjFAiiAk= golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +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/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= @@ -337,11 +344,15 @@ golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7 h1:PVCvyir09Xgta5zksNZDkrL+eSm/Y+gQxRG3IfqNQ3A= golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/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.0.0-20190331200053-3d26580ed485 h1:OB/uP/Puiu5vS5QMRPrXCDWUPb+kt8f1KW8oQzFejQw= gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= +gonum.org/v1/gonum v0.6.2 h1:4r+yNT0+8SWcOkXP+63H2zQbN+USnC73cjGUxnDF94Q= +gonum.org/v1/gonum v0.6.2/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e h1:jRyg0XfpwWlhEV8mDfdNGBeSJM2fuyh9Yjrnd8kF2Ts= gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= +gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -400,6 +411,7 @@ modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e h1:4Z09Hglb792X0kfOBBJUPFEyvVfQWrYT/l8h5EKA6JQ= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/structured-merge-diff v1.0.1-0.20191108220359-b1b620dd3f06 h1:zD2IemQ4LmOcAumeiyDWXKUI2SO0NYDe3H6QGvPOVgU= diff --git a/staging/src/k8s.io/sample-controller/go.sum b/staging/src/k8s.io/sample-controller/go.sum index 8ff82d0762e..5ec92d024b3 100644 --- a/staging/src/k8s.io/sample-controller/go.sum +++ b/staging/src/k8s.io/sample-controller/go.sum @@ -17,6 +17,7 @@ github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbt github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -30,6 +31,7 @@ github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/evanphx/json-patch v4.2.0+incompatible h1:fUDGZCv/7iAN7u0puUVhvKCcsR6vRfwrJatElLBEf0I= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -54,6 +56,7 @@ github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tF github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d h1:3PaI8p3seN09VjbTYC/QWlUZdZ1qS1zGjy7LH2Wt07I= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903 h1:LbsanbbD6LieFkXbj9YNNBupiGHJgFeLpO0j0Fza1h8= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -92,6 +95,7 @@ github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBv github.com/json-iterator/go v1.1.8 h1:QiWkFLKq0T7mpzwOTu6BzNDbfTE8OLrYhVKYMLF46Ok= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= @@ -145,10 +149,13 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586 h1:7KByu05hhLed2MO29w7p1XfZvZ13m8mub3shuVftRs0= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +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-20190121172915-509febef88a4/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-20190312203227-4b39c73a6495 h1:I6A9Ag9FpEKOjcKrRNjQkPHawoXIhKyTGfvvjFAiiAk= golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +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/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= @@ -188,11 +195,15 @@ golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7 h1:PVCvyir09Xgta5zksNZDkrL+eSm/Y+gQxRG3IfqNQ3A= golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/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.0.0-20190331200053-3d26580ed485 h1:OB/uP/Puiu5vS5QMRPrXCDWUPb+kt8f1KW8oQzFejQw= gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= +gonum.org/v1/gonum v0.6.2 h1:4r+yNT0+8SWcOkXP+63H2zQbN+USnC73cjGUxnDF94Q= +gonum.org/v1/gonum v0.6.2/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e h1:jRyg0XfpwWlhEV8mDfdNGBeSJM2fuyh9Yjrnd8kF2Ts= gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= +gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -237,6 +248,7 @@ modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= diff --git a/vendor/gonum.org/v1/gonum/AUTHORS b/vendor/gonum.org/v1/gonum/AUTHORS index 417db9b8903..132a341d9ea 100644 --- a/vendor/gonum.org/v1/gonum/AUTHORS +++ b/vendor/gonum.org/v1/gonum/AUTHORS @@ -20,10 +20,14 @@ Christophe Meessen Clayton Northey Dan Kortschak Daniel Fireman +Dario Heinisch +David Kleiven David Samborski Davor Kapsa DeepMind Technologies +Delaney Gillilan Dezmond Goff +Dong-hee Na Egon Elbre Ekaterina Efimova Ethan Burns @@ -46,6 +50,7 @@ Jeremy Atkinson Jonas Kahler Jonas Schulze Jonathan J Lawlor +Jonathan Reiter Jonathan Schroeder Joseph Watson Josh Wilson @@ -61,7 +66,9 @@ Martin Diz Matthieu Di Mercurio Max Halford MinJae Kwon +Nathan Edwards Nick Potts +Nils Wogatzky Olivier Wulveryck Or Rikon Pontus Melke @@ -87,3 +94,4 @@ Tobin Harding Vincent Thiery Vladimír Chalupecký Yevgeniy Vahlis +Yucheng Zhu diff --git a/vendor/gonum.org/v1/gonum/CONTRIBUTORS b/vendor/gonum.org/v1/gonum/CONTRIBUTORS index 0c7cc46a74f..e90db65c44a 100644 --- a/vendor/gonum.org/v1/gonum/CONTRIBUTORS +++ b/vendor/gonum.org/v1/gonum/CONTRIBUTORS @@ -28,9 +28,13 @@ Christophe Meessen Clayton Northey Dan Kortschak Daniel Fireman +Dario Heinisch +David Kleiven David Samborski Davor Kapsa +Delaney Gillilan Dezmond Goff +Dong-hee Na Egon Elbre Ekaterina Efimova Ethan Burns @@ -52,6 +56,7 @@ Jeremy Atkinson Jonas Kahler Jonas Schulze Jonathan J Lawlor +Jonathan Reiter Jonathan Schroeder Joseph Watson Josh Wilson @@ -67,7 +72,9 @@ Martin Diz Matthieu Di Mercurio Max Halford MinJae Kwon +Nathan Edwards Nick Potts +Nils Wogatzky Olivier Wulveryck Or Rikon Pontus Melke @@ -89,3 +96,4 @@ Tobin Harding Vincent Thiery Vladimír Chalupecký Yevgeniy Vahlis +Yucheng Zhu diff --git a/vendor/gonum.org/v1/gonum/blas/blas64/blas64.go b/vendor/gonum.org/v1/gonum/blas/blas64/blas64.go index 551983836c5..5871321eb0f 100644 --- a/vendor/gonum.org/v1/gonum/blas/blas64/blas64.go +++ b/vendor/gonum.org/v1/gonum/blas/blas64/blas64.go @@ -106,6 +106,7 @@ const ( // Dot computes the dot product of the two vectors: // \sum_i x[i]*y[i]. +// Dot will panic if the lengths of x and y do not match. func Dot(x, y Vector) float64 { if x.N != y.N { panic(badLength) @@ -149,6 +150,7 @@ func Iamax(x Vector) int { // Swap exchanges the elements of the two vectors: // x[i], y[i] = y[i], x[i] for all i. +// Swap will panic if the lengths of x and y do not match. func Swap(x, y Vector) { if x.N != y.N { panic(badLength) @@ -158,7 +160,7 @@ func Swap(x, y Vector) { // Copy copies the elements of x into the elements of y: // y[i] = x[i] for all i. -// Copy requires that the lengths of x and y match and will panic otherwise. +// Copy will panic if the lengths of x and y do not match. func Copy(x, y Vector) { if x.N != y.N { panic(badLength) @@ -168,6 +170,7 @@ func Copy(x, y Vector) { // Axpy adds x scaled by alpha to y: // y[i] += alpha*x[i] for all i. +// Axpy will panic if the lengths of x and y do not match. func Axpy(alpha float64, x, y Vector) { if x.N != y.N { panic(badLength) @@ -232,48 +235,48 @@ func Scal(alpha float64, x Vector) { // Level 2 // Gemv computes -// y = alpha * A * x + beta * y, if t == blas.NoTrans, -// y = alpha * A^T * x + beta * y, if t == blas.Trans or blas.ConjTrans, +// y = alpha * A * x + beta * y if t == blas.NoTrans, +// y = alpha * Aᵀ * x + beta * y if t == 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 Gemv(t blas.Transpose, alpha float64, a General, x Vector, beta float64, y Vector) { blas64.Dgemv(t, a.Rows, a.Cols, alpha, a.Data, a.Stride, x.Data, x.Inc, beta, y.Data, y.Inc) } // Gbmv computes -// y = alpha * A * x + beta * y, if t == blas.NoTrans, -// y = alpha * A^T * x + beta * y, if t == blas.Trans or blas.ConjTrans, +// y = alpha * A * x + beta * y if t == blas.NoTrans, +// y = alpha * Aᵀ * x + beta * y if t == blas.Trans or blas.ConjTrans, // where A is an m×n band matrix, x and y are vectors, and alpha and beta are scalars. func Gbmv(t blas.Transpose, alpha float64, a Band, x Vector, beta float64, y Vector) { blas64.Dgbmv(t, a.Rows, a.Cols, a.KL, a.KU, alpha, a.Data, a.Stride, x.Data, x.Inc, beta, y.Data, y.Inc) } // Trmv computes -// x = A * x, if t == blas.NoTrans, -// x = A^T * x, if t == blas.Trans or blas.ConjTrans, +// x = A * x if t == blas.NoTrans, +// x = Aᵀ * x if t == blas.Trans or blas.ConjTrans, // where A is an n×n triangular matrix, and x is a vector. func Trmv(t blas.Transpose, a Triangular, x Vector) { blas64.Dtrmv(a.Uplo, t, a.Diag, a.N, a.Data, a.Stride, x.Data, x.Inc) } // Tbmv computes -// x = A * x, if t == blas.NoTrans, -// x = A^T * x, if t == blas.Trans or blas.ConjTrans, +// x = A * x if t == blas.NoTrans, +// x = Aᵀ * x if t == blas.Trans or blas.ConjTrans, // where A is an n×n triangular band matrix, and x is a vector. func Tbmv(t blas.Transpose, a TriangularBand, x Vector) { blas64.Dtbmv(a.Uplo, t, a.Diag, a.N, a.K, a.Data, a.Stride, x.Data, x.Inc) } // Tpmv computes -// x = A * x, if t == blas.NoTrans, -// x = A^T * x, if t == blas.Trans or blas.ConjTrans, +// x = A * x if t == blas.NoTrans, +// x = Aᵀ * x if t == blas.Trans or blas.ConjTrans, // where A is an n×n triangular matrix in packed format, and x is a vector. func Tpmv(t blas.Transpose, a TriangularPacked, x Vector) { blas64.Dtpmv(a.Uplo, t, a.Diag, a.N, a.Data, x.Data, x.Inc) } // Trsv solves -// A * x = b, if t == blas.NoTrans, -// A^T * x = b, if t == blas.Trans or blas.ConjTrans, +// A * x = b if t == blas.NoTrans, +// Aᵀ * x = b if t == 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 @@ -286,8 +289,8 @@ func Trsv(t blas.Transpose, a Triangular, x Vector) { } // Tbsv solves -// A * x = b, if t == blas.NoTrans, -// A^T * x = b, if t == blas.Trans or blas.ConjTrans, +// A * x = b if t == blas.NoTrans, +// Aᵀ * x = b if t == blas.Trans or blas.ConjTrans, // where A is an n×n triangular band matrix, and x and b are vectors. // // At entry to the function, x contains the values of b, and the result is @@ -300,8 +303,8 @@ func Tbsv(t blas.Transpose, a TriangularBand, x Vector) { } // Tpsv solves -// A * x = b, if t == blas.NoTrans, -// A^T * x = b, if t == blas.Trans or blas.ConjTrans, +// A * x = b if t == blas.NoTrans, +// Aᵀ * x = b if t == blas.Trans or blas.ConjTrans, // where A is an n×n triangular matrix in packed format, and x and b are // vectors. // @@ -315,7 +318,7 @@ func Tpsv(t blas.Transpose, a TriangularPacked, x Vector) { } // Symv computes -// y = alpha * A * x + beta * y, +// 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 Symv(alpha float64, a Symmetric, x Vector, beta float64, y Vector) { @@ -331,7 +334,7 @@ func Sbmv(alpha float64, a SymmetricBand, x Vector, beta float64, y Vector) { } // Spmv performs -// y = alpha * A * x + beta * y, +// 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 Spmv(alpha float64, a SymmetricPacked, x Vector, beta float64, y Vector) { @@ -339,21 +342,21 @@ func Spmv(alpha float64, a SymmetricPacked, x Vector, beta float64, y Vector) { } // Ger performs a rank-1 update -// 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 Ger(alpha float64, x, y Vector, a General) { blas64.Dger(a.Rows, a.Cols, alpha, x.Data, x.Inc, y.Data, y.Inc, a.Data, a.Stride) } // Syr performs a rank-1 update -// A += alpha * x * x^T, +// A += alpha * x * xᵀ, // where A is an n×n symmetric matrix, x is a vector, and alpha is a scalar. func Syr(alpha float64, x Vector, a Symmetric) { blas64.Dsyr(a.Uplo, a.N, alpha, x.Data, x.Inc, a.Data, a.Stride) } // Spr performs the rank-1 update -// A += alpha * x * x^T, +// 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 Spr(alpha float64, x Vector, a SymmetricPacked) { @@ -361,14 +364,14 @@ func Spr(alpha float64, x Vector, a SymmetricPacked) { } // Syr2 performs a rank-2 update -// A += alpha * x * y^T + alpha * y * x^T, +// A += alpha * x * yᵀ + alpha * y * xᵀ, // where A is a symmetric n×n matrix, x and y are vectors, and alpha is a scalar. func Syr2(alpha float64, x, y Vector, a Symmetric) { blas64.Dsyr2(a.Uplo, a.N, alpha, x.Data, x.Inc, y.Data, y.Inc, a.Data, a.Stride) } // Spr2 performs a 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 Spr2(alpha float64, x, y Vector, a SymmetricPacked) { @@ -397,8 +400,8 @@ func Gemm(tA, tB blas.Transpose, alpha float64, a, b General, beta float64, c Ge } // Symm performs -// C = alpha * A * B + beta * C, if s == blas.Left, -// C = alpha * B * A + beta * C, if s == blas.Right, +// C = alpha * A * B + beta * C if s == blas.Left, +// C = alpha * B * A + beta * C if s == 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 Symm(s blas.Side, alpha float64, a Symmetric, b General, beta float64, c General) { @@ -412,8 +415,8 @@ func Symm(s blas.Side, alpha float64, a Symmetric, b General, beta float64, c Ge } // Syrk performs a symmetric rank-k update -// C = alpha * A * A^T + beta * C, if t == blas.NoTrans, -// C = alpha * A^T * A + beta * C, if t == blas.Trans or blas.ConjTrans, +// C = alpha * A * Aᵀ + beta * C if t == blas.NoTrans, +// C = alpha * Aᵀ * A + beta * C if t == blas.Trans or blas.ConjTrans, // where C is an n×n symmetric matrix, A is an n×k matrix if t == blas.NoTrans and // a k×n matrix otherwise, and alpha and beta are scalars. func Syrk(t blas.Transpose, alpha float64, a General, beta float64, c Symmetric) { @@ -427,8 +430,8 @@ func Syrk(t blas.Transpose, alpha float64, a General, beta float64, c Symmetric) } // Syr2k performs a symmetric rank-2k update -// C = alpha * A * B^T + alpha * B * A^T + beta * C, if t == blas.NoTrans, -// C = alpha * A^T * B + alpha * B^T * A + beta * C, if t == blas.Trans or blas.ConjTrans, +// C = alpha * A * Bᵀ + alpha * B * Aᵀ + beta * C if t == blas.NoTrans, +// C = alpha * Aᵀ * B + alpha * Bᵀ * A + beta * C if t == blas.Trans or blas.ConjTrans, // where C is an n×n symmetric matrix, A and B are n×k matrices if t == NoTrans // and k×n matrices otherwise, and alpha and beta are scalars. func Syr2k(t blas.Transpose, alpha float64, a, b General, beta float64, c Symmetric) { @@ -442,10 +445,10 @@ func Syr2k(t blas.Transpose, alpha float64, a, b General, beta float64, c Symmet } // Trmm performs -// B = alpha * A * B, if tA == blas.NoTrans and s == blas.Left, -// B = alpha * A^T * B, if tA == blas.Trans or blas.ConjTrans, and s == blas.Left, -// B = alpha * B * A, if tA == blas.NoTrans and s == blas.Right, -// B = alpha * B * A^T, if tA == blas.Trans or blas.ConjTrans, and s == blas.Right, +// B = alpha * A * B if tA == blas.NoTrans and s == blas.Left, +// B = alpha * Aᵀ * B if tA == blas.Trans or blas.ConjTrans, and s == blas.Left, +// B = alpha * B * A if tA == blas.NoTrans and s == blas.Right, +// B = alpha * B * Aᵀ if tA == blas.Trans or blas.ConjTrans, and s == 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 Trmm(s blas.Side, tA blas.Transpose, alpha float64, a Triangular, b General) { @@ -453,10 +456,10 @@ func Trmm(s blas.Side, tA blas.Transpose, alpha float64, a Triangular, b General } // Trsm solves -// A * X = alpha * B, if tA == blas.NoTrans and s == blas.Left, -// A^T * X = alpha * B, if tA == blas.Trans or blas.ConjTrans, and s == blas.Left, -// X * A = alpha * B, if tA == blas.NoTrans and s == blas.Right, -// X * A^T = alpha * B, if tA == blas.Trans or blas.ConjTrans, and s == blas.Right, +// A * X = alpha * B if tA == blas.NoTrans and s == blas.Left, +// Aᵀ * X = alpha * B if tA == blas.Trans or blas.ConjTrans, and s == blas.Left, +// X * A = alpha * B if tA == blas.NoTrans and s == blas.Right, +// X * Aᵀ = alpha * B if tA == blas.Trans or blas.ConjTrans, and s == 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. // diff --git a/vendor/gonum.org/v1/gonum/blas/blas64/conv.go b/vendor/gonum.org/v1/gonum/blas/blas64/conv.go index 882fd8a7163..6cc6517f1b9 100644 --- a/vendor/gonum.org/v1/gonum/blas/blas64/conv.go +++ b/vendor/gonum.org/v1/gonum/blas/blas64/conv.go @@ -169,7 +169,7 @@ func (t Band) From(a BandCols) { } } -// TriangularBandCols represents a symmetric matrix using the band column-major storage scheme. +// TriangularBandCols represents a triangular matrix using the band column-major storage scheme. type TriangularBandCols TriangularBand // From fills the receiver with elements from a. The receiver diff --git a/vendor/gonum.org/v1/gonum/blas/cblas128/cblas128.go b/vendor/gonum.org/v1/gonum/blas/cblas128/cblas128.go index 1205da8afab..4b74584371a 100644 --- a/vendor/gonum.org/v1/gonum/blas/cblas128/cblas128.go +++ b/vendor/gonum.org/v1/gonum/blas/cblas128/cblas128.go @@ -28,6 +28,7 @@ func Implementation() blas.Complex128 { // Vector represents a vector with an associated element increment. type Vector struct { + N int Inc int Data []complex128 } @@ -107,31 +108,42 @@ type HermitianPacked SymmetricPacked // Level 1 -const negInc = "cblas128: negative vector increment" +const ( + negInc = "cblas128: negative vector increment" + badLength = "cblas128: vector length mismatch" +) // Dotu computes the dot product of the two vectors without // complex conjugation: -// x^T * y. -func Dotu(n int, x, y Vector) complex128 { - return cblas128.Zdotu(n, x.Data, x.Inc, y.Data, y.Inc) +// xᵀ * y. +// Dotu will panic if the lengths of x and y do not match. +func Dotu(x, y Vector) complex128 { + if x.N != y.N { + panic(badLength) + } + return cblas128.Zdotu(x.N, x.Data, x.Inc, y.Data, y.Inc) } // Dotc computes the dot product of the two vectors with // complex conjugation: -// x^H * y. -func Dotc(n int, x, y Vector) complex128 { - return cblas128.Zdotc(n, x.Data, x.Inc, y.Data, y.Inc) +// xᴴ * y. +// Dotc will panic if the lengths of x and y do not match. +func Dotc(x, y Vector) complex128 { + if x.N != y.N { + panic(badLength) + } + return cblas128.Zdotc(x.N, x.Data, x.Inc, y.Data, y.Inc) } // Nrm2 computes the Euclidean norm of the vector x: // sqrt(\sum_i x[i] * x[i]). // // Nrm2 will panic if the vector increment is negative. -func Nrm2(n int, x Vector) float64 { +func Nrm2(x Vector) float64 { if x.Inc < 0 { panic(negInc) } - return cblas128.Dznrm2(n, x.Data, x.Inc) + return cblas128.Dznrm2(x.N, x.Data, x.Inc) } // Asum computes the sum of magnitudes of the real and imaginary parts of @@ -139,11 +151,11 @@ func Nrm2(n int, x Vector) float64 { // \sum_i (|Re x[i]| + |Im x[i]|). // // Asum will panic if the vector increment is negative. -func Asum(n int, x Vector) float64 { +func Asum(x Vector) float64 { if x.Inc < 0 { panic(negInc) } - return cblas128.Dzasum(n, x.Data, x.Inc) + return cblas128.Dzasum(x.N, x.Data, x.Inc) } // Iamax returns the index of an element of x with the largest sum of @@ -153,30 +165,42 @@ func Asum(n int, x Vector) float64 { // Iamax returns -1 if n == 0. // // Iamax will panic if the vector increment is negative. -func Iamax(n int, x Vector) int { +func Iamax(x Vector) int { if x.Inc < 0 { panic(negInc) } - return cblas128.Izamax(n, x.Data, x.Inc) + return cblas128.Izamax(x.N, x.Data, x.Inc) } // Swap exchanges the elements of two vectors: // x[i], y[i] = y[i], x[i] for all i. -func Swap(n int, x, y Vector) { - cblas128.Zswap(n, x.Data, x.Inc, y.Data, y.Inc) +// Swap will panic if the lengths of x and y do not match. +func Swap(x, y Vector) { + if x.N != y.N { + panic(badLength) + } + cblas128.Zswap(x.N, x.Data, x.Inc, y.Data, y.Inc) } // Copy copies the elements of x into the elements of y: // y[i] = x[i] for all i. -func Copy(n int, x, y Vector) { - cblas128.Zcopy(n, x.Data, x.Inc, y.Data, y.Inc) +// Copy will panic if the lengths of x and y do not match. +func Copy(x, y Vector) { + if x.N != y.N { + panic(badLength) + } + cblas128.Zcopy(x.N, x.Data, x.Inc, y.Data, y.Inc) } // Axpy computes // y = alpha * x + y, // where x and y are vectors, and alpha is a scalar. -func Axpy(n int, alpha complex128, x, y Vector) { - cblas128.Zaxpy(n, alpha, x.Data, x.Inc, y.Data, y.Inc) +// Axpy will panic if the lengths of x and y do not match. +func Axpy(alpha complex128, x, y Vector) { + if x.N != y.N { + panic(badLength) + } + cblas128.Zaxpy(x.N, alpha, x.Data, x.Inc, y.Data, y.Inc) } // Scal computes @@ -184,11 +208,11 @@ func Axpy(n int, alpha complex128, x, y Vector) { // where x is a vector, and alpha is a scalar. // // Scal will panic if the vector increment is negative. -func Scal(n int, alpha complex128, x Vector) { +func Scal(alpha complex128, x Vector) { if x.Inc < 0 { panic(negInc) } - cblas128.Zscal(n, alpha, x.Data, x.Inc) + cblas128.Zscal(x.N, alpha, x.Data, x.Inc) } // Dscal computes @@ -196,19 +220,19 @@ func Scal(n int, alpha complex128, x Vector) { // where x is a vector, and alpha is a real scalar. // // Dscal will panic if the vector increment is negative. -func Dscal(n int, alpha float64, x Vector) { +func Dscal(alpha float64, x Vector) { if x.Inc < 0 { panic(negInc) } - cblas128.Zdscal(n, alpha, x.Data, x.Inc) + cblas128.Zdscal(x.N, alpha, x.Data, x.Inc) } // Level 2 // Gemv computes -// y = alpha * A * x + beta * y, if t == blas.NoTrans, -// y = alpha * A^T * x + beta * y, if t == blas.Trans, -// y = alpha * A^H * x + beta * y, if t == blas.ConjTrans, +// y = alpha * A * x + beta * y if t == blas.NoTrans, +// y = alpha * Aᵀ * x + beta * y if t == blas.Trans, +// y = alpha * Aᴴ * x + beta * y if t == blas.ConjTrans, // where A is an m×n dense matrix, x and y are vectors, and alpha and beta are // scalars. func Gemv(t blas.Transpose, alpha complex128, a General, x Vector, beta complex128, y Vector) { @@ -216,9 +240,9 @@ func Gemv(t blas.Transpose, alpha complex128, a General, x Vector, beta complex1 } // Gbmv computes -// y = alpha * A * x + beta * y, if t == blas.NoTrans, -// y = alpha * A^T * x + beta * y, if t == blas.Trans, -// y = alpha * A^H * x + beta * y, if t == blas.ConjTrans, +// y = alpha * A * x + beta * y if t == blas.NoTrans, +// y = alpha * Aᵀ * x + beta * y if t == blas.Trans, +// y = alpha * Aᴴ * x + beta * y if t == blas.ConjTrans, // where A is an m×n band matrix, x and y are vectors, and alpha and beta are // scalars. func Gbmv(t blas.Transpose, alpha complex128, a Band, x Vector, beta complex128, y Vector) { @@ -226,36 +250,36 @@ func Gbmv(t blas.Transpose, alpha complex128, a Band, x Vector, beta complex128, } // Trmv computes -// x = A * x, if t == blas.NoTrans, -// x = A^T * x, if t == blas.Trans, -// x = A^H * x, if t == blas.ConjTrans, +// x = A * x if t == blas.NoTrans, +// x = Aᵀ * x if t == blas.Trans, +// x = Aᴴ * x if t == blas.ConjTrans, // where A is an n×n triangular matrix, and x is a vector. func Trmv(t blas.Transpose, a Triangular, x Vector) { cblas128.Ztrmv(a.Uplo, t, a.Diag, a.N, a.Data, a.Stride, x.Data, x.Inc) } // Tbmv computes -// x = A * x, if t == blas.NoTrans, -// x = A^T * x, if t == blas.Trans, -// x = A^H * x, if t == blas.ConjTrans, +// x = A * x if t == blas.NoTrans, +// x = Aᵀ * x if t == blas.Trans, +// x = Aᴴ * x if t == blas.ConjTrans, // where A is an n×n triangular band matrix, and x is a vector. func Tbmv(t blas.Transpose, a TriangularBand, x Vector) { cblas128.Ztbmv(a.Uplo, t, a.Diag, a.N, a.K, a.Data, a.Stride, x.Data, x.Inc) } // Tpmv computes -// x = A * x, if t == blas.NoTrans, -// x = A^T * x, if t == blas.Trans, -// x = A^H * x, if t == blas.ConjTrans, +// x = A * x if t == blas.NoTrans, +// x = Aᵀ * x if t == blas.Trans, +// x = Aᴴ * x if t == blas.ConjTrans, // where A is an n×n triangular matrix in packed format, and x is a vector. func Tpmv(t blas.Transpose, a TriangularPacked, x Vector) { cblas128.Ztpmv(a.Uplo, t, a.Diag, a.N, a.Data, x.Data, x.Inc) } // Trsv solves -// A * x = b, if t == blas.NoTrans, -// A^T * x = b, if t == blas.Trans, -// A^H * x = b, if t == blas.ConjTrans, +// A * x = b if t == blas.NoTrans, +// Aᵀ * x = b if t == blas.Trans, +// Aᴴ * x = b if t == blas.ConjTrans, // where A is an n×n triangular matrix and x is a vector. // // At entry to the function, x contains the values of b, and the result is @@ -268,9 +292,9 @@ func Trsv(t blas.Transpose, a Triangular, x Vector) { } // Tbsv solves -// A * x = b, if t == blas.NoTrans, -// A^T * x = b, if t == blas.Trans, -// A^H * x = b, if t == blas.ConjTrans, +// A * x = b if t == blas.NoTrans, +// Aᵀ * x = b if t == blas.Trans, +// Aᴴ * x = b if t == blas.ConjTrans, // where A is an n×n triangular band matrix, and x is a vector. // // At entry to the function, x contains the values of b, and the result is @@ -283,9 +307,9 @@ func Tbsv(t blas.Transpose, a TriangularBand, x Vector) { } // Tpsv solves -// A * x = b, if t == blas.NoTrans, -// A^T * x = b, if t == blas.Trans, -// A^H * x = b, if t == blas.ConjTrans, +// A * x = b if t == blas.NoTrans, +// Aᵀ * x = b if t == blas.Trans, +// Aᴴ * x = b if t == blas.ConjTrans, // where A is an n×n triangular matrix in packed format and x is a vector. // // At entry to the function, x contains the values of b, and the result is @@ -322,28 +346,28 @@ func Hpmv(alpha complex128, a HermitianPacked, x Vector, beta complex128, y Vect } // Geru performs a rank-1 update -// 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 Geru(alpha complex128, x, y Vector, a General) { cblas128.Zgeru(a.Rows, a.Cols, alpha, x.Data, x.Inc, y.Data, y.Inc, a.Data, a.Stride) } // Gerc performs a rank-1 update -// A += alpha * x * y^H, +// A += alpha * x * yᴴ, // where A is an m×n dense matrix, x and y are vectors, and alpha is a scalar. func Gerc(alpha complex128, x, y Vector, a General) { cblas128.Zgerc(a.Rows, a.Cols, alpha, x.Data, x.Inc, y.Data, y.Inc, a.Data, a.Stride) } // Her performs a rank-1 update -// A += alpha * x * y^T, +// A += alpha * x * yᵀ, // where A is an m×n Hermitian matrix, x and y are vectors, and alpha is a scalar. func Her(alpha float64, x Vector, a Hermitian) { cblas128.Zher(a.Uplo, a.N, alpha, x.Data, x.Inc, a.Data, a.Stride) } // Hpr performs a rank-1 update -// A += alpha * x * x^H, +// A += alpha * x * xᴴ, // where A is an n×n Hermitian matrix in packed format, x is a vector, and // alpha is a scalar. func Hpr(alpha float64, x Vector, a HermitianPacked) { @@ -351,14 +375,14 @@ func Hpr(alpha float64, x Vector, a HermitianPacked) { } // Her2 performs a rank-2 update -// A += alpha * x * y^H + conj(alpha) * y * x^H, +// A += alpha * x * yᴴ + conj(alpha) * y * xᴴ, // where A is an n×n Hermitian matrix, x and y are vectors, and alpha is a scalar. func Her2(alpha complex128, x, y Vector, a Hermitian) { cblas128.Zher2(a.Uplo, a.N, alpha, x.Data, x.Inc, y.Data, y.Inc, a.Data, a.Stride) } // Hpr2 performs a rank-2 update -// A += alpha * x * y^H + conj(alpha) * y * x^H, +// A += alpha * x * yᴴ + conj(alpha) * y * xᴴ, // where A is an n×n Hermitian matrix in packed format, x and y are vectors, // and alpha is a scalar. func Hpr2(alpha complex128, x, y Vector, a HermitianPacked) { @@ -387,8 +411,8 @@ func Gemm(tA, tB blas.Transpose, alpha complex128, a, b General, beta complex128 } // Symm performs -// C = alpha * A * B + beta * C, if s == blas.Left, -// C = alpha * B * A + beta * C, if s == blas.Right, +// C = alpha * A * B + beta * C if s == blas.Left, +// C = alpha * B * A + beta * C if s == blas.Right, // where A is an n×n or m×m symmetric matrix, B and C are m×n matrices, and // alpha and beta are scalars. func Symm(s blas.Side, alpha complex128, a Symmetric, b General, beta complex128, c General) { @@ -402,8 +426,8 @@ func Symm(s blas.Side, alpha complex128, a Symmetric, b General, beta complex128 } // Syrk performs a symmetric rank-k update -// C = alpha * A * A^T + beta * C, if t == blas.NoTrans, -// C = alpha * A^T * A + beta * C, if t == blas.Trans, +// C = alpha * A * Aᵀ + beta * C if t == blas.NoTrans, +// C = alpha * Aᵀ * A + beta * C if t == blas.Trans, // where C is an n×n symmetric matrix, A is an n×k matrix if t == blas.NoTrans // and a k×n matrix otherwise, and alpha and beta are scalars. func Syrk(t blas.Transpose, alpha complex128, a General, beta complex128, c Symmetric) { @@ -417,8 +441,8 @@ func Syrk(t blas.Transpose, alpha complex128, a General, beta complex128, c Symm } // Syr2k performs a symmetric rank-2k update -// C = alpha * A * B^T + alpha * B * A^T + beta * C, if t == blas.NoTrans, -// C = alpha * A^T * B + alpha * B^T * A + beta * C, if t == blas.Trans, +// C = alpha * A * Bᵀ + alpha * B * Aᵀ + beta * C if t == blas.NoTrans, +// C = alpha * Aᵀ * B + alpha * Bᵀ * A + beta * C if t == blas.Trans, // where C is an n×n symmetric matrix, A and B are n×k matrices if // t == blas.NoTrans and k×n otherwise, and alpha and beta are scalars. func Syr2k(t blas.Transpose, alpha complex128, a, b General, beta complex128, c Symmetric) { @@ -432,12 +456,12 @@ func Syr2k(t blas.Transpose, alpha complex128, a, b General, beta complex128, c } // Trmm performs -// B = alpha * A * B, if tA == blas.NoTrans and s == blas.Left, -// B = alpha * A^T * B, if tA == blas.Trans and s == blas.Left, -// B = alpha * A^H * B, if tA == blas.ConjTrans and s == blas.Left, -// B = alpha * B * A, if tA == blas.NoTrans and s == blas.Right, -// B = alpha * B * A^T, if tA == blas.Trans and s == blas.Right, -// B = alpha * B * A^H, if tA == blas.ConjTrans and s == blas.Right, +// B = alpha * A * B if tA == blas.NoTrans and s == blas.Left, +// B = alpha * Aᵀ * B if tA == blas.Trans and s == blas.Left, +// B = alpha * Aᴴ * B if tA == blas.ConjTrans and s == blas.Left, +// B = alpha * B * A if tA == blas.NoTrans and s == blas.Right, +// B = alpha * B * Aᵀ if tA == blas.Trans and s == blas.Right, +// B = alpha * B * Aᴴ if tA == blas.ConjTrans and s == 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 Trmm(s blas.Side, tA blas.Transpose, alpha complex128, a Triangular, b General) { @@ -445,12 +469,12 @@ func Trmm(s blas.Side, tA blas.Transpose, alpha complex128, a Triangular, b Gene } // Trsm solves -// A * X = alpha * B, if tA == blas.NoTrans and s == blas.Left, -// A^T * X = alpha * B, if tA == blas.Trans and s == blas.Left, -// A^H * X = alpha * B, if tA == blas.ConjTrans and s == blas.Left, -// X * A = alpha * B, if tA == blas.NoTrans and s == blas.Right, -// X * A^T = alpha * B, if tA == blas.Trans and s == blas.Right, -// X * A^H = alpha * B, if tA == blas.ConjTrans and s == blas.Right, +// A * X = alpha * B if tA == blas.NoTrans and s == blas.Left, +// Aᵀ * X = alpha * B if tA == blas.Trans and s == blas.Left, +// Aᴴ * X = alpha * B if tA == blas.ConjTrans and s == blas.Left, +// X * A = alpha * B if tA == blas.NoTrans and s == blas.Right, +// X * Aᵀ = alpha * B if tA == blas.Trans and s == blas.Right, +// X * Aᴴ = alpha * B if tA == blas.ConjTrans and s == 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. // @@ -463,8 +487,8 @@ func Trsm(s blas.Side, tA blas.Transpose, alpha complex128, a Triangular, b Gene } // Hemm performs -// C = alpha * A * B + beta * C, if s == blas.Left, -// C = alpha * B * A + beta * C, if s == blas.Right, +// C = alpha * A * B + beta * C if s == blas.Left, +// C = alpha * B * A + beta * C if s == blas.Right, // where A is an n×n or m×m Hermitian matrix, B and C are m×n matrices, and // alpha and beta are scalars. func Hemm(s blas.Side, alpha complex128, a Hermitian, b General, beta complex128, c General) { @@ -478,8 +502,8 @@ func Hemm(s blas.Side, alpha complex128, a Hermitian, b General, beta complex128 } // Herk performs the Hermitian rank-k update -// C = alpha * A * A^H + beta*C, if t == blas.NoTrans, -// C = alpha * A^H * A + beta*C, if t == blas.ConjTrans, +// C = alpha * A * Aᴴ + beta*C if t == blas.NoTrans, +// C = alpha * Aᴴ * A + beta*C if t == blas.ConjTrans, // where C is an n×n Hermitian matrix, A is an n×k matrix if t == blas.NoTrans // and a k×n matrix otherwise, and alpha and beta are scalars. func Herk(t blas.Transpose, alpha float64, a General, beta float64, c Hermitian) { @@ -493,8 +517,8 @@ func Herk(t blas.Transpose, alpha float64, a General, beta float64, c Hermitian) } // Her2k performs the Hermitian rank-2k update -// C = alpha * A * B^H + conj(alpha) * B * A^H + beta * C, if t == blas.NoTrans, -// C = alpha * A^H * B + conj(alpha) * B^H * A + beta * C, if t == blas.ConjTrans, +// C = alpha * A * Bᴴ + conj(alpha) * B * Aᴴ + beta * C if t == blas.NoTrans, +// C = alpha * Aᴴ * B + conj(alpha) * Bᴴ * A + beta * C if t == blas.ConjTrans, // where C is an n×n Hermitian matrix, A and B are n×k matrices if t == NoTrans // and k×n matrices otherwise, and alpha and beta are scalars. func Her2k(t blas.Transpose, alpha complex128, a, b General, beta float64, c Hermitian) { diff --git a/vendor/gonum.org/v1/gonum/blas/cblas128/conv.go b/vendor/gonum.org/v1/gonum/blas/cblas128/conv.go index 93e3cd2f929..c459e1d87e3 100644 --- a/vendor/gonum.org/v1/gonum/blas/cblas128/conv.go +++ b/vendor/gonum.org/v1/gonum/blas/cblas128/conv.go @@ -171,7 +171,7 @@ func (t Band) From(a BandCols) { } } -// TriangularBandCols represents a symmetric matrix using the band column-major storage scheme. +// TriangularBandCols represents a triangular matrix using the band column-major storage scheme. type TriangularBandCols TriangularBand // From fills the receiver with elements from a. The receiver diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/dgemm.go b/vendor/gonum.org/v1/gonum/blas/gonum/dgemm.go index ec3fcc61cb1..167dd27c98d 100644 --- a/vendor/gonum.org/v1/gonum/blas/gonum/dgemm.go +++ b/vendor/gonum.org/v1/gonum/blas/gonum/dgemm.go @@ -14,9 +14,9 @@ import ( // Dgemm performs one of the matrix-matrix operations // C = alpha * A * B + beta * C -// C = alpha * A^T * B + beta * C -// C = alpha * A * B^T + beta * C -// C = alpha * A^T * B^T + 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. @@ -134,9 +134,9 @@ func dgemmParallel(aTrans, bTrans bool, m, n, k int, a []float64, lda int, b []f // In all cases, there is one dimension for each matrix along which // C must be updated sequentially. // Cij = \sum_k Aik Bki, (A * B) - // Cij = \sum_k Aki Bkj, (A^T * B) - // Cij = \sum_k Aik Bjk, (A * B^T) - // Cij = \sum_k Aki Bjk, (A^T * B^T) + // Cij = \sum_k Aki Bkj, (Aᵀ * B) + // Cij = \sum_k Aik Bjk, (A * Bᵀ) + // Cij = \sum_k Aki Bjk, (Aᵀ * Bᵀ) // // This code computes one {i, j} block sequentially along the k dimension, // and computes all of the {i, j} blocks concurrently. This diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/gemv.go b/vendor/gonum.org/v1/gonum/blas/gonum/gemv.go index 9b9a1beb099..8bc3bf66da5 100644 --- a/vendor/gonum.org/v1/gonum/blas/gonum/gemv.go +++ b/vendor/gonum.org/v1/gonum/blas/gonum/gemv.go @@ -13,8 +13,8 @@ import ( // TODO(Kunde21): Merge these methods back into level2double/level2single when Sgemv assembly kernels are merged into f32. // 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 +// 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) { if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { @@ -83,8 +83,8 @@ func (Implementation) Dgemv(tA blas.Transpose, m, n int, alpha float64, a []floa } // 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 +// 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. // // Float32 implementations are autogenerated and not directly tested. diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level1cmplx128.go b/vendor/gonum.org/v1/gonum/blas/gonum/level1cmplx128.go index e37bf44dd34..a207db4bf18 100644 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level1cmplx128.go +++ b/vendor/gonum.org/v1/gonum/blas/gonum/level1cmplx128.go @@ -240,7 +240,7 @@ func (Implementation) Zcopy(n int, x []complex128, incX int, y []complex128, inc } // Zdotc computes the dot product -// x^H · y +// xᴴ · y // of two complex vectors x and y. func (Implementation) Zdotc(n int, x []complex128, incX int, y []complex128, incY int) complex128 { if incX == 0 { @@ -281,7 +281,7 @@ func (Implementation) Zdotc(n int, x []complex128, incX int, y []complex128, inc } // Zdotu computes the dot product -// x^T · y +// xᵀ · y // of two complex vectors x and y. func (Implementation) Zdotu(n int, x []complex128, incX int, y []complex128, incY int) complex128 { if incX == 0 { diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level1cmplx64.go b/vendor/gonum.org/v1/gonum/blas/gonum/level1cmplx64.go index ba192ea5955..018bae213be 100644 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level1cmplx64.go +++ b/vendor/gonum.org/v1/gonum/blas/gonum/level1cmplx64.go @@ -252,7 +252,7 @@ func (Implementation) Ccopy(n int, x []complex64, incX int, y []complex64, incY } // Cdotc computes the dot product -// x^H · y +// xᴴ · y // of two complex vectors x and y. // // Complex64 implementations are autogenerated and not directly tested. @@ -295,7 +295,7 @@ func (Implementation) Cdotc(n int, x []complex64, incX int, y []complex64, incY } // Cdotu computes the dot product -// x^T · y +// xᵀ · y // of two complex vectors x and y. // // Complex64 implementations are autogenerated and not directly tested. diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level2cmplx128.go b/vendor/gonum.org/v1/gonum/blas/gonum/level2cmplx128.go index 03ee328fdba..d0ca4eb9c4d 100644 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level2cmplx128.go +++ b/vendor/gonum.org/v1/gonum/blas/gonum/level2cmplx128.go @@ -14,9 +14,9 @@ import ( var _ blas.Complex128Level2 = Implementation{} // Zgbmv performs one of the matrix-vector operations -// y = alpha * A * x + beta * y if trans = blas.NoTrans -// y = alpha * A^T * x + beta * y if trans = blas.Trans -// y = alpha * A^H * x + beta * y if trans = blas.ConjTrans +// 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(trans blas.Transpose, m, n, kL, kU int, alpha complex128, a []complex128, lda int, x []complex128, incX int, beta complex128, y []complex128, incY int) { @@ -209,9 +209,9 @@ func (Implementation) Zgbmv(trans blas.Transpose, m, n, kL, kU int, alpha comple } // Zgemv performs one of the matrix-vector operations -// y = alpha * A * x + beta * y if trans = blas.NoTrans -// y = alpha * A^T * x + beta * y if trans = blas.Trans -// y = alpha * A^H * x + beta * y if trans = blas.ConjTrans +// 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(trans blas.Transpose, m, n int, alpha complex128, a []complex128, lda int, x []complex128, incX int, beta complex128, y []complex128, incY int) { switch trans { @@ -322,7 +322,7 @@ func (Implementation) Zgemv(trans blas.Transpose, m, n int, alpha complex128, a return case blas.Trans: - // Form y = alpha*A^T*x + y. + // Form y = alpha*Aᵀ*x + y. ix := kx if incY == 1 { for i := 0; i < m; i++ { @@ -338,7 +338,7 @@ func (Implementation) Zgemv(trans blas.Transpose, m, n int, alpha complex128, a return case blas.ConjTrans: - // Form y = alpha*A^H*x + y. + // Form y = alpha*Aᴴ*x + y. ix := kx if incY == 1 { for i := 0; i < m; i++ { @@ -364,7 +364,7 @@ func (Implementation) Zgemv(trans blas.Transpose, m, n int, alpha complex128, a } // 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) { @@ -422,7 +422,7 @@ func (Implementation) Zgerc(m, n int, alpha complex128, x []complex128, incX int } // Zgeru performs the rank-one operation -// A += alpha * x * y^T +// 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) { @@ -822,7 +822,7 @@ func (Implementation) Zhemv(uplo blas.Uplo, n int, alpha complex128, a []complex } // Zher performs the Hermitian rank-one operation -// A += alpha * x * x^H +// 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. @@ -944,7 +944,7 @@ func (Implementation) Zher(uplo blas.Uplo, n int, alpha float64, x []complex128, } // Zher2 performs the Hermitian rank-two operation -// A += alpha * x * y^H + conj(alpha) * y * x^H +// 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. @@ -1248,7 +1248,7 @@ func (Implementation) Zhpmv(uplo blas.Uplo, n int, alpha complex128, ap []comple } // Zhpr performs the Hermitian rank-1 operation -// A += alpha * x * x^H +// 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. @@ -1382,7 +1382,7 @@ func (Implementation) Zhpr(uplo blas.Uplo, n int, alpha float64, x []complex128, } // Zhpr2 performs the Hermitian rank-2 operation -// A += alpha * x * y^H + conj(alpha) * y * x^H +// 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. @@ -1529,9 +1529,9 @@ func (Implementation) Zhpr2(uplo blas.Uplo, n int, alpha complex128, x []complex } // Ztbmv performs one of the matrix-vector operations -// x = A * x if trans = blas.NoTrans -// x = A^T * x if trans = blas.Trans -// x = A^H * x if trans = blas.ConjTrans +// 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(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n, k int, a []complex128, lda int, x []complex128, incX int) { @@ -1765,9 +1765,9 @@ func (Implementation) Ztbmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag } // Ztbsv solves one of the systems of equations -// A * x = b if trans == blas.NoTrans -// A^T * x = b if trans == blas.Trans -// A^H * x = b if trans == blas.ConjTrans +// 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. // @@ -2007,9 +2007,9 @@ func (Implementation) Ztbsv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag } // Ztpmv performs one of the matrix-vector operations -// x = A * x if trans = blas.NoTrans -// x = A^T * x if trans = blas.Trans -// x = A^H * x if trans = blas.ConjTrans +// 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(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n int, ap []complex128, x []complex128, incX int) { @@ -2116,7 +2116,7 @@ func (Implementation) Ztpmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag } if trans == blas.Trans { - // Form x = A^T*x. + // Form x = Aᵀ*x. if uplo == blas.Upper { // kk points to the current diagonal element in ap. kk := n*(n+1)/2 - 1 @@ -2176,7 +2176,7 @@ func (Implementation) Ztpmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag return } - // Form x = A^H*x. + // Form x = Aᴴ*x. if uplo == blas.Upper { // kk points to the current diagonal element in ap. kk := n*(n+1)/2 - 1 @@ -2245,9 +2245,9 @@ func (Implementation) Ztpmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag } // Ztpsv solves one of the systems of equations -// A * x = b if trans == blas.NoTrans -// A^T * x = b if trans == blas.Trans -// A^H * x = b if trans == blas.ConjTrans +// 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. // @@ -2359,7 +2359,7 @@ func (Implementation) Ztpsv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag } if trans == blas.Trans { - // Form x = inv(A^T)*x. + // Form x = inv(Aᵀ)*x. if uplo == blas.Upper { kk := 0 if incX == 1 { @@ -2414,7 +2414,7 @@ func (Implementation) Ztpsv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag return } - // Form x = inv(A^H)*x. + // Form x = inv(Aᴴ)*x. if uplo == blas.Upper { kk := 0 if incX == 1 { @@ -2481,9 +2481,9 @@ func (Implementation) Ztpsv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag } // Ztrmv performs one of the matrix-vector operations -// x = A * x if trans = blas.NoTrans -// x = A^T * x if trans = blas.Trans -// x = A^H * x if trans = blas.ConjTrans +// 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(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n int, a []complex128, lda int, x []complex128, incX int) { switch trans { @@ -2583,7 +2583,7 @@ func (Implementation) Ztrmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag } if trans == blas.Trans { - // Form x = A^T*x. + // Form x = Aᵀ*x. if uplo == blas.Upper { if incX == 1 { for i := n - 1; i >= 0; i-- { @@ -2634,7 +2634,7 @@ func (Implementation) Ztrmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag return } - // Form x = A^H*x. + // Form x = Aᴴ*x. if uplo == blas.Upper { if incX == 1 { for i := n - 1; i >= 0; i-- { @@ -2689,9 +2689,9 @@ func (Implementation) Ztrmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag } // Ztrsv solves one of the systems of equations -// A * x = b if trans == blas.NoTrans -// A^T * x = b if trans == blas.Trans -// A^H * x = b if trans == blas.ConjTrans +// 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 @@ -2799,7 +2799,7 @@ func (Implementation) Ztrsv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag } if trans == blas.Trans { - // Form x = inv(A^T)*x. + // Form x = inv(Aᵀ)*x. if uplo == blas.Upper { if incX == 1 { for j := 0; j < n; j++ { @@ -2849,7 +2849,7 @@ func (Implementation) Ztrsv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag return } - // Form x = inv(A^H)*x. + // Form x = inv(Aᴴ)*x. if uplo == blas.Upper { if incX == 1 { for j := 0; j < n; j++ { diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level2cmplx64.go b/vendor/gonum.org/v1/gonum/blas/gonum/level2cmplx64.go index 10faf8f7d8e..3aa4c21cb04 100644 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level2cmplx64.go +++ b/vendor/gonum.org/v1/gonum/blas/gonum/level2cmplx64.go @@ -16,9 +16,9 @@ import ( var _ blas.Complex64Level2 = Implementation{} // Cgbmv performs one of the matrix-vector operations -// y = alpha * A * x + beta * y if trans = blas.NoTrans -// y = alpha * A^T * x + beta * y if trans = blas.Trans -// y = alpha * A^H * x + beta * y if trans = blas.ConjTrans +// 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. // @@ -213,9 +213,9 @@ func (Implementation) Cgbmv(trans blas.Transpose, m, n, kL, kU int, alpha comple } // Cgemv performs one of the matrix-vector operations -// y = alpha * A * x + beta * y if trans = blas.NoTrans -// y = alpha * A^T * x + beta * y if trans = blas.Trans -// y = alpha * A^H * x + beta * y if trans = blas.ConjTrans +// 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. @@ -328,7 +328,7 @@ func (Implementation) Cgemv(trans blas.Transpose, m, n int, alpha complex64, a [ return case blas.Trans: - // Form y = alpha*A^T*x + y. + // Form y = alpha*Aᵀ*x + y. ix := kx if incY == 1 { for i := 0; i < m; i++ { @@ -344,7 +344,7 @@ func (Implementation) Cgemv(trans blas.Transpose, m, n int, alpha complex64, a [ return case blas.ConjTrans: - // Form y = alpha*A^H*x + y. + // Form y = alpha*Aᴴ*x + y. ix := kx if incY == 1 { for i := 0; i < m; i++ { @@ -370,7 +370,7 @@ func (Implementation) Cgemv(trans blas.Transpose, m, n int, alpha complex64, a [ } // Cgerc 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. // @@ -430,7 +430,7 @@ func (Implementation) Cgerc(m, n int, alpha complex64, x []complex64, incX int, } // Cgeru performs the rank-one operation -// A += alpha * x * y^T +// 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. // @@ -836,7 +836,7 @@ func (Implementation) Chemv(uplo blas.Uplo, n int, alpha complex64, a []complex6 } // Cher performs the Hermitian rank-one operation -// A += alpha * x * x^H +// 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. @@ -960,7 +960,7 @@ func (Implementation) Cher(uplo blas.Uplo, n int, alpha float32, x []complex64, } // Cher2 performs the Hermitian rank-two operation -// A += alpha * x * y^H + conj(alpha) * y * x^H +// 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. @@ -1268,7 +1268,7 @@ func (Implementation) Chpmv(uplo blas.Uplo, n int, alpha complex64, ap []complex } // Chpr performs the Hermitian rank-1 operation -// A += alpha * x * x^H +// 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. @@ -1404,7 +1404,7 @@ func (Implementation) Chpr(uplo blas.Uplo, n int, alpha float32, x []complex64, } // Chpr2 performs the Hermitian rank-2 operation -// A += alpha * x * y^H + conj(alpha) * y * x^H +// 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. @@ -1553,9 +1553,9 @@ func (Implementation) Chpr2(uplo blas.Uplo, n int, alpha complex64, x []complex6 } // Ctbmv performs one of the matrix-vector operations -// x = A * x if trans = blas.NoTrans -// x = A^T * x if trans = blas.Trans -// x = A^H * x if trans = blas.ConjTrans +// 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. // @@ -1791,9 +1791,9 @@ func (Implementation) Ctbmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag } // Ctbsv solves one of the systems of equations -// A * x = b if trans == blas.NoTrans -// A^T * x = b if trans == blas.Trans -// A^H * x = b if trans == blas.ConjTrans +// 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. // @@ -2035,9 +2035,9 @@ func (Implementation) Ctbsv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag } // Ctpmv performs one of the matrix-vector operations -// x = A * x if trans = blas.NoTrans -// x = A^T * x if trans = blas.Trans -// x = A^H * x if trans = blas.ConjTrans +// 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. // @@ -2146,7 +2146,7 @@ func (Implementation) Ctpmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag } if trans == blas.Trans { - // Form x = A^T*x. + // Form x = Aᵀ*x. if uplo == blas.Upper { // kk points to the current diagonal element in ap. kk := n*(n+1)/2 - 1 @@ -2206,7 +2206,7 @@ func (Implementation) Ctpmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag return } - // Form x = A^H*x. + // Form x = Aᴴ*x. if uplo == blas.Upper { // kk points to the current diagonal element in ap. kk := n*(n+1)/2 - 1 @@ -2275,9 +2275,9 @@ func (Implementation) Ctpmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag } // Ctpsv solves one of the systems of equations -// A * x = b if trans == blas.NoTrans -// A^T * x = b if trans == blas.Trans -// A^H * x = b if trans == blas.ConjTrans +// 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. // @@ -2391,7 +2391,7 @@ func (Implementation) Ctpsv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag } if trans == blas.Trans { - // Form x = inv(A^T)*x. + // Form x = inv(Aᵀ)*x. if uplo == blas.Upper { kk := 0 if incX == 1 { @@ -2446,7 +2446,7 @@ func (Implementation) Ctpsv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag return } - // Form x = inv(A^H)*x. + // Form x = inv(Aᴴ)*x. if uplo == blas.Upper { kk := 0 if incX == 1 { @@ -2513,9 +2513,9 @@ func (Implementation) Ctpsv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag } // Ctrmv performs one of the matrix-vector operations -// x = A * x if trans = blas.NoTrans -// x = A^T * x if trans = blas.Trans -// x = A^H * x if trans = blas.ConjTrans +// 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. @@ -2617,7 +2617,7 @@ func (Implementation) Ctrmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag } if trans == blas.Trans { - // Form x = A^T*x. + // Form x = Aᵀ*x. if uplo == blas.Upper { if incX == 1 { for i := n - 1; i >= 0; i-- { @@ -2668,7 +2668,7 @@ func (Implementation) Ctrmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag return } - // Form x = A^H*x. + // Form x = Aᴴ*x. if uplo == blas.Upper { if incX == 1 { for i := n - 1; i >= 0; i-- { @@ -2723,9 +2723,9 @@ func (Implementation) Ctrmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag } // Ctrsv solves one of the systems of equations -// A * x = b if trans == blas.NoTrans -// A^T * x = b if trans == blas.Trans -// A^H * x = b if trans == blas.ConjTrans +// 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 @@ -2835,7 +2835,7 @@ func (Implementation) Ctrsv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag } if trans == blas.Trans { - // Form x = inv(A^T)*x. + // Form x = inv(Aᵀ)*x. if uplo == blas.Upper { if incX == 1 { for j := 0; j < n; j++ { @@ -2885,7 +2885,7 @@ func (Implementation) Ctrsv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag return } - // Form x = inv(A^H)*x. + // Form x = inv(Aᴴ)*x. if uplo == blas.Upper { if incX == 1 { for j := 0; j < n; j++ { diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level2float32.go b/vendor/gonum.org/v1/gonum/blas/gonum/level2float32.go index 08e1927f79c..d37a0b17dc2 100644 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level2float32.go +++ b/vendor/gonum.org/v1/gonum/blas/gonum/level2float32.go @@ -14,7 +14,7 @@ import ( var _ blas.Float32Level2 = Implementation{} // 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. // // Float32 implementations are autogenerated and not directly tested. @@ -63,8 +63,8 @@ func (Implementation) Sger(m, n int, alpha float32, x []float32, incX int, y []f } // Sgbmv performs one of the matrix-vector operations -// y = alpha * A * x + beta * y if tA == blas.NoTrans -// y = alpha * A^T * x + beta * y if tA == blas.Trans or blas.ConjTrans +// 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. // @@ -230,8 +230,8 @@ func (Implementation) Sgbmv(tA blas.Transpose, m, n, kL, kU int, alpha float32, } // Strmv performs one of the matrix-vector operations -// x = A * x if tA == blas.NoTrans -// x = A^T * x if tA == blas.Trans or blas.ConjTrans +// 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. // // Float32 implementations are autogenerated and not directly tested. @@ -384,8 +384,8 @@ func (Implementation) Strmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, } // Strsv solves one of the systems of equations -// A * x = b if tA == blas.NoTrans -// A^T * x = b if tA == blas.Trans or blas.ConjTrans +// 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 @@ -737,8 +737,8 @@ func (Implementation) Ssymv(ul blas.Uplo, n int, alpha float32, a []float32, lda } // Stbmv performs one of the matrix-vector operations -// x = A * x if tA == blas.NoTrans -// x = A^T * x if tA == blas.Trans or blas.ConjTrans +// 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. // // Float32 implementations are autogenerated and not directly tested. @@ -948,8 +948,8 @@ func (Implementation) Stbmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n, k i } // Stpmv performs one of the matrix-vector operations -// x = A * x if tA == blas.NoTrans -// x = A^T * x if tA == blas.Trans or blas.ConjTrans +// 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. // // Float32 implementations are autogenerated and not directly tested. @@ -1129,8 +1129,8 @@ func (Implementation) Stpmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, } // Stbsv solves one of the systems of equations -// A * x = b if tA == blas.NoTrans -// A^T * x = b if tA == blas.Trans or tA == blas.ConjTrans +// 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. // @@ -1525,7 +1525,7 @@ func (Implementation) Ssbmv(ul blas.Uplo, n, k int, alpha float32, a []float32, } // Ssyr performs the symmetric rank-one update -// A += alpha * x * x^T +// A += alpha * x * xᵀ // where A is an n×n symmetric matrix, and x is a vector. // // Float32 implementations are autogenerated and not directly tested. @@ -1625,7 +1625,7 @@ func (Implementation) Ssyr(ul blas.Uplo, n int, alpha float32, x []float32, incX } // Ssyr2 performs the symmetric rank-two 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, x and y are vectors, and alpha is a scalar. // // Float32 implementations are autogenerated and not directly tested. @@ -1734,8 +1734,8 @@ func (Implementation) Ssyr2(ul blas.Uplo, n int, alpha float32, x []float32, inc } // Stpsv solves one of the systems of equations -// A * x = b if tA == blas.NoTrans -// A^T * x = b if tA == blas.Trans or blas.ConjTrans +// 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 @@ -2089,7 +2089,7 @@ func (Implementation) Sspmv(ul blas.Uplo, n int, alpha float32, ap []float32, x } // Sspr performs the symmetric rank-one operation -// A += alpha * x * x^T +// A += alpha * x * xᵀ // where A is an n×n symmetric matrix in packed format, x is a vector, and // alpha is a scalar. // @@ -2183,7 +2183,7 @@ func (Implementation) Sspr(ul blas.Uplo, n int, alpha float32, x []float32, incX } // 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. // diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level2float64.go b/vendor/gonum.org/v1/gonum/blas/gonum/level2float64.go index 261257888d9..725efca5556 100644 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level2float64.go +++ b/vendor/gonum.org/v1/gonum/blas/gonum/level2float64.go @@ -12,7 +12,7 @@ import ( var _ blas.Float64Level2 = Implementation{} // 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) { if m < 0 { @@ -59,8 +59,8 @@ func (Implementation) Dger(m, n int, alpha float64, x []float64, incX int, y []f } // Dgbmv performs one of the matrix-vector operations -// y = alpha * A * x + beta * y if tA == blas.NoTrans -// y = alpha * A^T * x + beta * y if tA == blas.Trans or blas.ConjTrans +// 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) { @@ -224,8 +224,8 @@ func (Implementation) Dgbmv(tA blas.Transpose, m, n, kL, kU int, alpha float64, } // Dtrmv performs one of the matrix-vector operations -// x = A * x if tA == blas.NoTrans -// x = A^T * x if tA == blas.Trans or blas.ConjTrans +// 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) { if ul != blas.Lower && ul != blas.Upper { @@ -376,8 +376,8 @@ func (Implementation) Dtrmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, } // Dtrsv solves one of the systems of equations -// A * x = b if tA == blas.NoTrans -// A^T * x = b if tA == blas.Trans or blas.ConjTrans +// 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 @@ -725,8 +725,8 @@ func (Implementation) Dsymv(ul blas.Uplo, n int, alpha float64, a []float64, lda } // Dtbmv performs one of the matrix-vector operations -// x = A * x if tA == blas.NoTrans -// x = A^T * x if tA == blas.Trans or blas.ConjTrans +// 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) { if ul != blas.Lower && ul != blas.Upper { @@ -934,8 +934,8 @@ func (Implementation) Dtbmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n, k i } // Dtpmv performs one of the matrix-vector operations -// x = A * x if tA == blas.NoTrans -// x = A^T * x if tA == blas.Trans or blas.ConjTrans +// 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 []float64, x []float64, incX int) { if ul != blas.Lower && ul != blas.Upper { @@ -1113,8 +1113,8 @@ func (Implementation) Dtpmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, } // Dtbsv solves one of the systems of equations -// A * x = b if tA == blas.NoTrans -// A^T * x = b if tA == blas.Trans or tA == blas.ConjTrans +// 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. // @@ -1505,7 +1505,7 @@ func (Implementation) Dsbmv(ul blas.Uplo, n, k int, alpha float64, a []float64, } // Dsyr performs the symmetric rank-one update -// A += alpha * x * x^T +// 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) { if ul != blas.Lower && ul != blas.Upper { @@ -1603,7 +1603,7 @@ func (Implementation) Dsyr(ul blas.Uplo, n int, alpha float64, x []float64, incX } // Dsyr2 performs the symmetric rank-two 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, 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) { if ul != blas.Lower && ul != blas.Upper { @@ -1710,8 +1710,8 @@ func (Implementation) Dsyr2(ul blas.Uplo, n int, alpha float64, x []float64, inc } // Dtpsv solves one of the systems of equations -// A * x = b if tA == blas.NoTrans -// A^T * x = b if tA == blas.Trans or blas.ConjTrans +// 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 @@ -2061,7 +2061,7 @@ func (Implementation) Dspmv(ul blas.Uplo, n int, alpha float64, ap []float64, x } // Dspr performs the symmetric rank-one operation -// A += alpha * x * x^T +// 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) { @@ -2153,7 +2153,7 @@ func (Implementation) Dspr(ul blas.Uplo, n int, alpha float64, x []float64, incX } // 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) { diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level3cmplx128.go b/vendor/gonum.org/v1/gonum/blas/gonum/level3cmplx128.go index e4a2bb5e9b0..f2a2b2f5472 100644 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level3cmplx128.go +++ b/vendor/gonum.org/v1/gonum/blas/gonum/level3cmplx128.go @@ -16,7 +16,7 @@ var _ blas.Complex128Level3 = Implementation{} // 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^T or op(X) = X^H, +// 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) { @@ -118,7 +118,7 @@ func (Implementation) Zgemm(tA, tB blas.Transpose, m, n, k int, alpha complex128 } } case blas.Trans: - // Form C = alpha * A * B^T + beta * C. + // Form C = alpha * A * Bᵀ + beta * C. for i := 0; i < m; i++ { switch { case beta == 0: @@ -138,7 +138,7 @@ func (Implementation) Zgemm(tA, tB blas.Transpose, m, n, k int, alpha complex128 } } case blas.ConjTrans: - // Form C = alpha * A * B^H + beta * C. + // Form C = alpha * A * Bᴴ + beta * C. for i := 0; i < m; i++ { switch { case beta == 0: @@ -161,7 +161,7 @@ func (Implementation) Zgemm(tA, tB blas.Transpose, m, n, k int, alpha complex128 case blas.Trans: switch tB { case blas.NoTrans: - // Form C = alpha * A^T * B + beta * C. + // Form C = alpha * Aᵀ * B + beta * C. for i := 0; i < m; i++ { for j := 0; j < n; j++ { var tmp complex128 @@ -176,7 +176,7 @@ func (Implementation) Zgemm(tA, tB blas.Transpose, m, n, k int, alpha complex128 } } case blas.Trans: - // Form C = alpha * A^T * B^T + beta * C. + // Form C = alpha * Aᵀ * Bᵀ + beta * C. for i := 0; i < m; i++ { for j := 0; j < n; j++ { var tmp complex128 @@ -191,7 +191,7 @@ func (Implementation) Zgemm(tA, tB blas.Transpose, m, n, k int, alpha complex128 } } case blas.ConjTrans: - // Form C = alpha * A^T * B^H + beta * C. + // Form C = alpha * Aᵀ * Bᴴ + beta * C. for i := 0; i < m; i++ { for j := 0; j < n; j++ { var tmp complex128 @@ -209,7 +209,7 @@ func (Implementation) Zgemm(tA, tB blas.Transpose, m, n, k int, alpha complex128 case blas.ConjTrans: switch tB { case blas.NoTrans: - // Form C = alpha * A^H * B + beta * C. + // Form C = alpha * Aᴴ * B + beta * C. for i := 0; i < m; i++ { for j := 0; j < n; j++ { var tmp complex128 @@ -224,7 +224,7 @@ func (Implementation) Zgemm(tA, tB blas.Transpose, m, n, k int, alpha complex128 } } case blas.Trans: - // Form C = alpha * A^H * B^T + beta * C. + // Form C = alpha * Aᴴ * Bᵀ + beta * C. for i := 0; i < m; i++ { for j := 0; j < n; j++ { var tmp complex128 @@ -239,7 +239,7 @@ func (Implementation) Zgemm(tA, tB blas.Transpose, m, n, k int, alpha complex128 } } case blas.ConjTrans: - // Form C = alpha * A^H * B^H + beta * C. + // Form C = alpha * Aᴴ * Bᴴ + beta * C. for i := 0; i < m; i++ { for j := 0; j < n; j++ { var tmp complex128 @@ -405,8 +405,8 @@ func (Implementation) Zhemm(side blas.Side, uplo blas.Uplo, m, n int, alpha comp } // Zherk performs one of the hermitian rank-k operations -// C = alpha*A*A^H + beta*C if trans == blas.NoTrans -// C = alpha*A^H*A + beta*C if trans == blas.ConjTrans +// 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. // @@ -494,7 +494,7 @@ func (Implementation) Zherk(uplo blas.Uplo, trans blas.Transpose, n, k int, alph calpha := complex(alpha, 0) if trans == blas.NoTrans { - // Form C = alpha*A*A^H + beta*C. + // Form C = alpha*A*Aᴴ + beta*C. cbeta := complex(beta, 0) if uplo == blas.Upper { for i := 0; i < n; i++ { @@ -553,7 +553,7 @@ func (Implementation) Zherk(uplo blas.Uplo, trans blas.Transpose, n, k int, alph } } } else { - // Form C = alpha*A^H*A + beta*C. + // Form C = alpha*Aᴴ*A + beta*C. if uplo == blas.Upper { for i := 0; i < n; i++ { ci := c[i*ldc+i : i*ldc+n] @@ -603,8 +603,8 @@ func (Implementation) Zherk(uplo blas.Uplo, trans blas.Transpose, n, k int, alph } // Zher2k performs one of the hermitian rank-2k operations -// C = alpha*A*B^H + conj(alpha)*B*A^H + beta*C if trans == blas.NoTrans -// C = alpha*A^H*B + conj(alpha)*B^H*A + beta*C if trans == blas.ConjTrans +// 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. // @@ -698,7 +698,7 @@ func (Implementation) Zher2k(uplo blas.Uplo, trans blas.Transpose, n, k int, alp conjalpha := cmplx.Conj(alpha) cbeta := complex(beta, 0) if trans == blas.NoTrans { - // Form C = alpha*A*B^H + conj(alpha)*B*A^H + beta*C. + // Form C = alpha*A*Bᴴ + conj(alpha)*B*Aᴴ + beta*C. if uplo == blas.Upper { for i := 0; i < n; i++ { ci := c[i*ldc+i+1 : i*ldc+n] @@ -741,7 +741,7 @@ func (Implementation) Zher2k(uplo blas.Uplo, trans blas.Transpose, n, k int, alp } } } else { - // Form C = alpha*A^H*B + conj(alpha)*B^H*A + beta*C. + // Form C = alpha*Aᴴ*B + conj(alpha)*Bᴴ*A + beta*C. if uplo == blas.Upper { for i := 0; i < n; i++ { ci := c[i*ldc+i : i*ldc+n] @@ -943,8 +943,8 @@ func (Implementation) Zsymm(side blas.Side, uplo blas.Uplo, m, n int, alpha comp } // Zsyrk performs one of the symmetric rank-k operations -// C = alpha*A*A^T + beta*C if trans == blas.NoTrans -// C = alpha*A^T*A + beta*C if trans == blas.Trans +// 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(uplo blas.Uplo, trans blas.Transpose, n, k int, alpha complex128, a []complex128, lda int, beta complex128, c []complex128, ldc int) { @@ -1022,7 +1022,7 @@ func (Implementation) Zsyrk(uplo blas.Uplo, trans blas.Transpose, n, k int, alph } if trans == blas.NoTrans { - // Form C = alpha*A*A^T + beta*C. + // Form C = alpha*A*Aᵀ + beta*C. if uplo == blas.Upper { for i := 0; i < n; i++ { ci := c[i*ldc+i : i*ldc+n] @@ -1042,7 +1042,7 @@ func (Implementation) Zsyrk(uplo blas.Uplo, trans blas.Transpose, n, k int, alph } } } else { - // Form C = alpha*A^T*A + beta*C. + // Form C = alpha*Aᵀ*A + beta*C. if uplo == blas.Upper { for i := 0; i < n; i++ { ci := c[i*ldc+i : i*ldc+n] @@ -1088,8 +1088,8 @@ func (Implementation) Zsyrk(uplo blas.Uplo, trans blas.Transpose, n, k int, alph } // Zsyr2k performs one of the symmetric rank-2k operations -// C = alpha*A*B^T + alpha*B*A^T + beta*C if trans == blas.NoTrans -// C = alpha*A^T*B + alpha*B^T*A + beta*C if trans == blas.Trans +// 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(uplo blas.Uplo, trans blas.Transpose, n, k int, alpha complex128, a []complex128, lda int, b []complex128, ldb int, beta complex128, c []complex128, ldc int) { @@ -1172,7 +1172,7 @@ func (Implementation) Zsyr2k(uplo blas.Uplo, trans blas.Transpose, n, k int, alp } if trans == blas.NoTrans { - // Form C = alpha*A*B^T + alpha*B*A^T + beta*C. + // Form C = alpha*A*Bᵀ + alpha*B*Aᵀ + beta*C. if uplo == blas.Upper { for i := 0; i < n; i++ { ci := c[i*ldc+i : i*ldc+n] @@ -1207,7 +1207,7 @@ func (Implementation) Zsyr2k(uplo blas.Uplo, trans blas.Transpose, n, k int, alp } } } else { - // Form C = alpha*A^T*B + alpha*B^T*A + beta*C. + // Form C = alpha*Aᵀ*B + alpha*Bᵀ*A + beta*C. if uplo == blas.Upper { for i := 0; i < n; i++ { ci := c[i*ldc+i : i*ldc+n] @@ -1265,9 +1265,9 @@ func (Implementation) Zsyr2k(uplo blas.Uplo, trans blas.Transpose, n, k int, alp // 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^T if trans == blas.Trans, -// op(A) = A^H if trans == blas.ConjTrans. +// op(A) = A if trans == blas.NoTrans, +// op(A) = Aᵀ if trans == blas.Trans, +// op(A) = Aᴴ if trans == blas.ConjTrans. func (Implementation) Ztrmm(side blas.Side, uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, m, n int, alpha complex128, a []complex128, lda int, b []complex128, ldb int) { na := m if side == blas.Right { @@ -1356,7 +1356,7 @@ func (Implementation) Ztrmm(side blas.Side, uplo blas.Uplo, trans blas.Transpose } } } else { - // Form B = alpha*A^T*B or B = alpha*A^H*B. + // Form B = alpha*Aᵀ*B or B = alpha*Aᴴ*B. if uplo == blas.Upper { for k := m - 1; k >= 0; k-- { bk := b[k*ldb : k*ldb+n] @@ -1445,7 +1445,7 @@ func (Implementation) Ztrmm(side blas.Side, uplo blas.Uplo, trans blas.Transpose } } } else { - // Form B = alpha*B*A^T or B = alpha*B*A^H. + // Form B = alpha*B*Aᵀ or B = alpha*B*Aᴴ. if uplo == blas.Upper { for i := 0; i < m; i++ { bi := b[i*ldb : i*ldb+n] @@ -1493,9 +1493,9 @@ func (Implementation) Ztrmm(side blas.Side, uplo blas.Uplo, trans blas.Transpose // 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^T if transA == blas.Trans, -// op(A) = A^H if transA == blas.ConjTrans. +// 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(side blas.Side, uplo blas.Uplo, transA blas.Transpose, diag blas.Diag, m, n int, alpha complex128, a []complex128, lda int, b []complex128, ldb int) { na := m @@ -1581,7 +1581,7 @@ func (Implementation) Ztrsm(side blas.Side, uplo blas.Uplo, transA blas.Transpos } } } else { - // Form B = alpha*inv(A^T)*B or B = alpha*inv(A^H)*B. + // Form B = alpha*inv(Aᵀ)*B or B = alpha*inv(Aᴴ)*B. if uplo == blas.Upper { for i := 0; i < m; i++ { bi := b[i*ldb : i*ldb+n] @@ -1670,7 +1670,7 @@ func (Implementation) Ztrsm(side blas.Side, uplo blas.Uplo, transA blas.Transpos } } } else { - // Form B = alpha*B*inv(A^T) or B = alpha*B*inv(A^H). + // Form B = alpha*B*inv(Aᵀ) or B = alpha*B*inv(Aᴴ). if uplo == blas.Upper { for i := 0; i < m; i++ { bi := b[i*ldb : i*ldb+n] diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level3cmplx64.go b/vendor/gonum.org/v1/gonum/blas/gonum/level3cmplx64.go index 436c545065a..570b2af10bb 100644 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level3cmplx64.go +++ b/vendor/gonum.org/v1/gonum/blas/gonum/level3cmplx64.go @@ -18,7 +18,7 @@ var _ blas.Complex64Level3 = Implementation{} // 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^T or op(X) = X^H, +// 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. // @@ -122,7 +122,7 @@ func (Implementation) Cgemm(tA, tB blas.Transpose, m, n, k int, alpha complex64, } } case blas.Trans: - // Form C = alpha * A * B^T + beta * C. + // Form C = alpha * A * Bᵀ + beta * C. for i := 0; i < m; i++ { switch { case beta == 0: @@ -142,7 +142,7 @@ func (Implementation) Cgemm(tA, tB blas.Transpose, m, n, k int, alpha complex64, } } case blas.ConjTrans: - // Form C = alpha * A * B^H + beta * C. + // Form C = alpha * A * Bᴴ + beta * C. for i := 0; i < m; i++ { switch { case beta == 0: @@ -165,7 +165,7 @@ func (Implementation) Cgemm(tA, tB blas.Transpose, m, n, k int, alpha complex64, case blas.Trans: switch tB { case blas.NoTrans: - // Form C = alpha * A^T * B + beta * C. + // Form C = alpha * Aᵀ * B + beta * C. for i := 0; i < m; i++ { for j := 0; j < n; j++ { var tmp complex64 @@ -180,7 +180,7 @@ func (Implementation) Cgemm(tA, tB blas.Transpose, m, n, k int, alpha complex64, } } case blas.Trans: - // Form C = alpha * A^T * B^T + beta * C. + // Form C = alpha * Aᵀ * Bᵀ + beta * C. for i := 0; i < m; i++ { for j := 0; j < n; j++ { var tmp complex64 @@ -195,7 +195,7 @@ func (Implementation) Cgemm(tA, tB blas.Transpose, m, n, k int, alpha complex64, } } case blas.ConjTrans: - // Form C = alpha * A^T * B^H + beta * C. + // Form C = alpha * Aᵀ * Bᴴ + beta * C. for i := 0; i < m; i++ { for j := 0; j < n; j++ { var tmp complex64 @@ -213,7 +213,7 @@ func (Implementation) Cgemm(tA, tB blas.Transpose, m, n, k int, alpha complex64, case blas.ConjTrans: switch tB { case blas.NoTrans: - // Form C = alpha * A^H * B + beta * C. + // Form C = alpha * Aᴴ * B + beta * C. for i := 0; i < m; i++ { for j := 0; j < n; j++ { var tmp complex64 @@ -228,7 +228,7 @@ func (Implementation) Cgemm(tA, tB blas.Transpose, m, n, k int, alpha complex64, } } case blas.Trans: - // Form C = alpha * A^H * B^T + beta * C. + // Form C = alpha * Aᴴ * Bᵀ + beta * C. for i := 0; i < m; i++ { for j := 0; j < n; j++ { var tmp complex64 @@ -243,7 +243,7 @@ func (Implementation) Cgemm(tA, tB blas.Transpose, m, n, k int, alpha complex64, } } case blas.ConjTrans: - // Form C = alpha * A^H * B^H + beta * C. + // Form C = alpha * Aᴴ * Bᴴ + beta * C. for i := 0; i < m; i++ { for j := 0; j < n; j++ { var tmp complex64 @@ -411,8 +411,8 @@ func (Implementation) Chemm(side blas.Side, uplo blas.Uplo, m, n int, alpha comp } // Cherk performs one of the hermitian rank-k operations -// C = alpha*A*A^H + beta*C if trans == blas.NoTrans -// C = alpha*A^H*A + beta*C if trans == blas.ConjTrans +// 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. // @@ -502,7 +502,7 @@ func (Implementation) Cherk(uplo blas.Uplo, trans blas.Transpose, n, k int, alph calpha := complex(alpha, 0) if trans == blas.NoTrans { - // Form C = alpha*A*A^H + beta*C. + // Form C = alpha*A*Aᴴ + beta*C. cbeta := complex(beta, 0) if uplo == blas.Upper { for i := 0; i < n; i++ { @@ -561,7 +561,7 @@ func (Implementation) Cherk(uplo blas.Uplo, trans blas.Transpose, n, k int, alph } } } else { - // Form C = alpha*A^H*A + beta*C. + // Form C = alpha*Aᴴ*A + beta*C. if uplo == blas.Upper { for i := 0; i < n; i++ { ci := c[i*ldc+i : i*ldc+n] @@ -611,8 +611,8 @@ func (Implementation) Cherk(uplo blas.Uplo, trans blas.Transpose, n, k int, alph } // Cher2k performs one of the hermitian rank-2k operations -// C = alpha*A*B^H + conj(alpha)*B*A^H + beta*C if trans == blas.NoTrans -// C = alpha*A^H*B + conj(alpha)*B^H*A + beta*C if trans == blas.ConjTrans +// 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. // @@ -708,7 +708,7 @@ func (Implementation) Cher2k(uplo blas.Uplo, trans blas.Transpose, n, k int, alp conjalpha := cmplx.Conj(alpha) cbeta := complex(beta, 0) if trans == blas.NoTrans { - // Form C = alpha*A*B^H + conj(alpha)*B*A^H + beta*C. + // Form C = alpha*A*Bᴴ + conj(alpha)*B*Aᴴ + beta*C. if uplo == blas.Upper { for i := 0; i < n; i++ { ci := c[i*ldc+i+1 : i*ldc+n] @@ -751,7 +751,7 @@ func (Implementation) Cher2k(uplo blas.Uplo, trans blas.Transpose, n, k int, alp } } } else { - // Form C = alpha*A^H*B + conj(alpha)*B^H*A + beta*C. + // Form C = alpha*Aᴴ*B + conj(alpha)*Bᴴ*A + beta*C. if uplo == blas.Upper { for i := 0; i < n; i++ { ci := c[i*ldc+i : i*ldc+n] @@ -955,8 +955,8 @@ func (Implementation) Csymm(side blas.Side, uplo blas.Uplo, m, n int, alpha comp } // Csyrk performs one of the symmetric rank-k operations -// C = alpha*A*A^T + beta*C if trans == blas.NoTrans -// C = alpha*A^T*A + beta*C if trans == blas.Trans +// 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. // @@ -1036,7 +1036,7 @@ func (Implementation) Csyrk(uplo blas.Uplo, trans blas.Transpose, n, k int, alph } if trans == blas.NoTrans { - // Form C = alpha*A*A^T + beta*C. + // Form C = alpha*A*Aᵀ + beta*C. if uplo == blas.Upper { for i := 0; i < n; i++ { ci := c[i*ldc+i : i*ldc+n] @@ -1056,7 +1056,7 @@ func (Implementation) Csyrk(uplo blas.Uplo, trans blas.Transpose, n, k int, alph } } } else { - // Form C = alpha*A^T*A + beta*C. + // Form C = alpha*Aᵀ*A + beta*C. if uplo == blas.Upper { for i := 0; i < n; i++ { ci := c[i*ldc+i : i*ldc+n] @@ -1102,8 +1102,8 @@ func (Implementation) Csyrk(uplo blas.Uplo, trans blas.Transpose, n, k int, alph } // Csyr2k performs one of the symmetric rank-2k operations -// C = alpha*A*B^T + alpha*B*A^T + beta*C if trans == blas.NoTrans -// C = alpha*A^T*B + alpha*B^T*A + beta*C if trans == blas.Trans +// 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. // @@ -1188,7 +1188,7 @@ func (Implementation) Csyr2k(uplo blas.Uplo, trans blas.Transpose, n, k int, alp } if trans == blas.NoTrans { - // Form C = alpha*A*B^T + alpha*B*A^T + beta*C. + // Form C = alpha*A*Bᵀ + alpha*B*Aᵀ + beta*C. if uplo == blas.Upper { for i := 0; i < n; i++ { ci := c[i*ldc+i : i*ldc+n] @@ -1223,7 +1223,7 @@ func (Implementation) Csyr2k(uplo blas.Uplo, trans blas.Transpose, n, k int, alp } } } else { - // Form C = alpha*A^T*B + alpha*B^T*A + beta*C. + // Form C = alpha*Aᵀ*B + alpha*Bᵀ*A + beta*C. if uplo == blas.Upper { for i := 0; i < n; i++ { ci := c[i*ldc+i : i*ldc+n] @@ -1281,9 +1281,9 @@ func (Implementation) Csyr2k(uplo blas.Uplo, trans blas.Transpose, n, k int, alp // 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^T if trans == blas.Trans, -// op(A) = A^H if trans == blas.ConjTrans. +// 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(side blas.Side, uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, m, n int, alpha complex64, a []complex64, lda int, b []complex64, ldb int) { @@ -1374,7 +1374,7 @@ func (Implementation) Ctrmm(side blas.Side, uplo blas.Uplo, trans blas.Transpose } } } else { - // Form B = alpha*A^T*B or B = alpha*A^H*B. + // Form B = alpha*Aᵀ*B or B = alpha*Aᴴ*B. if uplo == blas.Upper { for k := m - 1; k >= 0; k-- { bk := b[k*ldb : k*ldb+n] @@ -1463,7 +1463,7 @@ func (Implementation) Ctrmm(side blas.Side, uplo blas.Uplo, trans blas.Transpose } } } else { - // Form B = alpha*B*A^T or B = alpha*B*A^H. + // Form B = alpha*B*Aᵀ or B = alpha*B*Aᴴ. if uplo == blas.Upper { for i := 0; i < m; i++ { bi := b[i*ldb : i*ldb+n] @@ -1511,9 +1511,9 @@ func (Implementation) Ctrmm(side blas.Side, uplo blas.Uplo, trans blas.Transpose // 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^T if transA == blas.Trans, -// op(A) = A^H if transA == blas.ConjTrans. +// 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. @@ -1601,7 +1601,7 @@ func (Implementation) Ctrsm(side blas.Side, uplo blas.Uplo, transA blas.Transpos } } } else { - // Form B = alpha*inv(A^T)*B or B = alpha*inv(A^H)*B. + // Form B = alpha*inv(Aᵀ)*B or B = alpha*inv(Aᴴ)*B. if uplo == blas.Upper { for i := 0; i < m; i++ { bi := b[i*ldb : i*ldb+n] @@ -1690,7 +1690,7 @@ func (Implementation) Ctrsm(side blas.Side, uplo blas.Uplo, transA blas.Transpos } } } else { - // Form B = alpha*B*inv(A^T) or B = alpha*B*inv(A^H). + // Form B = alpha*B*inv(Aᵀ) or B = alpha*B*inv(Aᴴ). if uplo == blas.Upper { for i := 0; i < m; i++ { bi := b[i*ldb : i*ldb+n] diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level3float32.go b/vendor/gonum.org/v1/gonum/blas/gonum/level3float32.go index 13c4a792e98..a565b9e8295 100644 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level3float32.go +++ b/vendor/gonum.org/v1/gonum/blas/gonum/level3float32.go @@ -14,10 +14,10 @@ import ( var _ blas.Float32Level3 = Implementation{} // Strsm solves one of the matrix equations -// A * X = alpha * B if tA == blas.NoTrans and 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 and side == blas.Right -// X * A^T = alpha * B if tA == blas.Trans or blas.ConjTrans, and side == blas.Right +// 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. // @@ -362,8 +362,8 @@ func (Implementation) Ssymm(s blas.Side, ul blas.Uplo, m, n int, alpha float32, } // Ssyrk performs one of the symmetric rank-k operations -// C = alpha * A * A^T + beta * C if tA == blas.NoTrans -// C = alpha * A^T * A + beta * C if tA == blas.Trans or tA == blas.ConjTrans +// 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. // @@ -514,8 +514,8 @@ func (Implementation) Ssyrk(ul blas.Uplo, tA blas.Transpose, n, k int, alpha flo } // Ssyr2k performs one of the symmetric rank 2k operations -// C = alpha * A * B^T + alpha * B * A^T + beta * C if tA == blas.NoTrans -// C = alpha * A^T * B + alpha * B^T * A + beta * C if tA == blas.Trans or tA == blas.ConjTrans +// 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. // @@ -678,10 +678,10 @@ func (Implementation) Ssyr2k(ul blas.Uplo, tA blas.Transpose, n, k int, alpha fl } // Strmm performs one of the matrix-matrix operations -// 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 +// 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. // // Float32 implementations are autogenerated and not directly tested. diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level3float64.go b/vendor/gonum.org/v1/gonum/blas/gonum/level3float64.go index 9eebd906912..bf91d14fc8d 100644 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level3float64.go +++ b/vendor/gonum.org/v1/gonum/blas/gonum/level3float64.go @@ -12,10 +12,10 @@ import ( var _ blas.Float64Level3 = Implementation{} // Dtrsm solves one of the matrix equations -// A * X = alpha * B if tA == blas.NoTrans and 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 and side == blas.Right -// X * A^T = alpha * B if tA == blas.Trans or blas.ConjTrans, and side == blas.Right +// 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. // @@ -356,8 +356,8 @@ func (Implementation) Dsymm(s blas.Side, ul blas.Uplo, m, n int, alpha float64, } // Dsyrk performs one of the symmetric rank-k operations -// C = alpha * A * A^T + beta * C if tA == blas.NoTrans -// C = alpha * A^T * A + beta * C if tA == blas.Trans or tA == blas.ConjTrans +// 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, tA blas.Transpose, n, k int, alpha float64, a []float64, lda int, beta float64, c []float64, ldc int) { @@ -506,8 +506,8 @@ func (Implementation) Dsyrk(ul blas.Uplo, tA blas.Transpose, n, k int, alpha flo } // Dsyr2k performs one of the symmetric rank 2k operations -// C = alpha * A * B^T + alpha * B * A^T + beta * C if tA == blas.NoTrans -// C = alpha * A^T * B + alpha * B^T * A + beta * C if tA == blas.Trans or tA == blas.ConjTrans +// 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, tA blas.Transpose, n, k int, alpha float64, a []float64, lda int, b []float64, ldb int, beta float64, c []float64, ldc int) { @@ -668,10 +668,10 @@ func (Implementation) Dsyr2k(ul blas.Uplo, tA blas.Transpose, n, k int, alpha fl } // Dtrmm performs one of the matrix-matrix operations -// 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 +// 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) { if s != blas.Left && s != blas.Right { diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/sgemm.go b/vendor/gonum.org/v1/gonum/blas/gonum/sgemm.go index e868a1050cf..079b94ce47a 100644 --- a/vendor/gonum.org/v1/gonum/blas/gonum/sgemm.go +++ b/vendor/gonum.org/v1/gonum/blas/gonum/sgemm.go @@ -16,9 +16,9 @@ import ( // Sgemm performs one of the matrix-matrix operations // C = alpha * A * B + beta * C -// C = alpha * A^T * B + beta * C -// C = alpha * A * B^T + beta * C -// C = alpha * A^T * B^T + 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. @@ -138,9 +138,9 @@ func sgemmParallel(aTrans, bTrans bool, m, n, k int, a []float32, lda int, b []f // In all cases, there is one dimension for each matrix along which // C must be updated sequentially. // Cij = \sum_k Aik Bki, (A * B) - // Cij = \sum_k Aki Bkj, (A^T * B) - // Cij = \sum_k Aik Bjk, (A * B^T) - // Cij = \sum_k Aki Bjk, (A^T * B^T) + // Cij = \sum_k Aki Bkj, (Aᵀ * B) + // Cij = \sum_k Aik Bjk, (A * Bᵀ) + // Cij = \sum_k Aki Bjk, (Aᵀ * Bᵀ) // // This code computes one {i, j} block sequentially along the k dimension, // and computes all of the {i, j} blocks concurrently. This diff --git a/vendor/gonum.org/v1/gonum/graph/encoding/dot/encode.go b/vendor/gonum.org/v1/gonum/graph/encoding/dot/encode.go index 10fc7d956ea..3e3955c52c8 100644 --- a/vendor/gonum.org/v1/gonum/graph/encoding/dot/encode.go +++ b/vendor/gonum.org/v1/gonum/graph/encoding/dot/encode.go @@ -135,8 +135,6 @@ type printer struct { prefix string indent string depth int - - err error } type edge struct { @@ -291,7 +289,7 @@ func (p *simpleGraphPrinter) print(g graph.Graph, name string, needsIndent, isSu return nil } -func (p *printer) printFrontMatter(name string, needsIndent, isSubgraph, isDirected, isStrict bool) error { +func (p *printer) printFrontMatter(name string, needsIndent, isSubgraph, isDirected, isStrict bool) { p.buf.WriteString(p.prefix) if needsIndent { for i := 0; i < p.depth; i++ { @@ -316,7 +314,6 @@ func (p *printer) printFrontMatter(name string, needsIndent, isSubgraph, isDirec } p.openBlock(" {") - return nil } func (p *printer) writeNode(n graph.Node) { diff --git a/vendor/gonum.org/v1/gonum/graph/iterator/nodes.go b/vendor/gonum.org/v1/gonum/graph/iterator/nodes.go index 952dd770f2e..f32ec12157f 100644 --- a/vendor/gonum.org/v1/gonum/graph/iterator/nodes.go +++ b/vendor/gonum.org/v1/gonum/graph/iterator/nodes.go @@ -4,7 +4,11 @@ package iterator -import "gonum.org/v1/gonum/graph" +import ( + "reflect" + + "gonum.org/v1/gonum/graph" +) // OrderedNodes implements the graph.Nodes and graph.NodeSlicer interfaces. // The iteration order of OrderedNodes is the order of nodes passed to @@ -123,3 +127,54 @@ func (n *ImplicitNodes) NodeSlice() []graph.Node { } return nodes } + +// Nodes implements the graph.Nodes interfaces. +// The iteration order of Nodes is randomized. +type Nodes struct { + nodes reflect.Value + iter *reflect.MapIter + pos int + curr graph.Node +} + +// NewNodes returns a Nodes initialized with the provided nodes, a +// map of node IDs to graph.Nodes. No check is made that the keys +// match the graph.Node IDs, and the map keys are not used. +// +// Behavior of the Nodes is unspecified if nodes is mutated after +// the call the NewNodes. +func NewNodes(nodes map[int64]graph.Node) *Nodes { + rv := reflect.ValueOf(nodes) + return &Nodes{nodes: rv, iter: rv.MapRange()} +} + +// Len returns the remaining number of nodes to be iterated over. +func (n *Nodes) Len() int { + return n.nodes.Len() - n.pos +} + +// Next returns whether the next call of Node will return a valid node. +func (n *Nodes) Next() bool { + if n.pos >= n.nodes.Len() { + return false + } + ok := n.iter.Next() + if ok { + n.pos++ + n.curr = n.iter.Value().Interface().(graph.Node) + } + return ok +} + +// Node returns the current node of the iterator. Next must have been +// called prior to a call to Node. +func (n *Nodes) Node() graph.Node { + return n.curr +} + +// Reset returns the iterator to its initial state. +func (n *Nodes) Reset() { + n.curr = nil + n.pos = 0 + n.iter = n.nodes.MapRange() +} diff --git a/vendor/gonum.org/v1/gonum/graph/simple/directed.go b/vendor/gonum.org/v1/gonum/graph/simple/directed.go index f19efbd0a2c..26c92c674b7 100644 --- a/vendor/gonum.org/v1/gonum/graph/simple/directed.go +++ b/vendor/gonum.org/v1/gonum/graph/simple/directed.go @@ -49,8 +49,6 @@ func (g *DirectedGraph) AddNode(n graph.Node) { panic(fmt.Sprintf("simple: node ID collision: %d", n.ID())) } g.nodes[n.ID()] = n - g.from[n.ID()] = make(map[int64]graph.Edge) - g.to[n.ID()] = make(map[int64]graph.Edge) g.nodeIDs.Use(n.ID()) } @@ -212,13 +210,21 @@ func (g *DirectedGraph) SetEdge(e graph.Edge) { g.nodes[tid] = to } - g.from[fid][tid] = e - g.to[tid][fid] = e + if fm, ok := g.from[fid]; ok { + fm[tid] = e + } else { + g.from[fid] = map[int64]graph.Edge{tid: e} + } + if tm, ok := g.to[tid]; ok { + tm[fid] = e + } else { + g.to[tid] = map[int64]graph.Edge{fid: e} + } } // To returns all nodes in g that can reach directly to n. func (g *DirectedGraph) To(id int64) graph.Nodes { - if _, ok := g.from[id]; !ok { + if _, ok := g.to[id]; !ok { return graph.Empty } diff --git a/vendor/gonum.org/v1/gonum/graph/simple/undirected.go b/vendor/gonum.org/v1/gonum/graph/simple/undirected.go index 841a8e380c5..0a7b05e0615 100644 --- a/vendor/gonum.org/v1/gonum/graph/simple/undirected.go +++ b/vendor/gonum.org/v1/gonum/graph/simple/undirected.go @@ -47,7 +47,6 @@ func (g *UndirectedGraph) AddNode(n graph.Node) { panic(fmt.Sprintf("simple: node ID collision: %d", n.ID())) } g.nodes[n.ID()] = n - g.edges[n.ID()] = make(map[int64]graph.Edge) g.nodeIDs.Use(n.ID()) } @@ -211,6 +210,14 @@ func (g *UndirectedGraph) SetEdge(e graph.Edge) { g.nodes[tid] = to } - g.edges[fid][tid] = e - g.edges[tid][fid] = e + if fm, ok := g.edges[fid]; ok { + fm[tid] = e + } else { + g.edges[fid] = map[int64]graph.Edge{tid: e} + } + if tm, ok := g.edges[tid]; ok { + tm[fid] = e + } else { + g.edges[tid] = map[int64]graph.Edge{fid: e} + } } diff --git a/vendor/gonum.org/v1/gonum/graph/simple/weighted_directed.go b/vendor/gonum.org/v1/gonum/graph/simple/weighted_directed.go index 92bd2842fdf..70e0ff29431 100644 --- a/vendor/gonum.org/v1/gonum/graph/simple/weighted_directed.go +++ b/vendor/gonum.org/v1/gonum/graph/simple/weighted_directed.go @@ -57,8 +57,6 @@ func (g *WeightedDirectedGraph) AddNode(n graph.Node) { panic(fmt.Sprintf("simple: node ID collision: %d", n.ID())) } g.nodes[n.ID()] = n - g.from[n.ID()] = make(map[int64]graph.WeightedEdge) - g.to[n.ID()] = make(map[int64]graph.WeightedEdge) g.nodeIDs.Use(n.ID()) } @@ -143,7 +141,7 @@ func (g *WeightedDirectedGraph) Node(id int64) graph.Node { // Nodes returns all the nodes in the graph. func (g *WeightedDirectedGraph) Nodes() graph.Nodes { - if len(g.from) == 0 { + if len(g.nodes) == 0 { return graph.Empty } nodes := make([]graph.Node, len(g.nodes)) @@ -216,13 +214,21 @@ func (g *WeightedDirectedGraph) SetWeightedEdge(e graph.WeightedEdge) { g.nodes[tid] = to } - g.from[fid][tid] = e - g.to[tid][fid] = e + if fm, ok := g.from[fid]; ok { + fm[tid] = e + } else { + g.from[fid] = map[int64]graph.WeightedEdge{tid: e} + } + if tm, ok := g.to[tid]; ok { + tm[fid] = e + } else { + g.to[tid] = map[int64]graph.WeightedEdge{fid: e} + } } // To returns all nodes in g that can reach directly to n. func (g *WeightedDirectedGraph) To(id int64) graph.Nodes { - if _, ok := g.from[id]; !ok { + if _, ok := g.to[id]; !ok { return graph.Empty } diff --git a/vendor/gonum.org/v1/gonum/graph/simple/weighted_undirected.go b/vendor/gonum.org/v1/gonum/graph/simple/weighted_undirected.go index 5932576832e..a4cfcdbfb59 100644 --- a/vendor/gonum.org/v1/gonum/graph/simple/weighted_undirected.go +++ b/vendor/gonum.org/v1/gonum/graph/simple/weighted_undirected.go @@ -55,7 +55,6 @@ func (g *WeightedUndirectedGraph) AddNode(n graph.Node) { panic(fmt.Sprintf("simple: node ID collision: %d", n.ID())) } g.nodes[n.ID()] = n - g.edges[n.ID()] = make(map[int64]graph.WeightedEdge) g.nodeIDs.Use(n.ID()) } @@ -212,8 +211,16 @@ func (g *WeightedUndirectedGraph) SetWeightedEdge(e graph.WeightedEdge) { g.nodes[tid] = to } - g.edges[fid][tid] = e - g.edges[tid][fid] = e + if fm, ok := g.edges[fid]; ok { + fm[tid] = e + } else { + g.edges[fid] = map[int64]graph.WeightedEdge{tid: e} + } + if tm, ok := g.edges[tid]; ok { + tm[fid] = e + } else { + g.edges[tid] = map[int64]graph.WeightedEdge{fid: e} + } } // Weight returns the weight for the edge between x and y if Edge(x, y) returns a non-nil Edge. diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyinc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyinc_amd64.s index 0a4c14c2926..68490e51a62 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyinc_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyinc_amd64.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyincto_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyincto_amd64.s index cb57f4bed3e..50d21f2cbfd 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyincto_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyincto_amd64.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyunitary_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyunitary_amd64.s index f1fddce71d6..ccf82896f19 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyunitary_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyunitary_amd64.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyunitaryto_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyunitaryto_amd64.s index b80015fda85..07ceabca9a5 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyunitaryto_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyunitaryto_amd64.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/dotcinc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c128/dotcinc_amd64.s index 301d294fa4b..03c07db9fdd 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/dotcinc_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/c128/dotcinc_amd64.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/dotcunitary_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c128/dotcunitary_amd64.s index 1db7e156d79..adce85e1dd0 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/dotcunitary_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/c128/dotcunitary_amd64.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/dotuinc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c128/dotuinc_amd64.s index 386467fcbd2..5b15444d88d 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/dotuinc_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/c128/dotuinc_amd64.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/dotuunitary_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c128/dotuunitary_amd64.s index d0d507cdcda..a45f31e9e4d 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/dotuunitary_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/c128/dotuunitary_amd64.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/dscalinc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c128/dscalinc_amd64.s index 40d5851a627..d8fd54d22ca 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/dscalinc_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/c128/dscalinc_amd64.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/dscalunitary_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c128/dscalunitary_amd64.s index cbc0768aa07..6ed900a6697 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/dscalunitary_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/c128/dscalunitary_amd64.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/scalUnitary_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c128/scalUnitary_amd64.s index 7b807b3a450..f08590e1b1e 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/scalUnitary_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/c128/scalUnitary_amd64.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/scalinc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c128/scalinc_amd64.s index 7857c1554fc..5829ee54b4f 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/scalinc_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/c128/scalinc_amd64.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyinc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyinc_amd64.s index 841415dbc9f..5f105116482 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyinc_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyinc_amd64.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyincto_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyincto_amd64.s index 5c5228dc21d..5b0e2848a69 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyincto_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyincto_amd64.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyunitary_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyunitary_amd64.s index ae744a4902e..c38cb3c5033 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyunitary_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyunitary_amd64.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyunitaryto_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyunitaryto_amd64.s index a5d702092d0..fee4bb94f69 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyunitaryto_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyunitaryto_amd64.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c64/dotcinc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c64/dotcinc_amd64.s index 87de31d32a8..2161643cde9 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/c64/dotcinc_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/c64/dotcinc_amd64.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c64/dotcunitary_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c64/dotcunitary_amd64.s index d53479ca49c..4efc52b1a86 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/c64/dotcunitary_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/c64/dotcunitary_amd64.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c64/dotuinc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c64/dotuinc_amd64.s index bdee59becd8..6b26c5ab754 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/c64/dotuinc_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/c64/dotuinc_amd64.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c64/dotuunitary_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c64/dotuunitary_amd64.s index dce83a46711..07a115b333c 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/c64/dotuunitary_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/c64/dotuunitary_amd64.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyinc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyinc_amd64.s index 2d167c08f34..ebf360ff764 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyinc_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyinc_amd64.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyincto_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyincto_amd64.s index b79f9926c90..4e9020e4fc6 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyincto_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyincto_amd64.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyunitary_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyunitary_amd64.s index 97df90a07f3..224b84255e2 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyunitary_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyunitary_amd64.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyunitaryto_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyunitaryto_amd64.s index a826ca31257..e26ccff35cc 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyunitaryto_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyunitaryto_amd64.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/ddotinc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f32/ddotinc_amd64.s index 4518e049520..de9e312920b 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/ddotinc_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/f32/ddotinc_amd64.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/ddotunitary_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f32/ddotunitary_amd64.s index 231cbd3bfba..d39ab78602d 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/ddotunitary_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/f32/ddotunitary_amd64.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/dotinc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f32/dotinc_amd64.s index 4d36b289c67..b6f40210c6c 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/dotinc_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/f32/dotinc_amd64.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/dotunitary_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f32/dotunitary_amd64.s index c32ede5a939..fd4f7b4e057 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/dotunitary_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/f32/dotunitary_amd64.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/ge_amd64.go b/vendor/gonum.org/v1/gonum/internal/asm/f32/ge_amd64.go index 2b336a2af94..a27fcaad947 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/ge_amd64.go +++ b/vendor/gonum.org/v1/gonum/internal/asm/f32/ge_amd64.go @@ -7,7 +7,7 @@ package f32 // Ger 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 Ger(m, n uintptr, alpha float32, x []float32, incX uintptr, diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/ge_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f32/ge_amd64.s index e5e80c52c60..ecb2641a90f 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/ge_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/f32/ge_amd64.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/ge_noasm.go b/vendor/gonum.org/v1/gonum/internal/asm/f32/ge_noasm.go index d92f9968d05..562302d88c9 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/ge_noasm.go +++ b/vendor/gonum.org/v1/gonum/internal/asm/f32/ge_noasm.go @@ -7,7 +7,7 @@ package f32 // Ger 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 Ger(m, n uintptr, alpha float32, x []float32, incX uintptr, y []float32, incY uintptr, a []float32, lda uintptr) { diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyinc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyinc_amd64.s index 95fe9f9044e..aab22e35a11 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyinc_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyinc_amd64.s @@ -34,7 +34,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyincto_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyincto_amd64.s index dcb79d878e8..f2fb977154f 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyincto_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyincto_amd64.s @@ -34,7 +34,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyunitary_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyunitary_amd64.s index bc290a15286..cc519cfd492 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyunitary_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyunitary_amd64.s @@ -34,7 +34,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyunitaryto_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyunitaryto_amd64.s index 16798ebaabd..3918092f5a6 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyunitaryto_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyunitaryto_amd64.s @@ -34,7 +34,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/dot_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/dot_amd64.s index eff25059f16..6daba1bae7d 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/dot_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/f64/dot_amd64.s @@ -34,7 +34,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/ge_amd64.go b/vendor/gonum.org/v1/gonum/internal/asm/f64/ge_amd64.go index 00c99e93231..506fdbbd0b1 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/ge_amd64.go +++ b/vendor/gonum.org/v1/gonum/internal/asm/f64/ge_amd64.go @@ -7,7 +7,7 @@ package f64 // Ger 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 Ger(m, n uintptr, alpha float64, x []float64, incX uintptr, y []float64, incY uintptr, a []float64, lda uintptr) @@ -17,6 +17,6 @@ func Ger(m, n uintptr, alpha float64, x []float64, incX uintptr, y []float64, in func GemvN(m, n uintptr, alpha float64, a []float64, lda uintptr, x []float64, incX uintptr, beta float64, y []float64, incY uintptr) // GemvT computes -// y = alpha * A^T * x + beta * y +// y = alpha * Aᵀ * x + beta * y // where A is an m×n dense matrix, x and y are vectors, and alpha and beta are scalars. func GemvT(m, n uintptr, alpha float64, a []float64, lda uintptr, x []float64, incX uintptr, beta float64, y []float64, incY uintptr) diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/ge_noasm.go b/vendor/gonum.org/v1/gonum/internal/asm/f64/ge_noasm.go index 2a1cfd5cdd0..4b949d01473 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/ge_noasm.go +++ b/vendor/gonum.org/v1/gonum/internal/asm/f64/ge_noasm.go @@ -7,7 +7,7 @@ package f64 // Ger 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 Ger(m, n uintptr, alpha float64, x []float64, incX uintptr, y []float64, incY uintptr, a []float64, lda uintptr) { if incX == 1 && incY == 1 { @@ -73,7 +73,7 @@ func GemvN(m, n uintptr, alpha float64, a []float64, lda uintptr, x []float64, i } // GemvT computes -// y = alpha * A^T * x + beta * y +// y = alpha * Aᵀ * x + beta * y // where A is an m×n dense matrix, x and y are vectors, and alpha and beta are scalars. func GemvT(m, n uintptr, alpha float64, a []float64, lda uintptr, x []float64, incX uintptr, beta float64, y []float64, incY uintptr) { var kx, ky, i uintptr diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/gemvN_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/gemvN_amd64.s index 8d2a6a71a52..f0a98f0f847 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/gemvN_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/f64/gemvN_amd64.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/gemvT_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/gemvT_amd64.s index ff7d60fb68b..87a9445e971 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/gemvT_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/f64/gemvT_amd64.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/ger_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/ger_amd64.s index 8c1b36a65ea..7ae5cf7c41e 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/ger_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/f64/ger_amd64.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/scalinc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/scalinc_amd64.s index fb8b545eba3..cf185fc0dad 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/scalinc_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/f64/scalinc_amd64.s @@ -34,7 +34,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/scalincto_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/scalincto_amd64.s index 186fd1c05f4..cf359ac1e58 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/scalincto_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/f64/scalincto_amd64.s @@ -34,7 +34,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/scalunitary_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/scalunitary_amd64.s index f852c7f7c89..560aef2a326 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/scalunitary_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/f64/scalunitary_amd64.s @@ -34,7 +34,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/scalunitaryto_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/scalunitaryto_amd64.s index d2b607f5253..a5b2b018fd4 100644 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/scalunitaryto_amd64.s +++ b/vendor/gonum.org/v1/gonum/internal/asm/f64/scalunitaryto_amd64.s @@ -34,7 +34,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -//+build !noasm,!appengine,!safe +// +build !noasm,!appengine,!safe #include "textflag.h" diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/BUILD b/vendor/gonum.org/v1/gonum/lapack/gonum/BUILD index 6504605fec9..a7842ae3934 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/BUILD +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/BUILD @@ -4,6 +4,7 @@ go_library( name = "go_default_library", srcs = [ "dbdsqr.go", + "dcombssq.go", "dgebak.go", "dgebal.go", "dgebd2.go", @@ -40,6 +41,7 @@ go_library( "dlahr2.go", "dlaln2.go", "dlange.go", + "dlansb.go", "dlanst.go", "dlansy.go", "dlantr.go", @@ -74,6 +76,7 @@ go_library( "dlasv2.go", "dlaswp.go", "dlasy2.go", + "dlatbs.go", "dlatrd.go", "dlatrs.go", "dlauu2.go", @@ -95,7 +98,10 @@ go_library( "dormlq.go", "dormqr.go", "dormr2.go", + "dpbcon.go", "dpbtf2.go", + "dpbtrf.go", + "dpbtrs.go", "dpocon.go", "dpotf2.go", "dpotrf.go", diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dbdsqr.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dbdsqr.go index 5f3833fd97a..acbf453488b 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dbdsqr.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dbdsqr.go @@ -15,19 +15,19 @@ import ( // 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ᵀ // 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. // // Q and P are only computed if requested. If left singular vectors are requested, // this routine returns U * Q instead of Q, and if right singular vectors are -// requested P^T * VT is returned instead of P^T. +// requested Pᵀ * VT is returned instead of Pᵀ. // // 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ᵀ * VT) // -// This routine may also compute Q^T * C. +// This routine may also compute Qᵀ * C. // // d and e contain the elements of the bidiagonal matrix b. d must have length at // least n, and e must have length at least n-1. Dbdsqr will panic if there is @@ -35,13 +35,13 @@ import ( // order. // // VT is a matrix of size n×ncvt whose elements are stored in vt. The elements -// of vt are modified to contain P^T * VT on exit. VT is not used if ncvt == 0. +// of vt are modified to contain Pᵀ * VT on exit. VT is not used if ncvt == 0. // // U is a matrix of size nru×n whose elements are stored in u. The elements // of u are modified to contain U * Q on exit. U is not used if nru == 0. // // 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. +// of c are modified to contain Qᵀ * C on exit. C is not used if ncc == 0. // // work contains temporary storage and must have length at least 4*(n-1). Dbdsqr // will panic if there is insufficient working memory. diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dcombssq.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dcombssq.go new file mode 100644 index 00000000000..e807e0a1d58 --- /dev/null +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dcombssq.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 gonum + +// Dcombssq adds two scaled sum-of-squares quantities, V := V1 + V2, +// V_scale^2 * V_ssq := V1_scale^2 * V1_ssq + V2_scale^2 * V2_ssq +// and returns the result V. +// +// Dcombssq is an internal routine. It is exported for testing purposes. +func (Implementation) Dcombssq(scale1, ssq1, scale2, ssq2 float64) (scale, ssq float64) { + if scale1 >= scale2 { + if scale1 != 0 { + return scale1, ssq1 + (scale2/scale1)*(scale2/scale1)*ssq2 + } + // If the input is non-negative and we are here, then scale2 must inevitably be 0, too. + return 0, 0 + } + return scale2, ssq2 + (scale1/scale2)*(scale1/scale2)*ssq1 +} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgebak.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgebak.go index 7caa0b17391..b8c61203fb3 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgebak.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dgebak.go @@ -10,8 +10,8 @@ import ( ) // Dgebak updates an n×m matrix V as -// V = P D V, if side == lapack.EVRight, -// V = P D^{-1} V, if side == lapack.EVLeft, +// V = P D V if side == lapack.EVRight, +// V = P D^{-1} V if side == lapack.EVLeft, // where P and D are n×n permutation and scaling matrices, respectively, // implicitly represented by job, scale, ilo and ihi as returned by Dgebal. // diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgebal.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgebal.go index 6fb5170cd28..f4690b504ae 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgebal.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dgebal.go @@ -15,10 +15,10 @@ import ( // and scaling. Both steps are optional and depend on the value of job. // // 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 ] +// that results from Pᵀ*A*P takes the upper block triangular form +// [ T1 X Y ] +// Pᵀ 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 diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgebd2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgebd2.go index cf951a1202f..6dc97ce5942 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgebd2.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dgebd2.go @@ -8,7 +8,7 @@ import "gonum.org/v1/gonum/blas" // Dgebd2 reduces an m×n matrix A to upper or lower bidiagonal form by an orthogonal // transformation. -// Q^T * A * P = B +// Qᵀ * A * P = B // if m >= n, B is upper diagonal, otherwise B is lower bidiagonal. // d is the diagonal, len = min(m,n) // e is the off-diagonal len = min(m,n)-1 diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgebrd.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgebrd.go index f03bf8d939f..8faef130d34 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgebrd.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dgebrd.go @@ -11,7 +11,7 @@ import ( // 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ᵀ * 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 is a @@ -24,8 +24,8 @@ import ( // 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ᵀ, +// G_i = I - tauP[i] * u_i * u_iᵀ. // // As an example, on exit the entries of A when m = 6, and n = 5 // [ d e u1 u1 u1] diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgeev.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgeev.go index 0da4e609c55..9d3aa724e1f 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgeev.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dgeev.go @@ -19,8 +19,8 @@ import ( // is defined by // 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, -// where u_j^H is the conjugate transpose of u_j. +// u_jᴴ A = λ_j u_jᴴ, +// where u_jᴴ 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 diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgehd2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgehd2.go index 261f21b983a..15f45b5e033 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgehd2.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dgehd2.go @@ -7,13 +7,13 @@ package gonum import "gonum.org/v1/gonum/blas" // Dgehd2 reduces a block of a general n×n matrix A to upper Hessenberg form H -// by an orthogonal similarity transformation Q^T * A * Q = H. +// by an orthogonal similarity transformation Qᵀ * A * Q = H. // // The matrix Q is represented as a product of (ihi-ilo) elementary // reflectors // 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ᵀ // 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]. // diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgehrd.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgehrd.go index 89b73cef991..2fc759875ab 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgehrd.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dgehrd.go @@ -11,13 +11,13 @@ import ( ) // Dgehrd reduces a block of a real n×n general matrix A to upper Hessenberg -// form H by an orthogonal similarity transformation Q^T * A * Q = H. +// form H by an orthogonal similarity transformation Qᵀ * A * Q = H. // // The matrix Q is represented as a product of (ihi-ilo) elementary // reflectors // 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ᵀ // 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]. // @@ -158,12 +158,12 @@ func (impl Implementation) Dgehrd(n, ilo, ihi int, a []float64, lda int, tau, wo ib := min(nb, ihi-i) // Reduce columns [i:i+ib] to Hessenberg form, returning the - // matrices V and T of the block reflector H = I - V*T*V^T + // matrices V and T of the block reflector H = I - V*T*Vᵀ // which performs the reduction, and also the matrix Y = A*V*T. impl.Dlahr2(ihi+1, i+1, ib, a[i:], lda, tau[i:], work[iwt:], ldt, work, ldwork) // Apply the block reflector H to A[:ihi+1,i+ib:ihi+1] from the - // right, computing A := A - Y * V^T. V[i+ib,i+ib-1] must be set + // right, computing A := A - Y * Vᵀ. V[i+ib,i+ib-1] must be set // to 1. ei := a[(i+ib)*lda+i+ib-1] a[(i+ib)*lda+i+ib-1] = 1 diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgels.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgels.go index a3894b6a0b6..cb0dbe86fc2 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgels.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dgels.go @@ -20,7 +20,7 @@ import ( // 2. If m < n and trans == blas.NoTrans, Dgels finds the minimum norm solution of // A * X = B. // 3. If m >= n and trans == blas.Trans, Dgels finds the minimum norm solution of -// A^T * X = B. +// Aᵀ * 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 diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgeql2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgeql2.go index 3f3ddb163fd..73e42d1a7a9 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgeql2.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dgeql2.go @@ -14,7 +14,7 @@ import "gonum.org/v1/gonum/blas" // Q is represented as a product of elementary reflectors, // Q = H_{k-1} * ... * H_1 * H_0 // where k = min(m,n) and each H_i has the form -// H_i = I - tau[i] * v_i * v_i^T +// H_i = I - tau[i] * v_i * v_iᵀ // Vector v_i has v[m-k+i+1:m] = 0, v[m-k+i] = 1, and v[:m-k+i+1] is stored on // exit in A[0:m-k+i-1, n-k+i]. // diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgeqp3.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgeqp3.go index 6949da967a2..d072d288538 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgeqp3.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dgeqp3.go @@ -15,7 +15,7 @@ import ( // The matrix Q is represented as a product of elementary reflectors // 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ᵀ // 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]. // diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgeqr2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgeqr2.go index 3e35d7e2f42..57bf37729dd 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgeqr2.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dgeqr2.go @@ -22,7 +22,7 @@ import "gonum.org/v1/gonum/blas" // 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. +// and computing H_i = I - tau[i] * v * vᵀ. // // The orthonormal matrix Q can be constructed from a product of these elementary // reflectors, Q = H_0 * H_1 * ... * H_{k-1}, where k = min(m,n). diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgeqrf.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgeqrf.go index 300f8eea4e0..d14088a1694 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgeqrf.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dgeqrf.go @@ -85,7 +85,7 @@ func (impl Implementation) Dgeqrf(m, n int, a []float64, lda int, tau, work []fl // Compute the QR factorization of the current block. impl.Dgeqr2(m-i, ib, a[i*lda+i:], lda, tau[i:], work) if i+ib < n { - // Form the triangular factor of the block reflector and apply H^T + // Form the triangular factor of the block reflector and apply Hᵀ // In Dlarft, work becomes the T matrix. impl.Dlarft(lapack.Forward, lapack.ColumnWise, m-i, ib, a[i*lda+i:], lda, diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgerq2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgerq2.go index 60dac973a14..a06dec5a09c 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgerq2.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dgerq2.go @@ -19,7 +19,7 @@ import "gonum.org/v1/gonum/blas" // The matrix Q is represented as a product of elementary reflectors // 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ᵀ // 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. // diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgerqf.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgerqf.go index 9b4aa050efb..86115548522 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgerqf.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dgerqf.go @@ -22,7 +22,7 @@ import ( // The matrix Q is represented as a product of elementary reflectors // 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ᵀ // 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. // diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgesvd.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgesvd.go index 136f683e4b9..f2e98547011 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgesvd.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dgesvd.go @@ -17,7 +17,7 @@ const noSVDO = "dgesvd: not coded for overwrite" // 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ᵀ // 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 @@ -29,7 +29,7 @@ const noSVDO = "dgesvd: not coded for overwrite" // 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 +// The behavior is the same for jobVT and the rows of Vᵀ. At most one of jobU // and jobVT can equal lapack.SVDOverwrite, and Dgesvd will panic otherwise. // // On entry, a contains the data for the m×n matrix A. During the call to Dgesvd diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgetrs.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgetrs.go index ecc20d7c968..5531934531e 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgetrs.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dgetrs.go @@ -11,8 +11,8 @@ import ( // 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ᵀ * 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 @@ -61,11 +61,11 @@ func (impl Implementation) Dgetrs(trans blas.Transpose, n, nrhs int, a []float64 n, nrhs, 1, a, lda, b, ldb) return } - // Solve A^T * X = B. - // Solve U^T * X = B, updating b. + // Solve Aᵀ * X = B. + // Solve Uᵀ * X = B, updating b. bi.Dtrsm(blas.Left, blas.Upper, blas.Trans, blas.NonUnit, n, nrhs, 1, a, lda, b, ldb) - // Solve L^T * X = B, updating b. + // Solve Lᵀ * X = B, updating b. bi.Dtrsm(blas.Left, blas.Lower, blas.Trans, blas.Unit, n, nrhs, 1, a, lda, b, ldb) impl.Dlaswp(nrhs, b, ldb, 0, n-1, ipiv, -1) diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dggsvd3.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dggsvd3.go index ac234dce33b..d5c8be9e23d 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dggsvd3.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dggsvd3.go @@ -13,13 +13,13 @@ import ( // 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 ] +// Uᵀ*A*Q = D1*[ 0 R ] // -// V^T*B*Q = D2*[ 0 R ] +// Vᵀ*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 -// is the effective numerical rank of the (m+p)×n matrix [ A^T B^T ]^T. +// is the effective numerical rank of the (m+p)×n matrix [ Aᵀ Bᵀ ]ᵀ. // R is a (k+l)×(k+l) nonsingular upper triangular matrix, D1 and // D2 are m×(k+l) and p×(k+l) diagonal matrices and of the following // structures, respectively: diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dggsvp3.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dggsvp3.go index 7a9ad9fbf96..902260c17c5 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dggsvp3.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dggsvp3.go @@ -14,16 +14,16 @@ import ( // 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; +// Uᵀ*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; +// Uᵀ*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 ] +// Vᵀ*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 @@ -31,7 +31,7 @@ import ( // otherwise A23 is (m-k)×l upper trapezoidal. // // Dggsvp3 returns k and l, the dimensions of the sub-blocks. k+l -// is the effective numerical rank of the (m+p)×n matrix [ A^T B^T ]^T. +// is the effective numerical rank of the (m+p)×n matrix [ Aᵀ Bᵀ ]ᵀ. // // jobU, jobV and jobQ are options for computing the orthogonal matrices. The behavior // is as follows @@ -174,11 +174,11 @@ func (impl Implementation) Dggsvp3(jobU, jobV, jobQ lapack.GSVDJob, m, p, n int, // RQ factorization of [ S11 S12 ]: [ S11 S12 ] = [ 0 S12 ]*Z. impl.Dgerq2(l, n, b, ldb, tau, work) - // Update A := A*Z^T. + // Update A := A*Zᵀ. impl.Dormr2(blas.Right, blas.Trans, m, n, l, b, ldb, tau, a, lda, work) if wantq { - // Update Q := Q*Z^T. + // Update Q := Q*Zᵀ. impl.Dormr2(blas.Right, blas.Trans, n, n, l, b, ldb, tau, q, ldq, work) } @@ -197,7 +197,7 @@ func (impl Implementation) Dggsvp3(jobU, jobV, jobQ lapack.GSVDJob, m, p, n int, // // then the following does the complete QR decomposition of A11: // - // A11 = U*[ 0 T12 ]*P1^T. + // A11 = U*[ 0 T12 ]*P1ᵀ. // [ 0 0 ] for i := range iwork[:n-l] { iwork[i] = 0 @@ -211,7 +211,7 @@ func (impl Implementation) Dggsvp3(jobU, jobV, jobQ lapack.GSVDJob, m, p, n int, } } - // Update A12 := U^T*A12, where A12 = A[0:m, n-l:n]. + // Update A12 := Uᵀ*A12, where A12 = A[0:m, n-l:n]. impl.Dorm2r(blas.Left, blas.Trans, m, l, min(m, n-l), a, lda, tau, a[n-l:], lda, work) if wantu { @@ -245,7 +245,7 @@ func (impl Implementation) Dggsvp3(jobU, jobV, jobQ lapack.GSVDJob, m, p, n int, impl.Dgerq2(k, n-l, a, lda, tau, work) if wantq { - // Update Q[0:n, 0:n-l] := Q[0:n, 0:n-l]*Z1^T. + // Update Q[0:n, 0:n-l] := Q[0:n, 0:n-l]*Z1ᵀ. impl.Dorm2r(blas.Right, blas.Trans, n, n-l, k, a, lda, tau, q, ldq, work) } diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dhseqr.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dhseqr.go index ed3fbca8514..61390fbde61 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dhseqr.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dhseqr.go @@ -13,14 +13,14 @@ import ( // 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ᵀ, // 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ᵀ = (QZ) T (QZ)ᵀ. // // If job == lapack.EigenvaluesOnly, only the eigenvalues will be computed. // If job == lapack.EigenvaluesAndSchur, the eigenvalues and the Schur form T will @@ -43,8 +43,8 @@ import ( // 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. // diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlabrd.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlabrd.go index babc0b7c0d7..8f7d2949a25 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlabrd.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dlabrd.go @@ -25,8 +25,8 @@ import ( // Q = H_0 * H_1 * ... * H_{nb-1} // P = G_0 * G_1 * ... * G_{nb-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ᵀ +// G_i = I - tauP[i] * u_i * u_iᵀ // // As an example, on exit the entries of A when m = 6, n = 5, and nb = 2 // [ 1 1 u1 u1 u1] @@ -44,7 +44,7 @@ import ( // // Dlabrd also returns the matrices X and Y which are used with U and V to // apply the transformation to the unreduced part of the matrix -// A := A - V*Y^T - X*U^T +// A := A - V*Yᵀ - X*Uᵀ // and returns the matrices X and Y which are needed to apply the // transformation to the unreduced part of A. // diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlacn2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlacn2.go index e8ac1e439c4..d97e5edf865 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlacn2.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dlacn2.go @@ -18,7 +18,7 @@ import ( // 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 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. diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlags2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlags2.go index 6954deb4244..1622275d6bf 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlags2.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dlags2.go @@ -11,19 +11,19 @@ import "math" // // If upper is true // -// U^T*A*Q = U^T*[ a1 a2 ]*Q = [ x 0 ] -// [ 0 a3 ] [ x x ] +// Uᵀ*A*Q = Uᵀ*[ a1 a2 ]*Q = [ x 0 ] +// [ 0 a3 ] [ x x ] // and -// V^T*B*Q = V^T*[ b1 b2 ]*Q = [ x 0 ] -// [ 0 b3 ] [ x x ] +// Vᵀ*B*Q = Vᵀ*[ b1 b2 ]*Q = [ x 0 ] +// [ 0 b3 ] [ x x ] // // otherwise // -// U^T*A*Q = U^T*[ a1 0 ]*Q = [ x x ] -// [ a2 a3 ] [ 0 x ] +// Uᵀ*A*Q = Uᵀ*[ a1 0 ]*Q = [ x x ] +// [ a2 a3 ] [ 0 x ] // and -// V^T*B*Q = V^T*[ b1 0 ]*Q = [ x x ] -// [ b2 b3 ] [ 0 x ]. +// Vᵀ*B*Q = Vᵀ*[ b1 0 ]*Q = [ x x ] +// [ b2 b3 ] [ 0 x ]. // // The rows of the transformed A and B are parallel, where // @@ -48,8 +48,8 @@ func (impl Implementation) Dlags2(upper bool, a1, a2, a3, b1, b2, b3 float64) (c _, _, snr, csr, snl, csl := impl.Dlasv2(a, b, d) if math.Abs(csl) >= math.Abs(snl) || math.Abs(csr) >= math.Abs(snr) { - // Compute the [0, 0] and [0, 1] elements of U^T*A and V^T*B, - // and [0, 1] element of |U|^T*|A| and |V|^T*|B|. + // Compute the [0, 0] and [0, 1] elements of Uᵀ*A and Vᵀ*B, + // and [0, 1] element of |U|ᵀ*|A| and |V|ᵀ*|B|. ua11r := csl * a1 ua12 := csl*a2 + snl*a3 @@ -60,7 +60,7 @@ func (impl Implementation) Dlags2(upper bool, a1, a2, a3, b1, b2, b3 float64) (c aua12 := math.Abs(csl)*math.Abs(a2) + math.Abs(snl)*math.Abs(a3) avb12 := math.Abs(csr)*math.Abs(b2) + math.Abs(snr)*math.Abs(b3) - // Zero [0, 1] elements of U^T*A and V^T*B. + // Zero [0, 1] elements of Uᵀ*A and Vᵀ*B. if math.Abs(ua11r)+math.Abs(ua12) != 0 { if aua12/(math.Abs(ua11r)+math.Abs(ua12)) <= avb12/(math.Abs(vb11r)+math.Abs(vb12)) { csq, snq, _ = impl.Dlartg(-ua11r, ua12) @@ -76,8 +76,8 @@ func (impl Implementation) Dlags2(upper bool, a1, a2, a3, b1, b2, b3 float64) (c csv = csr snv = -snr } else { - // Compute the [1, 0] and [1, 1] elements of U^T*A and V^T*B, - // and [1, 1] element of |U|^T*|A| and |V|^T*|B|. + // Compute the [1, 0] and [1, 1] elements of Uᵀ*A and Vᵀ*B, + // and [1, 1] element of |U|ᵀ*|A| and |V|ᵀ*|B|. ua21 := -snl * a1 ua22 := -snl*a2 + csl*a3 @@ -88,7 +88,7 @@ func (impl Implementation) Dlags2(upper bool, a1, a2, a3, b1, b2, b3 float64) (c aua22 := math.Abs(snl)*math.Abs(a2) + math.Abs(csl)*math.Abs(a3) avb22 := math.Abs(snr)*math.Abs(b2) + math.Abs(csr)*math.Abs(b3) - // Zero [1, 1] elements of U^T*A and V^T*B, and then swap. + // Zero [1, 1] elements of Uᵀ*A and Vᵀ*B, and then swap. if math.Abs(ua21)+math.Abs(ua22) != 0 { if aua22/(math.Abs(ua21)+math.Abs(ua22)) <= avb22/(math.Abs(vb21)+math.Abs(vb22)) { csq, snq, _ = impl.Dlartg(-ua21, ua22) @@ -120,8 +120,8 @@ func (impl Implementation) Dlags2(upper bool, a1, a2, a3, b1, b2, b3 float64) (c _, _, snr, csr, snl, csl := impl.Dlasv2(a, c, d) if math.Abs(csr) >= math.Abs(snr) || math.Abs(csl) >= math.Abs(snl) { - // Compute the [1, 0] and [1, 1] elements of U^T*A and V^T*B, - // and [1, 0] element of |U|^T*|A| and |V|^T*|B|. + // Compute the [1, 0] and [1, 1] elements of Uᵀ*A and Vᵀ*B, + // and [1, 0] element of |U|ᵀ*|A| and |V|ᵀ*|B|. ua21 := -snr*a1 + csr*a2 ua22r := csr * a3 @@ -132,7 +132,7 @@ func (impl Implementation) Dlags2(upper bool, a1, a2, a3, b1, b2, b3 float64) (c aua21 := math.Abs(snr)*math.Abs(a1) + math.Abs(csr)*math.Abs(a2) avb21 := math.Abs(snl)*math.Abs(b1) + math.Abs(csl)*math.Abs(b2) - // Zero [1, 0] elements of U^T*A and V^T*B. + // Zero [1, 0] elements of Uᵀ*A and Vᵀ*B. if (math.Abs(ua21) + math.Abs(ua22r)) != 0 { if aua21/(math.Abs(ua21)+math.Abs(ua22r)) <= avb21/(math.Abs(vb21)+math.Abs(vb22r)) { csq, snq, _ = impl.Dlartg(ua22r, ua21) @@ -148,8 +148,8 @@ func (impl Implementation) Dlags2(upper bool, a1, a2, a3, b1, b2, b3 float64) (c csv = csl snv = -snl } else { - // Compute the [0, 0] and [0, 1] elements of U^T *A and V^T *B, - // and [0, 0] element of |U|^T*|A| and |V|^T*|B|. + // Compute the [0, 0] and [0, 1] elements of Uᵀ *A and Vᵀ *B, + // and [0, 0] element of |U|ᵀ*|A| and |V|ᵀ*|B|. ua11 := csr*a1 + snr*a2 ua12 := snr * a3 @@ -160,7 +160,7 @@ func (impl Implementation) Dlags2(upper bool, a1, a2, a3, b1, b2, b3 float64) (c aua11 := math.Abs(csr)*math.Abs(a1) + math.Abs(snr)*math.Abs(a2) avb11 := math.Abs(csl)*math.Abs(b1) + math.Abs(snl)*math.Abs(b2) - // Zero [0, 0] elements of U^T*A and V^T*B, and then swap. + // Zero [0, 0] elements of Uᵀ*A and Vᵀ*B, and then swap. if (math.Abs(ua11) + math.Abs(ua12)) != 0 { if aua11/(math.Abs(ua11)+math.Abs(ua12)) <= avb11/(math.Abs(vb11)+math.Abs(vb12)) { csq, snq, _ = impl.Dlartg(ua12, ua11) diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlahr2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlahr2.go index a47dc8fed12..43b7308f16e 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlahr2.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dlahr2.go @@ -11,21 +11,21 @@ import ( // Dlahr2 reduces the first nb columns of a real general n×(n-k+1) matrix A so // that elements below the k-th subdiagonal are zero. The reduction is performed -// by an orthogonal similarity transformation Q^T * A * Q. Dlahr2 returns the -// matrices V and T which determine Q as a block reflector I - V*T*V^T, and +// by an orthogonal similarity transformation Qᵀ * A * Q. Dlahr2 returns the +// matrices V and T which determine Q as a block reflector I - V*T*Vᵀ, and // also the matrix Y = A * V * T. // // The matrix Q is represented as a product of nb elementary reflectors // Q = H_0 * H_1 * ... * H_{nb-1}. // Each H_i has the form -// H_i = I - tau[i] * v * v^T, +// H_i = I - tau[i] * v * vᵀ, // where v is a real vector with v[0:i+k-1] = 0 and v[i+k-1] = 1. v[i+k:n] is // stored on exit in A[i+k+1:n,i]. // // The elements of the vectors v together form the (n-k+1)×nb matrix // V which is needed, with T and Y, to apply the transformation to the // unreduced part of the matrix, using an update of the form -// A = (I - V*T*V^T) * (A - Y*V^T). +// A = (I - V*T*Vᵀ) * (A - Y*Vᵀ). // // On entry, a contains the n×(n-k+1) general matrix A. On return, the elements // on and above the k-th subdiagonal in the first nb columns are overwritten @@ -109,31 +109,31 @@ func (impl Implementation) Dlahr2(n, k, nb int, a []float64, lda int, tau, t []f if i > 0 { // Update A[k:n,i]. - // Update i-th column of A - Y * V^T. + // Update i-th column of A - Y * Vᵀ. bi.Dgemv(blas.NoTrans, n-k, i, -1, y[k*ldy:], ldy, a[(k+i-1)*lda:], 1, 1, a[k*lda+i:], lda) - // Apply I - V * T^T * V^T to this column (call it b) + // Apply I - V * Tᵀ * Vᵀ to this column (call it b) // from the left, using the last column of T as // workspace. // Let V = [ V1 ] and b = [ b1 ] (first i rows) // [ V2 ] [ b2 ] // where V1 is unit lower triangular. // - // w := V1^T * b1. + // w := V1ᵀ * b1. bi.Dcopy(i, a[k*lda+i:], lda, t[nb-1:], ldt) bi.Dtrmv(blas.Lower, blas.Trans, blas.Unit, i, a[k*lda:], lda, t[nb-1:], ldt) - // w := w + V2^T * b2. + // w := w + V2ᵀ * b2. bi.Dgemv(blas.Trans, n-k-i, i, 1, a[(k+i)*lda:], lda, a[(k+i)*lda+i:], lda, 1, t[nb-1:], ldt) - // w := T^T * w. + // w := Tᵀ * w. bi.Dtrmv(blas.Upper, blas.Trans, blas.NonUnit, i, t, ldt, t[nb-1:], ldt) diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaln2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlaln2.go index ca0b2f78c8d..df8164a7994 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaln2.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dlaln2.go @@ -7,8 +7,8 @@ package gonum import "math" // Dlaln2 solves a linear equation or a system of 2 linear equations of the form -// (ca A - w D) X = scale B, if trans == false, -// (ca A^T - w D) X = scale B, if trans == true, +// (ca A - w D) X = scale B if trans == false, +// (ca Aᵀ - w D) X = scale B if trans == true, // where A is a na×na real matrix, ca is a real scalar, D is a na×na diagonal // real matrix, w is a scalar, real if nw == 1, complex if nw == 2, and X and B // are na×1 matrices, real if w is real, complex if w is complex. @@ -147,7 +147,7 @@ func (impl Implementation) Dlaln2(trans bool, na, nw int, smin, ca float64, a [] // Compute the real part of // C = ca A - w D // or - // C = ca A^T - w D. + // C = ca Aᵀ - w D. crv := [4]float64{ ca*a[0] - wr*d1, ca * a[1], diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlange.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlange.go index 9edfa83c43a..059487701d4 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlange.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dlange.go @@ -10,19 +10,22 @@ import ( "gonum.org/v1/gonum/lapack" ) -// 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.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. +// Dlange returns the value of the specified norm of a general m×n matrix A: +// lapack.MaxAbs: the maximum absolute value of any element. +// lapack.MaxColumnSum: the maximum column sum of the absolute values of the elements (1-norm). +// lapack.MaxRowSum: the maximum row sum of the absolute values of the elements (infinity-norm). +// lapack.Frobenius: the square root of the sum of the squares of the elements (Frobenius norm). +// 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 { // TODO(btracey): These should probably be refactored to use BLAS calls. switch { case norm != lapack.MaxRowSum && norm != lapack.MaxColumnSum && norm != lapack.Frobenius && norm != lapack.MaxAbs: panic(badNorm) + case m < 0: + panic(mLT0) + case n < 0: + panic(nLT0) case lda < max(1, n): panic(badLdA) } @@ -39,7 +42,8 @@ func (impl Implementation) Dlange(norm lapack.MatrixNorm, m, n int, a []float64, panic(shortWork) } - if norm == lapack.MaxAbs { + switch norm { + case lapack.MaxAbs: var value float64 for i := 0; i < m; i++ { for j := 0; j < n; j++ { @@ -47,11 +51,7 @@ func (impl Implementation) Dlange(norm lapack.MatrixNorm, m, n int, a []float64, } } return value - } - if norm == lapack.MaxColumnSum { - if len(work) < n { - panic(shortWork) - } + case lapack.MaxColumnSum: for i := 0; i < n; i++ { work[i] = 0 } @@ -65,8 +65,7 @@ func (impl Implementation) Dlange(norm lapack.MatrixNorm, m, n int, a []float64, value = math.Max(value, work[i]) } return value - } - if norm == lapack.MaxRowSum { + case lapack.MaxRowSum: var value float64 for i := 0; i < m; i++ { var sum float64 @@ -76,14 +75,14 @@ func (impl Implementation) Dlange(norm lapack.MatrixNorm, m, n int, a []float64, value = math.Max(value, sum) } return value + default: + // lapack.Frobenius + scale := 0.0 + sum := 1.0 + for i := 0; i < m; i++ { + rowscale, rowsum := impl.Dlassq(n, a[i*lda:], 1, 0, 1) + scale, sum = impl.Dcombssq(scale, sum, rowscale, rowsum) + } + return scale * math.Sqrt(sum) } - // norm == lapack.Frobenius - var value float64 - scale := 0.0 - sum := 1.0 - for i := 0; i < m; i++ { - scale, sum = impl.Dlassq(n, a[i*lda:], 1, scale, sum) - } - value = scale * math.Sqrt(sum) - return value } diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlansb.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlansb.go new file mode 100644 index 00000000000..ac293759f29 --- /dev/null +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dlansb.go @@ -0,0 +1,135 @@ +// 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 gonum + +import ( + "math" + + "gonum.org/v1/gonum/blas" + "gonum.org/v1/gonum/lapack" +) + +// Dlansb returns the given norm of an n×n symmetric band matrix with kd +// super-diagonals. +// +// When norm is lapack.MaxColumnSum or lapack.MaxRowSum, the length of work must +// be at least n. +func (impl Implementation) Dlansb(norm lapack.MatrixNorm, uplo blas.Uplo, n, kd int, ab []float64, ldab int, work []float64) float64 { + switch { + case norm != lapack.MaxAbs && norm != lapack.MaxRowSum && norm != lapack.MaxColumnSum && norm != lapack.Frobenius: + panic(badNorm) + 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 0 + } + + switch { + case len(ab) < (n-1)*ldab+kd+1: + panic(shortAB) + case len(work) < n && (norm == lapack.MaxColumnSum || norm == lapack.MaxRowSum): + panic(shortWork) + } + + var value float64 + switch norm { + case lapack.MaxAbs: + if uplo == blas.Upper { + for i := 0; i < n; i++ { + for j := 0; j < min(n-i, kd+1); j++ { + aij := math.Abs(ab[i*ldab+j]) + if aij > value || math.IsNaN(aij) { + value = aij + } + } + } + } else { + for i := 0; i < n; i++ { + for j := max(0, kd-i); j < kd+1; j++ { + aij := math.Abs(ab[i*ldab+j]) + if aij > value || math.IsNaN(aij) { + value = aij + } + } + } + } + case lapack.MaxColumnSum, lapack.MaxRowSum: + work = work[:n] + var sum float64 + if uplo == blas.Upper { + for i := range work { + work[i] = 0 + } + for i := 0; i < n; i++ { + sum := work[i] + math.Abs(ab[i*ldab]) + for j := i + 1; j < min(i+kd+1, n); j++ { + aij := math.Abs(ab[i*ldab+j-i]) + sum += aij + work[j] += aij + } + if sum > value || math.IsNaN(sum) { + value = sum + } + } + } else { + for i := 0; i < n; i++ { + sum = 0 + for j := max(0, i-kd); j < i; j++ { + aij := math.Abs(ab[i*ldab+kd+j-i]) + sum += aij + work[j] += aij + } + work[i] = sum + math.Abs(ab[i*ldab+kd]) + } + for _, sum := range work { + if sum > value || math.IsNaN(sum) { + value = sum + } + } + } + case lapack.Frobenius: + scale := 0.0 + ssq := 1.0 + if uplo == blas.Upper { + if kd > 0 { + // Sum off-diagonals. + for i := 0; i < n-1; i++ { + ilen := min(n-i-1, kd) + rowscale, rowssq := impl.Dlassq(ilen, ab[i*ldab+1:], 1, 0, 1) + scale, ssq = impl.Dcombssq(scale, ssq, rowscale, rowssq) + } + ssq *= 2 + } + // Sum diagonal. + dscale, dssq := impl.Dlassq(n, ab, ldab, 0, 1) + scale, ssq = impl.Dcombssq(scale, ssq, dscale, dssq) + } else { + if kd > 0 { + // Sum off-diagonals. + for i := 1; i < n; i++ { + ilen := min(i, kd) + rowscale, rowssq := impl.Dlassq(ilen, ab[i*ldab+kd-ilen:], 1, 0, 1) + scale, ssq = impl.Dcombssq(scale, ssq, rowscale, rowssq) + } + ssq *= 2 + } + // Sum diagonal. + dscale, dssq := impl.Dlassq(n, ab[kd:], ldab, 0, 1) + scale, ssq = impl.Dcombssq(scale, ssq, dscale, dssq) + } + value = scale * math.Sqrt(ssq) + } + + return value +} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlansy.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlansy.go index 97ba5b24381..2c6f5cf3b48 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlansy.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dlansy.go @@ -11,8 +11,8 @@ import ( "gonum.org/v1/gonum/lapack" ) -// Dlansy computes the specified norm of an n×n symmetric matrix. If -// norm == lapack.MaxColumnSum or norm == lapackMaxRowSum work must have length +// Dlansy returns the value of the specified norm of an n×n symmetric matrix. If +// norm == lapack.MaxColumnSum or norm == lapack.MaxRowSum, 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 { switch { @@ -39,8 +39,6 @@ func (impl Implementation) Dlansy(norm lapack.MatrixNorm, uplo blas.Uplo, n int, } switch norm { - default: - panic(badNorm) case lapack.MaxAbs: if uplo == blas.Upper { var max float64 @@ -105,28 +103,26 @@ func (impl Implementation) Dlansy(norm lapack.MatrixNorm, uplo blas.Uplo, n int, } } return max - case lapack.Frobenius: + default: + // lapack.Frobenius: + scale := 0.0 + ssq := 1.0 + // Sum off-diagonals. if uplo == blas.Upper { - var sum float64 - for i := 0; i < n; i++ { - v := a[i*lda+i] - sum += v * v - for j := i + 1; j < n; j++ { - v := a[i*lda+j] - sum += 2 * v * v - } + for i := 0; i < n-1; i++ { + rowscale, rowssq := impl.Dlassq(n-i-1, a[i*lda+i+1:], 1, 0, 1) + scale, ssq = impl.Dcombssq(scale, ssq, rowscale, rowssq) } - return math.Sqrt(sum) - } - var sum float64 - for i := 0; i < n; i++ { - for j := 0; j < i; j++ { - v := a[i*lda+j] - sum += 2 * v * v + } else { + for i := 1; i < n; i++ { + rowscale, rowssq := impl.Dlassq(i, a[i*lda:], 1, 0, 1) + scale, ssq = impl.Dcombssq(scale, ssq, rowscale, rowssq) } - v := a[i*lda+i] - sum += v * v } - return math.Sqrt(sum) + ssq *= 2 + // Sum diagonal. + dscale, dssq := impl.Dlassq(n, a, lda+1, 0, 1) + scale, ssq = impl.Dcombssq(scale, ssq, dscale, dssq) + return scale * math.Sqrt(ssq) } } diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlantr.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlantr.go index cc96391d943..cb40d233731 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlantr.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dlantr.go @@ -22,6 +22,8 @@ func (impl Implementation) Dlantr(norm lapack.MatrixNorm, uplo blas.Uplo, diag b panic(badUplo) case diag != blas.Unit && diag != blas.NonUnit: panic(badDiag) + case m < 0: + panic(mLT0) case n < 0: panic(nLT0) case lda < max(1, n): @@ -42,8 +44,6 @@ func (impl Implementation) Dlantr(norm lapack.MatrixNorm, uplo blas.Uplo, diag b } switch norm { - default: - panic(badNorm) case lapack.MaxAbs: if diag == blas.Unit { value := 1.0 @@ -171,7 +171,7 @@ func (impl Implementation) Dlantr(norm lapack.MatrixNorm, uplo blas.Uplo, diag b } return maxsum } else { - for i := 1; i < m; i++ { + for i := 0; i < m; i++ { var sum float64 if i < minmn { sum = 1 @@ -219,42 +219,38 @@ func (impl Implementation) Dlantr(norm lapack.MatrixNorm, uplo blas.Uplo, diag b return maxsum } } - case lapack.Frobenius: - var nrm float64 + default: + // lapack.Frobenius: + var scale, ssq float64 if diag == blas.Unit { + scale = 1 + ssq = float64(min(m, n)) if uplo == blas.Upper { - for i := 0; i < m; i++ { - for j := i + 1; j < n; j++ { - tmp := a[i*lda+j] - nrm += tmp * tmp - } + for i := 0; i < min(m, n); i++ { + rowscale, rowssq := impl.Dlassq(n-i-1, a[i*lda+i+1:], 1, 0, 1) + scale, ssq = impl.Dcombssq(scale, ssq, rowscale, rowssq) } } else { for i := 1; i < m; i++ { - for j := 0; j < min(i, n); j++ { - tmp := a[i*lda+j] - nrm += tmp * tmp - } + rowscale, rowssq := impl.Dlassq(min(i, n), a[i*lda:], 1, 0, 1) + scale, ssq = impl.Dcombssq(scale, ssq, rowscale, rowssq) } } - nrm += float64(minmn) } else { + scale = 0 + ssq = 1 if uplo == blas.Upper { - for i := 0; i < m; i++ { - for j := i; j < n; j++ { - tmp := math.Abs(a[i*lda+j]) - nrm += tmp * tmp - } + for i := 0; i < min(m, n); i++ { + rowscale, rowssq := impl.Dlassq(n-i, a[i*lda+i:], 1, 0, 1) + scale, ssq = impl.Dcombssq(scale, ssq, rowscale, rowssq) } } else { for i := 0; i < m; i++ { - for j := 0; j <= min(i, n-1); j++ { - tmp := math.Abs(a[i*lda+j]) - nrm += tmp * tmp - } + rowscale, rowssq := impl.Dlassq(min(i+1, n), a[i*lda:], 1, 0, 1) + scale, ssq = impl.Dcombssq(scale, ssq, rowscale, rowssq) } } } - return math.Sqrt(nrm) + return scale * math.Sqrt(ssq) } } diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqp2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqp2.go index d3a0def6391..cc3bc06db66 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqp2.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqp2.go @@ -93,7 +93,7 @@ func (impl Implementation) Dlaqp2(m, n, offset int, a []float64, lda int, jpvt [ } if i < n-1 { - // Apply H_i^T to A[offset+i:m, i:n] from the left. + // Apply H_iᵀ to A[offset+i:m, i:n] from the left. aii := a[offpi*lda+i] a[offpi*lda+i] = 1 impl.Dlarf(blas.Left, m-offpi, n-i-1, a[offpi*lda+i:], lda, tau[i], a[offpi*lda+i+1:], lda, work) diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqps.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqps.go index dd683b62aea..da1a60e5cf5 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqps.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqps.go @@ -122,7 +122,7 @@ func (impl Implementation) Dlaqps(m, n, offset, nb int, a []float64, lda int, jp // Apply previous Householder reflectors to column K: // - // A[rk:m, k] = A[rk:m, k] - A[rk:m, 0:k-1]*F[k, 0:k-1]^T. + // A[rk:m, k] = A[rk:m, k] - A[rk:m, 0:k-1]*F[k, 0:k-1]ᵀ. if k > 0 { bi.Dgemv(blas.NoTrans, m-rk, k, -1, a[rk*lda:], lda, @@ -143,7 +143,7 @@ func (impl Implementation) Dlaqps(m, n, offset, nb int, a []float64, lda int, jp // Compute kth column of F: // - // Compute F[k+1:n, k] = tau[k]*A[rk:m, k+1:n]^T*A[rk:m, k]. + // Compute F[k+1:n, k] = tau[k]*A[rk:m, k+1:n]ᵀ*A[rk:m, k]. if k < n-1 { bi.Dgemv(blas.Trans, m-rk, n-k-1, tau[k], a[rk*lda+k+1:], lda, @@ -159,7 +159,7 @@ func (impl Implementation) Dlaqps(m, n, offset, nb int, a []float64, lda int, jp // Incremental updating of F: // - // F[0:n, k] := F[0:n, k] - tau[k]*F[0:n, 0:k-1]*A[rk:m, 0:k-1]^T*A[rk:m,k]. + // F[0:n, k] := F[0:n, k] - tau[k]*F[0:n, 0:k-1]*A[rk:m, 0:k-1]ᵀ*A[rk:m,k]. if k > 0 { bi.Dgemv(blas.Trans, m-rk, k, -tau[k], a[rk*lda:], lda, @@ -175,7 +175,7 @@ func (impl Implementation) Dlaqps(m, n, offset, nb int, a []float64, lda int, jp // Update the current row of A: // - // A[rk, k+1:n] = A[rk, k+1:n] - A[rk, 0:k]*F[k+1:n, 0:k]^T. + // A[rk, k+1:n] = A[rk, k+1:n] - A[rk, 0:k]*F[k+1:n, 0:k]ᵀ. if k < n-1 { bi.Dgemv(blas.NoTrans, n-k-1, k+1, -1, f[(k+1)*ldf:], ldf, @@ -216,7 +216,7 @@ func (impl Implementation) Dlaqps(m, n, offset, nb int, a []float64, lda int, jp // Apply the block reflector to the rest of the matrix: // - // A[offset+kb+1:m, kb+1:n] := A[offset+kb+1:m, kb+1:n] - A[offset+kb+1:m, 1:kb]*F[kb+1:n, 1:kb]^T. + // A[offset+kb+1:m, kb+1:n] := A[offset+kb+1:m, kb+1:n] - A[offset+kb+1:m, 1:kb]*F[kb+1:n, 1:kb]ᵀ. if kb < min(n, m-offset) { bi.Dgemm(blas.NoTrans, blas.Trans, m-rk, n-kb, kb, -1, diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr04.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr04.go index e9fbb6007e6..9a6da409205 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr04.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr04.go @@ -12,7 +12,7 @@ import ( // Dlaqr04 computes the eigenvalues of a block of an n×n upper Hessenberg matrix // H, and optionally the matrices T and Z from the Schur decomposition -// H = Z T Z^T +// H = Z T Zᵀ // where T is an upper quasi-triangular matrix (the Schur form), and Z is the // orthogonal matrix of Schur vectors. // @@ -24,8 +24,8 @@ import ( // Z[iloz:ihiz+1,ilo:ihi+1], otherwise Z will not be referenced. // // ilo and ihi determine the block of H on which Dlaqr04 operates. 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, // and the block must be isolated, that is, // ilo == 0 or H[ilo,ilo-1] == 0, // ihi == n-1 or H[ihi+1,ihi] == 0, @@ -39,8 +39,8 @@ import ( // otherwise Dlaqr04 will panic. // // work must have length at least lwork and lwork must be -// lwork >= 1, if n <= 11, -// lwork >= n, if n > 11, +// lwork >= 1 if n <= 11, +// lwork >= n if n > 11, // otherwise Dlaqr04 will panic. lwork as large as 6*n may be required for // optimal performance. On return, work[0] will contain the optimal value of // lwork. diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr23.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr23.go index ff299a73aaf..58af1e6d076 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr23.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr23.go @@ -29,8 +29,8 @@ import ( // // ktop and kbot determine a block [ktop:kbot+1,ktop:kbot+1] along the diagonal // of H. 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, // and the block must be isolated, that is, it must hold that // ktop == 0 or H[ktop,ktop-1] == 0, // kbot == n-1 or H[kbot+1,kbot] == 0, diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr5.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr5.go index c198f229a2d..0b0640ee53f 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr5.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr5.go @@ -544,12 +544,12 @@ func (impl Implementation) Dlaqr5(wantt, wantz bool, kacc22 int, n, ktop, kbot, // rows get multiplied by zero). impl.Dlacpy(blas.All, knz, jlen, h[(incol+1+j2)*ldh+jcol:], ldh, wh[kzs*ldwh:], ldwh) - // Multiply by U21^T. + // Multiply by U21ᵀ. impl.Dlaset(blas.All, kzs, jlen, 0, 0, wh, ldwh) bi.Dtrmm(blas.Left, blas.Upper, blas.Trans, blas.NonUnit, knz, jlen, 1, u[j2*ldu+kzs:], ldu, wh[kzs*ldwh:], ldwh) - // Multiply top of H by U11^T. + // Multiply top of H by U11ᵀ. bi.Dgemm(blas.Trans, blas.NoTrans, i2, jlen, j2, 1, u, ldu, h[(incol+1)*ldh+jcol:], ldh, 1, wh, ldwh) @@ -557,7 +557,7 @@ func (impl Implementation) Dlaqr5(wantt, wantz bool, kacc22 int, n, ktop, kbot, // Copy top of H to bottom of WH. impl.Dlacpy(blas.All, j2, jlen, h[(incol+1)*ldh+jcol:], ldh, wh[i2*ldwh:], ldwh) - // Multiply by U21^T. + // Multiply by U21ᵀ. bi.Dtrmm(blas.Left, blas.Lower, blas.Trans, blas.NonUnit, j2, jlen, 1, u[i2:], ldu, wh[i2*ldwh:], ldwh) diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlarf.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlarf.go index 9fc97a3285e..539b774c4db 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlarf.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dlarf.go @@ -14,7 +14,7 @@ import ( // c = h * c if side == Left // c = c * h if side == right // where -// h = 1 - tau * v * v^T +// h = 1 - tau * v * vᵀ // and c is an m * n matrix. // // work is temporary storage of length at least m if side == Left and at least @@ -87,15 +87,15 @@ func (impl Implementation) Dlarf(side blas.Side, m, n int, v []float64, incv int bi := blas64.Implementation() if applyleft { // Form H * C - // w[0:lastc+1] = c[1:lastv+1, 1:lastc+1]^T * v[1:lastv+1,1] + // w[0:lastc+1] = c[1:lastv+1, 1:lastc+1]ᵀ * v[1:lastv+1,1] bi.Dgemv(blas.Trans, lastv+1, lastc+1, 1, c, ldc, v, incv, 0, work, 1) - // c[0: lastv, 0: lastc] = c[...] - w[0:lastv, 1] * v[1:lastc, 1]^T + // c[0: lastv, 0: lastc] = c[...] - w[0:lastv, 1] * v[1:lastc, 1]ᵀ bi.Dger(lastv+1, lastc+1, -tau, v, incv, work, 1, c, ldc) return } // Form C*H // w[0:lastc+1,1] := c[0:lastc+1,0:lastv+1] * v[0:lastv+1,1] bi.Dgemv(blas.NoTrans, lastc+1, lastv+1, 1, c, ldc, v, incv, 0, work, 1) - // c[0:lastc+1,0:lastv+1] = c[...] - w[0:lastc+1,0] * v[0:lastv+1,0]^T + // c[0:lastc+1,0:lastv+1] = c[...] - w[0:lastc+1,0] * v[0:lastv+1,0]ᵀ bi.Dger(lastc+1, lastv+1, -tau, work, 1, v, incv, c, ldc) } diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlarfb.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlarfb.go index 4dd8e063acc..d3ddc8e4b76 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlarfb.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dlarfb.go @@ -13,13 +13,13 @@ import ( // 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ᵀ * c if side == Left and trans == Trans +// c = c * hᵀ 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. // @@ -118,13 +118,13 @@ func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack // elements are copied into the columns of the working array. The // loops should go in the other direction so the data is written // into the rows of work so the copy is not strided. A bigger change - // would be to replace work with work^T, but benchmarks would be + // would be to replace work with workᵀ, but benchmarks would be // needed to see if the change is merited. if store == lapack.ColumnWise { if direct == lapack.Forward { // V1 is the first k rows of C. V2 is the remaining rows. if side == blas.Left { - // W = C^T V = C1^T V1 + C2^T V2 (stored in work). + // W = Cᵀ V = C1ᵀ V1 + C2ᵀ V2 (stored in work). // W = C1. for j := 0; j < k; j++ { @@ -136,27 +136,27 @@ func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack v, ldv, work, ldwork) if m > k { - // W = W + C2^T V2. + // W = W + C2ᵀ V2. bi.Dgemm(blas.Trans, blas.NoTrans, n, k, m-k, 1, c[k*ldc:], ldc, v[k*ldv:], ldv, 1, work, ldwork) } - // W = W * T^T or W * T. + // W = W * Tᵀ or W * T. bi.Dtrmm(blas.Right, blas.Upper, transt, blas.NonUnit, n, k, 1, t, ldt, work, ldwork) - // C -= V * W^T. + // C -= V * Wᵀ. if m > k { - // C2 -= V2 * W^T. + // C2 -= V2 * Wᵀ. bi.Dgemm(blas.NoTrans, blas.Trans, m-k, n, k, -1, v[k*ldv:], ldv, work, ldwork, 1, c[k*ldc:], ldc) } - // W *= V1^T. + // W *= V1ᵀ. bi.Dtrmm(blas.Right, blas.Lower, blas.Trans, blas.Unit, n, k, 1, v, ldv, work, ldwork) - // C1 -= W^T. + // C1 -= Wᵀ. // TODO(btracey): This should use blas.Axpy. for i := 0; i < n; i++ { for j := 0; j < k; j++ { @@ -165,7 +165,7 @@ func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack } return } - // Form C = C * H or C * H^T, where C = (C1 C2). + // Form C = C * H or C * Hᵀ, where C = (C1 C2). // W = C1. for i := 0; i < k; i++ { @@ -180,7 +180,7 @@ func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack 1, c[k:], ldc, v[k*ldv:], ldv, 1, work, ldwork) } - // W *= T or T^T. + // W *= T or Tᵀ. bi.Dtrmm(blas.Right, blas.Upper, trans, blas.NonUnit, m, k, 1, t, ldt, work, ldwork) @@ -189,7 +189,7 @@ func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack -1, work, ldwork, v[k*ldv:], ldv, 1, c[k:], ldc) } - // C -= W * V^T. + // C -= W * Vᵀ. bi.Dtrmm(blas.Right, blas.Lower, blas.Trans, blas.Unit, m, k, 1, v, ldv, work, ldwork) @@ -207,9 +207,9 @@ func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack // Where V2 is unit upper triangular. if side == blas.Left { // Form H * C or - // W = C^T V. + // W = Cᵀ V. - // W = C2^T. + // W = C2ᵀ. for j := 0; j < k; j++ { bi.Dcopy(n, c[(m-k+j)*ldc:], 1, work[j:], ldwork) } @@ -218,26 +218,26 @@ func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack 1, v[(m-k)*ldv:], ldv, work, ldwork) if m > k { - // W += C1^T * V1. + // W += C1ᵀ * V1. bi.Dgemm(blas.Trans, blas.NoTrans, n, k, m-k, 1, c, ldc, v, ldv, 1, work, ldwork) } - // W *= T or T^T. + // W *= T or Tᵀ. bi.Dtrmm(blas.Right, blas.Lower, transt, blas.NonUnit, n, k, 1, t, ldt, work, ldwork) - // C -= V * W^T. + // C -= V * Wᵀ. if m > k { bi.Dgemm(blas.NoTrans, blas.Trans, m-k, n, k, -1, v, ldv, work, ldwork, 1, c, ldc) } - // W *= V2^T. + // W *= V2ᵀ. bi.Dtrmm(blas.Right, blas.Upper, blas.Trans, blas.Unit, n, k, 1, v[(m-k)*ldv:], ldv, work, ldwork) - // C2 -= W^T. + // C2 -= Wᵀ. // TODO(btracey): This should use blas.Axpy. for i := 0; i < n; i++ { for j := 0; j < k; j++ { @@ -246,7 +246,7 @@ func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack } return } - // Form C * H or C * H^T where C = (C1 C2). + // Form C * H or C * Hᵀ where C = (C1 C2). // W = C * V. // W = C2. @@ -263,18 +263,18 @@ func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack 1, c, ldc, v, ldv, 1, work, ldwork) } - // W *= T or T^T. + // W *= T or Tᵀ. bi.Dtrmm(blas.Right, blas.Lower, trans, blas.NonUnit, m, k, 1, t, ldt, work, ldwork) - // C -= W * V^T. + // C -= W * Vᵀ. if n > k { - // C1 -= W * V1^T. + // C1 -= W * V1ᵀ. bi.Dgemm(blas.NoTrans, blas.Trans, m, n-k, k, -1, work, ldwork, v, ldv, 1, c, ldc) } - // W *= V2^T. + // W *= V2ᵀ. bi.Dtrmm(blas.Right, blas.Upper, blas.Trans, blas.Unit, m, k, 1, v[(n-k)*ldv:], ldv, work, ldwork) @@ -291,14 +291,14 @@ func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack if direct == lapack.Forward { // V = (V1 V2) where v1 is unit upper triangular. if side == blas.Left { - // Form H * C or H^T * C where C = (C1; C2). - // W = C^T * V^T. + // Form H * C or Hᵀ * C where C = (C1; C2). + // W = Cᵀ * Vᵀ. - // W = C1^T. + // W = C1ᵀ. for j := 0; j < k; j++ { bi.Dcopy(n, c[j*ldc:], 1, work[j:], ldwork) } - // W *= V1^T. + // W *= V1ᵀ. bi.Dtrmm(blas.Right, blas.Upper, blas.Trans, blas.Unit, n, k, 1, v, ldv, work, ldwork) @@ -307,11 +307,11 @@ func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack 1, c[k*ldc:], ldc, v[k:], ldv, 1, work, ldwork) } - // W *= T or T^T. + // W *= T or Tᵀ. bi.Dtrmm(blas.Right, blas.Upper, transt, blas.NonUnit, n, k, 1, t, ldt, work, ldwork) - // C -= V^T * W^T. + // C -= Vᵀ * Wᵀ. if m > k { bi.Dgemm(blas.Trans, blas.Trans, m-k, n, k, -1, v[k:], ldv, work, ldwork, @@ -321,7 +321,7 @@ func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack bi.Dtrmm(blas.Right, blas.Upper, blas.NoTrans, blas.Unit, n, k, 1, v, ldv, work, ldwork) - // C1 -= W^T. + // C1 -= Wᵀ. // TODO(btracey): This should use blas.Axpy. for i := 0; i < n; i++ { for j := 0; j < k; j++ { @@ -330,14 +330,14 @@ func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack } return } - // Form C * H or C * H^T where C = (C1 C2). - // W = C * V^T. + // Form C * H or C * Hᵀ where C = (C1 C2). + // W = C * Vᵀ. // W = C1. for j := 0; j < k; j++ { bi.Dcopy(m, c[j:], ldc, work[j:], ldwork) } - // W *= V1^T. + // W *= V1ᵀ. bi.Dtrmm(blas.Right, blas.Upper, blas.Trans, blas.Unit, m, k, 1, v, ldv, work, ldwork) @@ -346,7 +346,7 @@ func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack 1, c[k:], ldc, v[k:], ldv, 1, work, ldwork) } - // W *= T or T^T. + // W *= T or Tᵀ. bi.Dtrmm(blas.Right, blas.Upper, trans, blas.NonUnit, m, k, 1, t, ldt, work, ldwork) @@ -371,14 +371,14 @@ func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack } // V = (V1 V2) where V2 is the last k columns and is lower unit triangular. if side == blas.Left { - // Form H * C or H^T C where C = (C1 ; C2). - // W = C^T * V^T. + // Form H * C or Hᵀ C where C = (C1 ; C2). + // W = Cᵀ * Vᵀ. - // W = C2^T. + // W = C2ᵀ. for j := 0; j < k; j++ { bi.Dcopy(n, c[(m-k+j)*ldc:], 1, work[j:], ldwork) } - // W *= V2^T. + // W *= V2ᵀ. bi.Dtrmm(blas.Right, blas.Lower, blas.Trans, blas.Unit, n, k, 1, v[m-k:], ldv, work, ldwork) @@ -387,11 +387,11 @@ func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack 1, c, ldc, v, ldv, 1, work, ldwork) } - // W *= T or T^T. + // W *= T or Tᵀ. bi.Dtrmm(blas.Right, blas.Lower, transt, blas.NonUnit, n, k, 1, t, ldt, work, ldwork) - // C -= V^T * W^T. + // C -= Vᵀ * Wᵀ. if m > k { bi.Dgemm(blas.Trans, blas.Trans, m-k, n, k, -1, v, ldv, work, ldwork, @@ -401,7 +401,7 @@ func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack bi.Dtrmm(blas.Right, blas.Lower, blas.NoTrans, blas.Unit, n, k, 1, v[m-k:], ldv, work, ldwork) - // C2 -= W^T. + // C2 -= Wᵀ. // TODO(btracey): This should use blas.Axpy. for i := 0; i < n; i++ { for j := 0; j < k; j++ { @@ -410,13 +410,13 @@ func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack } return } - // Form C * H or C * H^T where C = (C1 C2). - // W = C * V^T. + // Form C * H or C * Hᵀ where C = (C1 C2). + // W = C * Vᵀ. // W = C2. for j := 0; j < k; j++ { bi.Dcopy(m, c[n-k+j:], ldc, work[j:], ldwork) } - // W *= V2^T. + // W *= V2ᵀ. bi.Dtrmm(blas.Right, blas.Lower, blas.Trans, blas.Unit, m, k, 1, v[n-k:], ldv, work, ldwork) @@ -425,7 +425,7 @@ func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack 1, c, ldc, v, ldv, 1, work, ldwork) } - // W *= T or T^T. + // W *= T or Tᵀ. bi.Dtrmm(blas.Right, blas.Lower, trans, blas.NonUnit, m, k, 1, t, ldt, work, ldwork) diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlarfg.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlarfg.go index e037fdd6bdd..3f614b04467 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlarfg.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dlarfg.go @@ -14,9 +14,9 @@ import ( // a real elementary reflector of order n such that // H * (alpha) = (beta) // ( x) ( 0) -// H^T * H = I +// Hᵀ * H = I // H is represented in the form -// H = 1 - tau * (1; v) * (1 v^T) +// H = 1 - tau * (1; v) * (1 vᵀ) // where tau is a real scalar. // // On entry, x contains the vector x, on exit it contains v. diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlarft.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlarft.go index 8f03eb8b3b7..1d84fb5d6a4 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlarft.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dlarft.go @@ -12,8 +12,8 @@ import ( // 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ᵀ if store == lapack.ColumnWise +// H = I - Vᵀ * 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 diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlarfx.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlarfx.go index d7928c8cf47..a018593fe1b 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlarfx.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dlarfx.go @@ -11,7 +11,7 @@ import "gonum.org/v1/gonum/blas" // than 11. // // H is represented in the form -// H = I - tau * v * v^T, +// H = I - tau * v * vᵀ, // where tau is a real scalar and v is a real vector. If tau = 0, then H is // taken to be the identity matrix. // diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasr.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlasr.go index a7dbe002d5a..6bacca5ef5f 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasr.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dlasr.go @@ -12,7 +12,7 @@ import ( // Dlasr applies a sequence of plane rotations to the m×n matrix A. This series // of plane rotations is implicitly represented by a matrix P. P is multiplied // by a depending on the value of side -- A = P * A if side == lapack.Left, -// A = A * P^T if side == lapack.Right. +// A = A * Pᵀ if side == lapack.Right. // // The exact value of P depends on the value of pivot, but in all cases P is // implicitly represented by a series of 2×2 rotation matrices. The entries of diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasy2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlasy2.go index abfe60e58e0..d670f40de04 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasy2.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dlasy2.go @@ -12,10 +12,10 @@ import ( // Dlasy2 solves the Sylvester matrix equation where the matrices are of order 1 // or 2. It computes the unknown n1×n2 matrix X so that -// TL*X + sgn*X*TR = scale*B, if tranl == false and tranr == false, -// TL^T*X + sgn*X*TR = scale*B, if tranl == true and tranr == false, -// TL*X + sgn*X*TR^T = scale*B, if tranl == false and tranr == true, -// TL^T*X + sgn*X*TR^T = scale*B, if tranl == true and tranr == true, +// TL*X + sgn*X*TR = scale*B if tranl == false and tranr == false, +// TLᵀ*X + sgn*X*TR = scale*B if tranl == true and tranr == false, +// TL*X + sgn*X*TRᵀ = scale*B if tranl == false and tranr == true, +// TLᵀ*X + sgn*X*TRᵀ = scale*B if tranl == true and tranr == true, // where TL is n1×n1, TR is n2×n2, B is n1×n2, and 1 <= n1,n2 <= 2. // // isgn must be 1 or -1, and n1 and n2 must be 0, 1, or 2, but these conditions diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlatbs.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlatbs.go new file mode 100644 index 00000000000..0d3cf9f027c --- /dev/null +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dlatbs.go @@ -0,0 +1,452 @@ +// 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 gonum + +import ( + "math" + + "gonum.org/v1/gonum/blas" + "gonum.org/v1/gonum/blas/blas64" +) + +// Dlatbs solves a triangular banded system of equations +// A * x = s*b if trans == blas.NoTrans +// Aᵀ * x = s*b if trans == blas.Trans or blas.ConjTrans +// where A is an upper or lower triangular band matrix, x and b are n-element +// vectors, and s is a scaling factor chosen so that the components of x will be +// less than the overflow threshold. +// +// On entry, x contains the right-hand side b of the triangular system. +// On return, x is overwritten by the solution vector x. +// +// normin specifies whether the cnorm parameter contains the column norms of A on +// entry. If it is true, cnorm[j] contains the norm of the off-diagonal part of +// the j-th column of A. If it is false, the norms will be computed and stored +// in cnorm. +// +// Dlatbs returns the scaling factor s for the triangular system. If the matrix +// A is singular (A[j,j]==0 for some j), then scale is set to 0 and a +// non-trivial solution to A*x = 0 is returned. +// +// Dlatbs is an internal routine. It is exported for testing purposes. +func (Implementation) Dlatbs(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, normin bool, n, kd int, ab []float64, ldab int, x, cnorm []float64) (scale float64) { + noTran := trans == blas.NoTrans + switch { + case uplo != blas.Upper && uplo != blas.Lower: + panic(badUplo) + case !noTran && 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 ldab < kd+1: + panic(badLdA) + } + + // Quick return if possible. + if n == 0 { + return 0 + } + + switch { + case len(ab) < (n-1)*ldab+kd+1: + panic(shortAB) + case len(x) < n: + panic(shortX) + case len(cnorm) < n: + panic(shortCNorm) + } + + // Parameters to control overflow. + smlnum := dlamchS / dlamchP + bignum := 1 / smlnum + + bi := blas64.Implementation() + kld := max(1, ldab-1) + if !normin { + // Compute the 1-norm of each column, not including the diagonal. + if uplo == blas.Upper { + for j := 0; j < n; j++ { + jlen := min(j, kd) + if jlen > 0 { + cnorm[j] = bi.Dasum(jlen, ab[(j-jlen)*ldab+jlen:], kld) + } else { + cnorm[j] = 0 + } + } + } else { + for j := 0; j < n; j++ { + jlen := min(n-j-1, kd) + if jlen > 0 { + cnorm[j] = bi.Dasum(jlen, ab[(j+1)*ldab+kd-1:], kld) + } else { + cnorm[j] = 0 + } + } + } + } + + // Set up indices and increments for loops below. + var ( + jFirst, jLast, jInc int + maind int + ) + if noTran { + if uplo == blas.Upper { + jFirst = n - 1 + jLast = -1 + jInc = -1 + maind = 0 + } else { + jFirst = 0 + jLast = n + jInc = 1 + maind = kd + } + } else { + if uplo == blas.Upper { + jFirst = 0 + jLast = n + jInc = 1 + maind = 0 + } else { + jFirst = n - 1 + jLast = -1 + jInc = -1 + maind = kd + } + } + + // Scale the column norms by tscal if the maximum element in cnorm is + // greater than bignum. + tmax := cnorm[bi.Idamax(n, cnorm, 1)] + tscal := 1.0 + if tmax > bignum { + tscal = 1 / (smlnum * tmax) + bi.Dscal(n, tscal, cnorm, 1) + } + + // Compute a bound on the computed solution vector to see if the Level 2 + // BLAS routine Dtbsv can be used. + + xMax := math.Abs(x[bi.Idamax(n, x, 1)]) + xBnd := xMax + grow := 0.0 + // Compute the growth only if the maximum element in cnorm is NOT greater + // than bignum. + if tscal != 1 { + goto skipComputeGrow + } + if noTran { + // Compute the growth in A * x = b. + if diag == blas.NonUnit { + // A is non-unit triangular. + // + // Compute grow = 1/G_j and xBnd = 1/M_j. + // Initially, G_0 = max{x(i), i=1,...,n}. + grow = 1 / math.Max(xBnd, smlnum) + xBnd = grow + for j := jFirst; j != jLast; j += jInc { + if grow <= smlnum { + // Exit the loop because the growth factor is too small. + goto skipComputeGrow + } + // M_j = G_{j-1} / abs(A[j,j]) + tjj := math.Abs(ab[j*ldab+maind]) + xBnd = math.Min(xBnd, math.Min(1, tjj)*grow) + if tjj+cnorm[j] >= smlnum { + // G_j = G_{j-1}*( 1 + cnorm[j] / abs(A[j,j]) ) + grow *= tjj / (tjj + cnorm[j]) + } else { + // G_j could overflow, set grow to 0. + grow = 0 + } + } + grow = xBnd + } else { + // A is unit triangular. + // + // Compute grow = 1/G_j, where G_0 = max{x(i), i=1,...,n}. + grow = math.Min(1, 1/math.Max(xBnd, smlnum)) + for j := jFirst; j != jLast; j += jInc { + if grow <= smlnum { + // Exit the loop because the growth factor is too small. + goto skipComputeGrow + } + // G_j = G_{j-1}*( 1 + cnorm[j] ) + grow /= 1 + cnorm[j] + } + } + } else { + // Compute the growth in Aᵀ * x = b. + if diag == blas.NonUnit { + // A is non-unit triangular. + // + // Compute grow = 1/G_j and xBnd = 1/M_j. + // Initially, G_0 = max{x(i), i=1,...,n}. + grow = 1 / math.Max(xBnd, smlnum) + xBnd = grow + for j := jFirst; j != jLast; j += jInc { + if grow <= smlnum { + // Exit the loop because the growth factor is too small. + goto skipComputeGrow + } + // G_j = max( G_{j-1}, M_{j-1}*( 1 + cnorm[j] ) ) + xj := 1 + cnorm[j] + grow = math.Min(grow, xBnd/xj) + // M_j = M_{j-1}*( 1 + cnorm[j] ) / abs(A[j,j]) + tjj := math.Abs(ab[j*ldab+maind]) + if xj > tjj { + xBnd *= tjj / xj + } + } + grow = math.Min(grow, xBnd) + } else { + // A is unit triangular. + // + // Compute grow = 1/G_j, where G_0 = max{x(i), i=1,...,n}. + grow = math.Min(1, 1/math.Max(xBnd, smlnum)) + for j := jFirst; j != jLast; j += jInc { + if grow <= smlnum { + // Exit the loop because the growth factor is too small. + goto skipComputeGrow + } + // G_j = G_{j-1}*( 1 + cnorm[j] ) + grow /= 1 + cnorm[j] + } + } + } +skipComputeGrow: + + if grow*tscal > smlnum { + // The reciprocal of the bound on elements of X is not too small, use + // the Level 2 BLAS solve. + bi.Dtbsv(uplo, trans, diag, n, kd, ab, ldab, x, 1) + // Scale the column norms by 1/tscal for return. + if tscal != 1 { + bi.Dscal(n, 1/tscal, cnorm, 1) + } + return 1 + } + + // Use a Level 1 BLAS solve, scaling intermediate results. + + scale = 1 + if xMax > bignum { + // Scale x so that its components are less than or equal to bignum in + // absolute value. + scale = bignum / xMax + bi.Dscal(n, scale, x, 1) + xMax = bignum + } + + if noTran { + // Solve A * x = b. + for j := jFirst; j != jLast; j += jInc { + // Compute x[j] = b[j] / A[j,j], scaling x if necessary. + xj := math.Abs(x[j]) + tjjs := tscal + if diag == blas.NonUnit { + tjjs *= ab[j*ldab+maind] + } + tjj := math.Abs(tjjs) + switch { + case tjj > smlnum: + // smlnum < abs(A[j,j]) + if tjj < 1 && xj > tjj*bignum { + // Scale x by 1/b[j]. + rec := 1 / xj + bi.Dscal(n, rec, x, 1) + scale *= rec + xMax *= rec + } + x[j] /= tjjs + xj = math.Abs(x[j]) + case tjj > 0: + // 0 < abs(A[j,j]) <= smlnum + if xj > tjj*bignum { + // Scale x by (1/abs(x[j]))*abs(A[j,j])*bignum to avoid + // overflow when dividing by A[j,j]. + rec := tjj * bignum / xj + if cnorm[j] > 1 { + // Scale by 1/cnorm[j] to avoid overflow when + // multiplying x[j] times column j. + rec /= cnorm[j] + } + bi.Dscal(n, rec, x, 1) + scale *= rec + xMax *= rec + } + x[j] /= tjjs + xj = math.Abs(x[j]) + default: + // A[j,j] == 0: Set x[0:n] = 0, x[j] = 1, and scale = 0, and + // compute a solution to A*x = 0. + for i := range x[:n] { + x[i] = 0 + } + x[j] = 1 + xj = 1 + scale = 0 + xMax = 0 + } + + // Scale x if necessary to avoid overflow when adding a multiple of + // column j of A. + switch { + case xj > 1: + rec := 1 / xj + if cnorm[j] > (bignum-xMax)*rec { + // Scale x by 1/(2*abs(x[j])). + rec *= 0.5 + bi.Dscal(n, rec, x, 1) + scale *= rec + } + case xj*cnorm[j] > bignum-xMax: + // Scale x by 1/2. + bi.Dscal(n, 0.5, x, 1) + scale *= 0.5 + } + + if uplo == blas.Upper { + if j > 0 { + // Compute the update + // x[max(0,j-kd):j] := x[max(0,j-kd):j] - x[j] * A[max(0,j-kd):j,j] + jlen := min(j, kd) + if jlen > 0 { + bi.Daxpy(jlen, -x[j]*tscal, ab[(j-jlen)*ldab+jlen:], kld, x[j-jlen:], 1) + } + i := bi.Idamax(j, x, 1) + xMax = math.Abs(x[i]) + } + } else if j < n-1 { + // Compute the update + // x[j+1:min(j+kd,n)] := x[j+1:min(j+kd,n)] - x[j] * A[j+1:min(j+kd,n),j] + jlen := min(kd, n-j-1) + if jlen > 0 { + bi.Daxpy(jlen, -x[j]*tscal, ab[(j+1)*ldab+kd-1:], kld, x[j+1:], 1) + } + i := j + 1 + bi.Idamax(n-j-1, x[j+1:], 1) + xMax = math.Abs(x[i]) + } + } + } else { + // Solve Aᵀ * x = b. + for j := jFirst; j != jLast; j += jInc { + // Compute x[j] = b[j] - sum A[k,j]*x[k]. + // k!=j + xj := math.Abs(x[j]) + tjjs := tscal + if diag == blas.NonUnit { + tjjs *= ab[j*ldab+maind] + } + tjj := math.Abs(tjjs) + rec := 1 / math.Max(1, xMax) + uscal := tscal + if cnorm[j] > (bignum-xj)*rec { + // If x[j] could overflow, scale x by 1/(2*xMax). + rec *= 0.5 + if tjj > 1 { + // Divide by A[j,j] when scaling x if A[j,j] > 1. + rec = math.Min(1, rec*tjj) + uscal /= tjjs + } + if rec < 1 { + bi.Dscal(n, rec, x, 1) + scale *= rec + xMax *= rec + } + } + + var sumj float64 + if uscal == 1 { + // If the scaling needed for A in the dot product is 1, call + // Ddot to perform the dot product... + if uplo == blas.Upper { + jlen := min(j, kd) + if jlen > 0 { + sumj = bi.Ddot(jlen, ab[(j-jlen)*ldab+jlen:], kld, x[j-jlen:], 1) + } + } else { + jlen := min(n-j-1, kd) + if jlen > 0 { + sumj = bi.Ddot(jlen, ab[(j+1)*ldab+kd-1:], kld, x[j+1:], 1) + } + } + } else { + // ...otherwise, use in-line code for the dot product. + if uplo == blas.Upper { + jlen := min(j, kd) + for i := 0; i < jlen; i++ { + sumj += (ab[(j-jlen+i)*ldab+jlen-i] * uscal) * x[j-jlen+i] + } + } else { + jlen := min(n-j-1, kd) + for i := 0; i < jlen; i++ { + sumj += (ab[(j+1+i)*ldab+kd-1-i] * uscal) * x[j+i+1] + } + } + } + + if uscal == tscal { + // Compute x[j] := ( x[j] - sumj ) / A[j,j] + // if 1/A[j,j] was not used to scale the dot product. + x[j] -= sumj + xj = math.Abs(x[j]) + // Compute x[j] = x[j] / A[j,j], scaling if necessary. + // Note: the reference implementation skips this step for blas.Unit matrices + // when tscal is equal to 1 but it complicates the logic and only saves + // the comparison and division in the first switch-case. Not skipping it + // is also consistent with the NoTrans case above. + switch { + case tjj > smlnum: + // smlnum < abs(A[j,j]): + if tjj < 1 && xj > tjj*bignum { + // Scale x by 1/abs(x[j]). + rec := 1 / xj + bi.Dscal(n, rec, x, 1) + scale *= rec + xMax *= rec + } + x[j] /= tjjs + case tjj > 0: + // 0 < abs(A[j,j]) <= smlnum: + if xj > tjj*bignum { + // Scale x by (1/abs(x[j]))*abs(A[j,j])*bignum. + rec := (tjj * bignum) / xj + bi.Dscal(n, rec, x, 1) + scale *= rec + xMax *= rec + } + x[j] /= tjjs + default: + // A[j,j] == 0: Set x[0:n] = 0, x[j] = 1, and scale = 0, and + // compute a solution Aᵀ * x = 0. + for i := range x[:n] { + x[i] = 0 + } + x[j] = 1 + scale = 0 + xMax = 0 + } + } else { + // Compute x[j] := x[j] / A[j,j] - sumj + // if the dot product has already been divided by 1/A[j,j]. + x[j] = x[j]/tjjs - sumj + } + xMax = math.Max(xMax, math.Abs(x[j])) + } + scale /= tscal + } + + // Scale the column norms by 1/tscal for return. + if tscal != 1 { + bi.Dscal(n, 1/tscal, cnorm, 1) + } + return scale +} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlatrd.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlatrd.go index 018efc98ccd..1e057aa384e 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlatrd.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dlatrd.go @@ -11,7 +11,7 @@ import ( // Dlatrd reduces nb rows and columns of a real n×n symmetric matrix A to symmetric // tridiagonal form. It computes the orthonormal similarity transformation -// Q^T * A * Q +// Qᵀ * A * Q // and returns the matrices V and W to apply to the unreduced part of A. If // uplo == blas.Upper, the upper triangle is supplied and the last nb rows are // reduced. If uplo == blas.Lower, the lower triangle is supplied and the first @@ -51,7 +51,7 @@ import ( // // The matrix Q is represented as a product of elementary reflectors. Each reflector // H has the form -// I - tau * v * v^T +// I - tau * v * vᵀ // If uplo == blas.Upper, // Q = H_{n-1} * H_{n-2} * ... * H_{n-nb} // where v[:i-1] is stored in A[:i-1,i], v[i-1] = 1, and v[i:n] = 0. @@ -62,7 +62,7 @@ import ( // // The vectors v form the n×nb matrix V which is used with W to apply a // symmetric rank-2 update to the unreduced part of A -// A = A - V * W^T - W * V^T +// A = A - V * Wᵀ - W * Vᵀ // // Dlatrd is an internal routine. It is exported for testing purposes. func (impl Implementation) Dlatrd(uplo blas.Uplo, n, nb int, a []float64, lda int, e, tau, w []float64, ldw int) { diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlatrs.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlatrs.go index dc445c6fe18..73970bcf6f9 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlatrs.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dlatrs.go @@ -14,7 +14,7 @@ import ( // Dlatrs solves a triangular system of equations scaled to prevent overflow. It // solves // A * x = scale * b if trans == blas.NoTrans -// A^T * x = scale * b if trans == blas.Trans +// Aᵀ * x = scale * b if trans == blas.Trans // where the scale s is set for numeric stability. // // A is an n×n triangular matrix. On entry, the slice x contains the values of diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlauu2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlauu2.go index ecce22cc641..24e98ddd5ed 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlauu2.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dlauu2.go @@ -10,8 +10,8 @@ import ( ) // Dlauu2 computes the product -// U * U^T if uplo is blas.Upper -// L^T * L if uplo is blas.Lower +// U * Uᵀ if uplo is blas.Upper +// Lᵀ * L if uplo is blas.Lower // where U or L is stored in the upper or lower triangular part of A. // Only the upper or lower triangle of the result is stored, overwriting // the corresponding factor in A. @@ -37,7 +37,7 @@ func (impl Implementation) Dlauu2(uplo blas.Uplo, n int, a []float64, lda int) { bi := blas64.Implementation() if uplo == blas.Upper { - // Compute the product U*U^T. + // Compute the product U*Uᵀ. for i := 0; i < n; i++ { aii := a[i*lda+i] if i < n-1 { @@ -49,7 +49,7 @@ func (impl Implementation) Dlauu2(uplo blas.Uplo, n int, a []float64, lda int) { } } } else { - // Compute the product L^T*L. + // Compute the product Lᵀ*L. for i := 0; i < n; i++ { aii := a[i*lda+i] if i < n-1 { diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlauum.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlauum.go index 67ecaddf4c5..995fdc059ee 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlauum.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dlauum.go @@ -10,8 +10,8 @@ import ( ) // Dlauum computes the product -// U * U^T if uplo is blas.Upper -// L^T * L if uplo is blas.Lower +// U * Uᵀ if uplo is blas.Upper +// Lᵀ * L if uplo is blas.Lower // where U or L is stored in the upper or lower triangular part of A. // Only the upper or lower triangle of the result is stored, overwriting // the corresponding factor in A. @@ -50,7 +50,7 @@ func (impl Implementation) Dlauum(uplo blas.Uplo, n int, a []float64, lda int) { // Use blocked code. bi := blas64.Implementation() if uplo == blas.Upper { - // Compute the product U*U^T. + // Compute the product U*Uᵀ. for i := 0; i < n; i += nb { ib := min(nb, n-i) bi.Dtrmm(blas.Right, blas.Upper, blas.Trans, blas.NonUnit, @@ -64,7 +64,7 @@ func (impl Implementation) Dlauum(uplo blas.Uplo, n int, a []float64, lda int) { } } } else { - // Compute the product L^T*L. + // Compute the product Lᵀ*L. for i := 0; i < n; i += nb { ib := min(nb, n-i) bi.Dtrmm(blas.Left, blas.Lower, blas.Trans, blas.NonUnit, diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dorgbr.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dorgbr.go index 626cad5ffe6..8a4fe2b5ff4 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dorgbr.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dorgbr.go @@ -6,17 +6,17 @@ package gonum import "gonum.org/v1/gonum/lapack" -// Dorgbr generates one of the matrices Q or P^T computed by Dgebrd +// Dorgbr generates one of the matrices Q or Pᵀ computed by Dgebrd // computed from the decomposition Dgebrd. See Dgebd2 for the description of -// Q and P^T. +// Q and Pᵀ. // // If vect == lapack.GenerateQ, then a is assumed to have been an m×k matrix and // Q is of order m. If m >= k, then Dorgbr returns the first n columns of Q // where m >= n >= k. If m < k, then Dorgbr returns Q as an m×m matrix. // // If vect == lapack.GeneratePT, 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. +// Pᵀ is of order n. If k < n, then Dorgbr returns the first m rows of Pᵀ, +// where n >= m >= k. If k >= n, then Dorgbr returns Pᵀ as an n×n matrix. // // Dorgbr is an internal routine. It is exported for testing purposes. func (impl Implementation) Dorgbr(vect lapack.GenOrtho, m, n, k int, a []float64, lda int, tau, work []float64, lwork int) { @@ -112,12 +112,12 @@ func (impl Implementation) Dorgbr(vect lapack.GenOrtho, m, n, k int, a []float64 } } } else { - // Form P^T, determined by a call to Dgebrd to reduce a k×n matrix. + // Form Pᵀ, determined by a call to Dgebrd to reduce a k×n matrix. if k < n { impl.Dorglq(m, n, k, a, lda, tau, work, lwork) } else { // Shift the vectors which define the elementary reflectors one - // row downward, and set the first row and column of P^T to + // row downward, and set the first row and column of Pᵀ to // those of the unit matrix. a[0] = 1 for i := 1; i < n; i++ { diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dorghr.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dorghr.go index 6e799d10d5a..fd65531ba17 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dorghr.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dorghr.go @@ -15,8 +15,8 @@ package gonum // // 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. diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dorm2r.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dorm2r.go index 4b0bd83cc3c..8311f742689 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dorm2r.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dorm2r.go @@ -8,10 +8,10 @@ import "gonum.org/v1/gonum/blas" // Dorm2r multiplies a general matrix C by an orthogonal matrix from a QR factorization // determined by Dgeqrf. -// 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ᵀ * C if side == blas.Left and trans == blas.Trans +// C = C * Q if side == blas.Right and trans == blas.NoTrans +// C = C * Qᵀ if side == blas.Right and trans == blas.Trans // If side == blas.Left, a is a matrix of size m×k, and if side == blas.Right // a is of size n×k. // diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dormbr.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dormbr.go index 026dc04127d..e1b37373f03 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dormbr.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dormbr.go @@ -15,15 +15,15 @@ import ( // 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 +// Qᵀ * C if vect == lapack.ApplyQ, side == blas.Left, and trans == blas.Trans +// C * Qᵀ 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 +// Pᵀ * C if vect == lapack.ApplyP, side == blas.Left, and trans == blas.Trans +// C * Pᵀ 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 +// a matrix A to bidiagonal form: A = Q * B * Pᵀ. See Dgebrd for the // definitions of Q and P. // // If vect == lapack.ApplyQ, A is assumed to have been an nq×k matrix, while if diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dormhr.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dormhr.go index c00f440590e..ac4d3ae69c0 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dormhr.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dormhr.go @@ -7,10 +7,10 @@ package gonum import "gonum.org/v1/gonum/blas" // 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ᵀ * C if side == blas.Left and trans == blas.Trans, +// C * Q if side == blas.Right and trans == blas.NoTrans, +// C * Qᵀ 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 @@ -21,10 +21,10 @@ import "gonum.org/v1/gonum/blas" // // 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 diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dorml2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dorml2.go index 25aa83ac10d..df474ca4d1a 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dorml2.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dorml2.go @@ -8,10 +8,10 @@ import "gonum.org/v1/gonum/blas" // Dorml2 multiplies a general matrix C by an orthogonal matrix from an LQ factorization // determined by 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ᵀ * C if side == blas.Left and trans == blas.Trans +// C = C * Q if side == blas.Right and trans == blas.NoTrans +// C = C * Qᵀ 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. // diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dormlq.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dormlq.go index 6fcfc2fb199..a86a8a569c0 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dormlq.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dormlq.go @@ -11,10 +11,10 @@ import ( // 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ᵀ * C if side == blas.Left and trans == blas.Trans +// C = C * Q if side == blas.Right and trans == blas.NoTrans +// C = C * Qᵀ 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. // diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dormqr.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dormqr.go index 8ae45086548..ae67de5fc9d 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dormqr.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dormqr.go @@ -10,10 +10,10 @@ import ( ) // 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ᵀ * C if side == blas.Left and trans == blas.Trans, +// C = C * Q if side == blas.Right and trans == blas.NoTrans, +// C = C * Qᵀ 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}. // diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dormr2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dormr2.go index bb03f32c769..4bf0d879342 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dormr2.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dormr2.go @@ -8,10 +8,10 @@ import "gonum.org/v1/gonum/blas" // Dormr2 multiplies a general matrix C by an orthogonal matrix from a RQ factorization // determined by Dgerqf. -// 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ᵀ * C if side == blas.Left and trans == blas.Trans +// C = C * Q if side == blas.Right and trans == blas.NoTrans +// C = C * Qᵀ if side == blas.Right and trans == blas.Trans // If side == blas.Left, a is a matrix of size k×m, and if side == blas.Right // a is of size k×n. // diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dpbcon.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dpbcon.go new file mode 100644 index 00000000000..f55a596c347 --- /dev/null +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dpbcon.go @@ -0,0 +1,108 @@ +// 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 gonum + +import ( + "math" + + "gonum.org/v1/gonum/blas" + "gonum.org/v1/gonum/blas/blas64" +) + +// 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) + } + + // Quick return if possible. + if anorm == 0 { + return 0 + } + + const smlnum = dlamchS + + var ( + ainvnm float64 + kase int + isave [3]int + normin bool + + // Denote work slices. + x = work[:n] + v = work[n : 2*n] + cnorm = work[2*n : 3*n] + ) + // Estimate the 1-norm of the inverse. + bi := blas64.Implementation() + for { + ainvnm, kase = impl.Dlacn2(n, v, x, iwork, ainvnm, kase, &isave) + if kase == 0 { + break + } + var op1, op2 blas.Transpose + if uplo == blas.Upper { + // Multiply x by inv(Uᵀ), + op1 = blas.Trans + // then by inv(Uᵀ). + op2 = blas.NoTrans + } else { + // Multiply x by inv(L), + op1 = blas.NoTrans + // then by inv(Lᵀ). + op2 = blas.Trans + } + scaleL := impl.Dlatbs(uplo, op1, blas.NonUnit, normin, n, kd, ab, ldab, x, cnorm) + normin = true + scaleU := impl.Dlatbs(uplo, op2, blas.NonUnit, normin, n, kd, ab, ldab, x, cnorm) + // Multiply x by 1/scale if doing so will not cause overflow. + scale := scaleL * scaleU + if scale != 1 { + ix := bi.Idamax(n, x, 1) + if scale < math.Abs(x[ix])*smlnum || scale == 0 { + return 0 + } + impl.Drscl(n, scale, x, 1) + } + } + if ainvnm == 0 { + return 0 + } + // Return the estimate of the reciprocal condition number. + return (1 / ainvnm) / anorm +} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dpbtf2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dpbtf2.go index a5beb80bca2..e54bc46fdad 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dpbtf2.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dpbtf2.go @@ -14,8 +14,8 @@ import ( // Dpbtf2 computes the Cholesky factorization of a symmetric positive banded // matrix ab. The matrix ab is n×n with kd diagonal bands. The Cholesky // factorization computed is -// A = U^T * U if ul == blas.Upper -// A = L * L^T if ul == blas.Lower +// A = Uᵀ * U if ul == blas.Upper +// A = L * Lᵀ if ul == blas.Lower // ul also specifies the storage of ab. If ul == blas.Upper, then // ab is stored as an upper-triangular banded matrix with kd super-diagonals, // and if ul == blas.Lower, ab is stored as a lower-triangular banded matrix @@ -47,9 +47,9 @@ import ( // version. // // Dpbtf2 is an internal routine, exported for testing purposes. -func (Implementation) Dpbtf2(ul blas.Uplo, n, kd int, ab []float64, ldab int) (ok bool) { +func (Implementation) Dpbtf2(uplo blas.Uplo, n, kd int, ab []float64, ldab int) (ok bool) { switch { - case ul != blas.Upper && ul != blas.Lower: + case uplo != blas.Upper && uplo != blas.Lower: panic(badUplo) case n < 0: panic(nLT0) @@ -59,27 +59,29 @@ func (Implementation) Dpbtf2(ul blas.Uplo, n, kd int, ab []float64, ldab int) (o panic(badLdA) } + // Quick return if possible. if n == 0 { - return + return true } - if len(ab) < (n-1)*ldab+kd { + if len(ab) < (n-1)*ldab+kd+1 { panic(shortAB) } bi := blas64.Implementation() kld := max(1, ldab-1) - if ul == blas.Upper { + if uplo == blas.Upper { + // Compute the Cholesky factorization A = Uᵀ * U. for j := 0; j < n; j++ { - // Compute U(J,J) and test for non positive-definiteness. + // Compute U(j,j) and test for non-positive-definiteness. ajj := ab[j*ldab] if ajj <= 0 { return false } ajj = math.Sqrt(ajj) ab[j*ldab] = ajj - // Compute elements j+1:j+kn of row J and update the trailing submatrix + // Compute elements j+1:j+kn of row j and update the trailing submatrix // within the band. kn := min(kd, n-j-1) if kn > 0 { @@ -89,16 +91,16 @@ func (Implementation) Dpbtf2(ul blas.Uplo, n, kd int, ab []float64, ldab int) (o } return true } + // Compute the Cholesky factorization A = L * Lᵀ. for j := 0; j < n; j++ { - // Compute L(J,J) and test for non positive-definiteness. + // Compute L(j,j) and test for non-positive-definiteness. ajj := ab[j*ldab+kd] if ajj <= 0 { return false } ajj = math.Sqrt(ajj) ab[j*ldab+kd] = ajj - - // Compute elements J+1:J+KN of column J and update the trailing submatrix + // Compute elements j+1:j+kn of column j and update the trailing submatrix // within the band. kn := min(kd, n-j-1) if kn > 0 { diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dpbtrf.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dpbtrf.go new file mode 100644 index 00000000000..d8814cdbbc1 --- /dev/null +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dpbtrf.go @@ -0,0 +1,214 @@ +// 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 gonum + +import ( + "gonum.org/v1/gonum/blas" + "gonum.org/v1/gonum/blas/blas64" +) + +// Dpbtrf computes the Cholesky factorization of an n×n symmetric positive +// definite band matrix +// A = Uᵀ * U if uplo == blas.Upper +// A = L * Lᵀ 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) { + const nbmax = 32 + + 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) + } + + opts := string(blas.Upper) + if uplo == blas.Lower { + opts = string(blas.Lower) + } + nb := impl.Ilaenv(1, "DPBTRF", opts, n, kd, -1, -1) + // The block size must not exceed the semi-bandwidth kd, and must not + // exceed the limit set by the size of the local array work. + nb = min(nb, nbmax) + + if nb <= 1 || kd < nb { + // Use unblocked code. + return impl.Dpbtf2(uplo, n, kd, ab, ldab) + } + + // Use blocked code. + ldwork := nb + work := make([]float64, nb*ldwork) + bi := blas64.Implementation() + if uplo == blas.Upper { + // Compute the Cholesky factorization of a symmetric band + // matrix, given the upper triangle of the matrix in band + // storage. + + // Process the band matrix one diagonal block at a time. + for i := 0; i < n; i += nb { + ib := min(nb, n-i) + // Factorize the diagonal block. + ok := impl.Dpotf2(uplo, ib, ab[i*ldab:], ldab-1) + if !ok { + return false + } + if i+ib >= n { + continue + } + // Update the relevant part of the trailing submatrix. + // If A11 denotes the diagonal block which has just been + // factorized, then we need to update the remaining + // blocks in the diagram: + // + // A11 A12 A13 + // A22 A23 + // A33 + // + // The numbers of rows and columns in the partitioning + // are ib, i2, i3 respectively. The blocks A12, A22 and + // A23 are empty if ib = kd. The upper triangle of A13 + // lies outside the band. + i2 := min(kd-ib, n-i-ib) + if i2 > 0 { + // Update A12. + bi.Dtrsm(blas.Left, blas.Upper, blas.Trans, blas.NonUnit, ib, i2, + 1, ab[i*ldab:], ldab-1, ab[i*ldab+ib:], ldab-1) + // Update A22. + bi.Dsyrk(blas.Upper, blas.Trans, i2, ib, + -1, ab[i*ldab+ib:], ldab-1, 1, ab[(i+ib)*ldab:], ldab-1) + } + i3 := min(ib, n-i-kd) + if i3 > 0 { + // Copy the lower triangle of A13 into the work array. + for ii := 0; ii < ib; ii++ { + for jj := 0; jj <= min(ii, i3-1); jj++ { + work[ii*ldwork+jj] = ab[(i+ii)*ldab+kd-ii+jj] + } + } + // Update A13 (in the work array). + bi.Dtrsm(blas.Left, blas.Upper, blas.Trans, blas.NonUnit, ib, i3, + 1, ab[i*ldab:], ldab-1, work, ldwork) + // Update A23. + if i2 > 0 { + bi.Dgemm(blas.Trans, blas.NoTrans, i2, i3, ib, + -1, ab[i*ldab+ib:], ldab-1, work, ldwork, + 1, ab[(i+ib)*ldab+kd-ib:], ldab-1) + } + // Update A33. + bi.Dsyrk(blas.Upper, blas.Trans, i3, ib, + -1, work, ldwork, 1, ab[(i+kd)*ldab:], ldab-1) + // Copy the lower triangle of A13 back into place. + for ii := 0; ii < ib; ii++ { + for jj := 0; jj <= min(ii, i3-1); jj++ { + ab[(i+ii)*ldab+kd-ii+jj] = work[ii*ldwork+jj] + } + } + } + } + } else { + // Compute the Cholesky factorization of a symmetric band + // matrix, given the lower triangle of the matrix in band + // storage. + + // Process the band matrix one diagonal block at a time. + for i := 0; i < n; i += nb { + ib := min(nb, n-i) + // Factorize the diagonal block. + ok := impl.Dpotf2(uplo, ib, ab[i*ldab+kd:], ldab-1) + if !ok { + return false + } + if i+ib >= n { + continue + } + // Update the relevant part of the trailing submatrix. + // If A11 denotes the diagonal block which has just been + // factorized, then we need to update the remaining + // blocks in the diagram: + // + // A11 + // A21 A22 + // A31 A32 A33 + // + // The numbers of rows and columns in the partitioning + // are ib, i2, i3 respectively. The blocks A21, A22 and + // A32 are empty if ib = kd. The lowr triangle of A31 + // lies outside the band. + i2 := min(kd-ib, n-i-ib) + if i2 > 0 { + // Update A21. + bi.Dtrsm(blas.Right, blas.Lower, blas.Trans, blas.NonUnit, i2, ib, + 1, ab[i*ldab+kd:], ldab-1, ab[(i+ib)*ldab+kd-ib:], ldab-1) + // Update A22. + bi.Dsyrk(blas.Lower, blas.NoTrans, i2, ib, + -1, ab[(i+ib)*ldab+kd-ib:], ldab-1, 1, ab[(i+ib)*ldab+kd:], ldab-1) + } + i3 := min(ib, n-i-kd) + if i3 > 0 { + // Copy the upper triangle of A31 into the work array. + for ii := 0; ii < i3; ii++ { + for jj := ii; jj < ib; jj++ { + work[ii*ldwork+jj] = ab[(ii+i+kd)*ldab+jj-ii] + } + } + // Update A31 (in the work array). + bi.Dtrsm(blas.Right, blas.Lower, blas.Trans, blas.NonUnit, i3, ib, + 1, ab[i*ldab+kd:], ldab-1, work, ldwork) + // Update A32. + if i2 > 0 { + bi.Dgemm(blas.NoTrans, blas.Trans, i3, i2, ib, + -1, work, ldwork, ab[(i+ib)*ldab+kd-ib:], ldab-1, + 1, ab[(i+kd)*ldab+ib:], ldab-1) + } + // Update A33. + bi.Dsyrk(blas.Lower, blas.NoTrans, i3, ib, + -1, work, ldwork, 1, ab[(i+kd)*ldab+kd:], ldab-1) + // Copy the upper triangle of A31 back into place. + for ii := 0; ii < i3; ii++ { + for jj := ii; jj < ib; jj++ { + ab[(ii+i+kd)*ldab+jj-ii] = work[ii*ldwork+jj] + } + } + } + } + } + return true +} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dpbtrs.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dpbtrs.go new file mode 100644 index 00000000000..f3d9559db7b --- /dev/null +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dpbtrs.go @@ -0,0 +1,67 @@ +// 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 gonum + +import ( + "gonum.org/v1/gonum/blas" + "gonum.org/v1/gonum/blas/blas64" +) + +// 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ᵀ * U if uplo == blas.Upper +// A = L * Lᵀ 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+1 { + panic(shortAB) + } + if len(b) < (n-1)*ldb+nrhs { + panic(shortB) + } + + bi := blas64.Implementation() + if uplo == blas.Upper { + // Solve A*X = B where A = Uᵀ*U. + for j := 0; j < nrhs; j++ { + // Solve Uᵀ*Y = B, overwriting B with Y. + bi.Dtbsv(blas.Upper, blas.Trans, blas.NonUnit, n, kd, ab, ldab, b[j:], ldb) + // Solve U*X = Y, overwriting Y with X. + bi.Dtbsv(blas.Upper, blas.NoTrans, blas.NonUnit, n, kd, ab, ldab, b[j:], ldb) + } + } else { + // Solve A*X = B where A = L*Lᵀ. + for j := 0; j < nrhs; j++ { + // Solve L*Y = B, overwriting B with Y. + bi.Dtbsv(blas.Lower, blas.NoTrans, blas.NonUnit, n, kd, ab, ldab, b[j:], ldb) + // Solve Lᵀ*X = Y, overwriting Y with X. + bi.Dtbsv(blas.Lower, blas.Trans, blas.NonUnit, n, kd, ab, ldab, b[j:], ldb) + } + } +} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dpotf2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dpotf2.go index 5d3327c2d51..83411f1cf18 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dpotf2.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dpotf2.go @@ -13,7 +13,7 @@ import ( // Dpotf2 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^T U is stored in place into a. If ul == blas.Lower, then a = L L^T +// and a = Uᵀ U is stored in place into a. If ul == blas.Lower, then a = L Lᵀ // is computed and stored in-place into a. If a is not positive definite, false // is returned. This is the unblocked version of the algorithm. // diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dpotrf.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dpotrf.go index 21241687f84..7c81680166b 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dpotrf.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dpotrf.go @@ -11,7 +11,7 @@ import ( // 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^T U is stored in place into a. If ul == blas.Lower, then a = L L^T +// and a = Uᵀ U is stored in place into a. If ul == blas.Lower, then a = L Lᵀ // 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) { diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dpotri.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dpotri.go index 2394775c311..6fa981c1309 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dpotri.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dpotri.go @@ -10,7 +10,7 @@ import "gonum.org/v1/gonum/blas" // 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. +// factorization A = Uᵀ*U or A = L*Lᵀ, 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) { @@ -38,7 +38,7 @@ func (impl Implementation) Dpotri(uplo blas.Uplo, n int, a []float64, lda int) ( return false } - // Form inv(U)*inv(U)^T or inv(L)^T*inv(L). + // Form inv(U)*inv(U)ᵀ or inv(L)ᵀ*inv(L). impl.Dlauum(uplo, n, a, lda) return true } diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dpotrs.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dpotrs.go index 689e0439c2d..8977013db92 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dpotrs.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dpotrs.go @@ -12,8 +12,8 @@ import ( // 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 +// A = Uᵀ*U if uplo == blas.Upper +// A = L*Lᵀ 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) { @@ -45,18 +45,18 @@ func (Implementation) Dpotrs(uplo blas.Uplo, n, nrhs int, a []float64, lda int, bi := blas64.Implementation() if uplo == blas.Upper { - // Solve U^T * U * X = B where U is stored in the upper triangle of A. + // Solve Uᵀ * U * X = B where U is stored in the upper triangle of A. - // Solve U^T * X = B, overwriting B with X. + // Solve Uᵀ * X = B, overwriting B with X. bi.Dtrsm(blas.Left, blas.Upper, blas.Trans, blas.NonUnit, n, nrhs, 1, a, lda, b, ldb) // Solve U * X = B, overwriting B with X. bi.Dtrsm(blas.Left, blas.Upper, blas.NoTrans, blas.NonUnit, n, nrhs, 1, a, lda, b, ldb) } else { - // Solve L * L^T * X = B where L is stored in the lower triangle of A. + // Solve L * Lᵀ * X = B where L is stored in the lower triangle of A. // Solve L * X = B, overwriting B with X. bi.Dtrsm(blas.Left, blas.Lower, blas.NoTrans, blas.NonUnit, n, nrhs, 1, a, lda, b, ldb) - // Solve L^T * X = B, overwriting B with X. + // Solve Lᵀ * X = B, overwriting B with X. bi.Dtrsm(blas.Left, blas.Lower, blas.Trans, blas.NonUnit, n, nrhs, 1, a, lda, b, ldb) } } diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dsytd2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dsytd2.go index 23cfd05773f..8658f4e5ca8 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dsytd2.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dsytd2.go @@ -11,7 +11,7 @@ import ( // Dsytd2 reduces a symmetric n×n matrix A to symmetric tridiagonal form T by // an orthogonal similarity transformation -// Q^T * A * Q = T +// Qᵀ * A * Q = T // On entry, the matrix is contained in the specified triangle of a. On exit, // if uplo == blas.Upper, the diagonal and first super-diagonal of a are // overwritten with the elements of T. The elements above the first super-diagonal @@ -28,7 +28,7 @@ import ( // and if uplo == blas.Lower // Q = H_0 * H_1 * ... * H_{n-2} // where -// H_i = I - tau * v * v^T +// H_i = I - tau * v * vᵀ // where tau is stored in tau[i], and v is stored in a. // // If uplo == blas.Upper, v[0:i-1] is stored in A[0:i-1,i+1], v[i] = 1, and @@ -79,7 +79,7 @@ func (impl Implementation) Dsytd2(uplo blas.Uplo, n int, a []float64, lda int, d if uplo == blas.Upper { // Reduce the upper triangle of A. for i := n - 2; i >= 0; i-- { - // Generate elementary reflector H_i = I - tau * v * v^T to + // Generate elementary reflector H_i = I - tau * v * vᵀ to // annihilate A[i:i-1, i+1]. var taui float64 a[i*lda+i+1], taui = impl.Dlarfg(i+1, a[i*lda+i+1], a[i+1:], lda) @@ -91,12 +91,12 @@ func (impl Implementation) Dsytd2(uplo blas.Uplo, n int, a []float64, lda int, d // Compute x := tau * A * v storing x in tau[0:i]. bi.Dsymv(uplo, i+1, taui, a, lda, a[i+1:], lda, 0, tau, 1) - // Compute w := x - 1/2 * tau * (x^T * v) * v. + // Compute w := x - 1/2 * tau * (xᵀ * v) * v. alpha := -0.5 * taui * bi.Ddot(i+1, tau, 1, a[i+1:], lda) bi.Daxpy(i+1, alpha, a[i+1:], lda, tau, 1) // Apply the transformation as a rank-2 update - // A = A - v * w^T - w * v^T. + // A = A - v * wᵀ - w * vᵀ. bi.Dsyr2(uplo, i+1, -1, a[i+1:], lda, tau, 1, a, lda) a[i*lda+i+1] = e[i] } @@ -108,7 +108,7 @@ func (impl Implementation) Dsytd2(uplo blas.Uplo, n int, a []float64, lda int, d } // Reduce the lower triangle of A. for i := 0; i < n-1; i++ { - // Generate elementary reflector H_i = I - tau * v * v^T to + // Generate elementary reflector H_i = I - tau * v * vᵀ to // annihilate A[i+2:n, i]. var taui float64 a[(i+1)*lda+i], taui = impl.Dlarfg(n-i-1, a[(i+1)*lda+i], a[min(i+2, n-1)*lda+i:], lda) @@ -120,12 +120,12 @@ func (impl Implementation) Dsytd2(uplo blas.Uplo, n int, a []float64, lda int, d // Compute x := tau * A * v, storing y in tau[i:n-1]. bi.Dsymv(uplo, n-i-1, taui, a[(i+1)*lda+i+1:], lda, a[(i+1)*lda+i:], lda, 0, tau[i:], 1) - // Compute w := x - 1/2 * tau * (x^T * v) * v. + // Compute w := x - 1/2 * tau * (xᵀ * v) * v. alpha := -0.5 * taui * bi.Ddot(n-i-1, tau[i:], 1, a[(i+1)*lda+i:], lda) bi.Daxpy(n-i-1, alpha, a[(i+1)*lda+i:], lda, tau[i:], 1) // Apply the transformation as a rank-2 update - // A = A - v * w^T - w * v^T. + // A = A - v * wᵀ - w * vᵀ. bi.Dsyr2(uplo, n-i-1, -1, a[(i+1)*lda+i:], lda, tau[i:], 1, a[(i+1)*lda+i+1:], lda) a[(i+1)*lda+i] = e[i] } diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dsytrd.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dsytrd.go index df47568e92f..262a56c9a9d 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dsytrd.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dsytrd.go @@ -11,7 +11,7 @@ import ( // Dsytrd reduces a symmetric n×n matrix A to symmetric tridiagonal form by an // orthogonal similarity transformation -// Q^T * A * Q = T +// Qᵀ * 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 @@ -23,7 +23,7 @@ import ( // If uplo == blas.Upper, Q is constructed with // Q = H_{n-2} * ... * H_1 * H_0 // where -// H_i = I - tau_i * v * v^T +// H_i = I - tau_i * v * vᵀ // 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] @@ -35,7 +35,7 @@ import ( // If uplo == blas.Lower, Q is constructed with // Q = H_0 * H_1 * ... * H_{n-2} // where -// H_i = I - tau_i * v * v^T +// H_i = I - tau_i * v * vᵀ // 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 ] @@ -134,7 +134,7 @@ func (impl Implementation) Dsytrd(uplo blas.Uplo, n int, a []float64, lda int, d impl.Dlatrd(uplo, i+nb, nb, a, lda, e, tau, work, ldwork) // Update the unreduced submatrix A[0:i-1,0:i-1], using an update - // of the form A = A - V*W^T - W*V^T. + // of the form A = A - V*Wᵀ - W*Vᵀ. bi.Dsyr2k(uplo, blas.NoTrans, i, nb, -1, a[i:], lda, work, ldwork, 1, a, lda) // Copy superdiagonal elements back into A, and diagonal elements into D. @@ -155,7 +155,7 @@ func (impl Implementation) Dsytrd(uplo blas.Uplo, n int, a []float64, lda int, d impl.Dlatrd(uplo, n-i, nb, a[i*lda+i:], lda, e[i:], tau[i:], work, ldwork) // Update the unreduced submatrix A[i+ib:n, i+ib:n], using an update - // of the form A = A + V*W^T - W*V^T. + // of the form A = A + V*Wᵀ - W*Vᵀ. bi.Dsyr2k(uplo, blas.NoTrans, n-i-nb, nb, -1, a[(i+nb)*lda+i:], lda, work[nb*ldwork:], ldwork, 1, a[(i+nb)*lda+i+nb:], lda) diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dtgsja.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dtgsja.go index d70d1962342..3628ca6280c 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dtgsja.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dtgsja.go @@ -38,7 +38,7 @@ import ( // // On exit, // -// U^T*A*Q = D1*[ 0 R ], V^T*B*Q = D2*[ 0 R ], +// Uᵀ*A*Q = D1*[ 0 R ], Vᵀ*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 @@ -103,7 +103,7 @@ import ( // 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ᵀ*A13*Q1 = C1*R1; V1ᵀ*B13*Q1 = S1*R1, // // where U1, V1 and Q1 are orthogonal matrices. C1 and S1 are diagonal // matrices satisfying @@ -263,12 +263,12 @@ func (impl Implementation) Dtgsja(jobU, jobV, jobQ lapack.GSVDJob, m, p, n, k, l csu, snu, csv, snv, csq, snq := impl.Dlags2(upper, a1, a2, a3, b1, b2, b3) - // Update (k+i)-th and (k+j)-th rows of matrix A: U^T*A. + // Update (k+i)-th and (k+j)-th rows of matrix A: Uᵀ*A. if k+j < m { bi.Drot(l, a[(k+j)*lda+n-l:], 1, a[(k+i)*lda+n-l:], 1, csu, snu) } - // Update i-th and j-th rows of matrix B: V^T*B. + // Update i-th and j-th rows of matrix B: Vᵀ*B. bi.Drot(l, b[j*ldb+n-l:], 1, b[i*ldb+n-l:], 1, csv, snv) // Update (n-l+i)-th and (n-l+j)-th columns of matrices diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dtrevc3.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dtrevc3.go index 17121b8dbf0..0b0ee9b82e9 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dtrevc3.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dtrevc3.go @@ -15,14 +15,14 @@ import ( // Dtrevc3 computes some or all of the right and/or left eigenvectors of an n×n // upper quasi-triangular matrix T in Schur canonical form. Matrices of this // type are produced by the Schur factorization of a real general matrix A -// A = Q T Q^T, +// A = Q T Qᵀ, // as computed by Dhseqr. // // The right eigenvector x of T corresponding to an // eigenvalue λ is defined by // T x = λ x, // and the left eigenvector y is defined by -// y^T T = λ y^T. +// yᵀ T = λ yᵀ. // // The eigenvalues are read directly from the diagonal blocks of T. // @@ -614,7 +614,7 @@ leftev: b[k*ldb+iv] = -t[ki*ldt+k] } // Solve transposed quasi-triangular system: - // [ T[ki+1:n,ki+1:n] - wr ]^T * X = scale*b + // [ T[ki+1:n,ki+1:n] - wr ]ᵀ * X = scale*b vmax := 1.0 vcrit := bignum for j := ki + 1; j < n; { @@ -629,7 +629,7 @@ leftev: vmax = 1 } b[j*ldb+iv] -= bi.Ddot(j-ki-1, t[(ki+1)*ldt+j:], ldt, b[(ki+1)*ldb+iv:], ldb) - // Solve [ T[j,j] - wr ]^T * X = b. + // Solve [ T[j,j] - wr ]ᵀ * X = b. scale, _, _ := impl.Dlaln2(false, 1, 1, smin, 1, t[j*ldt+j:], ldt, 1, 1, b[j*ldb+iv:], ldb, wr, 0, x[:1], 2) // Scale if necessary. @@ -653,8 +653,8 @@ leftev: b[j*ldb+iv] -= bi.Ddot(j-ki-1, t[(ki+1)*ldt+j:], ldt, b[(ki+1)*ldb+iv:], ldb) b[(j+1)*ldb+iv] -= bi.Ddot(j-ki-1, t[(ki+1)*ldt+j+1:], ldt, b[(ki+1)*ldb+iv:], ldb) // Solve - // [ T[j,j]-wr T[j,j+1] ]^T * X = scale*[ b1 ] - // [ T[j+1,j] T[j+1,j+1]-wr ] [ b2 ] + // [ T[j,j]-wr T[j,j+1] ]ᵀ * X = scale*[ b1 ] + // [ T[j+1,j] T[j+1,j+1]-wr ] [ b2 ] scale, _, _ := impl.Dlaln2(true, 2, 1, smin, 1, t[j*ldt+j:], ldt, 1, 1, b[j*ldb+iv:], ldb, wr, 0, x[:3], 2) // Scale if necessary. @@ -702,8 +702,8 @@ leftev: // Complex left eigenvector. // Initial solve: - // [ [ T[ki,ki] T[ki,ki+1] ]^T - (wr - i* wi) ]*X = 0. - // [ [ T[ki+1,ki] T[ki+1,ki+1] ] ] + // [ [ T[ki,ki] T[ki,ki+1] ]ᵀ - (wr - i* wi) ]*X = 0. + // [ [ T[ki+1,ki] T[ki+1,ki+1] ] ] if math.Abs(t[ki*ldt+ki+1]) >= math.Abs(t[(ki+1)*ldt+ki]) { b[ki*ldb+iv] = wi / t[ki*ldt+ki+1] b[(ki+1)*ldb+iv+1] = 1 @@ -719,7 +719,7 @@ leftev: b[k*ldb+iv+1] = -b[(ki+1)*ldb+iv+1] * t[(ki+1)*ldt+k] } // Solve transposed quasi-triangular system: - // [ T[ki+2:n,ki+2:n]^T - (wr-i*wi) ]*X = b1+i*b2 + // [ T[ki+2:n,ki+2:n]ᵀ - (wr-i*wi) ]*X = b1+i*b2 vmax := 1.0 vcrit := bignum for j := ki + 2; j < n; { @@ -765,8 +765,8 @@ leftev: b[(j+1)*ldb+iv] -= bi.Ddot(j-ki-2, t[(ki+2)*ldt+j+1:], ldt, b[(ki+2)*ldb+iv:], ldb) b[(j+1)*ldb+iv+1] -= bi.Ddot(j-ki-2, t[(ki+2)*ldt+j+1:], ldt, b[(ki+2)*ldb+iv+1:], ldb) // Solve 2×2 complex linear equation - // [ [T[j,j] T[j,j+1] ]^T - (wr-i*wi)*I ]*X = scale*b - // [ [T[j+1,j] T[j+1,j+1]] ] + // [ [T[j,j] T[j,j+1] ]ᵀ - (wr-i*wi)*I ]*X = scale*b + // [ [T[j+1,j] T[j+1,j+1]] ] scale, _, _ := impl.Dlaln2(true, 2, 2, smin, 1, t[j*ldt+j:], ldt, 1, 1, b[j*ldb+iv:], ldb, wr, -wi, x[:], 2) // Scale if necessary. diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dtrexc.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dtrexc.go index 9f3f90bad8d..d063872ac0a 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dtrexc.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dtrexc.go @@ -7,7 +7,7 @@ package gonum import "gonum.org/v1/gonum/lapack" // Dtrexc reorders the real Schur factorization of a n×n real matrix -// A = Q*T*Q^T +// A = Q*T*Qᵀ // 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 @@ -15,7 +15,7 @@ import "gonum.org/v1/gonum/lapack" // elements equal and its off-diagonal elements of opposite sign. // // On return, T will be reordered by an orthogonal similarity transformation Z -// as Z^T*T*Z, and will be again in Schur canonical form. +// as Zᵀ*T*Z, and will be again in Schur canonical form. // // If compq is lapack.UpdateSchur, on return the matrix Q of Schur vectors will be // updated by post-multiplying it with Z. diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dtrtrs.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dtrtrs.go index 1752dc5c856..2145fbd5fd1 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dtrtrs.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/dtrtrs.go @@ -9,7 +9,7 @@ import ( "gonum.org/v1/gonum/blas/blas64" ) -// Dtrtrs solves a triangular system of the form A * X = B or A^T * X = B. Dtrtrs +// Dtrtrs solves a triangular system of the form A * X = B or Aᵀ * 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) { switch { diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/ilaenv.go b/vendor/gonum.org/v1/gonum/lapack/gonum/ilaenv.go index c134d21bb13..b401104869f 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/ilaenv.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/ilaenv.go @@ -165,12 +165,12 @@ func (impl Implementation) Ilaenv(ispec int, name string, opts string, n1, n2, n panic(badName) case "TRF": if sname { - if n4 <= 64 { + if n2 <= 64 { return 1 } return 32 } - if n4 <= 64 { + if n2 <= 64 { return 1 } return 32 diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/lapack.go b/vendor/gonum.org/v1/gonum/lapack/gonum/lapack.go index 434da02d2df..950db32ce79 100644 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/lapack.go +++ b/vendor/gonum.org/v1/gonum/lapack/gonum/lapack.go @@ -37,6 +37,8 @@ func abs(a int) int { const ( // dlamchE is the machine epsilon. For IEEE this is 2^{-53}. dlamchE = 1.0 / (1 << 53) + // TODO(kortschak) Replace this with 0x1p-53 when go1.12 is no + // longer supported. // dlamchB is the radix of the machine (the base of the number system). dlamchB = 2 @@ -48,4 +50,6 @@ const ( // 1/dlamchS does not overflow, or also the smallest normal number. // For IEEE this is 2^{-1022}. dlamchS = 1.0 / (1 << 256) / (1 << 256) / (1 << 256) / (1 << 254) + // TODO(kortschak) Replace this with 0x1p-1022 when go1.12 is no + // longer supported. ) diff --git a/vendor/gonum.org/v1/gonum/lapack/lapack.go b/vendor/gonum.org/v1/gonum/lapack/lapack.go index eef14c17a4b..da55fd9d125 100644 --- a/vendor/gonum.org/v1/gonum/lapack/lapack.go +++ b/vendor/gonum.org/v1/gonum/lapack/lapack.go @@ -93,15 +93,15 @@ const ( type ApplyOrtho byte const ( - ApplyP ApplyOrtho = 'P' // Apply P or P^T. - ApplyQ ApplyOrtho = 'Q' // Apply Q or Q^T. + ApplyP ApplyOrtho = 'P' // Apply P or Pᵀ. + ApplyQ ApplyOrtho = 'Q' // Apply Q or Qᵀ. ) // GenOrtho specifies which orthogonal matrix is generated in Dorgbr. type GenOrtho byte const ( - GeneratePT GenOrtho = 'P' // Generate P^T. + GeneratePT GenOrtho = 'P' // Generate Pᵀ. GenerateQ GenOrtho = 'Q' // Generate Q. ) diff --git a/vendor/gonum.org/v1/gonum/lapack/lapack64/lapack64.go b/vendor/gonum.org/v1/gonum/lapack/lapack64/lapack64.go index 208ee1f43fe..0aa76b6aa00 100644 --- a/vendor/gonum.org/v1/gonum/lapack/lapack64/lapack64.go +++ b/vendor/gonum.org/v1/gonum/lapack/lapack64/lapack64.go @@ -28,8 +28,8 @@ func max(a, b int) int { // Potrf computes the Cholesky factorization of a. // The factorization has the form -// A = U^T * U if a.Uplo == blas.Upper, or -// A = L * L^T if a.Uplo == blas.Lower, +// A = Uᵀ * U if a.Uplo == blas.Upper, or +// A = L * Lᵀ if a.Uplo == blas.Lower, // where U is an upper triangular matrix and L is lower triangular. // The triangular matrix is returned in t, and the underlying data between // a and t is shared. The returned bool indicates whether a is positive @@ -48,7 +48,7 @@ func Potrf(a blas64.Symmetric) (t blas64.Triangular, ok bool) { // using its Cholesky factorization. // // On entry, t contains the triangular factor U or L from the Cholesky -// factorization A = U^T*U or A = L*L^T, as computed by Potrf. +// factorization A = Uᵀ*U or A = L*Lᵀ, as computed by Potrf. // // On return, the upper or lower triangle of the (symmetric) inverse of A is // stored in t, overwriting the input factor U or L, and also returned in a. The @@ -66,7 +66,7 @@ func Potri(t blas64.Triangular) (a blas64.Symmetric, ok bool) { // Potrs 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, using the -// Cholesky factorization A = U^T*U or A = L*L^T. t contains the corresponding +// Cholesky factorization A = Uᵀ*U or A = L*Lᵀ. t contains the corresponding // triangular factor as returned by Potrf. On entry, B contains the right-hand // side matrix B, on return it contains the solution matrix X. func Potrs(t blas64.Triangular, b blas64.General) { @@ -99,7 +99,7 @@ func Gecon(norm lapack.MatrixNorm, a blas64.General, anorm float64, work []float // 2. If m < n and trans == blas.NoTrans, Gels finds the minimum norm solution of // A * X = B. // 3. If m >= n and trans == blas.Trans, Gels finds the minimum norm solution of -// A^T * X = B. +// Aᵀ * X = B. // 4. If m < n and trans == blas.Trans, Gels finds X such that || A*X - B||_2 // is minimized. // Note that the least-squares solutions (cases 1 and 3) perform the minimization @@ -133,7 +133,7 @@ func Gels(trans blas.Transpose, a blas64.General, b blas64.General, work []float // 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. +// and computing H_i = I - tau[i] * v * vᵀ. // // The orthonormal matrix Q can be constucted from a product of these elementary // reflectors, Q = H_0 * H_1 * ... * H_{k-1}, where k = min(m,n). @@ -170,7 +170,7 @@ func Gelqf(a blas64.General, tau, work []float64, lwork int) { // Gesvd computes the singular value decomposition of the input matrix A. // // The singular value decomposition is -// A = U * Sigma * V^T +// A = U * Sigma * Vᵀ // 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 @@ -182,7 +182,7 @@ func Gelqf(a blas64.General, tau, work []float64, lwork int) { // 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 +// The behavior is the same for jobVT and the rows of Vᵀ. At most one of jobU // and jobVT can equal lapack.SVDOverwrite, and Gesvd will panic otherwise. // // On entry, a contains the data for the m×n matrix A. During the call to Gesvd @@ -252,8 +252,8 @@ func Getri(a blas64.General, ipiv []int, work []float64, lwork int) (ok bool) { // Getrs 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ᵀ * 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 @@ -267,13 +267,13 @@ func Getrs(trans blas.Transpose, a blas64.General, b blas64.General, ipiv []int) // Ggsvd3 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 ] +// Uᵀ*A*Q = D1*[ 0 R ] // -// V^T*B*Q = D2*[ 0 R ] +// Vᵀ*B*Q = D2*[ 0 R ] // where U, V and Q are orthogonal matrices. // // Ggsvd3 returns k and l, the dimensions of the sub-blocks. k+l -// is the effective numerical rank of the (m+p)×n matrix [ A^T B^T ]^T. +// is the effective numerical rank of the (m+p)×n matrix [ Aᵀ Bᵀ ]ᵀ. // R is a (k+l)×(k+l) nonsingular upper triangular matrix, D1 and // D2 are m×(k+l) and p×(k+l) diagonal matrices and of the following // structures, respectively: @@ -410,10 +410,10 @@ func Lapmt(forward bool, x blas64.General, k []int) { // Ormlq multiplies the matrix C by the othogonal matrix Q defined by // A and tau. A and tau are as returned from Gelqf. -// 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ᵀ * C if side == blas.Left and trans == blas.Trans +// C = C * Q if side == blas.Right and trans == blas.NoTrans +// C = C * Qᵀ 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. // @@ -431,10 +431,10 @@ func Ormlq(side blas.Side, trans blas.Transpose, a blas64.General, tau []float64 } // Ormqr 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ᵀ * C if side == blas.Left and trans == blas.Trans, +// C = C * Q if side == blas.Right and trans == blas.NoTrans, +// C = C * Qᵀ 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}. // @@ -512,7 +512,7 @@ func Trtri(a blas64.Triangular) (ok bool) { return lapack64.Dtrtri(a.Uplo, a.Diag, a.N, a.Data, max(1, a.Stride)) } -// Trtrs solves a triangular system of the form A * X = B or A^T * X = B. Trtrs +// Trtrs solves a triangular system of the form A * X = B or Aᵀ * X = B. Trtrs // returns whether the solve completed successfully. If A is singular, no solve is performed. func Trtrs(trans blas.Transpose, a blas64.Triangular, b blas64.General) (ok bool) { return lapack64.Dtrtrs(a.Uplo, trans, a.Diag, a.N, b.Cols, a.Data, max(1, a.Stride), b.Data, max(1, b.Stride)) @@ -525,8 +525,8 @@ func Trtrs(trans blas.Transpose, a blas64.Triangular, b blas64.General) (ok bool // is defined by // 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, -// where u_j^H is the conjugate transpose of u_j. +// u_jᴴ A = λ_j u_jᴴ, +// where u_jᴴ 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 diff --git a/vendor/gonum.org/v1/gonum/mat/BUILD b/vendor/gonum.org/v1/gonum/mat/BUILD index 799c6d0c2f7..4ccbb981ba3 100644 --- a/vendor/gonum.org/v1/gonum/mat/BUILD +++ b/vendor/gonum.org/v1/gonum/mat/BUILD @@ -28,6 +28,8 @@ go_library( "product.go", "qr.go", "shadow.go", + "shadow_common.go", + "shadow_complex.go", "solve.go", "svd.go", "symband.go", diff --git a/vendor/gonum.org/v1/gonum/mat/band.go b/vendor/gonum.org/v1/gonum/mat/band.go index 72ebefddd1d..85a15cb5d9b 100644 --- a/vendor/gonum.org/v1/gonum/mat/band.go +++ b/vendor/gonum.org/v1/gonum/mat/band.go @@ -10,9 +10,11 @@ import ( var ( bandDense *BandDense - _ Matrix = bandDense - _ Banded = bandDense - _ RawBander = bandDense + _ Matrix = bandDense + _ allMatrix = bandDense + _ denseMatrix = bandDense + _ Banded = bandDense + _ RawBander = bandDense _ NonZeroDoer = bandDense _ RowNonZeroDoer = bandDense @@ -195,6 +197,26 @@ func (b *BandDense) SetRawBand(mat blas64.Band) { b.mat = mat } +// IsEmpty returns whether the receiver is empty. Empty matrices can be the +// receiver for size-restricted operations. The receiver can be zeroed using Reset. +func (b *BandDense) IsEmpty() bool { + return b.mat.Stride == 0 +} + +// Reset empties the matrix so that it can be reused as the +// receiver of a dimensionally restricted operation. +// +// Reset should not be used when the matrix shares backing data. +// See the Reseter interface for more information. +func (b *BandDense) Reset() { + b.mat.Rows = 0 + b.mat.Cols = 0 + b.mat.KL = 0 + b.mat.KU = 0 + b.mat.Stride = 0 + b.mat.Data = b.mat.Data[:0:0] +} + // DiagView returns the diagonal as a matrix backed by the original data. func (b *BandDense) DiagView() Diagonal { n := min(b.mat.Rows, b.mat.Cols) @@ -261,3 +283,17 @@ func (b *BandDense) Zero() { zero(b.mat.Data[i*b.mat.Stride+l : i*b.mat.Stride+u]) } } + +// Trace computes the trace of the matrix. +func (b *BandDense) Trace() float64 { + r, c := b.Dims() + if r != c { + panic(ErrShape) + } + rb := b.RawBand() + var tr float64 + for i := 0; i < r; i++ { + tr += rb.Data[rb.KL+i*rb.Stride] + } + return tr +} diff --git a/vendor/gonum.org/v1/gonum/mat/cdense.go b/vendor/gonum.org/v1/gonum/mat/cdense.go index 9c29d1afd19..4a1b453ac8e 100644 --- a/vendor/gonum.org/v1/gonum/mat/cdense.go +++ b/vendor/gonum.org/v1/gonum/mat/cdense.go @@ -6,7 +6,14 @@ package mat import "gonum.org/v1/gonum/blas/cblas128" -// Dense is a dense matrix representation with complex data. +var ( + cDense *CDense + + _ CMatrix = cDense + _ allMatrix = cDense +) + +// CDense is a dense matrix representation with complex data. type CDense struct { mat cblas128.General @@ -58,11 +65,32 @@ func NewCDense(r, c int, data []complex128) *CDense { } } +// ReuseAs changes the receiver if it IsEmpty() to be of size r×c. +// +// ReuseAs re-uses the backing data slice if it has sufficient capacity, +// otherwise a new slice is allocated. The backing data is zero on return. +// +// ReuseAs panics if the receiver is not empty, and panics if +// the input sizes are less than one. To empty the receiver for re-use, +// Reset should be used. +func (m *CDense) ReuseAs(r, c int) { + if r <= 0 || c <= 0 { + if r == 0 || c == 0 { + panic(ErrZeroLength) + } + panic(ErrNegativeDimension) + } + if !m.IsEmpty() { + panic(ErrReuseNonEmpty) + } + m.reuseAsZeroed(r, c) +} + // reuseAs resizes an empty matrix to a r×c matrix, // or checks that a non-empty matrix is r×c. // // reuseAs must be kept in sync with reuseAsZeroed. -func (m *CDense) reuseAs(r, c int) { +func (m *CDense) reuseAsNonZeroed(r, c int) { if m.mat.Rows > m.capRows || m.mat.Cols > m.capCols { // Panic as a string, not a mat.Error. panic("mat: caps not correctly set") @@ -70,7 +98,7 @@ func (m *CDense) reuseAs(r, c int) { if r == 0 || c == 0 { panic(ErrZeroLength) } - if m.IsZero() { + if m.IsEmpty() { m.mat = cblas128.General{ Rows: r, Cols: c, @@ -95,7 +123,7 @@ func (m *CDense) reuseAsZeroed(r, c int) { if r == 0 || c == 0 { panic(ErrZeroLength) } - if m.IsZero() { + if m.IsEmpty() { m.mat = cblas128.General{ Rows: r, Cols: c, @@ -115,6 +143,7 @@ func (m *CDense) reuseAsZeroed(r, c int) { // Reset zeros the dimensions of the matrix so that it can be reused as the // receiver of a dimensionally restricted operation. // +// Reset should not be used when the matrix shares backing data. // See the Reseter interface for more information. func (m *CDense) Reset() { // Row, Cols and Stride must be zeroed in unison. @@ -123,9 +152,9 @@ func (m *CDense) Reset() { m.mat.Data = m.mat.Data[:0] } -// IsZero returns whether the receiver is zero-sized. Zero-sized matrices can be the -// receiver for size-restricted operations. CDense matrices can be zeroed using Reset. -func (m *CDense) IsZero() bool { +// IsEmpty returns whether the receiver is empty. Empty matrices can be the +// receiver for size-restricted operations. The receiver can be zeroed using Reset. +func (m *CDense) IsEmpty() bool { // It must be the case that m.Dims() returns // zeros in this case. See comment in Reset(). return m.mat.Stride == 0 @@ -166,3 +195,8 @@ func (m *CDense) Copy(a CMatrix) (r, c int) { } return r, c } + +// RawCMatrix returns the underlying cblas128.General used by the receiver. +// Changes to elements in the receiver following the call will be reflected +// in returned cblas128.General. +func (m *CDense) RawCMatrix() cblas128.General { return m.mat } diff --git a/vendor/gonum.org/v1/gonum/mat/cholesky.go b/vendor/gonum.org/v1/gonum/mat/cholesky.go index bee438538f3..7381e5e0970 100644 --- a/vendor/gonum.org/v1/gonum/mat/cholesky.go +++ b/vendor/gonum.org/v1/gonum/mat/cholesky.go @@ -55,8 +55,8 @@ func (c *Cholesky) updateCond(norm float64) { if norm < 0 { // This is an approximation. By the definition of a norm, // |AB| <= |A| |B|. - // Since A = U^T*U, we get for the condition number κ that - // κ(A) := |A| |A^-1| = |U^T*U| |A^-1| <= |U^T| |U| |A^-1|, + // Since A = Uᵀ*U, we get for the condition number κ that + // κ(A) := |A| |A^-1| = |Uᵀ*U| |A^-1| <= |Uᵀ| |U| |A^-1|, // so this will overestimate the condition number somewhat. // The norm of the original factorized matrix cannot be stored // because of update possibilities. @@ -154,10 +154,19 @@ func (c *Cholesky) Reset() { c.cond = math.Inf(1) } +// IsEmpty returns whether the receiver is empty. Empty matrices can be the +// receiver for size-restricted operations. The receiver can be emptied using +// Reset. +func (c *Cholesky) IsEmpty() bool { + return c.chol == nil || c.chol.IsEmpty() +} + // SetFromU sets the Cholesky decomposition from the given triangular matrix. -// SetFromU panics if t is not upper triangular. Note that t is copied into, -// not stored inside, the receiver. -func (c *Cholesky) SetFromU(t *TriDense) { +// SetFromU panics if t is not upper triangular. If the receiver is empty it +// is resized to be n×n, the size of t. If dst is non-empty, SetFromU panics +// if c is not of size n×n. Note that t is copied into, not stored inside, the +// receiver. +func (c *Cholesky) SetFromU(t Triangular) { n, kind := t.Triangle() if kind != Upper { panic("cholesky: matrix must be upper triangular") @@ -165,7 +174,7 @@ func (c *Cholesky) SetFromU(t *TriDense) { if c.chol == nil { c.chol = NewTriDense(n, Upper, nil) } else { - c.chol = NewTriDense(n, Upper, use(c.chol.mat.Data, n*n)) + c.chol.reuseAsNonZeroed(n, Upper) } c.chol.Copy(t) c.updateCond(-1) @@ -220,7 +229,7 @@ func (c *Cholesky) SolveTo(dst *Dense, b Matrix) error { panic(ErrShape) } - dst.reuseAs(bm, bn) + dst.reuseAsNonZeroed(bm, bn) if b != dst { dst.Copy(b) } @@ -267,14 +276,14 @@ func (c *Cholesky) SolveVecTo(dst *VecDense, b Vector) error { } switch rv := b.(type) { default: - dst.reuseAs(n) + dst.reuseAsNonZeroed(n) return c.SolveTo(dst.asDense(), b) case RawVectorer: bmat := rv.RawVector() if dst != b { dst.checkOverlap(bmat) } - dst.reuseAs(n) + dst.reuseAsNonZeroed(n) if dst != b { dst.CopyVec(b) } @@ -293,54 +302,73 @@ func (c *Cholesky) RawU() Triangular { return c.chol } -// UTo extracts the n×n upper triangular matrix U from a Cholesky -// decomposition into dst and returns the result. If dst is nil a new -// TriDense is allocated. -// A = U^T * U. -func (c *Cholesky) UTo(dst *TriDense) *TriDense { +// UTo stores into dst the n×n upper triangular matrix U from a Cholesky +// decomposition +// A = Uᵀ * U. +// If dst is empty, it is resized to be an n×n upper triangular matrix. When dst +// is non-empty, UTo panics if dst is not n×n or not Upper. UTo will also panic +// if the receiver does not contain a successful factorization. +func (c *Cholesky) UTo(dst *TriDense) { if !c.valid() { panic(badCholesky) } n := c.chol.mat.N - if dst == nil { - dst = NewTriDense(n, Upper, make([]float64, n*n)) + if dst.IsEmpty() { + dst.ReuseAsTri(n, Upper) } else { - dst.reuseAs(n, Upper) + n2, kind := dst.Triangle() + if n != n2 { + panic(ErrShape) + } + if kind != Upper { + panic(ErrTriangle) + } } dst.Copy(c.chol) - return dst } -// LTo extracts the n×n lower triangular matrix L from a Cholesky -// decomposition into dst and returns the result. If dst is nil a new -// TriDense is allocated. -// A = L * L^T. -func (c *Cholesky) LTo(dst *TriDense) *TriDense { +// LTo stores into dst the n×n lower triangular matrix L from a Cholesky +// decomposition +// A = L * Lᵀ. +// If dst is empty, it is resized to be an n×n lower triangular matrix. When dst +// is non-empty, LTo panics if dst is not n×n or not Lower. LTo will also panic +// if the receiver does not contain a successful factorization. +func (c *Cholesky) LTo(dst *TriDense) { if !c.valid() { panic(badCholesky) } n := c.chol.mat.N - if dst == nil { - dst = NewTriDense(n, Lower, make([]float64, n*n)) + if dst.IsEmpty() { + dst.ReuseAsTri(n, Lower) } else { - dst.reuseAs(n, Lower) + n2, kind := dst.Triangle() + if n != n2 { + panic(ErrShape) + } + if kind != Lower { + panic(ErrTriangle) + } } dst.Copy(c.chol.TTri()) - return dst } -// ToSym reconstructs the original positive definite matrix given its -// Cholesky decomposition into dst and returns the result. If dst is nil -// a new SymDense is allocated. -func (c *Cholesky) ToSym(dst *SymDense) *SymDense { +// ToSym reconstructs the original positive definite matrix from its +// Cholesky decomposition, storing the result into dst. If dst is +// empty it is resized to be n×n. If dst is non-empty, ToSym panics +// if dst is not of size n×n. ToSym will also panic if the receiver +// does not contain a successful factorization. +func (c *Cholesky) ToSym(dst *SymDense) { if !c.valid() { panic(badCholesky) } n := c.chol.mat.N - if dst == nil { - dst = NewSymDense(n, nil) + if dst.IsEmpty() { + dst.ReuseAsSym(n) } else { - dst.reuseAs(n) + n2 := dst.Symmetric() + if n != n2 { + panic(ErrShape) + } } // Create a TriDense representing the Cholesky factor U with dst's // backing slice. @@ -356,7 +384,7 @@ func (c *Cholesky) ToSym(dst *SymDense) *SymDense { cap: n, } u.Copy(c.chol) - // Compute the product U^T*U using the algorithm from LAPACK/TESTING/LIN/dpot01.f + // Compute the product Uᵀ*U using the algorithm from LAPACK/TESTING/LIN/dpot01.f a := u.mat.Data lda := u.mat.Stride bi := blas64.Implementation() @@ -366,7 +394,6 @@ func (c *Cholesky) ToSym(dst *SymDense) *SymDense { bi.Dtrmv(blas.Upper, blas.Trans, blas.NonUnit, k, a, lda, a[k:], lda) } } - return dst } // InverseTo computes the inverse of the matrix represented by its Cholesky @@ -378,7 +405,7 @@ func (c *Cholesky) InverseTo(s *SymDense) error { if !c.valid() { panic(badCholesky) } - s.reuseAs(c.chol.mat.N) + s.reuseAsNonZeroed(c.chol.mat.N) // Create a TriDense representing the Cholesky factor U with the backing // slice from s. // Operations on u are reflected in s. @@ -407,10 +434,10 @@ func (c *Cholesky) InverseTo(s *SymDense) error { // Scale multiplies the original matrix A by a positive constant using // its Cholesky decomposition, storing the result in-place into the receiver. // That is, if the original Cholesky factorization is -// U^T * U = A +// Uᵀ * U = A // the updated factorization is -// U'^T * U' = f A = A' -// Scale panics if the constant is non-positive, or if the receiver is non-zero +// U'ᵀ * U' = f A = A' +// Scale panics if the constant is non-positive, or if the receiver is non-empty // and is of a different size from the input. func (c *Cholesky) Scale(f float64, orig *Cholesky) { if !orig.valid() { @@ -497,9 +524,9 @@ func (c *Cholesky) ExtendVecSym(a *Cholesky, v Vector) (ok bool) { // SymRankOne performs a rank-1 update of the original matrix A and refactorizes // its Cholesky factorization, storing the result into the receiver. That is, if // in the original Cholesky factorization -// U^T * U = A, +// Uᵀ * U = A, // in the updated factorization -// U'^T * U' = A + alpha * x * x^T = A'. +// U'ᵀ * U' = A + alpha * x * xᵀ = A'. // // Note that when alpha is negative, the updating problem may be ill-conditioned // and the results may be inaccurate, or the updated matrix A' may not be @@ -605,7 +632,7 @@ func (c *Cholesky) SymRankOne(orig *Cholesky, alpha float64, x Vector) (ok bool) if alpha != 1 { blas64.Scal(alpha, blas64.Vector{N: n, Data: work, Inc: 1}) } - // Solve U^T * p = x storing the result into work. + // Solve Uᵀ * p = x storing the result into work. ok = lapack64.Trtrs(blas.Trans, c.chol.RawTriangular(), blas64.General{ Rows: n, Cols: 1, @@ -669,5 +696,5 @@ func (c *Cholesky) SymRankOne(orig *Cholesky, alpha float64, x Vector) (ok bool) } func (c *Cholesky) valid() bool { - return c.chol != nil && !c.chol.IsZero() + return c.chol != nil && !c.chol.IsEmpty() } diff --git a/vendor/gonum.org/v1/gonum/mat/cmatrix.go b/vendor/gonum.org/v1/gonum/mat/cmatrix.go index 6219c28aaa4..3a7b3dac3ff 100644 --- a/vendor/gonum.org/v1/gonum/mat/cmatrix.go +++ b/vendor/gonum.org/v1/gonum/mat/cmatrix.go @@ -8,6 +8,7 @@ import ( "math" "math/cmplx" + "gonum.org/v1/gonum/blas/cblas128" "gonum.org/v1/gonum/floats" ) @@ -27,6 +28,12 @@ type CMatrix interface { H() CMatrix } +// A RawCMatrixer can return a cblas128.General representation of the receiver. Changes to the cblas128.General.Data +// slice will be reflected in the original matrix, changes to the Rows, Cols and Stride fields will not. +type RawCMatrixer interface { + RawCMatrix() cblas128.General +} + var ( _ CMatrix = Conjugate{} _ Unconjugator = Conjugate{} diff --git a/vendor/gonum.org/v1/gonum/mat/dense.go b/vendor/gonum.org/v1/gonum/mat/dense.go index 87b1105cad2..038c914c948 100644 --- a/vendor/gonum.org/v1/gonum/mat/dense.go +++ b/vendor/gonum.org/v1/gonum/mat/dense.go @@ -12,10 +12,12 @@ import ( var ( dense *Dense - _ Matrix = dense - _ Mutable = dense + _ Matrix = dense + _ allMatrix = dense + _ denseMatrix = dense + _ Mutable = dense - _ Cloner = dense + _ ClonerFrom = dense _ RowViewer = dense _ ColViewer = dense _ RawRowViewer = dense @@ -47,7 +49,7 @@ func NewDense(r, c int, data []float64) *Dense { if r == 0 || c == 0 { panic(ErrZeroLength) } - panic("mat: negative dimension") + panic(ErrNegativeDimension) } if data != nil && r*c != len(data) { panic(ErrShape) @@ -67,11 +69,32 @@ func NewDense(r, c int, data []float64) *Dense { } } -// reuseAs resizes an empty matrix to a r×c matrix, -// or checks that a non-empty matrix is r×c. +// ReuseAs changes the receiver if it IsEmpty() to be of size r×c. // -// reuseAs must be kept in sync with reuseAsZeroed. -func (m *Dense) reuseAs(r, c int) { +// ReuseAs re-uses the backing data slice if it has sufficient capacity, +// otherwise a new slice is allocated. The backing data is zero on return. +// +// ReuseAs panics if the receiver is not empty, and panics if +// the input sizes are less than one. To empty the receiver for re-use, +// Reset should be used. +func (m *Dense) ReuseAs(r, c int) { + if r <= 0 || c <= 0 { + if r == 0 || c == 0 { + panic(ErrZeroLength) + } + panic(ErrNegativeDimension) + } + if !m.IsEmpty() { + panic(ErrReuseNonEmpty) + } + m.reuseAsZeroed(r, c) +} + +// reuseAsNonZeroed resizes an empty matrix to a r×c matrix, +// or checks that a non-empty matrix is r×c. It does not zero +// the data in the receiver. +func (m *Dense) reuseAsNonZeroed(r, c int) { + // reuseAs must be kept in sync with reuseAsZeroed. if m.mat.Rows > m.capRows || m.mat.Cols > m.capCols { // Panic as a string, not a mat.Error. panic("mat: caps not correctly set") @@ -79,7 +102,7 @@ func (m *Dense) reuseAs(r, c int) { if r == 0 || c == 0 { panic(ErrZeroLength) } - if m.IsZero() { + if m.IsEmpty() { m.mat = blas64.General{ Rows: r, Cols: c, @@ -98,9 +121,8 @@ func (m *Dense) reuseAs(r, c int) { // reuseAsZeroed resizes an empty matrix to a r×c matrix, // or checks that a non-empty matrix is r×c. It zeroes // all the elements of the matrix. -// -// reuseAsZeroed must be kept in sync with reuseAs. func (m *Dense) reuseAsZeroed(r, c int) { + // reuseAsZeroed must be kept in sync with reuseAsNonZeroed. if m.mat.Rows > m.capRows || m.mat.Cols > m.capCols { // Panic as a string, not a mat.Error. panic("mat: caps not correctly set") @@ -108,7 +130,7 @@ func (m *Dense) reuseAsZeroed(r, c int) { if r == 0 || c == 0 { panic(ErrZeroLength) } - if m.IsZero() { + if m.IsEmpty() { m.mat = blas64.General{ Rows: r, Cols: c, @@ -149,9 +171,10 @@ func (m *Dense) isolatedWorkspace(a Matrix) (w *Dense, restore func()) { } } -// Reset zeros the dimensions of the matrix so that it can be reused as the +// Reset empties the matrix so that it can be reused as the // receiver of a dimensionally restricted operation. // +// Reset should not be used when the matrix shares backing data. // See the Reseter interface for more information. func (m *Dense) Reset() { // Row, Cols and Stride must be zeroed in unison. @@ -160,9 +183,10 @@ func (m *Dense) Reset() { m.mat.Data = m.mat.Data[:0] } -// IsZero returns whether the receiver is zero-sized. Zero-sized matrices can be the -// receiver for size-restricted operations. Dense matrices can be zeroed using Reset. -func (m *Dense) IsZero() bool { +// IsEmpty returns whether the receiver is empty. Empty matrices can be the +// receiver for size-restricted operations. The receiver can be emptied using +// Reset. +func (m *Dense) IsEmpty() bool { // It must be the case that m.Dims() returns // zeros in this case. See comment in Reset(). return m.mat.Stride == 0 @@ -186,7 +210,7 @@ func (m *Dense) asTriDense(n int, diag blas.Diag, uplo blas.Uplo) *TriDense { // DenseCopyOf returns a newly allocated copy of the elements of a. func DenseCopyOf(a Matrix) *Dense { d := &Dense{} - d.Clone(a) + d.CloneFrom(a) return d } @@ -375,12 +399,12 @@ func (m *Dense) Grow(r, c int) Matrix { return &t } -// Clone makes a copy of a into the receiver, overwriting the previous value of -// the receiver. The clone operation does not make any restriction on shape and +// CloneFrom makes a copy of a into the receiver, overwriting the previous value of +// the receiver. The clone from operation does not make any restriction on shape and // will not cause shadowing. // -// See the Cloner interface for more information. -func (m *Dense) Clone(a Matrix) { +// See the ClonerFrom interface for more information. +func (m *Dense) CloneFrom(a Matrix) { r, c := a.Dims() mat := blas64.General{ Rows: r, @@ -389,10 +413,10 @@ func (m *Dense) Clone(a Matrix) { } m.capRows, m.capCols = r, c - aU, trans := untranspose(a) + aU, trans := untransposeExtract(a) switch aU := aU.(type) { - case RawMatrixer: - amat := aU.RawMatrix() + case *Dense: + amat := aU.mat mat.Data = make([]float64, r*c) if trans { for i := 0; i < r; i++ { @@ -442,10 +466,10 @@ func (m *Dense) Copy(a Matrix) (r, c int) { return 0, 0 } - aU, trans := untranspose(a) + aU, trans := untransposeExtract(a) switch aU := aU.(type) { - case RawMatrixer: - amat := aU.RawMatrix() + case *Dense: + amat := aU.mat if trans { if amat.Stride != 1 { m.checkOverlap(amat) @@ -518,7 +542,7 @@ func (m *Dense) Stack(a, b Matrix) { panic(ErrShape) } - m.reuseAs(ar+br, ac) + m.reuseAsNonZeroed(ar+br, ac) m.Copy(a) w := m.Slice(ar, ar+br, 0, bc).(*Dense) @@ -536,7 +560,7 @@ func (m *Dense) Augment(a, b Matrix) { panic(ErrShape) } - m.reuseAs(ar, ac+bc) + m.reuseAsNonZeroed(ar, ac+bc) m.Copy(a) w := m.Slice(0, br, ac, ac+bc).(*Dense) diff --git a/vendor/gonum.org/v1/gonum/mat/dense_arithmetic.go b/vendor/gonum.org/v1/gonum/mat/dense_arithmetic.go index dd4526f634b..8a36a87f807 100644 --- a/vendor/gonum.org/v1/gonum/mat/dense_arithmetic.go +++ b/vendor/gonum.org/v1/gonum/mat/dense_arithmetic.go @@ -21,13 +21,13 @@ func (m *Dense) Add(a, b Matrix) { panic(ErrShape) } - aU, _ := untranspose(a) - bU, _ := untranspose(b) - m.reuseAs(ar, ac) + aU, _ := untransposeExtract(a) + bU, _ := untransposeExtract(b) + m.reuseAsNonZeroed(ar, ac) - if arm, ok := a.(RawMatrixer); ok { - if brm, ok := b.(RawMatrixer); ok { - amat, bmat := arm.RawMatrix(), brm.RawMatrix() + if arm, ok := a.(*Dense); ok { + if brm, ok := b.(*Dense); ok { + amat, bmat := arm.mat, brm.mat if m != aU { m.checkOverlap(amat) } @@ -70,13 +70,13 @@ func (m *Dense) Sub(a, b Matrix) { panic(ErrShape) } - aU, _ := untranspose(a) - bU, _ := untranspose(b) - m.reuseAs(ar, ac) + aU, _ := untransposeExtract(a) + bU, _ := untransposeExtract(b) + m.reuseAsNonZeroed(ar, ac) - if arm, ok := a.(RawMatrixer); ok { - if brm, ok := b.(RawMatrixer); ok { - amat, bmat := arm.RawMatrix(), brm.RawMatrix() + if arm, ok := a.(*Dense); ok { + if brm, ok := b.(*Dense); ok { + amat, bmat := arm.mat, brm.mat if m != aU { m.checkOverlap(amat) } @@ -120,13 +120,13 @@ func (m *Dense) MulElem(a, b Matrix) { panic(ErrShape) } - aU, _ := untranspose(a) - bU, _ := untranspose(b) - m.reuseAs(ar, ac) + aU, _ := untransposeExtract(a) + bU, _ := untransposeExtract(b) + m.reuseAsNonZeroed(ar, ac) - if arm, ok := a.(RawMatrixer); ok { - if brm, ok := b.(RawMatrixer); ok { - amat, bmat := arm.RawMatrix(), brm.RawMatrix() + if arm, ok := a.(*Dense); ok { + if brm, ok := b.(*Dense); ok { + amat, bmat := arm.mat, brm.mat if m != aU { m.checkOverlap(amat) } @@ -170,13 +170,13 @@ func (m *Dense) DivElem(a, b Matrix) { panic(ErrShape) } - aU, _ := untranspose(a) - bU, _ := untranspose(b) - m.reuseAs(ar, ac) + aU, _ := untransposeExtract(a) + bU, _ := untransposeExtract(b) + m.reuseAsNonZeroed(ar, ac) - if arm, ok := a.(RawMatrixer); ok { - if brm, ok := b.(RawMatrixer); ok { - amat, bmat := arm.RawMatrix(), brm.RawMatrix() + if arm, ok := a.(*Dense); ok { + if brm, ok := b.(*Dense); ok { + amat, bmat := arm.mat, brm.mat if m != aU { m.checkOverlap(amat) } @@ -220,12 +220,12 @@ func (m *Dense) Inverse(a Matrix) error { if r != c { panic(ErrSquare) } - m.reuseAs(a.Dims()) - aU, aTrans := untranspose(a) + m.reuseAsNonZeroed(a.Dims()) + aU, aTrans := untransposeExtract(a) switch rm := aU.(type) { - case RawMatrixer: + case *Dense: if m != aU || aTrans { - if m == aU || m.checkOverlap(rm.RawMatrix()) { + if m == aU || m.checkOverlap(rm.mat) { tmp := getWorkspace(r, c, false) tmp.Copy(a) m.Copy(tmp) @@ -276,9 +276,9 @@ func (m *Dense) Mul(a, b Matrix) { panic(ErrShape) } - aU, aTrans := untranspose(a) - bU, bTrans := untranspose(b) - m.reuseAs(ar, bc) + aU, aTrans := untransposeExtract(a) + bU, bTrans := untransposeExtract(b) + m.reuseAsNonZeroed(ar, bc) var restore func() if m == aU { m, restore = m.isolatedWorkspace(aU) @@ -298,55 +298,52 @@ func (m *Dense) Mul(a, b Matrix) { // Some of the cases do not have a transpose option, so create // temporary memory. - // C = A^T * B = (B^T * A)^T - // C^T = B^T * A. - if aUrm, ok := aU.(RawMatrixer); ok { - amat := aUrm.RawMatrix() + // C = Aᵀ * B = (Bᵀ * A)ᵀ + // Cᵀ = Bᵀ * A. + if aU, ok := aU.(*Dense); ok { if restore == nil { - m.checkOverlap(amat) + m.checkOverlap(aU.mat) } - if bUrm, ok := bU.(RawMatrixer); ok { - bmat := bUrm.RawMatrix() + switch bU := bU.(type) { + case *Dense: if restore == nil { - m.checkOverlap(bmat) + m.checkOverlap(bU.mat) } - blas64.Gemm(aT, bT, 1, amat, bmat, 0, m.mat) + blas64.Gemm(aT, bT, 1, aU.mat, bU.mat, 0, m.mat) return - } - if bU, ok := bU.(RawSymmetricer); ok { - bmat := bU.RawSymmetric() + + case *SymDense: if aTrans { c := getWorkspace(ac, ar, false) - blas64.Symm(blas.Left, 1, bmat, amat, 0, c.mat) + blas64.Symm(blas.Left, 1, bU.mat, aU.mat, 0, c.mat) strictCopy(m, c.T()) putWorkspace(c) return } - blas64.Symm(blas.Right, 1, bmat, amat, 0, m.mat) + blas64.Symm(blas.Right, 1, bU.mat, aU.mat, 0, m.mat) return - } - if bU, ok := bU.(RawTriangular); ok { + + case *TriDense: // Trmm updates in place, so copy aU first. - bmat := bU.RawTriangular() if aTrans { c := getWorkspace(ac, ar, false) var tmp Dense - tmp.SetRawMatrix(amat) + tmp.SetRawMatrix(aU.mat) c.Copy(&tmp) bT := blas.Trans if bTrans { bT = blas.NoTrans } - blas64.Trmm(blas.Left, bT, 1, bmat, c.mat) + blas64.Trmm(blas.Left, bT, 1, bU.mat, c.mat) strictCopy(m, c.T()) putWorkspace(c) return } m.Copy(a) - blas64.Trmm(blas.Right, bT, 1, bmat, m.mat) + blas64.Trmm(blas.Right, bT, 1, bU.mat, m.mat) return - } - if bU, ok := bU.(*VecDense); ok { + + case *VecDense: m.checkOverlap(bU.asGeneral()) bvec := bU.RawVector() if bTrans { @@ -358,56 +355,54 @@ func (m *Dense) Mul(a, b Matrix) { Stride: bvec.Inc, Data: bvec.Data, } - blas64.Gemm(aT, bT, 1, amat, bmat, 0, m.mat) + blas64.Gemm(aT, bT, 1, aU.mat, bmat, 0, m.mat) return } cvec := blas64.Vector{ Inc: m.mat.Stride, Data: m.mat.Data, } - blas64.Gemv(aT, 1, amat, bvec, 0, cvec) + blas64.Gemv(aT, 1, aU.mat, bvec, 0, cvec) return } } - if bUrm, ok := bU.(RawMatrixer); ok { - bmat := bUrm.RawMatrix() + if bU, ok := bU.(*Dense); ok { if restore == nil { - m.checkOverlap(bmat) + m.checkOverlap(bU.mat) } - if aU, ok := aU.(RawSymmetricer); ok { - amat := aU.RawSymmetric() + switch aU := aU.(type) { + case *SymDense: if bTrans { c := getWorkspace(bc, br, false) - blas64.Symm(blas.Right, 1, amat, bmat, 0, c.mat) + blas64.Symm(blas.Right, 1, aU.mat, bU.mat, 0, c.mat) strictCopy(m, c.T()) putWorkspace(c) return } - blas64.Symm(blas.Left, 1, amat, bmat, 0, m.mat) + blas64.Symm(blas.Left, 1, aU.mat, bU.mat, 0, m.mat) return - } - if aU, ok := aU.(RawTriangular); ok { + + case *TriDense: // Trmm updates in place, so copy bU first. - amat := aU.RawTriangular() if bTrans { c := getWorkspace(bc, br, false) var tmp Dense - tmp.SetRawMatrix(bmat) + tmp.SetRawMatrix(bU.mat) c.Copy(&tmp) aT := blas.Trans if aTrans { aT = blas.NoTrans } - blas64.Trmm(blas.Right, aT, 1, amat, c.mat) + blas64.Trmm(blas.Right, aT, 1, aU.mat, c.mat) strictCopy(m, c.T()) putWorkspace(c) return } m.Copy(b) - blas64.Trmm(blas.Left, aT, 1, amat, m.mat) + blas64.Trmm(blas.Left, aT, 1, aU.mat, m.mat) return - } - if aU, ok := aU.(*VecDense); ok { + + case *VecDense: m.checkOverlap(aU.asGeneral()) avec := aU.RawVector() if aTrans { @@ -421,7 +416,7 @@ func (m *Dense) Mul(a, b Matrix) { if bTrans { bT = blas.NoTrans } - blas64.Gemv(bT, 1, bmat, avec, 0, cvec) + blas64.Gemv(bT, 1, bU.mat, avec, 0, cvec) return } // {ar,1} x {1,bc} which is not a vector result. @@ -432,7 +427,7 @@ func (m *Dense) Mul(a, b Matrix) { Stride: avec.Inc, Data: avec.Data, } - blas64.Gemm(aT, bT, 1, amat, bmat, 0, m.mat) + blas64.Gemm(aT, bT, 1, amat, bU.mat, 0, m.mat) return } } @@ -476,7 +471,7 @@ func (m *Dense) Exp(a Matrix) { panic(ErrShape) } - m.reuseAs(r, r) + m.reuseAsNonZeroed(r, r) if r == 1 { m.mat.Data[0] = math.Exp(a.At(0, 0)) return @@ -631,14 +626,14 @@ func (m *Dense) Exp(a Matrix) { // in the receiver. Pow will panic if n is negative or if a is not square. func (m *Dense) Pow(a Matrix, n int) { if n < 0 { - panic("matrix: illegal power") + panic("mat: illegal power") } r, c := a.Dims() if r != c { panic(ErrShape) } - m.reuseAs(r, c) + m.reuseAsNonZeroed(r, c) // Take possible fast paths. switch n { @@ -684,11 +679,11 @@ func (m *Dense) Pow(a Matrix, n int) { func (m *Dense) Scale(f float64, a Matrix) { ar, ac := a.Dims() - m.reuseAs(ar, ac) + m.reuseAsNonZeroed(ar, ac) - aU, aTrans := untranspose(a) - if rm, ok := aU.(RawMatrixer); ok { - amat := rm.RawMatrix() + aU, aTrans := untransposeExtract(a) + if rm, ok := aU.(*Dense); ok { + amat := rm.mat if m == aU || m.checkOverlap(amat) { var restore func() m, restore = m.isolatedWorkspace(a) @@ -724,11 +719,11 @@ func (m *Dense) Scale(f float64, a Matrix) { func (m *Dense) Apply(fn func(i, j int, v float64) float64, a Matrix) { ar, ac := a.Dims() - m.reuseAs(ar, ac) + m.reuseAsNonZeroed(ar, ac) - aU, aTrans := untranspose(a) - if rm, ok := aU.(RawMatrixer); ok { - amat := rm.RawMatrix() + aU, aTrans := untransposeExtract(a) + if rm, ok := aU.(*Dense); ok { + amat := rm.mat if m == aU || m.checkOverlap(amat) { var restore func() m, restore = m.isolatedWorkspace(a) @@ -758,54 +753,55 @@ func (m *Dense) Apply(fn func(i, j int, v float64) float64, a Matrix) { } } -// RankOne performs a rank-one update to the matrix a and stores the result -// in the receiver. If a is zero, see Outer. -// m = a + alpha * x * y' +// RankOne performs a rank-one update to the matrix a with the vectors x and +// y, where x and y are treated as column vectors. The result is stored in the +// receiver. The Outer method can be used instead of RankOne if a is not needed. +// m = a + alpha * x * yᵀ func (m *Dense) RankOne(a Matrix, alpha float64, x, y Vector) { ar, ac := a.Dims() - xr, xc := x.Dims() - if xr != ar || xc != 1 { + if x.Len() != ar { panic(ErrShape) } - yr, yc := y.Dims() - if yr != ac || yc != 1 { + if y.Len() != ac { panic(ErrShape) } if a != m { - aU, _ := untranspose(a) - if rm, ok := aU.(RawMatrixer); ok { + aU, _ := untransposeExtract(a) + if rm, ok := aU.(*Dense); ok { m.checkOverlap(rm.RawMatrix()) } } var xmat, ymat blas64.Vector fast := true - xU, _ := untranspose(x) - if rv, ok := xU.(RawVectorer); ok { - xmat = rv.RawVector() - m.checkOverlap((&VecDense{mat: xmat}).asGeneral()) + xU, _ := untransposeExtract(x) + if rv, ok := xU.(*VecDense); ok { + r, c := xU.Dims() + xmat = rv.mat + m.checkOverlap(generalFromVector(xmat, r, c)) } else { fast = false } - yU, _ := untranspose(y) - if rv, ok := yU.(RawVectorer); ok { - ymat = rv.RawVector() - m.checkOverlap((&VecDense{mat: ymat}).asGeneral()) + yU, _ := untransposeExtract(y) + if rv, ok := yU.(*VecDense); ok { + r, c := yU.Dims() + ymat = rv.mat + m.checkOverlap(generalFromVector(ymat, r, c)) } else { fast = false } if fast { if m != a { - m.reuseAs(ar, ac) + m.reuseAsNonZeroed(ar, ac) m.Copy(a) } blas64.Ger(alpha, xmat, ymat, m.mat) return } - m.reuseAs(ar, ac) + m.reuseAsNonZeroed(ar, ac) for i := 0; i < ar; i++ { for j := 0; j < ac; j++ { m.set(i, j, a.At(i, j)+alpha*x.AtVec(i)*y.AtVec(j)) @@ -813,59 +809,30 @@ func (m *Dense) RankOne(a Matrix, alpha float64, x, y Vector) { } } -// Outer calculates the outer product of the column vectors x and y, -// and stores the result in the receiver. -// m = alpha * x * y' +// Outer calculates the outer product of the vectors x and y, where x and y +// are treated as column vectors, and stores the result in the receiver. +// m = alpha * x * yᵀ // In order to update an existing matrix, see RankOne. func (m *Dense) Outer(alpha float64, x, y Vector) { - xr, xc := x.Dims() - if xc != 1 { - panic(ErrShape) - } - yr, yc := y.Dims() - if yc != 1 { - panic(ErrShape) - } + r, c := x.Len(), y.Len() - r := xr - c := yr - - // Copied from reuseAs with use replaced by useZeroed - // and a final zero of the matrix elements if we pass - // the shape checks. - // TODO(kortschak): Factor out into reuseZeroedAs if - // we find another case that needs it. - if m.mat.Rows > m.capRows || m.mat.Cols > m.capCols { - // Panic as a string, not a mat.Error. - panic("mat: caps not correctly set") - } - if m.IsZero() { - m.mat = blas64.General{ - Rows: r, - Cols: c, - Stride: c, - Data: useZeroed(m.mat.Data, r*c), - } - m.capRows = r - m.capCols = c - } else if r != m.mat.Rows || c != m.mat.Cols { - panic(ErrShape) - } + m.reuseAsZeroed(r, c) var xmat, ymat blas64.Vector fast := true - xU, _ := untranspose(x) - if rv, ok := xU.(RawVectorer); ok { - xmat = rv.RawVector() - m.checkOverlap((&VecDense{mat: xmat}).asGeneral()) - + xU, _ := untransposeExtract(x) + if rv, ok := xU.(*VecDense); ok { + r, c := xU.Dims() + xmat = rv.mat + m.checkOverlap(generalFromVector(xmat, r, c)) } else { fast = false } - yU, _ := untranspose(y) - if rv, ok := yU.(RawVectorer); ok { - ymat = rv.RawVector() - m.checkOverlap((&VecDense{mat: ymat}).asGeneral()) + yU, _ := untransposeExtract(y) + if rv, ok := yU.(*VecDense); ok { + r, c := yU.Dims() + ymat = rv.mat + m.checkOverlap(generalFromVector(ymat, r, c)) } else { fast = false } diff --git a/vendor/gonum.org/v1/gonum/mat/diagonal.go b/vendor/gonum.org/v1/gonum/mat/diagonal.go index e9f074a7fb3..f3357d6b616 100644 --- a/vendor/gonum.org/v1/gonum/mat/diagonal.go +++ b/vendor/gonum.org/v1/gonum/mat/diagonal.go @@ -12,6 +12,8 @@ import ( var ( diagDense *DiagDense _ Matrix = diagDense + _ allMatrix = diagDense + _ denseMatrix = diagDense _ Diagonal = diagDense _ MutableDiagonal = diagDense _ Triangular = diagDense @@ -156,9 +158,10 @@ func (d *DiagDense) TriBand() (n, k int, kind TriKind) { return d.mat.N, 0, Upper } -// Reset zeros the length of the matrix so that it can be reused as the +// Reset empties the matrix so that it can be reused as the // receiver of a dimensionally restricted operation. // +// Reset should not be used when the matrix shares backing data. // See the Reseter interface for more information. func (d *DiagDense) Reset() { // No change of Inc or n to 0 may be @@ -181,10 +184,10 @@ func (d *DiagDense) DiagView() Diagonal { } // DiagFrom copies the diagonal of m into the receiver. The receiver must -// be min(r, c) long or zero. Otherwise DiagFrom will panic. +// be min(r, c) long or empty, otherwise DiagFrom will panic. func (d *DiagDense) DiagFrom(m Matrix) { n := min(m.Dims()) - d.reuseAs(n) + d.reuseAsNonZeroed(n) var vec blas64.Vector switch r := m.(type) { @@ -283,13 +286,13 @@ func (d *DiagDense) RawSymBand() blas64.SymmetricBand { } } -// reuseAs resizes an empty diagonal to a r×r diagonal, +// reuseAsNonZeroed resizes an empty diagonal to a r×r diagonal, // or checks that a non-empty matrix is r×r. -func (d *DiagDense) reuseAs(r int) { +func (d *DiagDense) reuseAsNonZeroed(r int) { if r == 0 { panic(ErrZeroLength) } - if d.IsZero() { + if d.IsEmpty() { d.mat = blas64.Vector{ Inc: 1, Data: use(d.mat.Data, r), @@ -302,10 +305,22 @@ func (d *DiagDense) reuseAs(r int) { } } -// IsZero returns whether the receiver is zero-sized. Zero-sized vectors can be the -// receiver for size-restricted operations. DiagDenses can be zeroed using Reset. -func (d *DiagDense) IsZero() bool { +// IsEmpty returns whether the receiver is empty. Empty matrices can be the +// receiver for size-restricted operations. The receiver can be emptied using +// Reset. +func (d *DiagDense) IsEmpty() bool { // It must be the case that d.Dims() returns // zeros in this case. See comment in Reset(). return d.mat.Inc == 0 } + +// Trace returns the trace. +func (d *DiagDense) Trace() float64 { + rb := d.RawBand() + var tr float64 + for i := 0; i < rb.Rows; i++ { + tr += rb.Data[rb.KL+i*rb.Stride] + } + return tr + +} diff --git a/vendor/gonum.org/v1/gonum/mat/doc.go b/vendor/gonum.org/v1/gonum/mat/doc.go index 2cc91001591..6d8e873d6b5 100644 --- a/vendor/gonum.org/v1/gonum/mat/doc.go +++ b/vendor/gonum.org/v1/gonum/mat/doc.go @@ -16,13 +16,16 @@ // - Methods and functions for using matrix data (Add, Trace, SymRankOne) // - Types for constructing and using matrix factorizations (QR, LU) // - The complementary types for complex matrices, CMatrix, CSymDense, etc. +// In the documentation below, we use "matrix" as a short-hand for all of +// the FooDense types implemented in this package. We use "Matrix" to +// refer to the Matrix interface. // // A matrix may be constructed through the corresponding New function. If no // backing array is provided the matrix will be initialized to all zeros. // // Allocate a zeroed real matrix of size 3×5 // zero := mat.NewDense(3, 5, nil) // If a backing data slice is provided, the matrix will have those elements. -// Matrices are all stored in row-major format. +// All matrices are all stored in row-major format. // // Generate a 6×6 matrix of random values. // data := make([]float64, 36) // for i := range data { @@ -34,24 +37,29 @@ // tr := mat.Trace(a) // and are implemented as methods when the operation modifies the receiver. // zero.Copy(a) +// Note that the input arguments to most functions and methods are interfaces +// rather than concrete types `func Trace(Matrix)` rather than +// `func Trace(*Dense)` allowing flexible use of internal and external +// Matrix types. // -// Receivers must be the correct size for the matrix operations, otherwise the -// operation will panic. As a special case for convenience, a zero-value matrix -// will be modified to have the correct size, allocating data if necessary. -// var c mat.Dense // construct a new zero-sized matrix -// c.Mul(a, a) // c is automatically adjusted to be 6×6 +// When a matrix is the destination or receiver for a function or method, +// the operation will panic if the matrix is not the correct size. +// An exception is if that destination is empty (see below). // -// Zero-value of a matrix +// Empty matrix // -// A zero-value matrix is either the Go language definition of a zero-value or -// is a zero-sized matrix with zero-length stride. Matrix implementations may have -// a Reset method to revert the receiver into a zero-valued matrix and an IsZero -// method that returns whether the matrix is zero-valued. -// So the following will all result in a zero-value matrix. -// - var a mat.Dense -// - a := NewDense(0, 0, make([]float64, 0, 100)) -// - a.Reset() -// A zero-value matrix can not be sliced even if it does have an adequately sized +// An empty matrix is one that has zero size. Empty matrices are used to allow +// the destination of a matrix operation to assume the correct size automatically. +// This operation will re-use the backing data, if available, or will allocate +// new data if necessary. The IsEmpty method returns whether the given matrix +// is empty. The zero-value of a matrix is empty, and is useful for easily +// getting the result of matrix operations. +// var c mat.Dense // construct a new zero-value matrix +// c.Mul(a, a) // c is automatically adjusted to be the right size +// The Reset method can be used to revert a matrix to an empty matrix. +// Reset should not be used when multiple different matrices share the same backing +// data slice. This can cause unexpected data modifications after being resized. +// An empty matrix can not be sliced even if it does have an adequately sized // backing data slice, but can be expanded using its Grow method if it exists. // // The Matrix Interfaces @@ -60,12 +68,12 @@ // matrices, The Matrix interface is defined by three functions: Dims, which // returns the dimensions of the Matrix, At, which returns the element in the // specified location, and T for returning a Transpose (discussed later). All of -// the concrete types can perform these behaviors and so implement the interface. +// the matrix types can perform these behaviors and so implement the interface. // Methods and functions are designed to use this interface, so in particular the method // func (m *Dense) Mul(a, b Matrix) // constructs a *Dense from the result of a multiplication with any Matrix types, -// not just *Dense. Where more restrictive requirements must be met, there are also the -// Symmetric and Triangular interfaces. For example, in +// not just *Dense. Where more restrictive requirements must be met, there are also +// additional interfaces like Symmetric and Triangular. For example, in // func (s *SymDense) AddSym(a, b Symmetric) // the Symmetric interface guarantees a symmetric result. // @@ -77,7 +85,7 @@ // // The T method is used for transposition on real matrices, and H is used for // conjugate transposition on complex matrices. For example, c.Mul(a.T(), b) computes -// c = a^T * b. The mat types implement this method implicitly — +// c = aᵀ * b. The mat types implement this method implicitly — // see the Transpose and Conjugate types for more details. Note that some // operations have a transpose as part of their definition, as in *SymDense.SymOuterK. // @@ -126,7 +134,8 @@ // Invariants // // Matrix input arguments to functions are never directly modified. If an operation -// changes Matrix data, the mutated matrix will be the receiver of a function. +// changes Matrix data, the mutated matrix will be the receiver of a method, or +// will be the first argument to a method or function. // // For convenience, a matrix may be used as both a receiver and as an input, e.g. // a.Pow(a, 6) diff --git a/vendor/gonum.org/v1/gonum/mat/eigen.go b/vendor/gonum.org/v1/gonum/mat/eigen.go index ee971e4ae48..caa208e9d64 100644 --- a/vendor/gonum.org/v1/gonum/mat/eigen.go +++ b/vendor/gonum.org/v1/gonum/mat/eigen.go @@ -91,14 +91,14 @@ func (e *EigenSym) Values(dst []float64) []float64 { return dst } -// VectorsTo returns the eigenvectors of the decomposition. VectorsTo -// will panic if the eigenvectors were not computed during the factorization, -// or if the factorization was not successful. +// VectorsTo stores the eigenvectors of the decomposition into the columns of +// dst. // -// If dst is not nil, the eigenvectors are stored in-place into dst, and dst -// must have size n×n and panics otherwise. If dst is nil, a new matrix -// is allocated and returned. -func (e *EigenSym) VectorsTo(dst *Dense) *Dense { +// If dst is empty, VectorsTo will resize dst to be n×n. When dst is +// non-empty, VectorsTo will panic if dst is not n×n. VectorsTo will also +// panic if the eigenvectors were not computed during the factorization, +// or if the receiver does not contain a successful factorization. +func (e *EigenSym) VectorsTo(dst *Dense) { if !e.succFact() { panic(badFact) } @@ -106,13 +106,15 @@ func (e *EigenSym) VectorsTo(dst *Dense) *Dense { panic(badNoVect) } r, c := e.vectors.Dims() - if dst == nil { - dst = NewDense(r, c, nil) + if dst.IsEmpty() { + dst.ReuseAs(r, c) } else { - dst.reuseAs(r, c) + r2, c2 := dst.Dims() + if r != r2 || c != c2 { + panic(ErrShape) + } } dst.Copy(e.vectors) - return dst } // EigenKind specifies the computation of eigenvectors during factorization. @@ -176,7 +178,7 @@ func (e *Eigen) Factorize(a Matrix, kind EigenKind) (ok bool) { panic(ErrShape) } var sd Dense - sd.Clone(a) + sd.CloneFrom(a) left := kind&EigenLeft != 0 right := kind&EigenRight != 0 @@ -305,46 +307,54 @@ func (e *Eigen) complexEigenTo(dst *CDense, d *Dense) { } } -// VectorsTo returns the right eigenvectors of the decomposition. VectorsTo -// will panic if the right eigenvectors were not computed during the factorization, -// or if the factorization was not successful. +// VectorsTo stores the right eigenvectors of the decomposition into the columns +// of dst. The computed eigenvectors are normalized to have Euclidean norm equal +// to 1 and largest component real. // -// The computed eigenvectors are normalized to have Euclidean norm equal to 1 -// and largest component real. -func (e *Eigen) VectorsTo(dst *CDense) *CDense { +// If dst is empty, VectorsTo will resize dst to be n×n. When dst is +// non-empty, VectorsTo will panic if dst is not n×n. VectorsTo will also +// panic if the eigenvectors were not computed during the factorization, +// or if the receiver does not contain a successful factorization. +func (e *Eigen) VectorsTo(dst *CDense) { if !e.succFact() { panic(badFact) } if e.kind&EigenRight == 0 { panic(badNoVect) } - if dst == nil { - dst = NewCDense(e.n, e.n, nil) + if dst.IsEmpty() { + dst.ReuseAs(e.n, e.n) } else { - dst.reuseAs(e.n, e.n) + r, c := dst.Dims() + if r != e.n || c != e.n { + panic(ErrShape) + } } dst.Copy(e.rVectors) - return dst } -// LeftVectorsTo returns the left eigenvectors of the decomposition. LeftVectorsTo -// will panic if the left eigenvectors were not computed during the factorization, -// or if the factorization was not successful. +// LeftVectorsTo stores the left eigenvectors of the decomposition into the +// columns of dst. The computed eigenvectors are normalized to have Euclidean +// norm equal to 1 and largest component real. // -// The computed eigenvectors are normalized to have Euclidean norm equal to 1 -// and largest component real. -func (e *Eigen) LeftVectorsTo(dst *CDense) *CDense { +// If dst is empty, LeftVectorsTo will resize dst to be n×n. When dst is +// non-empty, LeftVectorsTo will panic if dst is not n×n. LeftVectorsTo will also +// panic if the left eigenvectors were not computed during the factorization, +// or if the receiver does not contain a successful factorization +func (e *Eigen) LeftVectorsTo(dst *CDense) { if !e.succFact() { panic(badFact) } if e.kind&EigenLeft == 0 { panic(badNoVect) } - if dst == nil { - dst = NewCDense(e.n, e.n, nil) + if dst.IsEmpty() { + dst.ReuseAs(e.n, e.n) } else { - dst.reuseAs(e.n, e.n) + r, c := dst.Dims() + if r != e.n || c != e.n { + panic(ErrShape) + } } dst.Copy(e.lVectors) - return dst } diff --git a/vendor/gonum.org/v1/gonum/mat/errors.go b/vendor/gonum.org/v1/gonum/mat/errors.go index 0430d126f2a..8609f7ceb17 100644 --- a/vendor/gonum.org/v1/gonum/mat/errors.go +++ b/vendor/gonum.org/v1/gonum/mat/errors.go @@ -37,7 +37,7 @@ const ( // in the matrix packages. CondNorm = lapack.MaxRowSum - // CondNormTrans is the norm used to compute on A^T to get the same result as + // CondNormTrans is the norm used to compute on Aᵀ to get the same result as // computing CondNorm on A. CondNormTrans = lapack.MaxColumnSum ) @@ -114,26 +114,28 @@ type Error struct{ string } func (err Error) Error() string { return err.string } var ( - ErrIndexOutOfRange = Error{"matrix: index out of range"} - ErrRowAccess = Error{"matrix: row index out of range"} - ErrColAccess = Error{"matrix: column index out of range"} - ErrVectorAccess = Error{"matrix: vector index out of range"} - ErrZeroLength = Error{"matrix: zero length in matrix dimension"} - ErrRowLength = Error{"matrix: row length mismatch"} - ErrColLength = Error{"matrix: col length mismatch"} - ErrSquare = Error{"matrix: expect square matrix"} - ErrNormOrder = Error{"matrix: invalid norm order for matrix"} - ErrSingular = Error{"matrix: matrix is singular"} - ErrShape = Error{"matrix: dimension mismatch"} - ErrIllegalStride = Error{"matrix: illegal stride"} - ErrPivot = Error{"matrix: malformed pivot list"} - ErrTriangle = Error{"matrix: triangular storage mismatch"} - ErrTriangleSet = Error{"matrix: triangular set out of bounds"} - ErrBandSet = Error{"matrix: band set out of bounds"} - ErrDiagSet = Error{"matrix: diagonal set out of bounds"} - ErrSliceLengthMismatch = Error{"matrix: input slice length mismatch"} - ErrNotPSD = Error{"matrix: input not positive symmetric definite"} - ErrFailedEigen = Error{"matrix: eigendecomposition not successful"} + ErrNegativeDimension = Error{"mat: negative dimension"} + ErrIndexOutOfRange = Error{"mat: index out of range"} + ErrReuseNonEmpty = Error{"mat: reuse of non-empty matrix"} + ErrRowAccess = Error{"mat: row index out of range"} + ErrColAccess = Error{"mat: column index out of range"} + ErrVectorAccess = Error{"mat: vector index out of range"} + ErrZeroLength = Error{"mat: zero length in matrix dimension"} + ErrRowLength = Error{"mat: row length mismatch"} + ErrColLength = Error{"mat: col length mismatch"} + ErrSquare = Error{"mat: expect square matrix"} + ErrNormOrder = Error{"mat: invalid norm order for matrix"} + ErrSingular = Error{"mat: matrix is singular"} + ErrShape = Error{"mat: dimension mismatch"} + ErrIllegalStride = Error{"mat: illegal stride"} + ErrPivot = Error{"mat: malformed pivot list"} + ErrTriangle = Error{"mat: triangular storage mismatch"} + ErrTriangleSet = Error{"mat: triangular set out of bounds"} + ErrBandSet = Error{"mat: band set out of bounds"} + ErrDiagSet = Error{"mat: diagonal set out of bounds"} + ErrSliceLengthMismatch = Error{"mat: input slice length mismatch"} + ErrNotPSD = Error{"mat: input not positive symmetric definite"} + ErrFailedEigen = Error{"mat: eigendecomposition not successful"} ) // ErrorStack represents matrix handling errors that have been recovered by Maybe wrappers. diff --git a/vendor/gonum.org/v1/gonum/mat/gsvd.go b/vendor/gonum.org/v1/gonum/mat/gsvd.go index 2de511a9feb..e694542013b 100644 --- a/vendor/gonum.org/v1/gonum/mat/gsvd.go +++ b/vendor/gonum.org/v1/gonum/mat/gsvd.go @@ -62,12 +62,12 @@ func (gsvd *GSVD) succFact() bool { // input kind. // // The full singular value decomposition (kind == GSVDAll) deconstructs A and B as -// A = U * Σ₁ * [ 0 R ] * Q^T +// A = U * Σ₁ * [ 0 R ] * Qᵀ // -// B = V * Σ₂ * [ 0 R ] * Q^T +// B = V * Σ₂ * [ 0 R ] * Qᵀ // where Σ₁ and Σ₂ are r×(k+l) and p×(k+l) diagonal matrices of singular values, and // U, V and Q are r×r, p×p and c×c orthogonal matrices of singular vectors. k+l is the -// effective numerical rank of the matrix [ A^T B^T ]^T. +// effective numerical rank of the matrix [ Aᵀ Bᵀ ]ᵀ. // // It is frequently not necessary to compute the full GSVD. Computation time and // storage costs can be reduced using the appropriate kind. Either only the singular @@ -156,7 +156,7 @@ func (gsvd *GSVD) Kind() GSVDKind { return gsvd.kind } -// Rank returns the k and l terms of the rank of [ A^T B^T ]^T. +// Rank returns the k and l terms of the rank of [ Aᵀ Bᵀ ]ᵀ. func (gsvd *GSVD) Rank() (k, l int) { return gsvd.k, gsvd.l } @@ -236,12 +236,13 @@ func (gsvd *GSVD) ValuesB(s []float64) []float64 { return s } -// ZeroRTo extracts the matrix [ 0 R ] from the singular value decomposition, storing -// the result in-place into dst. [ 0 R ] is size (k+l)×c. -// If dst is nil, a new matrix is allocated. The resulting ZeroR matrix is returned. +// ZeroRTo extracts the matrix [ 0 R ] from the singular value decomposition, +// storing the result into dst. [ 0 R ] is of size (k+l)×c. // -// ZeroRTo will panic if the receiver does not contain a successful factorization. -func (gsvd *GSVD) ZeroRTo(dst *Dense) *Dense { +// If dst is empty, ZeroRTo will resize dst to be (k+l)×c. When dst is +// non-empty, ZeroRTo will panic if dst is not (k+l)×c. ZeroRTo will also panic +// if the receiver does not contain a successful factorization. +func (gsvd *GSVD) ZeroRTo(dst *Dense) { if !gsvd.succFact() { panic(badFact) } @@ -250,10 +251,14 @@ func (gsvd *GSVD) ZeroRTo(dst *Dense) *Dense { k := gsvd.k l := gsvd.l h := min(k+l, r) - if dst == nil { - dst = NewDense(k+l, c, nil) + if dst.IsEmpty() { + dst.ReuseAs(k+l, c) } else { - dst.reuseAsZeroed(k+l, c) + r2, c2 := dst.Dims() + if r2 != k+l || c != c2 { + panic(ErrShape) + } + dst.Zero() } a := Dense{ mat: gsvd.a, @@ -271,25 +276,29 @@ func (gsvd *GSVD) ZeroRTo(dst *Dense) *Dense { dst.Slice(r, k+l, c+r-k-l, c).(*Dense). Copy(b.Slice(r-k, l, c+r-k-l, c)) } - return dst } // SigmaATo extracts the matrix Σ₁ from the singular value decomposition, storing -// the result in-place into dst. Σ₁ is size r×(k+l). -// If dst is nil, a new matrix is allocated. The resulting SigmaA matrix is returned. +// the result into dst. Σ₁ is size r×(k+l). // -// SigmaATo will panic if the receiver does not contain a successful factorization. -func (gsvd *GSVD) SigmaATo(dst *Dense) *Dense { +// If dst is empty, SigmaATo will resize dst to be r×(k+l). When dst is +// non-empty, SigmATo will panic if dst is not r×(k+l). SigmaATo will also +// panic if the receiver does not contain a successful factorization. +func (gsvd *GSVD) SigmaATo(dst *Dense) { if !gsvd.succFact() { panic(badFact) } r := gsvd.r k := gsvd.k l := gsvd.l - if dst == nil { - dst = NewDense(r, k+l, nil) + if dst.IsEmpty() { + dst.ReuseAs(r, k+l) } else { - dst.reuseAsZeroed(r, k+l) + r2, c := dst.Dims() + if r2 != r || c != k+l { + panic(ErrShape) + } + dst.Zero() } for i := 0; i < k; i++ { dst.set(i, i, 1) @@ -297,15 +306,15 @@ func (gsvd *GSVD) SigmaATo(dst *Dense) *Dense { for i := k; i < min(r, k+l); i++ { dst.set(i, i, gsvd.s1[i]) } - return dst } // SigmaBTo extracts the matrix Σ₂ from the singular value decomposition, storing -// the result in-place into dst. Σ₂ is size p×(k+l). -// If dst is nil, a new matrix is allocated. The resulting SigmaB matrix is returned. +// the result into dst. Σ₂ is size p×(k+l). // -// SigmaBTo will panic if the receiver does not contain a successful factorization. -func (gsvd *GSVD) SigmaBTo(dst *Dense) *Dense { +// If dst is empty, SigmaBTo will resize dst to be p×(k+l). When dst is +// non-empty, SigmBTo will panic if dst is not p×(k+l). SigmaBTo will also +// panic if the receiver does not contain a successful factorization. +func (gsvd *GSVD) SigmaBTo(dst *Dense) { if !gsvd.succFact() { panic(badFact) } @@ -313,10 +322,14 @@ func (gsvd *GSVD) SigmaBTo(dst *Dense) *Dense { p := gsvd.p k := gsvd.k l := gsvd.l - if dst == nil { - dst = NewDense(p, k+l, nil) + if dst.IsEmpty() { + dst.ReuseAs(p, k+l) } else { - dst.reuseAsZeroed(p, k+l) + r, c := dst.Dims() + if r != p || c != k+l { + panic(ErrShape) + } + dst.Zero() } for i := 0; i < min(l, r-k); i++ { dst.set(i, i+k, gsvd.s2[k+i]) @@ -324,15 +337,15 @@ func (gsvd *GSVD) SigmaBTo(dst *Dense) *Dense { for i := r - k; i < l; i++ { dst.set(i, i+k, 1) } - return dst } // UTo extracts the matrix U from the singular value decomposition, storing -// the result in-place into dst. U is size r×r. -// If dst is nil, a new matrix is allocated. The resulting U matrix is returned. +// the result into dst. U is size r×r. // -// UTo will panic if the receiver does not contain a successful factorization. -func (gsvd *GSVD) UTo(dst *Dense) *Dense { +// If dst is empty, UTo will resize dst to be r×r. When dst is +// non-empty, UTo will panic if dst is not r×r. UTo will also +// panic if the receiver does not contain a successful factorization. +func (gsvd *GSVD) UTo(dst *Dense) { if !gsvd.succFact() { panic(badFact) } @@ -341,10 +354,13 @@ func (gsvd *GSVD) UTo(dst *Dense) *Dense { } r := gsvd.u.Rows c := gsvd.u.Cols - if dst == nil { - dst = NewDense(r, c, nil) + if dst.IsEmpty() { + dst.ReuseAs(r, c) } else { - dst.reuseAs(r, c) + r2, c2 := dst.Dims() + if r != r2 || c != c2 { + panic(ErrShape) + } } tmp := &Dense{ @@ -353,15 +369,15 @@ func (gsvd *GSVD) UTo(dst *Dense) *Dense { capCols: c, } dst.Copy(tmp) - return dst } // VTo extracts the matrix V from the singular value decomposition, storing -// the result in-place into dst. V is size p×p. -// If dst is nil, a new matrix is allocated. The resulting V matrix is returned. +// the result into dst. V is size p×p. // -// VTo will panic if the receiver does not contain a successful factorization. -func (gsvd *GSVD) VTo(dst *Dense) *Dense { +// If dst is empty, VTo will resize dst to be p×p. When dst is +// non-empty, VTo will panic if dst is not p×p. VTo will also +// panic if the receiver does not contain a successful factorization. +func (gsvd *GSVD) VTo(dst *Dense) { if !gsvd.succFact() { panic(badFact) } @@ -370,10 +386,13 @@ func (gsvd *GSVD) VTo(dst *Dense) *Dense { } r := gsvd.v.Rows c := gsvd.v.Cols - if dst == nil { - dst = NewDense(r, c, nil) + if dst.IsEmpty() { + dst.ReuseAs(r, c) } else { - dst.reuseAs(r, c) + r2, c2 := dst.Dims() + if r != r2 || c != c2 { + panic(ErrShape) + } } tmp := &Dense{ @@ -382,15 +401,15 @@ func (gsvd *GSVD) VTo(dst *Dense) *Dense { capCols: c, } dst.Copy(tmp) - return dst } // QTo extracts the matrix Q from the singular value decomposition, storing -// the result in-place into dst. Q is size c×c. -// If dst is nil, a new matrix is allocated. The resulting Q matrix is returned. +// the result into dst. Q is size c×c. // -// QTo will panic if the receiver does not contain a successful factorization. -func (gsvd *GSVD) QTo(dst *Dense) *Dense { +// If dst is empty, QTo will resize dst to be c×c. When dst is +// non-empty, QTo will panic if dst is not c×c. QTo will also +// panic if the receiver does not contain a successful factorization. +func (gsvd *GSVD) QTo(dst *Dense) { if !gsvd.succFact() { panic(badFact) } @@ -399,10 +418,13 @@ func (gsvd *GSVD) QTo(dst *Dense) *Dense { } r := gsvd.q.Rows c := gsvd.q.Cols - if dst == nil { - dst = NewDense(r, c, nil) + if dst.IsEmpty() { + dst.ReuseAs(r, c) } else { - dst.reuseAs(r, c) + r2, c2 := dst.Dims() + if r != r2 || c != c2 { + panic(ErrShape) + } } tmp := &Dense{ @@ -411,5 +433,4 @@ func (gsvd *GSVD) QTo(dst *Dense) *Dense { capCols: c, } dst.Copy(tmp) - return dst } diff --git a/vendor/gonum.org/v1/gonum/mat/hogsvd.go b/vendor/gonum.org/v1/gonum/mat/hogsvd.go index bd843e6b36f..23777b9c175 100644 --- a/vendor/gonum.org/v1/gonum/mat/hogsvd.go +++ b/vendor/gonum.org/v1/gonum/mat/hogsvd.go @@ -33,12 +33,12 @@ func (gsvd *HOGSVD) succFact() bool { // of the n input r_i×c column tall matrices in m. HOGSV extends the GSVD case from 2 to n // input matrices. // -// M_0 = U_0 * Σ_0 * V^T -// M_1 = U_1 * Σ_1 * V^T +// M_0 = U_0 * Σ_0 * Vᵀ +// M_1 = U_1 * Σ_1 * Vᵀ // . // . // . -// M_{n-1} = U_{n-1} * Σ_{n-1} * V^T +// M_{n-1} = U_{n-1} * Σ_{n-1} * Vᵀ // // where U_i are r_i×c matrices of singular vectors, Σ are c×c matrices singular values, and V // is a c×c matrix of singular vectors. @@ -106,7 +106,8 @@ func (gsvd *HOGSVD) Factorize(m ...Matrix) (ok bool) { gsvd.err = errors.New("hogsvd: eigen decomposition failed") return false } - vc := eig.VectorsTo(nil) + var vc CDense + eig.VectorsTo(&vc) // vc is guaranteed to have real eigenvalues. rc, cc := vc.Dims() v := NewDense(rc, cc, nil) @@ -128,7 +129,7 @@ func (gsvd *HOGSVD) Factorize(m ...Matrix) (ok bool) { biT := getWorkspace(c, r, false) defer putWorkspace(biT) for i, d := range m { - // All calls to reset will leave a zeroed + // All calls to reset will leave an emptied // matrix with capacity to store the result // without additional allocation. biT.Reset() @@ -136,7 +137,7 @@ func (gsvd *HOGSVD) Factorize(m ...Matrix) (ok bool) { if gsvd.err != nil { return false } - b[i].Clone(biT.T()) + b[i].CloneFrom(biT.T()) } gsvd.n = len(m) @@ -158,22 +159,25 @@ func (gsvd *HOGSVD) Len() int { // UTo extracts the matrix U_n from the singular value decomposition, storing // the result in-place into dst. U_n is size r×c. -// If dst is nil, a new matrix is allocated. The resulting U matrix is returned. // -// UTo will panic if the receiver does not contain a successful factorization. -func (gsvd *HOGSVD) UTo(dst *Dense, n int) *Dense { +// If dst is empty, UTo will resize dst to be r×c. When dst is +// non-empty, UTo will panic if dst is not r×c. UTo will also +// panic if the receiver does not contain a successful factorization. +func (gsvd *HOGSVD) UTo(dst *Dense, n int) { if !gsvd.succFact() { panic(badFact) } if n < 0 || gsvd.n <= n { panic("hogsvd: invalid index") } - - if dst == nil { - r, c := gsvd.b[n].Dims() - dst = NewDense(r, c, nil) + r, c := gsvd.b[n].Dims() + if dst.IsEmpty() { + dst.ReuseAs(r, c) } else { - dst.reuseAs(gsvd.b[n].Dims()) + r2, c2 := dst.Dims() + if r != r2 || c != c2 { + panic(ErrShape) + } } dst.Copy(&gsvd.b[n]) var v VecDense @@ -181,7 +185,6 @@ func (gsvd *HOGSVD) UTo(dst *Dense, n int) *Dense { v.ColViewOf(dst, j) v.ScaleVec(1/f, &v) } - return dst } // Values returns the nth set of singular values of the factorized system. @@ -215,19 +218,22 @@ func (gsvd *HOGSVD) Values(s []float64, n int) []float64 { // VTo extracts the matrix V from the singular value decomposition, storing // the result in-place into dst. V is size c×c. -// If dst is nil, a new matrix is allocated. The resulting V matrix is returned. // -// VTo will panic if the receiver does not contain a successful factorization. -func (gsvd *HOGSVD) VTo(dst *Dense) *Dense { +// If dst is empty, VTo will resize dst to be c×c. When dst is +// non-empty, VTo will panic if dst is not c×c. VTo will also +// panic if the receiver does not contain a successful factorization. +func (gsvd *HOGSVD) VTo(dst *Dense) { if !gsvd.succFact() { panic(badFact) } - if dst == nil { - r, c := gsvd.v.Dims() - dst = NewDense(r, c, nil) + r, c := gsvd.v.Dims() + if dst.IsEmpty() { + dst.ReuseAs(r, c) } else { - dst.reuseAs(gsvd.v.Dims()) + r2, c2 := dst.Dims() + if r != r2 || c != c2 { + panic(ErrShape) + } } dst.Copy(gsvd.v) - return dst } diff --git a/vendor/gonum.org/v1/gonum/mat/inner.go b/vendor/gonum.org/v1/gonum/mat/inner.go index fba3e0b046c..7607cf9aa69 100644 --- a/vendor/gonum.org/v1/gonum/mat/inner.go +++ b/vendor/gonum.org/v1/gonum/mat/inner.go @@ -11,9 +11,12 @@ import ( ) // Inner computes the generalized inner product -// x^T A y -// between column vectors x and y with matrix A. This is only a true inner product if -// A is symmetric positive definite, though the operation works for any matrix A. +// xᵀ A y +// between the vectors x and y with matrix A, where x and y are treated as +// column vectors. +// +// This is only a true inner product if A is symmetric positive definite, though +// the operation works for any matrix A. // // Inner panics if x.Len != m or y.Len != n when A is an m x n matrix. func Inner(x Vector, a Matrix, y Vector) float64 { diff --git a/vendor/gonum.org/v1/gonum/mat/io.go b/vendor/gonum.org/v1/gonum/mat/io.go index 7f7ef0703ed..7e9b72aecfc 100644 --- a/vendor/gonum.org/v1/gonum/mat/io.go +++ b/vendor/gonum.org/v1/gonum/mat/io.go @@ -21,7 +21,6 @@ const maxLen = int64(int(^uint(0) >> 1)) var ( headerSize = binary.Size(storage{}) - sizeInt64 = binary.Size(int64(0)) sizeFloat64 = binary.Size(float64(0)) errWrongType = errors.New("mat: wrong data type") @@ -128,7 +127,7 @@ func (m Dense) MarshalBinaryTo(w io.Writer) (int, error) { } // UnmarshalBinary decodes the binary form into the receiver. -// It panics if the receiver is a non-zero Dense matrix. +// It panics if the receiver is a non-empty Dense matrix. // // See MarshalBinary for the on-disk layout. // @@ -140,8 +139,8 @@ func (m Dense) MarshalBinaryTo(w io.Writer) (int, error) { // UnmarshalBinary does not limit the size of the unmarshaled matrix, and so // it should not be used on untrusted data. func (m *Dense) UnmarshalBinary(data []byte) error { - if !m.IsZero() { - panic("mat: unmarshal into non-zero matrix") + if !m.IsEmpty() { + panic("mat: unmarshal into non-empty matrix") } if len(data) < headerSize { @@ -176,7 +175,7 @@ func (m *Dense) UnmarshalBinary(data []byte) error { } p := headerSize - m.reuseAs(int(rows), int(cols)) + m.reuseAsNonZeroed(int(rows), int(cols)) for i := range m.mat.Data { m.mat.Data[i] = math.Float64frombits(binary.LittleEndian.Uint64(data[p : p+sizeFloat64])) p += sizeFloat64 @@ -187,7 +186,7 @@ func (m *Dense) UnmarshalBinary(data []byte) error { // UnmarshalBinaryFrom decodes the binary form into the receiver and returns // the number of bytes read and an error if any. -// It panics if the receiver is a non-zero Dense matrix. +// It panics if the receiver is a non-empty Dense matrix. // // See MarshalBinary for the on-disk layout. // @@ -199,8 +198,8 @@ func (m *Dense) UnmarshalBinary(data []byte) error { // UnmarshalBinary does not limit the size of the unmarshaled matrix, and so // it should not be used on untrusted data. func (m *Dense) UnmarshalBinaryFrom(r io.Reader) (int, error) { - if !m.IsZero() { - panic("mat: unmarshal into non-zero matrix") + if !m.IsEmpty() { + panic("mat: unmarshal into non-empty matrix") } var header storage @@ -227,7 +226,7 @@ func (m *Dense) UnmarshalBinaryFrom(r io.Reader) (int, error) { return n, errTooBig } - m.reuseAs(int(rows), int(cols)) + m.reuseAsNonZeroed(int(rows), int(cols)) var b [8]byte for i := range m.mat.Data { nn, err := readFull(r, b[:]) @@ -314,7 +313,7 @@ func (v VecDense) MarshalBinaryTo(w io.Writer) (int, error) { } // UnmarshalBinary decodes the binary form into the receiver. -// It panics if the receiver is a non-zero VecDense. +// It panics if the receiver is a non-empty VecDense. // // See MarshalBinary for the on-disk layout. // @@ -326,8 +325,8 @@ func (v VecDense) MarshalBinaryTo(w io.Writer) (int, error) { // UnmarshalBinary does not limit the size of the unmarshaled vector, and so // it should not be used on untrusted data. func (v *VecDense) UnmarshalBinary(data []byte) error { - if !v.IsZero() { - panic("mat: unmarshal into non-zero vector") + if !v.IsEmpty() { + panic("mat: unmarshal into non-empty vector") } if len(data) < headerSize { @@ -363,7 +362,7 @@ func (v *VecDense) UnmarshalBinary(data []byte) error { } p := headerSize - v.reuseAs(int(n)) + v.reuseAsNonZeroed(int(n)) for i := range v.mat.Data { v.mat.Data[i] = math.Float64frombits(binary.LittleEndian.Uint64(data[p : p+sizeFloat64])) p += sizeFloat64 @@ -374,13 +373,13 @@ func (v *VecDense) UnmarshalBinary(data []byte) error { // UnmarshalBinaryFrom decodes the binary form into the receiver, from the // io.Reader and returns the number of bytes read and an error if any. -// It panics if the receiver is a non-zero VecDense. +// It panics if the receiver is a non-empty VecDense. // // See MarshalBinary for the on-disk layout. // See UnmarshalBinary for the list of sanity checks performed on the input. func (v *VecDense) UnmarshalBinaryFrom(r io.Reader) (int, error) { - if !v.IsZero() { - panic("mat: unmarshal into non-zero vector") + if !v.IsEmpty() { + panic("mat: unmarshal into non-empty vector") } var header storage @@ -408,7 +407,7 @@ func (v *VecDense) UnmarshalBinaryFrom(r io.Reader) (int, error) { return n, errTooBig } - v.reuseAs(int(l)) + v.reuseAsNonZeroed(int(l)) var b [8]byte for i := range v.mat.Data { nn, err := readFull(r, b[:]) diff --git a/vendor/gonum.org/v1/gonum/mat/lq.go b/vendor/gonum.org/v1/gonum/mat/lq.go index d788457d2b4..dfff65d0340 100644 --- a/vendor/gonum.org/v1/gonum/mat/lq.go +++ b/vendor/gonum.org/v1/gonum/mat/lq.go @@ -24,9 +24,9 @@ type LQ struct { func (lq *LQ) updateCond(norm lapack.MatrixNorm) { // Since A = L*Q, and Q is orthogonal, we get for the condition number κ - // κ(A) := |A| |A^-1| = |L*Q| |(L*Q)^-1| = |L| |Q^T * L^-1| + // κ(A) := |A| |A^-1| = |L*Q| |(L*Q)^-1| = |L| |Qᵀ * L^-1| // = |L| |L^-1| = κ(L), - // where we used that fact that Q^-1 = Q^T. However, this assumes that + // where we used that fact that Q^-1 = Qᵀ. However, this assumes that // the matrix norm is invariant under orthogonal transformations which // is not the case for CondNorm. Hopefully the error is negligible: κ // is only a qualitative measure anyway. @@ -40,12 +40,12 @@ func (lq *LQ) updateCond(norm lapack.MatrixNorm) { putInts(iwork) } -// Factorize computes the LQ factorization of an m×n matrix a where n <= m. The LQ +// Factorize computes the LQ factorization of an m×n matrix a where m <= n. The LQ // factorization always exists even if A is singular. // // The LQ decomposition is a factorization of the matrix A such that A = L * Q. -// The matrix Q is an orthonormal n×n matrix, and L is an m×n upper triangular matrix. -// L and Q can be extracted from the LTo and QTo methods. +// The matrix Q is an orthonormal n×n matrix, and L is an m×n lower triangular matrix. +// L and Q can be extracted using the LTo and QTo methods. func (lq *LQ) Factorize(a Matrix) { lq.factorize(a, CondNorm) } @@ -59,7 +59,7 @@ func (lq *LQ) factorize(a Matrix, norm lapack.MatrixNorm) { if lq.lq == nil { lq.lq = &Dense{} } - lq.lq.Clone(a) + lq.lq.CloneFrom(a) work := []float64{0} lq.tau = make([]float64, k) lapack64.Gelqf(lq.lq.mat, lq.tau, work, -1) @@ -71,7 +71,7 @@ func (lq *LQ) factorize(a Matrix, norm lapack.MatrixNorm) { // isValid returns whether the receiver contains a factorization. func (lq *LQ) isValid() bool { - return lq.lq != nil && !lq.lq.IsZero() + return lq.lq != nil && !lq.lq.IsEmpty() } // Cond returns the condition number for the factorized matrix. @@ -87,18 +87,23 @@ func (lq *LQ) Cond() float64 { // and upper triangular matrices. // LTo extracts the m×n lower trapezoidal matrix from a LQ decomposition. -// If dst is nil, a new matrix is allocated. The resulting L matrix is returned. -// LTo will panic if the receiver does not contain a factorization. -func (lq *LQ) LTo(dst *Dense) *Dense { +// +// If dst is empty, LTo will resize dst to be r×c. When dst is +// non-empty, LTo will panic if dst is not r×c. LTo will also panic +// if the receiver does not contain a successful factorization. +func (lq *LQ) LTo(dst *Dense) { if !lq.isValid() { panic(badLQ) } r, c := lq.lq.Dims() - if dst == nil { - dst = NewDense(r, c, nil) + if dst.IsEmpty() { + dst.ReuseAs(r, c) } else { - dst.reuseAs(r, c) + r2, c2 := dst.Dims() + if r != r2 || c != c2 { + panic(ErrShape) + } } // Disguise the LQ as a lower triangular. @@ -115,29 +120,33 @@ func (lq *LQ) LTo(dst *Dense) *Dense { dst.Copy(t) if r == c { - return dst + return } // Zero right of the triangular. for i := 0; i < r; i++ { zero(dst.mat.Data[i*dst.mat.Stride+r : i*dst.mat.Stride+c]) } - - return dst } // QTo extracts the n×n orthonormal matrix Q from an LQ decomposition. -// If dst is nil, a new matrix is allocated. The resulting Q matrix is returned. -// QTo will panic if the receiver does not contain a factorization. -func (lq *LQ) QTo(dst *Dense) *Dense { +// +// If dst is empty, QTo will resize dst to be c×c. When dst is +// non-empty, QTo will panic if dst is not c×c. QTo will also panic +// if the receiver does not contain a successful factorization. +func (lq *LQ) QTo(dst *Dense) { if !lq.isValid() { panic(badLQ) } _, c := lq.lq.Dims() - if dst == nil { - dst = NewDense(c, c, nil) + if dst.IsEmpty() { + dst.ReuseAs(c, c) } else { - dst.reuseAsZeroed(c, c) + r2, c2 := dst.Dims() + if c != r2 || c != c2 { + panic(ErrShape) + } + dst.Zero() } q := dst.mat @@ -153,8 +162,6 @@ func (lq *LQ) QTo(dst *Dense) *Dense { work = getFloats(int(work[0]), false) lapack64.Ormlq(blas.Left, blas.NoTrans, lq.lq.mat, lq.tau, q, work, len(work)) putFloats(work) - - return dst } // SolveTo finds a minimum-norm solution to a system of linear equations defined @@ -183,12 +190,12 @@ func (lq *LQ) SolveTo(dst *Dense, trans bool, b Matrix) error { if c != br { panic(ErrShape) } - dst.reuseAs(r, bc) + dst.reuseAsNonZeroed(r, bc) } else { if r != br { panic(ErrShape) } - dst.reuseAs(c, bc) + dst.reuseAsNonZeroed(c, bc) } // Do not need to worry about overlap between x and b because w has its own // independent storage. @@ -254,9 +261,9 @@ func (lq *LQ) SolveVecTo(dst *VecDense, trans bool, b Vector) error { bm = b.asDense() } if trans { - dst.reuseAs(r) + dst.reuseAsNonZeroed(r) } else { - dst.reuseAs(c) + dst.reuseAsNonZeroed(c) } return lq.SolveTo(dst.asDense(), trans, bm) } diff --git a/vendor/gonum.org/v1/gonum/mat/lu.go b/vendor/gonum.org/v1/gonum/mat/lu.go index e0437169be6..073a4523efe 100644 --- a/vendor/gonum.org/v1/gonum/mat/lu.go +++ b/vendor/gonum.org/v1/gonum/mat/lu.go @@ -58,7 +58,7 @@ func (lu *LU) updateCond(anorm float64, norm lapack.MatrixNorm) { // The LU factorization is computed with pivoting, and so really the decomposition // is a PLU decomposition where P is a permutation matrix. The individual matrix // factors can be extracted from the factorization using the Permutation method -// on Dense, and the LU LTo and UTo methods. +// on Dense, and the LU.LTo and LU.UTo methods. func (lu *LU) Factorize(a Matrix) { lu.factorize(a, CondNorm) } @@ -72,7 +72,7 @@ func (lu *LU) factorize(a Matrix, norm lapack.MatrixNorm) { lu.lu = NewDense(r, r, nil) } else { lu.lu.Reset() - lu.lu.reuseAs(r, r) + lu.lu.reuseAsNonZeroed(r, r) } lu.lu.Copy(a) if cap(lu.pivot) < r { @@ -88,7 +88,7 @@ func (lu *LU) factorize(a Matrix, norm lapack.MatrixNorm) { // isValid returns whether the receiver contains a factorization. func (lu *LU) isValid() bool { - return lu.lu != nil && !lu.lu.IsZero() + return lu.lu != nil && !lu.lu.IsEmpty() } // Cond returns the condition number for the factorized matrix. @@ -179,7 +179,7 @@ func (lu *LU) Pivot(swaps []int) []int { // RankOne updates an LU factorization as if a rank-one update had been applied to // the original matrix A, storing the result into the receiver. That is, if in // the original LU decomposition P * L * U = A, in the updated decomposition -// P * L * U = A + alpha * x * y^T. +// P * L * U = A + alpha * x * yᵀ. // RankOne will panic if orig does not contain a factorization. func (lu *LU) RankOne(orig *LU, alpha float64, x, y Vector) { if !orig.isValid() { @@ -205,7 +205,7 @@ func (lu *LU) RankOne(orig *LU, alpha float64, x, y Vector) { if lu.lu == nil { lu.lu = NewDense(n, n, nil) } else { - lu.lu.reuseAs(n, n) + lu.lu.reuseAsNonZeroed(n, n) } } else if len(lu.pivot) != n { panic(ErrShape) @@ -250,18 +250,27 @@ func (lu *LU) RankOne(orig *LU, alpha float64, x, y Vector) { } // LTo extracts the lower triangular matrix from an LU factorization. -// If dst is nil, a new matrix is allocated. The resulting L matrix is returned. -// LTo will panic if the receiver does not contain a factorization. +// +// If dst is empty, LTo will resize dst to be a lower-triangular n×n matrix. +// When dst is non-empty, LTo will panic if dst is not n×n or not Lower. +// LTo will also panic if the receiver does not contain a successful +// factorization. func (lu *LU) LTo(dst *TriDense) *TriDense { if !lu.isValid() { panic(badLU) } _, n := lu.lu.Dims() - if dst == nil { - dst = NewTriDense(n, Lower, nil) + if dst.IsEmpty() { + dst.ReuseAsTri(n, Lower) } else { - dst.reuseAs(n, Lower) + n2, kind := dst.Triangle() + if n != n2 { + panic(ErrShape) + } + if kind != Lower { + panic(ErrTriangle) + } } // Extract the lower triangular elements. for i := 0; i < n; i++ { @@ -277,18 +286,27 @@ func (lu *LU) LTo(dst *TriDense) *TriDense { } // UTo extracts the upper triangular matrix from an LU factorization. -// If dst is nil, a new matrix is allocated. The resulting U matrix is returned. -// UTo will panic if the receiver does not contain a factorization. -func (lu *LU) UTo(dst *TriDense) *TriDense { +// +// If dst is empty, UTo will resize dst to be an upper-triangular n×n matrix. +// When dst is non-empty, UTo will panic if dst is not n×n or not Upper. +// UTo will also panic if the receiver does not contain a successful +// factorization. +func (lu *LU) UTo(dst *TriDense) { if !lu.isValid() { panic(badLU) } _, n := lu.lu.Dims() - if dst == nil { - dst = NewTriDense(n, Upper, nil) + if dst.IsEmpty() { + dst.ReuseAsTri(n, Upper) } else { - dst.reuseAs(n, Upper) + n2, kind := dst.Triangle() + if n != n2 { + panic(ErrShape) + } + if kind != Upper { + panic(ErrTriangle) + } } // Extract the upper triangular elements. for i := 0; i < n; i++ { @@ -296,7 +314,6 @@ func (lu *LU) UTo(dst *TriDense) *TriDense { dst.mat.Data[i*dst.mat.Stride+j] = lu.lu.mat.Data[i*lu.lu.mat.Stride+j] } } - return dst } // Permutation constructs an r×r permutation matrix with the given row swaps. @@ -304,7 +321,7 @@ func (lu *LU) UTo(dst *TriDense) *TriDense { // and all other elements equal to zero. swaps[i] specifies the row with which // i will be swapped, which is equivalent to the non-zero column of row i. func (m *Dense) Permutation(r int, swaps []int) { - m.reuseAs(r, r) + m.reuseAsNonZeroed(r, r) for i := 0; i < r; i++ { zero(m.mat.Data[i*m.mat.Stride : i*m.mat.Stride+r]) v := swaps[i] @@ -318,7 +335,7 @@ func (m *Dense) Permutation(r int, swaps []int) { // SolveTo solves a system of linear equations using the LU decomposition of a matrix. // It computes // A * X = B if trans == false -// A^T * X = B if trans == true +// Aᵀ * X = B if trans == true // In both cases, A is represented in LU factorized form, and the matrix X is // stored into dst. // @@ -341,7 +358,7 @@ func (lu *LU) SolveTo(dst *Dense, trans bool, b Matrix) error { return Condition(math.Inf(1)) } - dst.reuseAs(n, bc) + dst.reuseAsNonZeroed(n, bc) bU, _ := untranspose(b) var restore func() if dst == bU { @@ -366,7 +383,7 @@ func (lu *LU) SolveTo(dst *Dense, trans bool, b Matrix) error { // SolveVecTo solves a system of linear equations using the LU decomposition of a matrix. // It computes // A * x = b if trans == false -// A^T * x = b if trans == true +// Aᵀ * x = b if trans == true // In both cases, A is represented in LU factorized form, and the vector x is // stored into dst. // @@ -384,7 +401,7 @@ func (lu *LU) SolveVecTo(dst *VecDense, trans bool, b Vector) error { } switch rv := b.(type) { default: - dst.reuseAs(n) + dst.reuseAsNonZeroed(n) return lu.SolveTo(dst.asDense(), trans, b) case RawVectorer: if dst != b { @@ -396,7 +413,7 @@ func (lu *LU) SolveVecTo(dst *VecDense, trans bool, b Vector) error { return Condition(math.Inf(1)) } - dst.reuseAs(n) + dst.reuseAsNonZeroed(n) var restore func() if dst == b { dst, restore = dst.isolatedWorkspace(b) diff --git a/vendor/gonum.org/v1/gonum/mat/matrix.go b/vendor/gonum.org/v1/gonum/mat/matrix.go index 444d0445799..5ea5d716caf 100644 --- a/vendor/gonum.org/v1/gonum/mat/matrix.go +++ b/vendor/gonum.org/v1/gonum/mat/matrix.go @@ -30,6 +30,23 @@ type Matrix interface { T() Matrix } +// allMatrix represents the extra set of methods that all mat Matrix types +// should satisfy. This is used to enforce compile-time consistency between the +// Dense types, especially helpful when adding new features. +type allMatrix interface { + Reseter + IsEmpty() bool + Zero() +} + +// denseMatrix represents the extra set of methods that all Dense Matrix types +// should satisfy. This is used to enforce compile-time consistency between the +// Dense types, especially helpful when adding new features. +type denseMatrix interface { + DiagView() Diagonal + Tracer +} + var ( _ Matrix = Transpose{} _ Untransposer = Transpose{} @@ -129,19 +146,20 @@ type RawColViewer interface { RawColView(j int) []float64 } -// A Cloner can make a copy of a into the receiver, overwriting the previous value of the +// A ClonerFrom can make a copy of a into the receiver, overwriting the previous value of the // receiver. The clone operation does not make any restriction on shape and will not cause // shadowing. -type Cloner interface { - Clone(a Matrix) +type ClonerFrom interface { + CloneFrom(a Matrix) } // A Reseter can reset the matrix so that it can be reused as the receiver of a dimensionally // restricted operation. This is commonly used when the matrix is being used as a workspace // or temporary matrix. // -// If the matrix is a view, using the reset matrix may result in data corruption in elements -// outside the view. +// If the matrix is a view, using Reset may result in data corruption in elements outside +// the view. Similarly, if the matrix shares backing data with another variable, using +// Reset may lead to unexpected changes in data values. type Reseter interface { Reset() } @@ -580,7 +598,7 @@ func Max(a Matrix) float64 { if r == 0 || c == 0 { panic(ErrShape) } - // Max(A) = Max(A^T) + // Max(A) = Max(Aᵀ) aU, _ := untranspose(a) switch m := aU.(type) { case RawMatrixer: @@ -655,7 +673,7 @@ func Min(a Matrix) float64 { if r == 0 || c == 0 { panic(ErrShape) } - // Min(A) = Min(A^T) + // Min(A) = Min(Aᵀ) aU, _ := untranspose(a) switch m := aU.(type) { case RawMatrixer: @@ -768,7 +786,7 @@ func Norm(a Matrix, norm float64) float64 { rv := rma.RawVector() switch norm { default: - panic("unreachable") + panic(ErrNormOrder) case 1: if aTrans { imax := blas64.Iamax(rv) @@ -787,7 +805,7 @@ func Norm(a Matrix, norm float64) float64 { } switch norm { default: - panic("unreachable") + panic(ErrNormOrder) case 1: var max float64 for j := 0; j < c; j++ { @@ -848,12 +866,43 @@ func normLapack(norm float64, aTrans bool) lapack.MatrixNorm { // Sum returns the sum of the elements of the matrix. func Sum(a Matrix) float64 { - // TODO(btracey): Add a fast path for the other supported matrix types. - r, c := a.Dims() var sum float64 aU, _ := untranspose(a) - if rma, ok := aU.(RawMatrixer); ok { + switch rma := aU.(type) { + case RawSymmetricer: + rm := rma.RawSymmetric() + for i := 0; i < rm.N; i++ { + // Diagonals count once while off-diagonals count twice. + sum += rm.Data[i*rm.Stride+i] + var s float64 + for _, v := range rm.Data[i*rm.Stride+i+1 : i*rm.Stride+rm.N] { + s += v + } + sum += 2 * s + } + return sum + case RawTriangular: + rm := rma.RawTriangular() + var startIdx, endIdx int + for i := 0; i < rm.N; i++ { + // Start and end index for this triangle-row. + switch rm.Uplo { + case blas.Upper: + startIdx = i + endIdx = rm.N + case blas.Lower: + startIdx = 0 + endIdx = i + 1 + default: + panic(badTriangle) + } + for _, v := range rm.Data[i*rm.Stride+startIdx : i*rm.Stride+endIdx] { + sum += v + } + } + return sum + case RawMatrixer: rm := rma.RawMatrix() for i := 0; i < rm.Rows; i++ { for _, v := range rm.Data[i*rm.Stride : i*rm.Stride+rm.Cols] { @@ -861,13 +910,21 @@ func Sum(a Matrix) float64 { } } return sum - } - for i := 0; i < r; i++ { - for j := 0; j < c; j++ { - sum += a.At(i, j) + case *VecDense: + rm := rma.RawVector() + for i := 0; i < rm.N; i++ { + sum += rm.Data[i*rm.Inc] } + return sum + default: + r, c := a.Dims() + for i := 0; i < r; i++ { + for j := 0; j < c; j++ { + sum += a.At(i, j) + } + } + return sum } - return sum } // A Tracer can compute the trace of the matrix. Trace must panic if the diff --git a/vendor/gonum.org/v1/gonum/mat/offset.go b/vendor/gonum.org/v1/gonum/mat/offset.go index af2c03b64a6..830589dc910 100644 --- a/vendor/gonum.org/v1/gonum/mat/offset.go +++ b/vendor/gonum.org/v1/gonum/mat/offset.go @@ -18,3 +18,14 @@ func offset(a, b []float64) int { // move. See https://golang.org/issue/12445. return int(uintptr(unsafe.Pointer(&b[0]))-uintptr(unsafe.Pointer(&a[0]))) / int(unsafe.Sizeof(float64(0))) } + +// offsetComplex returns the number of complex128 values b[0] is after a[0]. +func offsetComplex(a, b []complex128) int { + if &a[0] == &b[0] { + return 0 + } + // This expression must be atomic with respect to GC moves. + // At this stage this is true, because the GC does not + // move. See https://golang.org/issue/12445. + return int(uintptr(unsafe.Pointer(&b[0]))-uintptr(unsafe.Pointer(&a[0]))) / int(unsafe.Sizeof(complex128(0))) +} diff --git a/vendor/gonum.org/v1/gonum/mat/offset_appengine.go b/vendor/gonum.org/v1/gonum/mat/offset_appengine.go index df617478cfc..3204d182f46 100644 --- a/vendor/gonum.org/v1/gonum/mat/offset_appengine.go +++ b/vendor/gonum.org/v1/gonum/mat/offset_appengine.go @@ -22,3 +22,18 @@ func offset(a, b []float64) int { // move. See https://golang.org/issue/12445. return int(vb0.UnsafeAddr()-va0.UnsafeAddr()) / sizeOfFloat64 } + +var sizeOfComplex128 = int(reflect.TypeOf(complex128(0)).Size()) + +// offsetComplex returns the number of complex128 values b[0] is after a[0]. +func offsetComplex(a, b []complex128) int { + va0 := reflect.ValueOf(a).Index(0) + vb0 := reflect.ValueOf(b).Index(0) + if va0.Addr() == vb0.Addr() { + return 0 + } + // This expression must be atomic with respect to GC moves. + // At this stage this is true, because the GC does not + // move. See https://golang.org/issue/12445. + return int(vb0.UnsafeAddr()-va0.UnsafeAddr()) / sizeOfComplex128 +} diff --git a/vendor/gonum.org/v1/gonum/mat/pool.go b/vendor/gonum.org/v1/gonum/mat/pool.go index 25ca29f18f2..f51215ce3e3 100644 --- a/vendor/gonum.org/v1/gonum/mat/pool.go +++ b/vendor/gonum.org/v1/gonum/mat/pool.go @@ -87,10 +87,12 @@ func init() { }} } poolFloats[i].New = func() interface{} { - return make([]float64, l) + s := make([]float64, l) + return &s } poolInts[i].New = func() interface{} { - return make([]int, l) + s := make([]int, l) + return &s } } } @@ -200,7 +202,7 @@ func putWorkspaceVec(v *VecDense) { // getFloats returns a []float64 of length l and a cap that is // less than 2*l. If clear is true, the slice visible is zeroed. func getFloats(l int, clear bool) []float64 { - w := poolFloats[bits(uint64(l))].Get().([]float64) + w := *poolFloats[bits(uint64(l))].Get().(*[]float64) w = w[:l] if clear { zero(w) @@ -212,13 +214,13 @@ func getFloats(l int, clear bool) []float64 { // workspace pool. putFloats must not be called with a slice // where references to the underlying data have been kept. func putFloats(w []float64) { - poolFloats[bits(uint64(cap(w)))].Put(w) + poolFloats[bits(uint64(cap(w)))].Put(&w) } // getInts returns a []ints of length l and a cap that is // less than 2*l. If clear is true, the slice visible is zeroed. func getInts(l int, clear bool) []int { - w := poolInts[bits(uint64(l))].Get().([]int) + w := *poolInts[bits(uint64(l))].Get().(*[]int) w = w[:l] if clear { for i := range w { @@ -232,5 +234,5 @@ func getInts(l int, clear bool) []int { // workspace pool. putInts must not be called with a slice // where references to the underlying data have been kept. func putInts(w []int) { - poolInts[bits(uint64(cap(w)))].Put(w) + poolInts[bits(uint64(cap(w)))].Put(&w) } diff --git a/vendor/gonum.org/v1/gonum/mat/product.go b/vendor/gonum.org/v1/gonum/mat/product.go index 08424ab3ca0..d8e0302758b 100644 --- a/vendor/gonum.org/v1/gonum/mat/product.go +++ b/vendor/gonum.org/v1/gonum/mat/product.go @@ -31,7 +31,7 @@ func (m *Dense) Product(factors ...Matrix) { } return case 1: - m.reuseAs(factors[0].Dims()) + m.reuseAsNonZeroed(factors[0].Dims()) m.Copy(factors[0]) return case 2: @@ -43,7 +43,7 @@ func (m *Dense) Product(factors ...Matrix) { p := newMultiplier(m, factors) p.optimize() result := p.multiply() - m.reuseAs(result.Dims()) + m.reuseAsNonZeroed(result.Dims()) m.Copy(result) putWorkspace(result) } @@ -71,7 +71,7 @@ func newMultiplier(m *Dense, factors []Matrix) *multiplier { // allocate data for m. r, c := m.Dims() fr, fc := factors[0].Dims() // newMultiplier is only called with len(factors) > 2. - if !m.IsZero() { + if !m.IsEmpty() { if fr != r { panic(ErrShape) } diff --git a/vendor/gonum.org/v1/gonum/mat/qr.go b/vendor/gonum.org/v1/gonum/mat/qr.go index bf38ee4d6da..78e9f3e8bed 100644 --- a/vendor/gonum.org/v1/gonum/mat/qr.go +++ b/vendor/gonum.org/v1/gonum/mat/qr.go @@ -24,9 +24,9 @@ type QR struct { func (qr *QR) updateCond(norm lapack.MatrixNorm) { // Since A = Q*R, and Q is orthogonal, we get for the condition number κ - // κ(A) := |A| |A^-1| = |Q*R| |(Q*R)^-1| = |R| |R^-1 * Q^T| + // κ(A) := |A| |A^-1| = |Q*R| |(Q*R)^-1| = |R| |R^-1 * Qᵀ| // = |R| |R^-1| = κ(R), - // where we used that fact that Q^-1 = Q^T. However, this assumes that + // where we used that fact that Q^-1 = Qᵀ. However, this assumes that // the matrix norm is invariant under orthogonal transformations which // is not the case for CondNorm. Hopefully the error is negligible: κ // is only a qualitative measure anyway. @@ -59,11 +59,10 @@ func (qr *QR) factorize(a Matrix, norm lapack.MatrixNorm) { if qr.qr == nil { qr.qr = &Dense{} } - qr.qr.Clone(a) + qr.qr.CloneFrom(a) work := []float64{0} qr.tau = make([]float64, k) lapack64.Geqrf(qr.qr.mat, qr.tau, work, -1) - work = getFloats(int(work[0]), false) lapack64.Geqrf(qr.qr.mat, qr.tau, work, len(work)) putFloats(work) @@ -72,7 +71,7 @@ func (qr *QR) factorize(a Matrix, norm lapack.MatrixNorm) { // isValid returns whether the receiver contains a factorization. func (qr *QR) isValid() bool { - return qr.qr != nil && !qr.qr.IsZero() + return qr.qr != nil && !qr.qr.IsEmpty() } // Cond returns the condition number for the factorized matrix. @@ -88,18 +87,23 @@ func (qr *QR) Cond() float64 { // and upper triangular matrices. // RTo extracts the m×n upper trapezoidal matrix from a QR decomposition. -// If dst is nil, a new matrix is allocated. The resulting dst matrix is returned. -// RTo will panic if the receiver does not contain a factorization. -func (qr *QR) RTo(dst *Dense) *Dense { +// +// If dst is empty, RTo will resize dst to be r×c. When dst is non-empty, +// RTo will panic if dst is not r×c. RTo will also panic if the receiver +// does not contain a successful factorization. +func (qr *QR) RTo(dst *Dense) { if !qr.isValid() { panic(badQR) } r, c := qr.qr.Dims() - if dst == nil { - dst = NewDense(r, c, nil) + if dst.IsEmpty() { + dst.ReuseAs(r, c) } else { - dst.reuseAs(r, c) + r2, c2 := dst.Dims() + if c != r2 || c != c2 { + panic(ErrShape) + } } // Disguise the QR as an upper triangular @@ -119,23 +123,27 @@ func (qr *QR) RTo(dst *Dense) *Dense { for i := r; i < c; i++ { zero(dst.mat.Data[i*dst.mat.Stride : i*dst.mat.Stride+c]) } - - return dst } -// QTo extracts the m×m orthonormal matrix Q from a QR decomposition. -// If dst is nil, a new matrix is allocated. The resulting Q matrix is returned. -// QTo will panic if the receiver does not contain a factorization. -func (qr *QR) QTo(dst *Dense) *Dense { +// QTo extracts the r×r orthonormal matrix Q from a QR decomposition. +// +// If dst is empty, QTo will resize dst to be r×r. When dst is non-empty, +// QTo will panic if dst is not r×r. QTo will also panic if the receiver +// does not contain a successful factorization. +func (qr *QR) QTo(dst *Dense) { if !qr.isValid() { panic(badQR) } r, _ := qr.qr.Dims() - if dst == nil { - dst = NewDense(r, r, nil) + if dst.IsEmpty() { + dst.ReuseAs(r, r) } else { - dst.reuseAsZeroed(r, r) + r2, c2 := dst.Dims() + if r != r2 || r != c2 { + panic(ErrShape) + } + dst.Zero() } // Set Q = I. @@ -149,8 +157,6 @@ func (qr *QR) QTo(dst *Dense) *Dense { work = getFloats(int(work[0]), false) lapack64.Ormqr(blas.Left, blas.NoTrans, qr.qr.mat, qr.tau, dst.mat, work, len(work)) putFloats(work) - - return dst } // SolveTo finds a minimum-norm solution to a system of linear equations defined @@ -160,7 +166,7 @@ func (qr *QR) QTo(dst *Dense) *Dense { // // The minimization problem solved depends on the input parameters. // If trans == false, find X such that ||A*X - B||_2 is minimized. -// If trans == true, find the minimum norm solution of A^T * X = B. +// If trans == true, find the minimum norm solution of Aᵀ * X = B. // The solution matrix, X, is stored in place into dst. // SolveTo will panic if the receiver does not contain a factorization. func (qr *QR) SolveTo(dst *Dense, trans bool, b Matrix) error { @@ -179,12 +185,12 @@ func (qr *QR) SolveTo(dst *Dense, trans bool, b Matrix) error { if c != br { panic(ErrShape) } - dst.reuseAs(r, bc) + dst.reuseAsNonZeroed(r, bc) } else { if r != br { panic(ErrShape) } - dst.reuseAs(c, bc) + dst.reuseAsNonZeroed(c, bc) } // Do not need to worry about overlap between m and b because x has its own // independent storage. @@ -251,9 +257,9 @@ func (qr *QR) SolveVecTo(dst *VecDense, trans bool, b Vector) error { bm = b.asDense() } if trans { - dst.reuseAs(r) + dst.reuseAsNonZeroed(r) } else { - dst.reuseAs(c) + dst.reuseAsNonZeroed(c) } return qr.SolveTo(dst.asDense(), trans, bm) diff --git a/vendor/gonum.org/v1/gonum/mat/shadow.go b/vendor/gonum.org/v1/gonum/mat/shadow.go index cc62e44f0b4..8a941c7fc19 100644 --- a/vendor/gonum.org/v1/gonum/mat/shadow.go +++ b/vendor/gonum.org/v1/gonum/mat/shadow.go @@ -4,23 +4,7 @@ package mat -import ( - "gonum.org/v1/gonum/blas/blas64" -) - -const ( - // regionOverlap is the panic string used for the general case - // of a matrix region overlap between a source and destination. - regionOverlap = "mat: bad region: overlap" - - // regionIdentity is the panic string used for the specific - // case of complete agreement between a source and a destination. - regionIdentity = "mat: bad region: identical" - - // mismatchedStrides is the panic string used for overlapping - // data slices with differing strides. - mismatchedStrides = "mat: bad region: different strides" -) +import "gonum.org/v1/gonum/blas/blas64" // checkOverlap returns false if the receiver does not overlap data elements // referenced by the parameter and panics otherwise. @@ -51,8 +35,9 @@ func checkOverlap(a, b blas64.General) bool { return false } - if a.Stride != b.Stride { - // Too hard, so assume the worst. + if a.Stride != b.Stride && a.Stride != 1 && b.Stride != 1 { + // Too hard, so assume the worst; if either stride + // is one it will be caught in rectanglesOverlap. panic(mismatchedStrides) } @@ -60,7 +45,7 @@ func checkOverlap(a, b blas64.General) bool { off = -off a.Cols, b.Cols = b.Cols, a.Cols } - if rectanglesOverlap(off, a.Cols, b.Cols, a.Stride) { + if rectanglesOverlap(off, a.Cols, b.Cols, min(a.Stride, b.Stride)) { panic(regionOverlap) } return false @@ -75,15 +60,20 @@ func (m *Dense) checkOverlapMatrix(a Matrix) bool { return false } var amat blas64.General - switch a := a.(type) { + switch ar := a.(type) { default: return false case RawMatrixer: - amat = a.RawMatrix() + amat = ar.RawMatrix() case RawSymmetricer: - amat = generalFromSymmetric(a.RawSymmetric()) + amat = generalFromSymmetric(ar.RawSymmetric()) + case RawSymBander: + amat = generalFromSymmetricBand(ar.RawSymBand()) case RawTriangular: - amat = generalFromTriangular(a.RawTriangular()) + amat = generalFromTriangular(ar.RawTriangular()) + case RawVectorer: + r, c := a.Dims() + amat = generalFromVector(ar.RawVector(), r, c) } return m.checkOverlap(amat) } @@ -97,15 +87,20 @@ func (s *SymDense) checkOverlapMatrix(a Matrix) bool { return false } var amat blas64.General - switch a := a.(type) { + switch ar := a.(type) { default: return false case RawMatrixer: - amat = a.RawMatrix() + amat = ar.RawMatrix() case RawSymmetricer: - amat = generalFromSymmetric(a.RawSymmetric()) + amat = generalFromSymmetric(ar.RawSymmetric()) + case RawSymBander: + amat = generalFromSymmetricBand(ar.RawSymBand()) case RawTriangular: - amat = generalFromTriangular(a.RawTriangular()) + amat = generalFromTriangular(ar.RawTriangular()) + case RawVectorer: + r, c := a.Dims() + amat = generalFromVector(ar.RawVector(), r, c) } return s.checkOverlap(amat) } @@ -130,15 +125,20 @@ func (t *TriDense) checkOverlapMatrix(a Matrix) bool { return false } var amat blas64.General - switch a := a.(type) { + switch ar := a.(type) { default: return false case RawMatrixer: - amat = a.RawMatrix() + amat = ar.RawMatrix() case RawSymmetricer: - amat = generalFromSymmetric(a.RawSymmetric()) + amat = generalFromSymmetric(ar.RawSymmetric()) + case RawSymBander: + amat = generalFromSymmetricBand(ar.RawSymBand()) case RawTriangular: - amat = generalFromTriangular(a.RawTriangular()) + amat = generalFromTriangular(ar.RawTriangular()) + case RawVectorer: + r, c := a.Dims() + amat = generalFromVector(ar.RawVector(), r, c) } return t.checkOverlap(amat) } @@ -179,48 +179,64 @@ func (v *VecDense) checkOverlap(a blas64.Vector) bool { return false } - if mat.Inc != a.Inc { - // Too hard, so assume the worst. + if mat.Inc != a.Inc && mat.Inc != 1 && a.Inc != 1 { + // Too hard, so assume the worst; if either + // increment is one it will be caught below. panic(mismatchedStrides) } + inc := min(mat.Inc, a.Inc) - if mat.Inc == 1 || off&mat.Inc == 0 { + if inc == 1 || off&inc == 0 { panic(regionOverlap) } return false } -// rectanglesOverlap returns whether the strided rectangles a and b overlap -// when b is offset by off elements after a but has at least one element before -// the end of a. off must be positive. a and b have aCols and bCols respectively. -// -// rectanglesOverlap works by shifting both matrices left such that the left -// column of a is at 0. The column indexes are flattened by obtaining the shifted -// relative left and right column positions modulo the common stride. This allows -// direct comparison of the column offsets when the matrix backing data slices -// are known to overlap. -func rectanglesOverlap(off, aCols, bCols, stride int) bool { - if stride == 1 { - // Unit stride means overlapping data - // slices must overlap as matrices. - return true +// generalFromVector returns a blas64.General with the backing +// data and dimensions of a. +func generalFromVector(a blas64.Vector, r, c int) blas64.General { + return blas64.General{ + Rows: r, + Cols: c, + Stride: a.Inc, + Data: a.Data, + } +} + +func (s *SymBandDense) checkOverlap(a blas64.General) bool { + return checkOverlap(generalFromSymmetricBand(s.RawSymBand()), a) +} + +func (s *SymBandDense) checkOverlapMatrix(a Matrix) bool { + if s == a { + return false + } + var amat blas64.General + switch ar := a.(type) { + default: + return false + case RawMatrixer: + amat = ar.RawMatrix() + case RawSymmetricer: + amat = generalFromSymmetric(ar.RawSymmetric()) + case RawSymBander: + amat = generalFromSymmetricBand(ar.RawSymBand()) + case RawTriangular: + amat = generalFromTriangular(ar.RawTriangular()) + case RawVectorer: + r, c := a.Dims() + amat = generalFromVector(ar.RawVector(), r, c) + } + return s.checkOverlap(amat) +} + +// generalFromSymmetricBand returns a blas64.General with the backing +// data and dimensions of a. +func generalFromSymmetricBand(a blas64.SymmetricBand) blas64.General { + return blas64.General{ + Rows: a.N, + Cols: a.K + 1, + Data: a.Data, + Stride: a.Stride, } - - // Flatten the shifted matrix column positions - // so a starts at 0, modulo the common stride. - aTo := aCols - // The mod stride operations here make the from - // and to indexes comparable between a and b when - // the data slices of a and b overlap. - bFrom := off % stride - bTo := (bFrom + bCols) % stride - - if bTo == 0 || bFrom < bTo { - // b matrix is not wrapped: compare for - // simple overlap. - return bFrom < aTo - } - - // b strictly wraps and so must overlap with a. - return true } diff --git a/vendor/gonum.org/v1/gonum/mat/shadow_common.go b/vendor/gonum.org/v1/gonum/mat/shadow_common.go new file mode 100644 index 00000000000..e4cdf4ddee1 --- /dev/null +++ b/vendor/gonum.org/v1/gonum/mat/shadow_common.go @@ -0,0 +1,54 @@ +// 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 mat + +const ( + // regionOverlap is the panic string used for the general case + // of a matrix region overlap between a source and destination. + regionOverlap = "mat: bad region: overlap" + + // regionIdentity is the panic string used for the specific + // case of complete agreement between a source and a destination. + regionIdentity = "mat: bad region: identical" + + // mismatchedStrides is the panic string used for overlapping + // data slices with differing strides. + mismatchedStrides = "mat: bad region: different strides" +) + +// rectanglesOverlap returns whether the strided rectangles a and b overlap +// when b is offset by off elements after a but has at least one element before +// the end of a. off must be positive. a and b have aCols and bCols respectively. +// +// rectanglesOverlap works by shifting both matrices left such that the left +// column of a is at 0. The column indexes are flattened by obtaining the shifted +// relative left and right column positions modulo the common stride. This allows +// direct comparison of the column offsets when the matrix backing data slices +// are known to overlap. +func rectanglesOverlap(off, aCols, bCols, stride int) bool { + if stride == 1 { + // Unit stride means overlapping data + // slices must overlap as matrices. + return true + } + + // Flatten the shifted matrix column positions + // so a starts at 0, modulo the common stride. + aTo := aCols + // The mod stride operations here make the from + // and to indexes comparable between a and b when + // the data slices of a and b overlap. + bFrom := off % stride + bTo := (bFrom + bCols) % stride + + if bTo == 0 || bFrom < bTo { + // b matrix is not wrapped: compare for + // simple overlap. + return bFrom < aTo + } + + // b strictly wraps and so must overlap with a. + return true +} diff --git a/vendor/gonum.org/v1/gonum/mat/shadow_complex.go b/vendor/gonum.org/v1/gonum/mat/shadow_complex.go new file mode 100644 index 00000000000..7bf1cefd826 --- /dev/null +++ b/vendor/gonum.org/v1/gonum/mat/shadow_complex.go @@ -0,0 +1,72 @@ +// 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. + +// TODO(kortschak): Generate this file from shadow.go when all complex type are available. + +package mat + +import "gonum.org/v1/gonum/blas/cblas128" + +// checkOverlapComplex returns false if the receiver does not overlap data elements +// referenced by the parameter and panics otherwise. +// +// checkOverlapComplex methods return a boolean to allow the check call to be added to a +// boolean expression, making use of short-circuit operators. +func checkOverlapComplex(a, b cblas128.General) bool { + if cap(a.Data) == 0 || cap(b.Data) == 0 { + return false + } + + off := offsetComplex(a.Data[:1], b.Data[:1]) + + if off == 0 { + // At least one element overlaps. + if a.Cols == b.Cols && a.Rows == b.Rows && a.Stride == b.Stride { + panic(regionIdentity) + } + panic(regionOverlap) + } + + if off > 0 && len(a.Data) <= off { + // We know a is completely before b. + return false + } + if off < 0 && len(b.Data) <= -off { + // We know a is completely after b. + return false + } + + if a.Stride != b.Stride && a.Stride != 1 && b.Stride != 1 { + // Too hard, so assume the worst; if either stride + // is one it will be caught in rectanglesOverlap. + panic(mismatchedStrides) + } + + if off < 0 { + off = -off + a.Cols, b.Cols = b.Cols, a.Cols + } + if rectanglesOverlap(off, a.Cols, b.Cols, min(a.Stride, b.Stride)) { + panic(regionOverlap) + } + return false +} + +func (m *CDense) checkOverlapComplex(a cblas128.General) bool { + return checkOverlapComplex(m.RawCMatrix(), a) +} + +func (m *CDense) checkOverlapMatrix(a CMatrix) bool { + if m == a { + return false + } + var amat cblas128.General + switch ar := a.(type) { + default: + return false + case RawCMatrixer: + amat = ar.RawCMatrix() + } + return m.checkOverlapComplex(amat) +} diff --git a/vendor/gonum.org/v1/gonum/mat/solve.go b/vendor/gonum.org/v1/gonum/mat/solve.go index 11813280f84..df62cedcdb6 100644 --- a/vendor/gonum.org/v1/gonum/mat/solve.go +++ b/vendor/gonum.org/v1/gonum/mat/solve.go @@ -24,7 +24,7 @@ func (m *Dense) Solve(a, b Matrix) error { if ar != br { panic(ErrShape) } - m.reuseAs(ac, bc) + m.reuseAsNonZeroed(ac, bc) // TODO(btracey): Add special cases for SymDense, etc. aU, aTrans := untranspose(a) @@ -121,7 +121,7 @@ func (v *VecDense) SolveVec(a Matrix, b Vector) error { if v != b { v.checkOverlap(bmat) } - v.reuseAs(c) + v.reuseAsNonZeroed(c) m := v.asDense() // We conditionally create bm as m when b and v are identical // to prevent the overlap detection code from identifying m @@ -134,7 +134,7 @@ func (v *VecDense) SolveVec(a Matrix, b Vector) error { return m.Solve(a, bm) } - v.reuseAs(c) + v.reuseAsNonZeroed(c) m := v.asDense() return m.Solve(a, b) } diff --git a/vendor/gonum.org/v1/gonum/mat/svd.go b/vendor/gonum.org/v1/gonum/mat/svd.go index 2f55c4114b1..77fd042a849 100644 --- a/vendor/gonum.org/v1/gonum/mat/svd.go +++ b/vendor/gonum.org/v1/gonum/mat/svd.go @@ -40,7 +40,7 @@ const ( // SVDThin is a convenience value for computing both thin vectors. SVDThin SVDKind = SVDThinU | SVDThinV - // SVDThin is a convenience value for computing both full vectors. + // SVDFull is a convenience value for computing both full vectors. SVDFull SVDKind = SVDFullU | SVDFullV ) @@ -55,7 +55,7 @@ func (svd *SVD) succFact() bool { // // The full singular value decomposition (kind == SVDFull) is a factorization // of an m×n matrix A of the form -// A = U * Σ * V^T +// A = U * Σ * Vᵀ // where Σ is an m×n diagonal matrix, U is an m×m orthogonal matrix, and V is an // n×n orthogonal matrix. The diagonal elements of Σ are the singular values of A. // The first min(m,n) columns of U and V are, respectively, the left and right @@ -64,7 +64,7 @@ func (svd *SVD) succFact() bool { // Significant storage space can be saved by using the thin representation of // the SVD (kind == SVDThin) instead of the full SVD, especially if // m >> n or m << n. The thin SVD finds -// A = U~ * Σ * V~^T +// A = U~ * Σ * V~ᵀ // where U~ is of size m×min(m,n), Σ is a diagonal matrix of size min(m,n)×min(m,n) // and V~ is of size n×min(m,n). // @@ -182,11 +182,12 @@ func (svd *SVD) Values(s []float64) []float64 { // min(m,n) columns are the left singular vectors and correspond to the singular // values as returned from SVD.Values. // -// If dst is not nil, U is stored in-place into dst, and dst must have size -// m×m if the full U was computed, size m×min(m,n) if the thin U was computed, -// and UTo panics otherwise. If dst is nil, a new matrix of the appropriate size -// is allocated and returned. -func (svd *SVD) UTo(dst *Dense) *Dense { +// If dst is empty, UTo will resize dst to be m×m if the full U was computed +// and size m×min(m,n) if the thin U was computed. When dst is non-empty, then +// UTo will panic if dst is not the appropriate size. UTo will also panic if +// the receiver does not contain a successful factorization, or if U was +// not computed during factorization. +func (svd *SVD) UTo(dst *Dense) { if !svd.succFact() { panic(badFact) } @@ -196,10 +197,13 @@ func (svd *SVD) UTo(dst *Dense) *Dense { } r := svd.u.Rows c := svd.u.Cols - if dst == nil { - dst = NewDense(r, c, nil) + if dst.IsEmpty() { + dst.ReuseAs(r, c) } else { - dst.reuseAs(r, c) + r2, c2 := dst.Dims() + if r != r2 || c != c2 { + panic(ErrShape) + } } tmp := &Dense{ @@ -208,19 +212,18 @@ func (svd *SVD) UTo(dst *Dense) *Dense { capCols: c, } dst.Copy(tmp) - - return dst } // VTo extracts the matrix V from the singular value decomposition. The first // min(m,n) columns are the right singular vectors and correspond to the singular // values as returned from SVD.Values. // -// If dst is not nil, V is stored in-place into dst, and dst must have size -// n×n if the full V was computed, size n×min(m,n) if the thin V was computed, -// and VTo panics otherwise. If dst is nil, a new matrix of the appropriate size -// is allocated and returned. -func (svd *SVD) VTo(dst *Dense) *Dense { +// If dst is empty, VTo will resize dst to be n×n if the full V was computed +// and size n×min(m,n) if the thin V was computed. When dst is non-empty, then +// VTo will panic if dst is not the appropriate size. VTo will also panic if +// the receiver does not contain a successful factorization, or if V was +// not computed during factorization. +func (svd *SVD) VTo(dst *Dense) { if !svd.succFact() { panic(badFact) } @@ -230,10 +233,13 @@ func (svd *SVD) VTo(dst *Dense) *Dense { } r := svd.vt.Rows c := svd.vt.Cols - if dst == nil { - dst = NewDense(c, r, nil) + if dst.IsEmpty() { + dst.ReuseAs(c, r) } else { - dst.reuseAs(c, r) + r2, c2 := dst.Dims() + if c != r2 || r != c2 { + panic(ErrShape) + } } tmp := &Dense{ @@ -242,6 +248,4 @@ func (svd *SVD) VTo(dst *Dense) *Dense { capCols: c, } dst.Copy(tmp.T()) - - return dst } diff --git a/vendor/gonum.org/v1/gonum/mat/symband.go b/vendor/gonum.org/v1/gonum/mat/symband.go index add9a807d37..4072608242c 100644 --- a/vendor/gonum.org/v1/gonum/mat/symband.go +++ b/vendor/gonum.org/v1/gonum/mat/symband.go @@ -12,6 +12,8 @@ import ( var ( symBandDense *SymBandDense _ Matrix = symBandDense + _ allMatrix = symBandDense + _ denseMatrix = symBandDense _ Symmetric = symBandDense _ Banded = symBandDense _ SymBanded = symBandDense @@ -157,6 +159,26 @@ func (s *SymBandDense) SetRawSymBand(mat blas64.SymmetricBand) { s.mat = mat } +// IsEmpty returns whether the receiver is empty. Empty matrices can be the +// receiver for size-restricted operations. The receiver can be emptied using +// Reset. +func (s *SymBandDense) IsEmpty() bool { + return s.mat.Stride == 0 +} + +// Reset empties the matrix so that it can be reused as the +// receiver of a dimensionally restricted operation. +// +// Reset should not be used when the matrix shares backing data. +// See the Reseter interface for more information. +func (s *SymBandDense) Reset() { + s.mat.N = 0 + s.mat.K = 0 + s.mat.Stride = 0 + s.mat.Uplo = 0 + s.mat.Data = s.mat.Data[:0:0] +} + // Zero sets all of the matrix elements to zero. func (s *SymBandDense) Zero() { for i := 0; i < s.mat.N; i++ { @@ -219,3 +241,13 @@ func (s *SymBandDense) DoColNonZero(j int, fn func(i, j int, v float64)) { } } } + +// Trace returns the trace. +func (s *SymBandDense) Trace() float64 { + rb := s.RawSymBand() + var tr float64 + for i := 0; i < rb.N; i++ { + tr += rb.Data[i*rb.Stride] + } + return tr +} diff --git a/vendor/gonum.org/v1/gonum/mat/symmetric.go b/vendor/gonum.org/v1/gonum/mat/symmetric.go index 2ea5bdb0392..4f79420b44b 100644 --- a/vendor/gonum.org/v1/gonum/mat/symmetric.go +++ b/vendor/gonum.org/v1/gonum/mat/symmetric.go @@ -15,6 +15,8 @@ var ( symDense *SymDense _ Matrix = symDense + _ allMatrix = symDense + _ denseMatrix = symDense _ Symmetric = symDense _ RawSymmetricer = symDense _ MutableSymmetric = symDense @@ -120,12 +122,14 @@ func (s *SymDense) SetRawSymmetric(mat blas64.Symmetric) { if mat.Uplo != blas.Upper { panic(badSymTriangle) } + s.cap = mat.N s.mat = mat } -// Reset zeros the dimensions of the matrix so that it can be reused as the +// Reset empties the matrix so that it can be reused as the // receiver of a dimensionally restricted operation. // +// Reset should not be used when the matrix shares backing data. // See the Reseter interface for more information. func (s *SymDense) Reset() { // N and Stride must be zeroed in unison. @@ -133,6 +137,27 @@ func (s *SymDense) Reset() { s.mat.Data = s.mat.Data[:0] } +// ReuseAsSym changes the receiver if it IsEmpty() to be of size n×n. +// +// ReuseAsSym re-uses the backing data slice if it has sufficient capacity, +// otherwise a new slice is allocated. The backing data is zero on return. +// +// ReuseAsSym panics if the receiver is not empty, and panics if +// the input size is less than one. To empty the receiver for re-use, +// Reset should be used. +func (s *SymDense) ReuseAsSym(n int) { + if n <= 0 { + if n == 0 { + panic(ErrZeroLength) + } + panic(ErrNegativeDimension) + } + if !s.IsEmpty() { + panic(ErrReuseNonEmpty) + } + s.reuseAsZeroed(n) +} + // Zero sets all of the matrix elements to zero. func (s *SymDense) Zero() { for i := 0; i < s.mat.N; i++ { @@ -140,24 +165,26 @@ func (s *SymDense) Zero() { } } -// IsZero returns whether the receiver is zero-sized. Zero-sized matrices can be the -// receiver for size-restricted operations. SymDense matrices can be zeroed using Reset. -func (s *SymDense) IsZero() bool { +// IsEmpty returns whether the receiver is empty. Empty matrices can be the +// receiver for size-restricted operations. The receiver can be emptied using +// Reset. +func (s *SymDense) IsEmpty() bool { // It must be the case that m.Dims() returns // zeros in this case. See comment in Reset(). return s.mat.N == 0 } -// reuseAs resizes an empty matrix to a n×n matrix, +// reuseAsNonZeroed resizes an empty matrix to a n×n matrix, // or checks that a non-empty matrix is n×n. -func (s *SymDense) reuseAs(n int) { +func (s *SymDense) reuseAsNonZeroed(n int) { + // reuseAsNonZeroed must be kept in sync with reuseAsZeroed. if n == 0 { panic(ErrZeroLength) } if s.mat.N > s.cap { panic(badSymCap) } - if s.IsZero() { + if s.IsEmpty() { s.mat = blas64.Symmetric{ N: n, Stride: n, @@ -175,6 +202,36 @@ func (s *SymDense) reuseAs(n int) { } } +// reuseAsNonZeroed resizes an empty matrix to a n×n matrix, +// or checks that a non-empty matrix is n×n. It then zeros the +// elements of the matrix. +func (s *SymDense) reuseAsZeroed(n int) { + // reuseAsZeroed must be kept in sync with reuseAsNonZeroed. + if n == 0 { + panic(ErrZeroLength) + } + if s.mat.N > s.cap { + panic(badSymCap) + } + if s.IsEmpty() { + s.mat = blas64.Symmetric{ + N: n, + Stride: n, + Data: useZeroed(s.mat.Data, n*n), + Uplo: blas.Upper, + } + s.cap = n + return + } + if s.mat.Uplo != blas.Upper { + panic(badSymTriangle) + } + if s.mat.N != n { + panic(ErrShape) + } + s.Zero() +} + func (s *SymDense) isolatedWorkspace(a Symmetric) (w *SymDense, restore func()) { n := a.Symmetric() if n == 0 { @@ -204,7 +261,7 @@ func (s *SymDense) AddSym(a, b Symmetric) { if n != b.Symmetric() { panic(ErrShape) } - s.reuseAs(n) + s.reuseAsNonZeroed(n) if a, ok := a.(RawSymmetricer); ok { if b, ok := b.(RawSymmetricer); ok { @@ -262,15 +319,15 @@ func (s *SymDense) CopySym(a Symmetric) int { return n } -// SymRankOne performs a symetric rank-one update to the matrix a and stores -// the result in the receiver -// s = a + alpha * x * x' +// SymRankOne performs a symmetric rank-one update to the matrix a with x, +// which is treated as a column vector, and stores the result in the receiver +// s = a + alpha * x * xᵀ func (s *SymDense) SymRankOne(a Symmetric, alpha float64, x Vector) { - n, c := x.Dims() - if a.Symmetric() != n || c != 1 { + n := x.Len() + if a.Symmetric() != n { panic(ErrShape) } - s.reuseAs(n) + s.reuseAsNonZeroed(n) if s != a { if rs, ok := a.(RawSymmetricer); ok { @@ -279,10 +336,11 @@ func (s *SymDense) SymRankOne(a Symmetric, alpha float64, x Vector) { s.CopySym(a) } - xU, _ := untranspose(x) - if rv, ok := xU.(RawVectorer); ok { - xmat := rv.RawVector() - s.checkOverlap((&VecDense{mat: xmat}).asGeneral()) + xU, _ := untransposeExtract(x) + if rv, ok := xU.(*VecDense); ok { + r, c := xU.Dims() + xmat := rv.mat + s.checkOverlap(generalFromVector(xmat, r, c)) blas64.Syr(alpha, xmat, s.mat) return } @@ -303,10 +361,10 @@ func (s *SymDense) SymRankK(a Symmetric, alpha float64, x Matrix) { if r != n { panic(ErrShape) } - xMat, aTrans := untranspose(x) + xMat, aTrans := untransposeExtract(x) var g blas64.General - if rm, ok := xMat.(RawMatrixer); ok { - g = rm.RawMatrix() + if rm, ok := xMat.(*Dense); ok { + g = rm.mat } else { g = DenseCopyOf(x).mat aTrans = false @@ -315,7 +373,7 @@ func (s *SymDense) SymRankK(a Symmetric, alpha float64, x Matrix) { if rs, ok := a.(RawSymmetricer); ok { s.checkOverlap(generalFromSymmetric(rs.RawSymmetric())) } - s.reuseAs(n) + s.reuseAsNonZeroed(n) s.CopySym(a) } t := blas.NoTrans @@ -333,7 +391,7 @@ func (s *SymDense) SymRankK(a Symmetric, alpha float64, x Matrix) { func (s *SymDense) SymOuterK(alpha float64, x Matrix) { n, _ := x.Dims() switch { - case s.IsZero(): + case s.IsEmpty(): s.mat = blas64.Symmetric{ N: n, Stride: n, @@ -371,17 +429,16 @@ func (s *SymDense) SymOuterK(alpha float64, x Matrix) { } } -// RankTwo performs a symmmetric rank-two update to the matrix a and stores -// the result in the receiver -// m = a + alpha * (x * y' + y * x') +// RankTwo performs a symmetric rank-two update to the matrix a with the +// vectors x and y, which are treated as column vectors, and stores the +// result in the receiver +// m = a + alpha * (x * yᵀ + y * xᵀ) func (s *SymDense) RankTwo(a Symmetric, alpha float64, x, y Vector) { n := s.mat.N - xr, xc := x.Dims() - if xr != n || xc != 1 { + if x.Len() != n { panic(ErrShape) } - yr, yc := y.Dims() - if yr != n || yc != 1 { + if y.Len() != n { panic(ErrShape) } @@ -393,17 +450,19 @@ func (s *SymDense) RankTwo(a Symmetric, alpha float64, x, y Vector) { var xmat, ymat blas64.Vector fast := true - xU, _ := untranspose(x) - if rv, ok := xU.(RawVectorer); ok { - xmat = rv.RawVector() - s.checkOverlap((&VecDense{mat: xmat}).asGeneral()) + xU, _ := untransposeExtract(x) + if rv, ok := xU.(*VecDense); ok { + r, c := xU.Dims() + xmat = rv.mat + s.checkOverlap(generalFromVector(xmat, r, c)) } else { fast = false } - yU, _ := untranspose(y) - if rv, ok := yU.(RawVectorer); ok { - ymat = rv.RawVector() - s.checkOverlap((&VecDense{mat: ymat}).asGeneral()) + yU, _ := untransposeExtract(y) + if rv, ok := yU.(*VecDense); ok { + r, c := yU.Dims() + ymat = rv.mat + s.checkOverlap(generalFromVector(ymat, r, c)) } else { fast = false } @@ -412,13 +471,13 @@ func (s *SymDense) RankTwo(a Symmetric, alpha float64, x, y Vector) { if rs, ok := a.(RawSymmetricer); ok { s.checkOverlap(generalFromSymmetric(rs.RawSymmetric())) } - s.reuseAs(n) + s.reuseAsNonZeroed(n) s.CopySym(a) } if fast { if s != a { - s.reuseAs(n) + s.reuseAsNonZeroed(n) s.CopySym(a) } blas64.Syr2(alpha, xmat, ymat, s.mat) @@ -426,7 +485,7 @@ func (s *SymDense) RankTwo(a Symmetric, alpha float64, x, y Vector) { } for i := 0; i < n; i++ { - s.reuseAs(n) + s.reuseAsNonZeroed(n) for j := i; j < n; j++ { s.set(i, j, a.At(i, j)+alpha*(x.AtVec(i)*y.AtVec(j)+y.AtVec(i)*x.AtVec(j))) } @@ -436,7 +495,7 @@ func (s *SymDense) RankTwo(a Symmetric, alpha float64, x, y Vector) { // ScaleSym multiplies the elements of a by f, placing the result in the receiver. func (s *SymDense) ScaleSym(f float64, a Symmetric) { n := a.Symmetric() - s.reuseAs(n) + s.reuseAsNonZeroed(n) if a, ok := a.(RawSymmetricer); ok { amat := a.RawSymmetric() if s != a { @@ -464,7 +523,7 @@ func (s *SymDense) ScaleSym(f float64, a Symmetric) { func (s *SymDense) SubsetSym(a Symmetric, set []int) { n := len(set) na := a.Symmetric() - s.reuseAs(n) + s.reuseAsNonZeroed(n) var restore func() if a == s { s, restore = s.isolatedWorkspace(a) @@ -575,7 +634,7 @@ func (s *SymDense) GrowSym(n int) Symmetric { // or the Eigendecomposition is not successful. func (s *SymDense) PowPSD(a Symmetric, pow float64) error { dim := a.Symmetric() - s.reuseAs(dim) + s.reuseAsNonZeroed(dim) var eigen EigenSym ok := eigen.Factorize(a, true) @@ -589,13 +648,14 @@ func (s *SymDense) PowPSD(a Symmetric, pow float64) error { } values[i] = math.Pow(v, pow) } - u := eigen.VectorsTo(nil) + var u Dense + eigen.VectorsTo(&u) s.SymOuterK(values[0], u.ColView(0)) var v VecDense for i := 1; i < dim; i++ { - v.ColViewOf(u, i) + v.ColViewOf(&u, i) s.SymRankOne(s, values[i], &v) } return nil diff --git a/vendor/gonum.org/v1/gonum/mat/triangular.go b/vendor/gonum.org/v1/gonum/mat/triangular.go index e32ee405498..962c51625ce 100644 --- a/vendor/gonum.org/v1/gonum/mat/triangular.go +++ b/vendor/gonum.org/v1/gonum/mat/triangular.go @@ -15,6 +15,8 @@ import ( var ( triDense *TriDense _ Matrix = triDense + _ allMatrix = triDense + _ denseMatrix = triDense _ Triangular = triDense _ RawTriangular = triDense _ MutableTriangular = triDense @@ -152,7 +154,7 @@ func (t *TriDense) Dims() (r, c int) { } // Triangle returns the dimension of t and its orientation. The returned -// orientation is only valid when n is not zero. +// orientation is only valid when n is not empty. func (t *TriDense) Triangle() (n int, kind TriKind) { return t.mat.N, t.triKind() } @@ -226,12 +228,14 @@ func (t *TriDense) SetRawTriangular(mat blas64.Triangular) { if mat.Diag == blas.Unit { panic("mat: cannot set TriDense with Unit storage format") } + t.cap = mat.N t.mat = mat } -// Reset zeros the dimensions of the matrix so that it can be reused as the +// Reset empties the matrix so that it can be reused as the // receiver of a dimensionally restricted operation. // +// Reset should not be used when the matrix shares backing data. // See the Reseter interface for more information. func (t *TriDense) Reset() { // N and Stride must be zeroed in unison. @@ -255,9 +259,10 @@ func (t *TriDense) Zero() { } } -// IsZero returns whether the receiver is zero-sized. Zero-sized matrices can be the -// receiver for size-restricted operations. TriDense matrices can be zeroed using Reset. -func (t *TriDense) IsZero() bool { +// IsEmpty returns whether the receiver is empty. Empty matrices can be the +// receiver for size-restricted operations. The receiver can be emptied using +// Reset. +func (t *TriDense) IsEmpty() bool { // It must be the case that t.Dims() returns // zeros in this case. See comment in Reset(). return t.mat.Stride == 0 @@ -273,10 +278,32 @@ func untransposeTri(a Triangular) (Triangular, bool) { return a, false } -// reuseAs resizes a zero receiver to an n×n triangular matrix with the given -// orientation. If the receiver is non-zero, reuseAs checks that the receiver +// ReuseAsTri changes the receiver if it IsEmpty() to be of size n×n. +// +// ReuseAsTri re-uses the backing data slice if it has sufficient capacity, +// otherwise a new slice is allocated. The backing data is zero on return. +// +// ReuseAsTri panics if the receiver is not empty, and panics if +// the input size is less than one. To empty the receiver for re-use, +// Reset should be used. +func (t *TriDense) ReuseAsTri(n int, kind TriKind) { + if n <= 0 { + if n == 0 { + panic(ErrZeroLength) + } + panic(ErrNegativeDimension) + } + if !t.IsEmpty() { + panic(ErrReuseNonEmpty) + } + t.reuseAsZeroed(n, kind) +} + +// reuseAsNonZeroed resizes a zero receiver to an n×n triangular matrix with the given +// orientation. If the receiver is non-zero, reuseAsNonZeroed checks that the receiver // is the correct size and orientation. -func (t *TriDense) reuseAs(n int, kind TriKind) { +func (t *TriDense) reuseAsNonZeroed(n int, kind TriKind) { + // reuseAsNonZeroed must be kept in sync with reuseAsZeroed. if n == 0 { panic(ErrZeroLength) } @@ -287,7 +314,7 @@ func (t *TriDense) reuseAs(n int, kind TriKind) { if t.mat.N > t.cap { panic(badTriCap) } - if t.IsZero() { + if t.IsEmpty() { t.mat = blas64.Triangular{ N: n, Stride: n, @@ -306,6 +333,41 @@ func (t *TriDense) reuseAs(n int, kind TriKind) { } } +// reuseAsZeroed resizes a zero receiver to an n×n triangular matrix with the given +// orientation. If the receiver is non-zero, reuseAsZeroed checks that the receiver +// is the correct size and orientation. It then zeros out the matrix data. +func (t *TriDense) reuseAsZeroed(n int, kind TriKind) { + // reuseAsZeroed must be kept in sync with reuseAsNonZeroed. + if n == 0 { + panic(ErrZeroLength) + } + ul := blas.Lower + if kind == Upper { + ul = blas.Upper + } + if t.mat.N > t.cap { + panic(badTriCap) + } + if t.IsEmpty() { + t.mat = blas64.Triangular{ + N: n, + Stride: n, + Diag: blas.NonUnit, + Data: useZeroed(t.mat.Data, n*n), + Uplo: ul, + } + t.cap = n + return + } + if t.mat.N != n { + panic(ErrShape) + } + if t.mat.Uplo != ul { + panic(ErrTriangle) + } + t.Zero() +} + // isolatedWorkspace returns a new TriDense matrix w with the size of a and // returns a callback to defer which performs cleanup at the return of the call. // This should be used when a method receiver is the same pointer as an input argument. @@ -405,7 +467,7 @@ func (t *TriDense) Copy(a Matrix) (r, c int) { func (t *TriDense) InverseTri(a Triangular) error { t.checkOverlapMatrix(a) n, _ := a.Triangle() - t.reuseAs(a.Triangle()) + t.reuseAsNonZeroed(a.Triangle()) t.Copy(a) work := getFloats(3*n, false) iwork := getInts(n, false) @@ -442,7 +504,7 @@ func (t *TriDense) MulTri(a, b Triangular) { bU, _ := untransposeTri(b) t.checkOverlapMatrix(bU) t.checkOverlapMatrix(aU) - t.reuseAs(n, kind) + t.reuseAsNonZeroed(n, kind) var restore func() if t == aU { t, restore = t.isolatedWorkspace(aU) @@ -452,15 +514,39 @@ func (t *TriDense) MulTri(a, b Triangular) { defer restore() } - // TODO(btracey): Improve the set of fast-paths. + // Inspect types here, helps keep the loops later clean(er). + _, aDiag := aU.(Diagonal) + _, bDiag := bU.(Diagonal) + // If they are both diagonal only need 1 loop. + // All diagonal matrices are Upper. + // TODO: Add fast paths for DiagDense. + if aDiag && bDiag { + t.Zero() + for i := 0; i < n; i++ { + t.SetTri(i, i, a.At(i, i)*b.At(i, i)) + } + return + } + + // Now we know at least one matrix is non-diagonal. + // And all diagonal matrices are all Upper. + // The both-diagonal case is handled above. + // TODO: Add fast paths for Dense variants. if kind == Upper { for i := 0; i < n; i++ { for j := i; j < n; j++ { - var v float64 - for k := i; k <= j; k++ { - v += a.At(i, k) * b.At(k, j) + switch { + case aDiag: + t.SetTri(i, j, a.At(i, i)*b.At(i, j)) + case bDiag: + t.SetTri(i, j, a.At(i, j)*b.At(j, j)) + default: + var v float64 + for k := i; k <= j; k++ { + v += a.At(i, k) * b.At(k, j) + } + t.SetTri(i, j, v) } - t.SetTri(i, j, v) } } return @@ -481,7 +567,7 @@ func (t *TriDense) MulTri(a, b Triangular) { // the input, or ScaleTri will panic. func (t *TriDense) ScaleTri(f float64, a Triangular) { n, kind := a.Triangle() - t.reuseAs(n, kind) + t.reuseAsNonZeroed(n, kind) // TODO(btracey): Improve the set of fast-paths. switch a := a.(type) { diff --git a/vendor/gonum.org/v1/gonum/mat/triband.go b/vendor/gonum.org/v1/gonum/mat/triband.go index f97855046ea..9c26f196414 100644 --- a/vendor/gonum.org/v1/gonum/mat/triband.go +++ b/vendor/gonum.org/v1/gonum/mat/triband.go @@ -16,6 +16,8 @@ var ( triBandDense *TriBandDense _ Matrix = triBandDense + _ allMatrix = triBandDense + _ denseMatrix = triBandDense _ Triangular = triBandDense _ Banded = triBandDense _ TriBanded = triBandDense @@ -237,17 +239,19 @@ func (t *TriBandDense) T() Matrix { return Transpose{t} } -// IsZero returns whether the receiver is zero-sized. Zero-sized matrices can be the -// receiver for size-restricted operations. TriBandDense matrices can be zeroed using Reset. -func (t *TriBandDense) IsZero() bool { +// IsEmpty returns whether the receiver is empty. Empty matrices can be the +// receiver for size-restricted operations. The receiver can be emptied using +// Reset. +func (t *TriBandDense) IsEmpty() bool { // It must be the case that t.Dims() returns // zeros in this case. See comment in Reset(). return t.mat.Stride == 0 } -// Reset zeros the dimensions of the matrix so that it can be reused as the +// Reset empties the matrix so that it can be reused as the // receiver of a dimensionally restricted operation. // +// Reset should not be used when the matrix shares backing data. // See the Reseter interface for more information. func (t *TriBandDense) Reset() { t.mat.N = 0 @@ -306,7 +310,7 @@ func (t *TriBandDense) TBand() Banded { // TriBand returns the number of rows/columns in the matrix, the // size of the bandwidth, and the orientation. func (t *TriBandDense) TriBand() (n, k int, kind TriKind) { - return t.mat.N, t.mat.K, TriKind(!t.IsZero()) && t.triKind() + return t.mat.N, t.mat.K, TriKind(!t.IsEmpty()) && t.triKind() } // TTriBand performs an implicit transpose by returning the receiver inside a TransposeTriBand. @@ -351,3 +355,17 @@ func (t *TriBandDense) DiagView() Diagonal { }, } } + +// Trace returns the trace. +func (t *TriBandDense) Trace() float64 { + rb := t.RawTriBand() + var tr float64 + var offsetIndex int + if rb.Uplo == blas.Lower { + offsetIndex = rb.K + } + for i := 0; i < rb.N; i++ { + tr += rb.Data[offsetIndex+i*rb.Stride] + } + return tr +} diff --git a/vendor/gonum.org/v1/gonum/mat/vector.go b/vendor/gonum.org/v1/gonum/mat/vector.go index 8191312bfe4..0f0f3cbf36d 100644 --- a/vendor/gonum.org/v1/gonum/mat/vector.go +++ b/vendor/gonum.org/v1/gonum/mat/vector.go @@ -13,9 +13,10 @@ import ( var ( vector *VecDense - _ Matrix = vector - _ Vector = vector - _ Reseter = vector + _ Matrix = vector + _ allMatrix = vector + _ Vector = vector + _ Reseter = vector ) // Vector is a vector. @@ -128,7 +129,7 @@ func (v *VecDense) SliceVec(i, k int) Vector { // Dims returns the number of rows and columns in the matrix. Columns is always 1 // for a non-Reset vector. func (v *VecDense) Dims() (r, c int) { - if v.IsZero() { + if v.IsEmpty() { return 0, 0 } return v.mat.N, 1 @@ -137,7 +138,7 @@ func (v *VecDense) Dims() (r, c int) { // Caps returns the number of rows and columns in the backing matrix. Columns is always 1 // for a non-Reset vector. func (v *VecDense) Caps() (r, c int) { - if v.IsZero() { + if v.IsEmpty() { return 0, 0 } return v.Cap(), 1 @@ -150,7 +151,7 @@ func (v *VecDense) Len() int { // Cap returns the capacity of the vector. func (v *VecDense) Cap() int { - if v.IsZero() { + if v.IsEmpty() { return 0 } return (cap(v.mat.Data)-1)/v.mat.Inc + 1 @@ -166,9 +167,10 @@ func (v *VecDense) TVec() Vector { return TransposeVec{v} } -// Reset zeros the length of the vector so that it can be reused as the +// Reset empties the matrix so that it can be reused as the // receiver of a dimensionally restricted operation. // +// Reset should not be used when the matrix shares backing data. // See the Reseter interface for more information. func (v *VecDense) Reset() { // No change of Inc or N to 0 may be @@ -226,7 +228,11 @@ func (v *VecDense) CopyVec(a Vector) int { return n } if r, ok := a.(RawVectorer); ok { - blas64.Copy(r.RawVector(), v.mat) + src := r.RawVector() + src.N = n + dst := v.mat + dst.N = n + blas64.Copy(src, dst) return n } for i := 0; i < n; i++ { @@ -248,7 +254,7 @@ func (v *VecDense) ScaleVec(alpha float64, a Vector) { return } - v.reuseAs(n) + v.reuseAsNonZeroed(n) if rv, ok := a.(RawVectorer); ok { mat := rv.RawVector() @@ -287,18 +293,18 @@ func (v *VecDense) AddScaledVec(a Vector, alpha float64, b Vector) { var amat, bmat blas64.Vector fast := true - aU, _ := untranspose(a) - if rv, ok := aU.(RawVectorer); ok { - amat = rv.RawVector() + aU, _ := untransposeExtract(a) + if rv, ok := aU.(*VecDense); ok { + amat = rv.mat if v != a { v.checkOverlap(amat) } } else { fast = false } - bU, _ := untranspose(b) - if rv, ok := bU.(RawVectorer); ok { - bmat = rv.RawVector() + bU, _ := untransposeExtract(b) + if rv, ok := bU.(*VecDense); ok { + bmat = rv.mat if v != b { v.checkOverlap(bmat) } @@ -306,7 +312,7 @@ func (v *VecDense) AddScaledVec(a Vector, alpha float64, b Vector) { fast = false } - v.reuseAs(ar) + v.reuseAsNonZeroed(ar) switch { case alpha == 0: // v <- a @@ -349,15 +355,15 @@ func (v *VecDense) AddVec(a, b Vector) { panic(ErrShape) } - v.reuseAs(ar) + v.reuseAsNonZeroed(ar) - aU, _ := untranspose(a) - bU, _ := untranspose(b) + aU, _ := untransposeExtract(a) + bU, _ := untransposeExtract(b) - if arv, ok := aU.(RawVectorer); ok { - if brv, ok := bU.(RawVectorer); ok { - amat := arv.RawVector() - bmat := brv.RawVector() + if arv, ok := aU.(*VecDense); ok { + if brv, ok := bU.(*VecDense); ok { + amat := arv.mat + bmat := brv.mat if v != a { v.checkOverlap(amat) @@ -392,15 +398,15 @@ func (v *VecDense) SubVec(a, b Vector) { panic(ErrShape) } - v.reuseAs(ar) + v.reuseAsNonZeroed(ar) - aU, _ := untranspose(a) - bU, _ := untranspose(b) + aU, _ := untransposeExtract(a) + bU, _ := untransposeExtract(b) - if arv, ok := aU.(RawVectorer); ok { - if brv, ok := bU.(RawVectorer); ok { - amat := arv.RawVector() - bmat := brv.RawVector() + if arv, ok := aU.(*VecDense); ok { + if brv, ok := bU.(*VecDense); ok { + amat := arv.mat + bmat := brv.mat if v != a { v.checkOverlap(amat) @@ -436,15 +442,15 @@ func (v *VecDense) MulElemVec(a, b Vector) { panic(ErrShape) } - v.reuseAs(ar) + v.reuseAsNonZeroed(ar) - aU, _ := untranspose(a) - bU, _ := untranspose(b) + aU, _ := untransposeExtract(a) + bU, _ := untransposeExtract(b) - if arv, ok := aU.(RawVectorer); ok { - if brv, ok := bU.(RawVectorer); ok { - amat := arv.RawVector() - bmat := brv.RawVector() + if arv, ok := aU.(*VecDense); ok { + if brv, ok := bU.(*VecDense); ok { + amat := arv.mat + bmat := brv.mat if v != a { v.checkOverlap(amat) @@ -485,15 +491,15 @@ func (v *VecDense) DivElemVec(a, b Vector) { panic(ErrShape) } - v.reuseAs(ar) + v.reuseAsNonZeroed(ar) - aU, _ := untranspose(a) - bU, _ := untranspose(b) + aU, _ := untransposeExtract(a) + bU, _ := untransposeExtract(b) - if arv, ok := aU.(RawVectorer); ok { - if brv, ok := bU.(RawVectorer); ok { - amat := arv.RawVector() - bmat := brv.RawVector() + if arv, ok := aU.(*VecDense); ok { + if brv, ok := bU.(*VecDense); ok { + amat := arv.mat + bmat := brv.mat if v != a { v.checkOverlap(amat) @@ -533,12 +539,12 @@ func (v *VecDense) MulVec(a Matrix, b Vector) { panic(ErrShape) } - aU, trans := untranspose(a) + aU, trans := untransposeExtract(a) var bmat blas64.Vector fast := true - bU, _ := untranspose(b) - if rv, ok := bU.(RawVectorer); ok { - bmat = rv.RawVector() + bU, _ := untransposeExtract(b) + if rv, ok := bU.(*VecDense); ok { + bmat = rv.mat if v != b { v.checkOverlap(bmat) } @@ -546,7 +552,7 @@ func (v *VecDense) MulVec(a Matrix, b Vector) { fast = false } - v.reuseAs(r) + v.reuseAsNonZeroed(r) var restore func() if v == aU { v, restore = v.isolatedWorkspace(aU.(*VecDense)) @@ -567,8 +573,8 @@ func (v *VecDense) MulVec(a Matrix, b Vector) { // {1,n} x {n,1} if fast { - if rv, ok := aU.(RawVectorer); ok { - amat := rv.RawVector() + if rv, ok := aU.(*VecDense); ok { + amat := rv.mat if v != aU { v.checkOverlap(amat) } @@ -589,37 +595,34 @@ func (v *VecDense) MulVec(a Matrix, b Vector) { } v.setVec(0, sum) return - case RawSymmetricer: + case *SymBandDense: if fast { - amat := aU.RawSymmetric() - // We don't know that a is a *SymDense, so make - // a temporary SymDense to check overlap. - (&SymDense{mat: amat}).checkOverlap(v.asGeneral()) - blas64.Symv(1, amat, bmat, 0, v.mat) + aU.checkOverlap(v.asGeneral()) + blas64.Sbmv(1, aU.mat, bmat, 0, v.mat) return } - case RawTriangular: + case *SymDense: + if fast { + aU.checkOverlap(v.asGeneral()) + blas64.Symv(1, aU.mat, bmat, 0, v.mat) + return + } + case *TriDense: v.CopyVec(b) - amat := aU.RawTriangular() - // We don't know that a is a *TriDense, so make - // a temporary TriDense to check overlap. - (&TriDense{mat: amat}).checkOverlap(v.asGeneral()) + aU.checkOverlap(v.asGeneral()) ta := blas.NoTrans if trans { ta = blas.Trans } - blas64.Trmv(ta, amat, v.mat) - case RawMatrixer: + blas64.Trmv(ta, aU.mat, v.mat) + case *Dense: if fast { - amat := aU.RawMatrix() - // We don't know that a is a *Dense, so make - // a temporary Dense to check overlap. - (&Dense{mat: amat}).checkOverlap(v.asGeneral()) + aU.checkOverlap(v.asGeneral()) t := blas.NoTrans if trans { t = blas.Trans } - blas64.Gemv(t, 1, amat, bmat, 0, v.mat) + blas64.Gemv(t, 1, aU.mat, bmat, 0, v.mat) return } default: @@ -644,13 +647,35 @@ func (v *VecDense) MulVec(a Matrix, b Vector) { } } -// reuseAs resizes an empty vector to a r×1 vector, +// ReuseAsVec changes the receiver if it IsEmpty() to be of size n×1. +// +// ReuseAsVec re-uses the backing data slice if it has sufficient capacity, +// otherwise a new slice is allocated. The backing data is zero on return. +// +// ReuseAsVec panics if the receiver is not empty, and panics if +// the input size is less than one. To empty the receiver for re-use, +// Reset should be used. +func (v *VecDense) ReuseAsVec(n int) { + if n <= 0 { + if n == 0 { + panic(ErrZeroLength) + } + panic(ErrNegativeDimension) + } + if !v.IsEmpty() { + panic(ErrReuseNonEmpty) + } + v.reuseAsZeroed(n) +} + +// reuseAsNonZeroed resizes an empty vector to a r×1 vector, // or checks that a non-empty matrix is r×1. -func (v *VecDense) reuseAs(r int) { +func (v *VecDense) reuseAsNonZeroed(r int) { + // reuseAsNonZeroed must be kept in sync with reuseAsZeroed. if r == 0 { panic(ErrZeroLength) } - if v.IsZero() { + if v.IsEmpty() { v.mat = blas64.Vector{ N: r, Inc: 1, @@ -663,9 +688,31 @@ func (v *VecDense) reuseAs(r int) { } } -// IsZero returns whether the receiver is zero-sized. Zero-sized vectors can be the -// receiver for size-restricted operations. VecDenses can be zeroed using Reset. -func (v *VecDense) IsZero() bool { +// reuseAsZeroed resizes an empty vector to a r×1 vector, +// or checks that a non-empty matrix is r×1. +func (v *VecDense) reuseAsZeroed(r int) { + // reuseAsZeroed must be kept in sync with reuseAsNonZeroed. + if r == 0 { + panic(ErrZeroLength) + } + if v.IsEmpty() { + v.mat = blas64.Vector{ + N: r, + Inc: 1, + Data: useZeroed(v.mat.Data, r), + } + return + } + if r != v.mat.N { + panic(ErrShape) + } + v.Zero() +} + +// IsEmpty returns whether the receiver is empty. Empty matrices can be the +// receiver for size-restricted operations. The receiver can be emptied using +// Reset. +func (v *VecDense) IsEmpty() bool { // It must be the case that v.Dims() returns // zeros in this case. See comment in Reset(). return v.mat.Inc == 0 @@ -705,15 +752,15 @@ func (v *VecDense) asGeneral() blas64.General { } // ColViewOf reflects the column j of the RawMatrixer m, into the receiver -// backed by the same underlying data. The length of the receiver must either be -// zero or match the number of rows in m. +// backed by the same underlying data. The receiver must either be empty +// have length equal to the number of rows of m. func (v *VecDense) ColViewOf(m RawMatrixer, j int) { rm := m.RawMatrix() if j >= rm.Cols || j < 0 { panic(ErrColAccess) } - if !v.IsZero() && v.mat.N != rm.Rows { + if !v.IsEmpty() && v.mat.N != rm.Rows { panic(ErrShape) } @@ -723,15 +770,15 @@ func (v *VecDense) ColViewOf(m RawMatrixer, j int) { } // RowViewOf reflects the row i of the RawMatrixer m, into the receiver -// backed by the same underlying data. The length of the receiver must either be -// zero or match the number of columns in m. +// backed by the same underlying data. The receiver must either be +// empty or have length equal to the number of columns of m. func (v *VecDense) RowViewOf(m RawMatrixer, i int) { rm := m.RawMatrix() if i >= rm.Rows || i < 0 { panic(ErrRowAccess) } - if !v.IsZero() && v.mat.N != rm.Cols { + if !v.IsEmpty() && v.mat.N != rm.Cols { panic(ErrShape) } diff --git a/vendor/modules.txt b/vendor/modules.txt index 67af2bba312..4c953484e99 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -941,7 +941,7 @@ golang.org/x/tools/internal/gopathwalk golang.org/x/tools/internal/imports golang.org/x/tools/internal/module golang.org/x/tools/internal/semver -# gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485 => gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485 +# gonum.org/v1/gonum v0.6.2 => gonum.org/v1/gonum v0.6.2 gonum.org/v1/gonum/blas gonum.org/v1/gonum/blas/blas64 gonum.org/v1/gonum/blas/cblas128