I am trying to check the symmetry of a matrix which I was expecting to be symmetric.
I have printed A^T -A
to check the deviation from symmetry. It is actually populated with very small numbers, as shown below.
0.0 0.0 0.0 0.0 0.0 1.13687e-13 9.09495e-13 5.68434e-14 0.0 0.0 1.13687e-13 1.42109e-14
0.0 0.0 0.0 0.0 0.0 -9.09495e-13 0.0 0.0 0.0 0.0 -9.09495e-13 0.0
0.0 0.0 0.0 0.0 0.0 -9.09495e-13 2.84217e-14 0.0 0.0 5.68434e-14 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0 -7.10543e-15 2.84217e-14 0.0 0.0 -2.77556e-17 1.42109e-14
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 2.22045e-16 0.0 3.55271e-15
-1.13687e-13 9.09495e-13 9.09495e-13 0.0 0.0 0.0 0.0 0.0 0.0 0.0 3.55271e-15 -1.81899e-12
-9.09495e-13 0.0 -2.84217e-14 7.10543e-15 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
-5.68434e-14 0.0 0.0 -2.84217e-14 0.0 0.0 0.0 0.0 0.0 0.0 2.84217e-14 0.0
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.13687e-13 0.0 0.0
0.0 0.0 -5.68434e-14 0.0 -2.22045e-16 0.0 0.0 0.0 -1.13687e-13 0.0 -4.44089e-16 0.0
-1.13687e-13 9.09495e-13 0.0 2.77556e-17 0.0 -3.55271e-15 0.0 -2.84217e-14 0.0 4.44089e-16 0.0 0.0
-1.42109e-14 0.0 0.0 -1.42109e-14 -3.55271e-15 1.81899e-12 0.0 0.0 0.0 0.0 0.0 0.0
Please let me know if there is a way to give tolerance on checking the equality of terms about the main diagonal.
Thanks.