mirror of
https://github.com/gonum/gonum.git
synced 2025-10-20 21:59:25 +08:00
lapack: rename JobRightEV to RightEVJob, JobLeftEV to LeftEVJob
This commit is contained in:
@@ -1765,11 +1765,11 @@ func (impl Implementation) Dhseqr(job lapack.Job, compz lapack.Comp, n, ilo, ihi
|
||||
// Dgeev failed to compute all the eigenvalues, no eigenvectors have been
|
||||
// computed and wr[first:] and wi[first:] contain those eigenvalues which have
|
||||
// converged.
|
||||
func (impl Implementation) Dgeev(jobvl lapack.JobLeftEV, jobvr lapack.JobRightEV, n int, a []float64, lda int, wr, wi []float64, vl []float64, ldvl int, vr []float64, ldvr int, work []float64, lwork int) (first int) {
|
||||
func (impl Implementation) Dgeev(jobvl lapack.LeftEVJob, jobvr lapack.RightEVJob, n int, a []float64, lda int, wr, wi []float64, vl []float64, ldvl int, vr []float64, ldvr int, work []float64, lwork int) (first int) {
|
||||
var wantvl bool
|
||||
switch jobvl {
|
||||
default:
|
||||
panic("lapack: invalid JobLeftEV")
|
||||
panic("lapack: invalid LeftEVJob")
|
||||
case lapack.ComputeLeftEV:
|
||||
wantvl = true
|
||||
case lapack.None:
|
||||
@@ -1778,7 +1778,7 @@ func (impl Implementation) Dgeev(jobvl lapack.JobLeftEV, jobvr lapack.JobRightEV
|
||||
var wantvr bool
|
||||
switch jobvr {
|
||||
default:
|
||||
panic("lapack: invalid JobRightEV")
|
||||
panic("lapack: invalid RightEVJob")
|
||||
case lapack.ComputeRightEV:
|
||||
wantvr = true
|
||||
case lapack.None:
|
||||
|
30
lapack.go
30
lapack.go
@@ -18,7 +18,7 @@ type Complex128 interface{}
|
||||
// Float64 defines the public float64 LAPACK API supported by gonum/lapack.
|
||||
type Float64 interface {
|
||||
Dgecon(norm MatrixNorm, n int, a []float64, lda int, anorm float64, work []float64, iwork []int) float64
|
||||
Dgeev(jobvl JobLeftEV, jobvr JobRightEV, n int, a []float64, lda int, wr, wi []float64, vl []float64, ldvl int, vr []float64, ldvr int, work []float64, lwork int) (first int)
|
||||
Dgeev(jobvl LeftEVJob, jobvr RightEVJob, n int, a []float64, lda int, wr, wi []float64, vl []float64, ldvl int, vr []float64, ldvr int, work []float64, lwork int) (first int)
|
||||
Dgels(trans blas.Transpose, m, n, nrhs int, a []float64, lda int, b []float64, ldb int, work []float64, lwork int) bool
|
||||
Dgelqf(m, n int, a []float64, lda int, tau, work []float64, lwork int)
|
||||
Dgeqrf(m, n int, a []float64, lda int, tau, work []float64, lwork int)
|
||||
@@ -122,11 +122,19 @@ const (
|
||||
EigBoth EigComp = 'I'
|
||||
)
|
||||
|
||||
// EVJob specifies whether eigenvectors will be computed in Dsyev.
|
||||
type EVJob byte
|
||||
// Job types for computation of eigenvectors.
|
||||
type (
|
||||
EVJob byte
|
||||
LeftEVJob byte
|
||||
RightEVJob byte
|
||||
)
|
||||
|
||||
// ComputeEV specifies that eigenvectors will be computed in Dsyev.
|
||||
const ComputeEV EVJob = 'V'
|
||||
// Job constants for computation of eigenvectors.
|
||||
const (
|
||||
ComputeEV EVJob = 'V' // Compute eigenvectors in Dsyev.
|
||||
ComputeLeftEV LeftEVJob = 'V' // Compute left eigenvectors.
|
||||
ComputeRightEV RightEVJob = 'V' // Compute right eigenvectors.
|
||||
)
|
||||
|
||||
// Jobs for Dgebal.
|
||||
const (
|
||||
@@ -166,15 +174,3 @@ const (
|
||||
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.
|
||||
)
|
||||
|
||||
// Job types for Dgeev.
|
||||
type (
|
||||
JobLeftEV byte
|
||||
JobRightEV byte
|
||||
)
|
||||
|
||||
// Job constants for Dgeev.
|
||||
const (
|
||||
ComputeLeftEV JobLeftEV = 'V'
|
||||
ComputeRightEV JobRightEV = 'V'
|
||||
)
|
||||
|
@@ -429,7 +429,7 @@ func Trtrs(trans blas.Transpose, a blas64.Triangular, b blas64.General) (ok bool
|
||||
// If first is positive, Geev failed to compute all the eigenvalues, no
|
||||
// eigenvectors have been computed and wr[first:] and wi[first:] contain those
|
||||
// eigenvalues which have converged.
|
||||
func Geev(jobvl lapack.JobLeftEV, jobvr lapack.JobRightEV, a blas64.General, wr, wi []float64, vl, vr blas64.General, work []float64, lwork int) (first int) {
|
||||
func Geev(jobvl lapack.LeftEVJob, jobvr lapack.RightEVJob, a blas64.General, wr, wi []float64, vl, vr blas64.General, work []float64, lwork int) (first int) {
|
||||
n := a.Rows
|
||||
if a.Cols != n {
|
||||
panic("lapack64: matrix not square")
|
||||
|
@@ -59,11 +59,11 @@ import (
|
||||
// Dgeev failed to compute all the eigenvalues, no eigenvectors have been
|
||||
// computed and wr[first:] and wi[first:] contain those eigenvalues which have
|
||||
// converged.
|
||||
func (impl Implementation) Dgeev(jobvl lapack.JobLeftEV, jobvr lapack.JobRightEV, n int, a []float64, lda int, wr, wi []float64, vl []float64, ldvl int, vr []float64, ldvr int, work []float64, lwork int) (first int) {
|
||||
func (impl Implementation) Dgeev(jobvl lapack.LeftEVJob, jobvr lapack.RightEVJob, n int, a []float64, lda int, wr, wi []float64, vl []float64, ldvl int, vr []float64, ldvr int, work []float64, lwork int) (first int) {
|
||||
var wantvl bool
|
||||
switch jobvl {
|
||||
default:
|
||||
panic("lapack: invalid JobLeftEV")
|
||||
panic("lapack: invalid LeftEVJob")
|
||||
case lapack.ComputeLeftEV:
|
||||
wantvl = true
|
||||
case lapack.None:
|
||||
@@ -71,7 +71,7 @@ func (impl Implementation) Dgeev(jobvl lapack.JobLeftEV, jobvr lapack.JobRightEV
|
||||
var wantvr bool
|
||||
switch jobvr {
|
||||
default:
|
||||
panic("lapack: invalid JobRightEV")
|
||||
panic("lapack: invalid RightEVJob")
|
||||
case lapack.ComputeRightEV:
|
||||
wantvr = true
|
||||
case lapack.None:
|
||||
|
@@ -19,7 +19,7 @@ import (
|
||||
)
|
||||
|
||||
type Dgeever interface {
|
||||
Dgeev(jobvl lapack.JobLeftEV, jobvr lapack.JobRightEV, n int, a []float64, lda int,
|
||||
Dgeev(jobvl lapack.LeftEVJob, jobvr lapack.RightEVJob, n int, a []float64, lda int,
|
||||
wr, wi []float64, vl []float64, ldvl int, vr []float64, ldvr int, work []float64, lwork int) int
|
||||
}
|
||||
|
||||
@@ -474,8 +474,8 @@ func DgeevTest(t *testing.T, impl Dgeever) {
|
||||
evWant: Zero(100).Eigenvalues(),
|
||||
},
|
||||
} {
|
||||
for _, jobvl := range []lapack.JobLeftEV{lapack.ComputeLeftEV, lapack.None} {
|
||||
for _, jobvr := range []lapack.JobRightEV{lapack.ComputeRightEV, lapack.None} {
|
||||
for _, jobvl := range []lapack.LeftEVJob{lapack.ComputeLeftEV, lapack.None} {
|
||||
for _, jobvr := range []lapack.RightEVJob{lapack.ComputeRightEV, lapack.None} {
|
||||
for _, extra := range []int{0, 11} {
|
||||
for _, wl := range []worklen{minimumWork, mediumWork, optimumWork} {
|
||||
testDgeev(t, impl, strconv.Itoa(i), test, jobvl, jobvr, extra, wl)
|
||||
@@ -486,8 +486,8 @@ func DgeevTest(t *testing.T, impl Dgeever) {
|
||||
}
|
||||
|
||||
for _, n := range []int{2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 20, 50, 51, 100, 101} {
|
||||
for _, jobvl := range []lapack.JobLeftEV{lapack.ComputeLeftEV, lapack.None} {
|
||||
for _, jobvr := range []lapack.JobRightEV{lapack.ComputeRightEV, lapack.None} {
|
||||
for _, jobvl := range []lapack.LeftEVJob{lapack.ComputeLeftEV, lapack.None} {
|
||||
for _, jobvr := range []lapack.RightEVJob{lapack.ComputeRightEV, lapack.None} {
|
||||
for cas := 0; cas < 10; cas++ {
|
||||
// Create a block diagonal matrix with
|
||||
// random eigenvalues of random multiplicity.
|
||||
@@ -541,7 +541,7 @@ func DgeevTest(t *testing.T, impl Dgeever) {
|
||||
}
|
||||
}
|
||||
|
||||
func testDgeev(t *testing.T, impl Dgeever, tc string, test dgeevTest, jobvl lapack.JobLeftEV, jobvr lapack.JobRightEV, extra int, wl worklen) {
|
||||
func testDgeev(t *testing.T, impl Dgeever, tc string, test dgeevTest, jobvl lapack.LeftEVJob, jobvr lapack.RightEVJob, extra int, wl worklen) {
|
||||
const defaultTol = 1e-13
|
||||
valTol := test.valTol
|
||||
if valTol == 0 {
|
||||
|
Reference in New Issue
Block a user