lapack: rename HowMany type and consts
MODIFY
lapack/gonum/dgeev.go
lapack/gonum/dgeev.go
@@ -123,7 +123,7 @@ func (impl Implementation) Dgeev(jobvl lapack.LeftEVJob, jobvr lapack.RightEVJob
if wantvr {
side = lapack.EVRight
}
- impl.Dtrevc3(side, lapack.AllEVMulQ, nil, n, nil, 1, nil, 1, nil, 1,
+ impl.Dtrevc3(side, lapack.EVAllMulQ, nil, n, nil, 1, nil, 1, nil, 1,
n, work, -1)
maxwrk = max(maxwrk, n+int(work[0]))
maxwrk = max(maxwrk, 4*n)
@@ -215,7 +215,7 @@ func (impl Implementation) Dgeev(jobvl lapack.LeftEVJob, jobvr lapack.RightEVJob
if wantvl || wantvr {
// Compute left and/or right eigenvectors.
- impl.Dtrevc3(side, lapack.AllEVMulQ, nil, n,
+ impl.Dtrevc3(side, lapack.EVAllMulQ, nil, n,
a, lda, vl, ldvl, vr, ldvr, n, work[iwrk:], lwork-iwrk)
}
bi := blas64.Implementation()

MODIFY
lapack/gonum/general.go
lapack/gonum/general.go
@@ -28,10 +28,10 @@ const (
badDirect = "lapack: bad direct"
badE = "lapack: e has insufficient length"
badEVComp = "lapack: bad EVComp"
+ badEVHowMany = "lapack: bad EVHowMany"
badEVJob = "lapack: bad EVJob"
badEVSide = "lapack: bad EVSide"
badGSVDJob = "lapack: bad GSVDJob"
- badHowMany = "lapack: bad HowMany"
badIlo = "lapack: ilo out of range"
badIhi = "lapack: ihi out of range"
badIpiv = "lapack: bad permutation length"

MODIFY
lapack/lapack.go
lapack/lapack.go
@@ -187,12 +187,11 @@ const (
EVRightLeft EVSide = 'B' // Both right and left eigenvectors are computed.
)
-// HowMany specifies which eigenvectors will be computed.
-type HowMany byte
+// EVHowMany specifies which eigenvectors are computed in Dtrevc3 and how.
+type EVHowMany byte
-// HowMany constants for Dhseqr.
const (
- AllEV HowMany = 'A' // Compute all right and/or left eigenvectors.
- AllEVMulQ HowMany = 'B' // Compute all right and/or left eigenvectors multiplied by an input matrix.
- SelectedEV HowMany = 'S' // Compute selected right and/or left eigenvectors.
+ EVAll EVHowMany = 'A' // Compute all right and/or left eigenvectors.
+ EVAllMulQ EVHowMany = 'B' // Compute all right and/or left eigenvectors multiplied by an input matrix.
+ EVSelected EVHowMany = 'S' // Compute selected right and/or left eigenvectors.
)

MODIFY
lapack/testlapack/dtrevc3.go
lapack/testlapack/dtrevc3.go
@@ -17,7 +17,7 @@ import (
)
type Dtrevc3er interface {
- Dtrevc3(side lapack.EVSide, howmny lapack.HowMany, selected []bool, n int, t []float64, ldt int, vl []float64, ldvl int, vr []float64, ldvr int, mm int, work []float64, lwork int) int
+ Dtrevc3(side lapack.EVSide, howmny lapack.EVHowMany, selected []bool, n int, t []float64, ldt int, vl []float64, ldvl int, vr []float64, ldvr int, mm int, work []float64, lwork int) int
}
func Dtrevc3Test(t *testing.T, impl Dtrevc3er) {
@@ -38,7 +38,7 @@ func Dtrevc3Test(t *testing.T, impl Dtrevc3er) {
}
}
-func testDtrevc3(t *testing.T, impl Dtrevc3er, side lapack.EVSide, howmny lapack.HowMany, tmat blas64.General, optwork bool, rnd *rand.Rand) {
+func testDtrevc3(t *testing.T, impl Dtrevc3er, side lapack.EVSide, howmny lapack.EVHowMany, tmat blas64.General, optwork bool, rnd *rand.Rand) {
const tol = 1e-14
n := tmat.Rows
@@ -48,7 +48,7 @@ func testDtrevc3(t *testing.T, impl Dtrevc3er, side lapack.EVSide, howmny lapack
var selected, selectedWant []bool
var mWant int // How many columns will the eigenvectors occupy.
- if howmny == lapack.SelectedEV {
+ if howmny == lapack.EVSelected {
selected = make([]bool, n)
selectedWant = make([]bool, n)
// Dtrevc3 will compute only selected eigenvectors. Pick them
@@ -88,7 +88,7 @@ func testDtrevc3(t *testing.T, impl Dtrevc3er, side lapack.EVSide, howmny lapack
var vr blas64.General
if right {
- if howmny == lapack.AllEVMulQ {
+ if howmny == lapack.EVAllMulQ {
vr = eye(n, n+extra)
} else {
// VR will be overwritten.
@@ -98,7 +98,7 @@ func testDtrevc3(t *testing.T, impl Dtrevc3er, side lapack.EVSide, howmny lapack
var vl blas64.General
if left {
- if howmny == lapack.AllEVMulQ {
+ if howmny == lapack.EVAllMulQ {
vl = eye(n, n+extra)
} else {
// VL will be overwritten.
@@ -132,7 +132,7 @@ func testDtrevc3(t *testing.T, impl Dtrevc3er, side lapack.EVSide, howmny lapack
t.Errorf("%v: unexpected value of m. Want %v, got %v", prefix, mWant, m)
}
- if howmny == lapack.SelectedEV {
+ if howmny == lapack.EVSelected {
for i := range selected {
if selected[i] != selectedWant[i] {
t.Errorf("%v: unexpected selected[%v]", prefix, i)
@@ -146,7 +146,7 @@ func testDtrevc3(t *testing.T, impl Dtrevc3er, side lapack.EVSide, howmny lapack
for j := 0; j < n; {
re := tmat.Data[j*tmat.Stride+j]
if j == n-1 || tmat.Data[(j+1)*tmat.Stride+j] == 0 {
- if howmny == lapack.SelectedEV && !selected[j] {
+ if howmny == lapack.EVSelected && !selected[j] {
j++
continue
}
@@ -174,7 +174,7 @@ func testDtrevc3(t *testing.T, impl Dtrevc3er, side lapack.EVSide, howmny lapack
j++
continue
}
- if howmny == lapack.SelectedEV && !selected[j] {
+ if howmny == lapack.EVSelected && !selected[j] {
j += 2
continue
}

lapack: rename HowMany type and consts