mirror of
https://github.com/gonum/gonum.git
synced 2025-10-23 15:13:31 +08:00
lapack: remove EigValueOnly constant
'None' can be used instead.
This commit is contained in:
@@ -112,8 +112,6 @@ const (
|
||||
type EigComp byte
|
||||
|
||||
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
|
||||
// full symmetric matrix.
|
||||
EigDecomp EigComp = 'V'
|
||||
|
@@ -30,7 +30,7 @@ import (
|
||||
// compz == lapack.EigBoth, z contains the orthonormal eigenvectors of the
|
||||
// original symmetric matrix, and if compz == lapack.EigDecomp, z contains the
|
||||
// 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,
|
||||
// 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 {
|
||||
panic(badE)
|
||||
}
|
||||
if compz != lapack.EigValueOnly && compz != lapack.EigBoth && compz != lapack.EigDecomp {
|
||||
if compz != lapack.None && compz != lapack.EigBoth && compz != lapack.EigDecomp {
|
||||
panic(badEigComp)
|
||||
}
|
||||
if compz != lapack.EigValueOnly {
|
||||
if compz != lapack.None {
|
||||
if len(work) < max(1, 2*n-2) {
|
||||
panic(badWork)
|
||||
}
|
||||
|
@@ -134,7 +134,7 @@ func DsteqrTest(t *testing.T, impl Dsteqrer) {
|
||||
for i := range work {
|
||||
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) {
|
||||
t.Errorf("Eigenvalue mismatch when eigenvectors not computed")
|
||||
}
|
||||
|
Reference in New Issue
Block a user