lapack/testlapack: change isIdentity to distFromIdentity

This commit is contained in:
Vladimir Chalupecky
2019-01-17 14:56:40 +01:00
committed by Vladimír Chalupecký
parent 54df3f38fd
commit 08d9e7ed28
7 changed files with 33 additions and 28 deletions

View File

@@ -97,9 +97,10 @@ func DpotriTest(t *testing.T, impl Dpotrier) {
want := make([]float64, n*ldwant)
bi.Dsymm(blas.Left, uplo, n, n, 1, aCopy, lda, ainv, ldainv, 0, want, ldwant)
// Check that want is the identity matrix.
if !isIdentity(n, want, ldwant, tol) {
t.Errorf("%v: A * inv(A) != I", prefix)
// Check that want is close to the identity matrix.
dist := distFromIdentity(n, want, ldwant)
if dist > tol {
t.Errorf("%v: |A * inv(A) - I| = %v is too large", prefix, dist)
}
}
}