lapack: rename JobRightEV to RightEVJob, JobLeftEV to LeftEVJob

This commit is contained in:
Vladimir Chalupecky
2016-10-06 15:01:14 +09:00
parent f4dbaaea62
commit 78b6c8cef8
5 changed files with 26 additions and 30 deletions

View File

@@ -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 // Dgeev failed to compute all the eigenvalues, no eigenvectors have been
// computed and wr[first:] and wi[first:] contain those eigenvalues which have // computed and wr[first:] and wi[first:] contain those eigenvalues which have
// converged. // 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 var wantvl bool
switch jobvl { switch jobvl {
default: default:
panic("lapack: invalid JobLeftEV") panic("lapack: invalid LeftEVJob")
case lapack.ComputeLeftEV: case lapack.ComputeLeftEV:
wantvl = true wantvl = true
case lapack.None: case lapack.None:
@@ -1778,7 +1778,7 @@ func (impl Implementation) Dgeev(jobvl lapack.JobLeftEV, jobvr lapack.JobRightEV
var wantvr bool var wantvr bool
switch jobvr { switch jobvr {
default: default:
panic("lapack: invalid JobRightEV") panic("lapack: invalid RightEVJob")
case lapack.ComputeRightEV: case lapack.ComputeRightEV:
wantvr = true wantvr = true
case lapack.None: case lapack.None:

View File

@@ -18,7 +18,7 @@ type Complex128 interface{}
// Float64 defines the public float64 LAPACK API supported by gonum/lapack. // Float64 defines the public float64 LAPACK API supported by gonum/lapack.
type Float64 interface { type Float64 interface {
Dgecon(norm MatrixNorm, n int, a []float64, lda int, anorm float64, work []float64, iwork []int) float64 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 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) 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) Dgeqrf(m, n int, a []float64, lda int, tau, work []float64, lwork int)
@@ -122,11 +122,19 @@ const (
EigBoth EigComp = 'I' EigBoth EigComp = 'I'
) )
// EVJob specifies whether eigenvectors will be computed in Dsyev. // Job types for computation of eigenvectors.
type EVJob byte type (
EVJob byte
LeftEVJob byte
RightEVJob byte
)
// ComputeEV specifies that eigenvectors will be computed in Dsyev. // Job constants for computation of eigenvectors.
const ComputeEV EVJob = 'V' const (
ComputeEV EVJob = 'V' // Compute eigenvectors in Dsyev.
ComputeLeftEV LeftEVJob = 'V' // Compute left eigenvectors.
ComputeRightEV RightEVJob = 'V' // Compute right eigenvectors.
)
// Jobs for Dgebal. // Jobs for Dgebal.
const ( const (
@@ -166,15 +174,3 @@ const (
AllEVMulQ HowMany = 'B' // Compute all right and/or left eigenvectors multiplied by an input matrix. 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. 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'
)

View File

@@ -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 // If first is positive, Geev failed to compute all the eigenvalues, no
// eigenvectors have been computed and wr[first:] and wi[first:] contain those // eigenvectors have been computed and wr[first:] and wi[first:] contain those
// eigenvalues which have converged. // 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 n := a.Rows
if a.Cols != n { if a.Cols != n {
panic("lapack64: matrix not square") panic("lapack64: matrix not square")

View File

@@ -59,11 +59,11 @@ import (
// Dgeev failed to compute all the eigenvalues, no eigenvectors have been // Dgeev failed to compute all the eigenvalues, no eigenvectors have been
// computed and wr[first:] and wi[first:] contain those eigenvalues which have // computed and wr[first:] and wi[first:] contain those eigenvalues which have
// converged. // 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 var wantvl bool
switch jobvl { switch jobvl {
default: default:
panic("lapack: invalid JobLeftEV") panic("lapack: invalid LeftEVJob")
case lapack.ComputeLeftEV: case lapack.ComputeLeftEV:
wantvl = true wantvl = true
case lapack.None: case lapack.None:
@@ -71,7 +71,7 @@ func (impl Implementation) Dgeev(jobvl lapack.JobLeftEV, jobvr lapack.JobRightEV
var wantvr bool var wantvr bool
switch jobvr { switch jobvr {
default: default:
panic("lapack: invalid JobRightEV") panic("lapack: invalid RightEVJob")
case lapack.ComputeRightEV: case lapack.ComputeRightEV:
wantvr = true wantvr = true
case lapack.None: case lapack.None:

View File

@@ -19,7 +19,7 @@ import (
) )
type Dgeever interface { 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 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(), evWant: Zero(100).Eigenvalues(),
}, },
} { } {
for _, jobvl := range []lapack.JobLeftEV{lapack.ComputeLeftEV, lapack.None} { for _, jobvl := range []lapack.LeftEVJob{lapack.ComputeLeftEV, lapack.None} {
for _, jobvr := range []lapack.JobRightEV{lapack.ComputeRightEV, lapack.None} { for _, jobvr := range []lapack.RightEVJob{lapack.ComputeRightEV, lapack.None} {
for _, extra := range []int{0, 11} { for _, extra := range []int{0, 11} {
for _, wl := range []worklen{minimumWork, mediumWork, optimumWork} { for _, wl := range []worklen{minimumWork, mediumWork, optimumWork} {
testDgeev(t, impl, strconv.Itoa(i), test, jobvl, jobvr, extra, wl) 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 _, 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 _, jobvl := range []lapack.LeftEVJob{lapack.ComputeLeftEV, lapack.None} {
for _, jobvr := range []lapack.JobRightEV{lapack.ComputeRightEV, lapack.None} { for _, jobvr := range []lapack.RightEVJob{lapack.ComputeRightEV, lapack.None} {
for cas := 0; cas < 10; cas++ { for cas := 0; cas < 10; cas++ {
// Create a block diagonal matrix with // Create a block diagonal matrix with
// random eigenvalues of random multiplicity. // 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 const defaultTol = 1e-13
valTol := test.valTol valTol := test.valTol
if valTol == 0 { if valTol == 0 {