mirror of
https://github.com/gonum/gonum.git
synced 2025-10-21 14:19:35 +08:00
lapack/testlapack: change isIdentity to distFromIdentity
This commit is contained in:

committed by
Vladimír Chalupecký

parent
54df3f38fd
commit
08d9e7ed28
@@ -79,9 +79,10 @@ func DtrtriTest(t *testing.T, impl Dtrtrier) {
|
||||
ans := make([]float64, len(a))
|
||||
bi.Dgemm(blas.NoTrans, blas.NoTrans, n, n, n, 1, a, lda, aCopy, lda, 0, ans, lda)
|
||||
// Check that ans is the identity matrix.
|
||||
if !isIdentity(n, ans, lda, tol) {
|
||||
t.Errorf("inv(A) * A != I. Upper = %v, unit = %v, n = %v, lda = %v",
|
||||
uplo == blas.Upper, diag == blas.Unit, n, lda)
|
||||
dist := distFromIdentity(n, ans, lda)
|
||||
if dist > tol {
|
||||
t.Errorf("|inv(A) * A - I| = %v is too large. Upper = %v, unit = %v, n = %v, lda = %v",
|
||||
dist, uplo == blas.Upper, diag == blas.Unit, n, lda)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user