lapack: rename LeftEV and RightEV job constants

This commit is contained in:
Vladimir Chalupecky
2018-08-22 13:59:17 +02:00
committed by Vladimír Chalupecký
parent de667f08e7
commit a6f3f37374
6 changed files with 44 additions and 39 deletions

View File

@@ -475,8 +475,8 @@ func DgeevTest(t *testing.T, impl Dgeever) {
evWant: Zero(100).Eigenvalues(),
},
} {
for _, jobvl := range []lapack.LeftEVJob{lapack.ComputeLeftEV, lapack.None} {
for _, jobvr := range []lapack.RightEVJob{lapack.ComputeRightEV, lapack.None} {
for _, jobvl := range []lapack.LeftEVJob{lapack.LeftEVCompute, lapack.LeftEVNone} {
for _, jobvr := range []lapack.RightEVJob{lapack.RightEVCompute, lapack.RightEVNone} {
for _, extra := range []int{0, 11} {
for _, wl := range []worklen{minimumWork, mediumWork, optimumWork} {
testDgeev(t, impl, strconv.Itoa(i), test, jobvl, jobvr, extra, wl)
@@ -487,8 +487,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.LeftEVJob{lapack.ComputeLeftEV, lapack.None} {
for _, jobvr := range []lapack.RightEVJob{lapack.ComputeRightEV, lapack.None} {
for _, jobvl := range []lapack.LeftEVJob{lapack.LeftEVCompute, lapack.LeftEVNone} {
for _, jobvr := range []lapack.RightEVJob{lapack.RightEVCompute, lapack.RightEVNone} {
for cas := 0; cas < 10; cas++ {
// Create a block diagonal matrix with
// random eigenvalues of random multiplicity.
@@ -557,12 +557,12 @@ func testDgeev(t *testing.T, impl Dgeever, tc string, test dgeevTest, jobvl lapa
n := a.Rows
var vl blas64.General
if jobvl == lapack.ComputeLeftEV {
if jobvl == lapack.LeftEVCompute {
vl = nanGeneral(n, n, n)
}
var vr blas64.General
if jobvr == lapack.ComputeRightEV {
if jobvr == lapack.RightEVCompute {
vr = nanGeneral(n, n, n)
}
@@ -572,7 +572,7 @@ func testDgeev(t *testing.T, impl Dgeever, tc string, test dgeevTest, jobvl lapa
var lwork int
switch wl {
case minimumWork:
if jobvl == lapack.ComputeLeftEV || jobvr == lapack.ComputeRightEV {
if jobvl == lapack.LeftEVCompute || jobvr == lapack.RightEVCompute {
lwork = max(1, 4*n)
} else {
lwork = max(1, 3*n)
@@ -580,7 +580,7 @@ func testDgeev(t *testing.T, impl Dgeever, tc string, test dgeevTest, jobvl lapa
case mediumWork:
work := make([]float64, 1)
impl.Dgeev(jobvl, jobvr, n, nil, 1, nil, nil, nil, 1, nil, 1, work, -1)
if jobvl == lapack.ComputeLeftEV || jobvr == lapack.ComputeRightEV {
if jobvl == lapack.LeftEVCompute || jobvr == lapack.RightEVCompute {
lwork = (int(work[0]) + 4*n) / 2
} else {
lwork = (int(work[0]) + 3*n) / 2
@@ -644,7 +644,7 @@ func testDgeev(t *testing.T, impl Dgeever, tc string, test dgeevTest, jobvl lapa
}
}
if first > 0 || (jobvl == lapack.None && jobvr == lapack.None) {
if first > 0 || (jobvl == lapack.LeftEVNone && jobvr == lapack.RightEVNone) {
// No eigenvectors have been computed.
return
}
@@ -653,7 +653,7 @@ func testDgeev(t *testing.T, impl Dgeever, tc string, test dgeevTest, jobvl lapa
// to the computed eigenvalues.
for k := 0; k < n; {
if wi[k] == 0 {
if jobvl == lapack.ComputeLeftEV {
if jobvl == lapack.LeftEVCompute {
ev := columnOf(vl, k)
if !isLeftEigenvectorOf(test.a, ev, nil, complex(wr[k], 0), vecTol) {
t.Errorf("%v: VL[:,%v] is not left real eigenvector",
@@ -666,7 +666,7 @@ func testDgeev(t *testing.T, impl Dgeever, tc string, test dgeevTest, jobvl lapa
prefix, k, norm)
}
}
if jobvr == lapack.ComputeRightEV {
if jobvr == lapack.RightEVCompute {
ev := columnOf(vr, k)
if !isRightEigenvectorOf(test.a, ev, nil, complex(wr[k], 0), vecTol) {
t.Errorf("%v: VR[:,%v] is not right real eigenvector",
@@ -681,7 +681,7 @@ func testDgeev(t *testing.T, impl Dgeever, tc string, test dgeevTest, jobvl lapa
}
k++
} else {
if jobvl == lapack.ComputeLeftEV {
if jobvl == lapack.LeftEVCompute {
evre := columnOf(vl, k)
evim := columnOf(vl, k+1)
if !isLeftEigenvectorOf(test.a, evre, evim, complex(wr[k], wi[k]), vecTol) {
@@ -700,7 +700,7 @@ func testDgeev(t *testing.T, impl Dgeever, tc string, test dgeevTest, jobvl lapa
prefix, k, norm)
}
}
if jobvr == lapack.ComputeRightEV {
if jobvr == lapack.RightEVCompute {
evre := columnOf(vr, k)
evim := columnOf(vr, k+1)
if !isRightEigenvectorOf(test.a, evre, evim, complex(wr[k], wi[k]), vecTol) {