mirror of
https://github.com/gonum/gonum.git
synced 2025-10-05 15:16:59 +08:00
testlapack: print byte constants as chars
This commit is contained in:

committed by
Vladimír Chalupecký

parent
939a2b38a3
commit
3973e30147
@@ -85,7 +85,7 @@ func testDgebak(t *testing.T, impl Dgebaker, job lapack.BalanceJob, side lapack.
|
|||||||
got := cloneGeneral(v)
|
got := cloneGeneral(v)
|
||||||
impl.Dgebak(job, side, n, ilo, ihi, scale, m, got.Data, got.Stride)
|
impl.Dgebak(job, side, n, ilo, ihi, scale, m, got.Data, got.Stride)
|
||||||
|
|
||||||
prefix := fmt.Sprintf("Case job=%v, side=%v, n=%v, ilo=%v, ihi=%v, m=%v, extra=%v",
|
prefix := fmt.Sprintf("Case job=%c, side=%c, n=%v, ilo=%v, ihi=%v, m=%v, extra=%v",
|
||||||
job, side, n, ilo, ihi, m, extra)
|
job, side, n, ilo, ihi, m, extra)
|
||||||
|
|
||||||
if !generalOutsideAllNaN(got) {
|
if !generalOutsideAllNaN(got) {
|
||||||
|
@@ -49,7 +49,7 @@ func testDgebal(t *testing.T, impl Dgebaler, job lapack.BalanceJob, a blas64.Gen
|
|||||||
|
|
||||||
ilo, ihi := impl.Dgebal(job, n, a.Data, a.Stride, scale)
|
ilo, ihi := impl.Dgebal(job, n, a.Data, a.Stride, scale)
|
||||||
|
|
||||||
prefix := fmt.Sprintf("Case job=%v, n=%v, extra=%v", job, n, extra)
|
prefix := fmt.Sprintf("Case job=%c, n=%v, extra=%v", job, n, extra)
|
||||||
|
|
||||||
if !generalOutsideAllNaN(a) {
|
if !generalOutsideAllNaN(a) {
|
||||||
t.Errorf("%v: out-of-range write to A\n%v", prefix, a.Data)
|
t.Errorf("%v: out-of-range write to A\n%v", prefix, a.Data)
|
||||||
|
@@ -63,7 +63,7 @@ func dgeconTest(t *testing.T, impl Dgeconer, rnd *rand.Rand, n, lda int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, norm := range []lapack.MatrixNorm{lapack.MaxColumnSum, lapack.MaxRowSum} {
|
for _, norm := range []lapack.MatrixNorm{lapack.MaxColumnSum, lapack.MaxRowSum} {
|
||||||
name := fmt.Sprintf("norm%v,n=%v,lda=%v", string(norm), n, lda)
|
name := fmt.Sprintf("norm=%v,n=%v,lda=%v", string(norm), n, lda)
|
||||||
|
|
||||||
// Compute the norm of A and A^{-1}.
|
// Compute the norm of A and A^{-1}.
|
||||||
aNorm := impl.Dlange(norm, n, n, a, lda, work)
|
aNorm := impl.Dlange(norm, n, n, a, lda, work)
|
||||||
|
@@ -590,7 +590,7 @@ func testDgeev(t *testing.T, impl Dgeever, tc string, test dgeevTest, jobvl lapa
|
|||||||
first := impl.Dgeev(jobvl, jobvr, n, a.Data, a.Stride, wr, wi,
|
first := impl.Dgeev(jobvl, jobvr, n, a.Data, a.Stride, wr, wi,
|
||||||
vl.Data, vl.Stride, vr.Data, vr.Stride, work, len(work))
|
vl.Data, vl.Stride, vr.Data, vr.Stride, work, len(work))
|
||||||
|
|
||||||
prefix := fmt.Sprintf("Case #%v: n=%v, jobvl=%v, jobvr=%v, extra=%v, work=%v",
|
prefix := fmt.Sprintf("Case #%v: n=%v, jobvl=%c, jobvr=%c, extra=%v, work=%v",
|
||||||
tc, n, jobvl, jobvr, extra, wl)
|
tc, n, jobvl, jobvr, extra, wl)
|
||||||
|
|
||||||
if !generalOutsideAllNaN(vl) {
|
if !generalOutsideAllNaN(vl) {
|
||||||
|
@@ -75,7 +75,7 @@ func testDhseqr(t *testing.T, impl Dhseqrer, i int, test dhseqrTest, job lapack.
|
|||||||
}
|
}
|
||||||
|
|
||||||
unconverged := impl.Dhseqr(job, compz, n, ilo, ihi, h.Data, h.Stride, wr, wi, z.Data, z.Stride, work, len(work))
|
unconverged := impl.Dhseqr(job, compz, n, ilo, ihi, h.Data, h.Stride, wr, wi, z.Data, z.Stride, work, len(work))
|
||||||
prefix := fmt.Sprintf("Case %v: job=%v, compz=%v, n=%v, ilo=%v, ihi=%v, extra=%v, optwk=%v",
|
prefix := fmt.Sprintf("Case %v: job=%c, compz=%c, n=%v, ilo=%v, ihi=%v, extra=%v, optwk=%v",
|
||||||
i, job, compz, n, ilo, ihi, extra, optwork)
|
i, job, compz, n, ilo, ihi, extra, optwork)
|
||||||
if unconverged > 0 {
|
if unconverged > 0 {
|
||||||
t.Logf("%v: Dhseqr did not compute all eigenvalues. unconverged=%v", prefix, unconverged)
|
t.Logf("%v: Dhseqr did not compute all eigenvalues. unconverged=%v", prefix, unconverged)
|
||||||
|
@@ -55,7 +55,7 @@ func testDlaln2(t *testing.T, impl Dlaln2er, trans bool, na, nw, extra int, rnd
|
|||||||
|
|
||||||
scale, xnormGot, ok := impl.Dlaln2(trans, na, nw, smin, ca, a.Data, a.Stride, d1, d2, b.Data, b.Stride, real(w), imag(w), x.Data, x.Stride)
|
scale, xnormGot, ok := impl.Dlaln2(trans, na, nw, smin, ca, a.Data, a.Stride, d1, d2, b.Data, b.Stride, real(w), imag(w), x.Data, x.Stride)
|
||||||
|
|
||||||
prefix := fmt.Sprintf("Case trans=%v, na=%v, nw=%v, extra=%v", trans, na, nw, extra)
|
prefix := fmt.Sprintf("Case trans=%t, na=%v, nw=%v, extra=%v", trans, na, nw, extra)
|
||||||
|
|
||||||
if !generalOutsideAllNaN(a) {
|
if !generalOutsideAllNaN(a) {
|
||||||
t.Errorf("%v: out-of-range write to A\n%v", prefix, a.Data)
|
t.Errorf("%v: out-of-range write to A\n%v", prefix, a.Data)
|
||||||
|
@@ -77,7 +77,7 @@ func testDlarfx(t *testing.T, impl Dlarfxer, side blas.Side, m, n, extra int, rn
|
|||||||
|
|
||||||
impl.Dlarfx(side, m, n, v, tau, c.Data, c.Stride, work)
|
impl.Dlarfx(side, m, n, v, tau, c.Data, c.Stride, work)
|
||||||
|
|
||||||
prefix := fmt.Sprintf("Case side=%v, m=%v, n=%v, extra=%v", side, m, n, extra)
|
prefix := fmt.Sprintf("Case side=%c, m=%v, n=%v, extra=%v", side, m, n, extra)
|
||||||
|
|
||||||
// Check any invalid modifications of c.
|
// Check any invalid modifications of c.
|
||||||
if !generalOutsideAllNaN(c) {
|
if !generalOutsideAllNaN(c) {
|
||||||
|
@@ -43,7 +43,7 @@ func DlasetTest(t *testing.T, impl Dlaseter) {
|
|||||||
|
|
||||||
impl.Dlaset(uplo, m, n, alpha, beta, a.Data, a.Stride)
|
impl.Dlaset(uplo, m, n, alpha, beta, a.Data, a.Stride)
|
||||||
|
|
||||||
prefix := fmt.Sprintf("Case #%v: m=%v,n=%v,uplo=%v,extra=%v",
|
prefix := fmt.Sprintf("Case #%v: m=%v,n=%v,uplo=%c,extra=%v",
|
||||||
ti, m, n, uplo, extra)
|
ti, m, n, uplo, extra)
|
||||||
if !generalOutsideAllNaN(a) {
|
if !generalOutsideAllNaN(a) {
|
||||||
t.Errorf("%v: out-of-range write to A", prefix)
|
t.Errorf("%v: out-of-range write to A", prefix)
|
||||||
|
@@ -59,7 +59,7 @@ func testDlatrs(t *testing.T, impl Dlatrser, imat int, uplo blas.Uplo, trans bla
|
|||||||
// Call Dlatrs with normin=false.
|
// Call Dlatrs with normin=false.
|
||||||
copy(x, b)
|
copy(x, b)
|
||||||
scale := impl.Dlatrs(uplo, trans, diag, false, n, a, lda, x, cnorm)
|
scale := impl.Dlatrs(uplo, trans, diag, false, n, a, lda, x, cnorm)
|
||||||
prefix := fmt.Sprintf("Case imat=%v (n=%v,lda=%v,trans=%v,uplo=%v,diag=%v", imat, n, lda, trans, uplo, diag)
|
prefix := fmt.Sprintf("Case imat=%v (n=%v,lda=%v,trans=%c,uplo=%c,diag=%c", imat, n, lda, trans, uplo, diag)
|
||||||
for i, v := range cnorm {
|
for i, v := range cnorm {
|
||||||
if math.IsNaN(v) {
|
if math.IsNaN(v) {
|
||||||
t.Errorf("%v: cnorm[%v] not computed (scale=%v,normin=false)", prefix, i, scale)
|
t.Errorf("%v: cnorm[%v] not computed (scale=%v,normin=false)", prefix, i, scale)
|
||||||
|
@@ -116,7 +116,7 @@ func testDormhr(t *testing.T, impl Dormhrer, side blas.Side, trans blas.Transpos
|
|||||||
impl.Dormhr(side, trans, m, n, ilo, ihi, a.Data, a.Stride, tau, c.Data, c.Stride, work, len(work))
|
impl.Dormhr(side, trans, m, n, ilo, ihi, a.Data, a.Stride, tau, c.Data, c.Stride, work, len(work))
|
||||||
|
|
||||||
// Compare the two answers.
|
// Compare the two answers.
|
||||||
prefix := fmt.Sprintf("Case side=%v, trans=%v, m=%v, n=%v, ilo=%v, ihi=%v, extra=%v, optwork=%v",
|
prefix := fmt.Sprintf("Case side=%c, trans=%c, m=%v, n=%v, ilo=%v, ihi=%v, extra=%v, optwork=%v",
|
||||||
side, trans, m, n, ilo, ihi, extra, optwork)
|
side, trans, m, n, ilo, ihi, extra, optwork)
|
||||||
if !generalOutsideAllNaN(c) {
|
if !generalOutsideAllNaN(c) {
|
||||||
t.Errorf("%v: out-of-range write to C\n%v", prefix, c.Data)
|
t.Errorf("%v: out-of-range write to C\n%v", prefix, c.Data)
|
||||||
|
@@ -84,7 +84,7 @@ func DsytrdTest(t *testing.T, impl Dsytrder) {
|
|||||||
|
|
||||||
impl.Dsytrd(uplo, n, a.Data, a.Stride, d, e, tau, work, lwork)
|
impl.Dsytrd(uplo, n, a.Data, a.Stride, d, e, tau, work, lwork)
|
||||||
|
|
||||||
prefix := fmt.Sprintf("Case #%v: uplo=%v,n=%v,lda=%v,work=%v",
|
prefix := fmt.Sprintf("Case #%v: uplo=%c,n=%v,lda=%v,work=%v",
|
||||||
tc, uplo, n, lda, wl)
|
tc, uplo, n, lda, wl)
|
||||||
|
|
||||||
if !generalOutsideAllNaN(a) {
|
if !generalOutsideAllNaN(a) {
|
||||||
|
Reference in New Issue
Block a user