mirror of
https://github.com/gonum/gonum.git
synced 2025-10-19 05:24:52 +08:00
lapack: rename EigComp to EVComp
This follows the naming style of EVJob and EVSide.
This commit is contained in:
@@ -20,7 +20,7 @@ const (
|
|||||||
badDims = "lapack: bad input dimensions"
|
badDims = "lapack: bad input dimensions"
|
||||||
badDirect = "lapack: bad direct"
|
badDirect = "lapack: bad direct"
|
||||||
badE = "lapack: e has insufficient length"
|
badE = "lapack: e has insufficient length"
|
||||||
badEigComp = "lapack: bad EigComp"
|
badEVComp = "lapack: bad EVComp"
|
||||||
badEVSide = "lapack: bad EVSide"
|
badEVSide = "lapack: bad EVSide"
|
||||||
badHowMany = "lapack: bad HowMany"
|
badHowMany = "lapack: bad HowMany"
|
||||||
badIlo = "lapack: ilo out of range"
|
badIlo = "lapack: ilo out of range"
|
||||||
|
@@ -108,16 +108,16 @@ const (
|
|||||||
SVDNone SVDJob = 'N' // Do not compute singular vectors
|
SVDNone SVDJob = 'N' // Do not compute singular vectors
|
||||||
)
|
)
|
||||||
|
|
||||||
// EigComp specifies the type of eigenvalue decomposition.
|
// EVComp specifies how eigenvectors are computed.
|
||||||
type EigComp byte
|
type EVComp byte
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// EigDecomp specifies to compute the eigenvalues and eigenvectors of the
|
// EigDecomp specifies to compute the eigenvalues and eigenvectors of the
|
||||||
// full symmetric matrix.
|
// full symmetric matrix.
|
||||||
EigDecomp EigComp = 'V'
|
EigDecomp EVComp = 'V'
|
||||||
// EigBoth specifies to compute both the eigenvalues and eigenvectors of the
|
// EigBoth specifies to compute both the eigenvalues and eigenvectors of the
|
||||||
// input tridiagonal matrix.
|
// input tridiagonal matrix.
|
||||||
EigBoth EigComp = 'I'
|
EigBoth EVComp = 'I'
|
||||||
)
|
)
|
||||||
|
|
||||||
// Job types for computation of eigenvectors.
|
// Job types for computation of eigenvectors.
|
||||||
|
@@ -36,7 +36,7 @@ import (
|
|||||||
// and Dsteqr will panic otherwise.
|
// and Dsteqr will panic otherwise.
|
||||||
//
|
//
|
||||||
// Dsteqr is an internal routine. It is exported for testing purposes.
|
// Dsteqr is an internal routine. It is exported for testing purposes.
|
||||||
func (impl Implementation) Dsteqr(compz lapack.EigComp, n int, d, e, z []float64, ldz int, work []float64) (ok bool) {
|
func (impl Implementation) Dsteqr(compz lapack.EVComp, n int, d, e, z []float64, ldz int, work []float64) (ok bool) {
|
||||||
if len(d) < n {
|
if len(d) < n {
|
||||||
panic(badD)
|
panic(badD)
|
||||||
}
|
}
|
||||||
@@ -44,7 +44,7 @@ func (impl Implementation) Dsteqr(compz lapack.EigComp, n int, d, e, z []float64
|
|||||||
panic(badE)
|
panic(badE)
|
||||||
}
|
}
|
||||||
if compz != lapack.None && compz != lapack.EigBoth && compz != lapack.EigDecomp {
|
if compz != lapack.None && compz != lapack.EigBoth && compz != lapack.EigDecomp {
|
||||||
panic(badEigComp)
|
panic(badEVComp)
|
||||||
}
|
}
|
||||||
if compz != lapack.None {
|
if compz != lapack.None {
|
||||||
if len(work) < max(1, 2*n-2) {
|
if len(work) < max(1, 2*n-2) {
|
||||||
|
@@ -97,7 +97,7 @@ func (impl Implementation) Dsyev(jobz lapack.EVJob, uplo blas.Uplo, n int, a []f
|
|||||||
ok = impl.Dsterf(n, w, work[inde:])
|
ok = impl.Dsterf(n, w, work[inde:])
|
||||||
} else {
|
} else {
|
||||||
impl.Dorgtr(uplo, n, a, lda, work[indtau:], work[indwork:], llwork)
|
impl.Dorgtr(uplo, n, a, lda, work[indtau:], work[indwork:], llwork)
|
||||||
ok = impl.Dsteqr(lapack.EigComp(jobz), n, w, work[inde:], a, lda, work[indtau:])
|
ok = impl.Dsteqr(lapack.EVComp(jobz), n, w, work[inde:], a, lda, work[indtau:])
|
||||||
}
|
}
|
||||||
if !ok {
|
if !ok {
|
||||||
return false
|
return false
|
||||||
|
@@ -26,7 +26,7 @@ const (
|
|||||||
badDims = "lapack: bad input dimensions"
|
badDims = "lapack: bad input dimensions"
|
||||||
badDirect = "lapack: bad direct"
|
badDirect = "lapack: bad direct"
|
||||||
badE = "lapack: e has insufficient length"
|
badE = "lapack: e has insufficient length"
|
||||||
badEigComp = "lapack: bad EigComp"
|
badEVComp = "lapack: bad EVComp"
|
||||||
badEVSide = "lapack: bad EVSide"
|
badEVSide = "lapack: bad EVSide"
|
||||||
badHowMany = "lapack: bad HowMany"
|
badHowMany = "lapack: bad HowMany"
|
||||||
badIlo = "lapack: ilo out of range"
|
badIlo = "lapack: ilo out of range"
|
||||||
|
@@ -15,13 +15,13 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Dsteqrer interface {
|
type Dsteqrer interface {
|
||||||
Dsteqr(compz lapack.EigComp, n int, d, e, z []float64, ldz int, work []float64) (ok bool)
|
Dsteqr(compz lapack.EVComp, n int, d, e, z []float64, ldz int, work []float64) (ok bool)
|
||||||
Dorgtrer
|
Dorgtrer
|
||||||
}
|
}
|
||||||
|
|
||||||
func DsteqrTest(t *testing.T, impl Dsteqrer) {
|
func DsteqrTest(t *testing.T, impl Dsteqrer) {
|
||||||
rnd := rand.New(rand.NewSource(1))
|
rnd := rand.New(rand.NewSource(1))
|
||||||
for _, compz := range []lapack.EigComp{lapack.EigDecomp, lapack.EigBoth} {
|
for _, compz := range []lapack.EVComp{lapack.EigDecomp, lapack.EigBoth} {
|
||||||
for _, test := range []struct {
|
for _, test := range []struct {
|
||||||
n, lda int
|
n, lda int
|
||||||
}{
|
}{
|
||||||
|
Reference in New Issue
Block a user