mirror of
https://github.com/gonum/gonum.git
synced 2025-10-21 06:09:26 +08:00
lapack: remove EigValueOnly constant
'None' can be used instead.
This commit is contained in:
@@ -112,8 +112,6 @@ const (
|
|||||||
type EigComp byte
|
type EigComp byte
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// EigValueOnly specifies to compute only the eigenvalues of the input matrix.
|
|
||||||
EigValueOnly EigComp = 'N'
|
|
||||||
// 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 EigComp = 'V'
|
||||||
|
@@ -30,7 +30,7 @@ import (
|
|||||||
// compz == lapack.EigBoth, z contains the orthonormal eigenvectors of the
|
// compz == lapack.EigBoth, z contains the orthonormal eigenvectors of the
|
||||||
// original symmetric matrix, and if compz == lapack.EigDecomp, z contains the
|
// original symmetric matrix, and if compz == lapack.EigDecomp, z contains the
|
||||||
// orthonormal eigenvectors of the symmetric tridiagonal matrix. z is not used
|
// orthonormal eigenvectors of the symmetric tridiagonal matrix. z is not used
|
||||||
// if compz == lapack.EigValueOnly.
|
// if compz == lapack.None.
|
||||||
//
|
//
|
||||||
// work must have length at least max(1, 2*n-2) if the eigenvectors are computed,
|
// work must have length at least max(1, 2*n-2) if the eigenvectors are computed,
|
||||||
// and Dsteqr will panic otherwise.
|
// and Dsteqr will panic otherwise.
|
||||||
@@ -43,10 +43,10 @@ func (impl Implementation) Dsteqr(compz lapack.EigComp, n int, d, e, z []float64
|
|||||||
if len(e) < n-1 {
|
if len(e) < n-1 {
|
||||||
panic(badE)
|
panic(badE)
|
||||||
}
|
}
|
||||||
if compz != lapack.EigValueOnly && compz != lapack.EigBoth && compz != lapack.EigDecomp {
|
if compz != lapack.None && compz != lapack.EigBoth && compz != lapack.EigDecomp {
|
||||||
panic(badEigComp)
|
panic(badEigComp)
|
||||||
}
|
}
|
||||||
if compz != lapack.EigValueOnly {
|
if compz != lapack.None {
|
||||||
if len(work) < max(1, 2*n-2) {
|
if len(work) < max(1, 2*n-2) {
|
||||||
panic(badWork)
|
panic(badWork)
|
||||||
}
|
}
|
||||||
|
@@ -134,7 +134,7 @@ func DsteqrTest(t *testing.T, impl Dsteqrer) {
|
|||||||
for i := range work {
|
for i := range work {
|
||||||
work[i] = rnd.Float64()
|
work[i] = rnd.Float64()
|
||||||
}
|
}
|
||||||
impl.Dsteqr(lapack.EigValueOnly, n, dDecomp, eDecomp, aDecomp, lda, work)
|
impl.Dsteqr(lapack.None, n, dDecomp, eDecomp, aDecomp, lda, work)
|
||||||
if !floats.EqualApprox(d, dAns, 1e-8) {
|
if !floats.EqualApprox(d, dAns, 1e-8) {
|
||||||
t.Errorf("Eigenvalue mismatch when eigenvectors not computed")
|
t.Errorf("Eigenvalue mismatch when eigenvectors not computed")
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user