TMatrixD has a attribute fTol that makes no sence

Dear friends of Root

if a TMatrixD is inverted the algorithms check if a diagonal element is 0 by comparing it to a value fTol.

The root manual says at
root.cern.ch/root/html528/TMatri … uble_:fTol
that this value is “sqrt(epsilon); epsilon is smallest number number so that 1+epsilon > 1”.
Now if one checks this value with the member function .GetTol() one can see it is 2.22044604925031308e-16
I asked several other people using the same root version than me if thy get the same number and they did.

This is very strange because from the definition one would expect a value close to the square root of smallest number in absolute terms a double can hold. (so some thing in the region of 1E-150)

The actual value of around 2.22e-16 is the one one would expect if you had a matrix of floats and not of doubles.

If I set the fTol value with SetTol to 1E-150 more matrices are successfully inverted in my track fit software.

So I suspect this is an error and the fTol value holds the number reasonable for TMatrixT and therefore triggers errors in invert algorithms working on TMatrixT where no errors are.

I am using root 5.28/00d on Ubuntu 11.04 32 bit.

Thanks in advance for any insights

Hi,
The smallest epsilon such that 1 + epsilon > 1 is around 2.2E-16 for doubles and around 1E-7 for float. So the value is correct according to the definition. It is true if you want to simply compare if a number is different than zero you can use a much smaller tolerance (around 1E-300 for doubles), but in the case of matrix inversion this
comparison is done for numbers resulting from a arithmetic operation (e.g. a decomposition), so one cannot use in this case such a small tolerances. You might invert the matrix, but you might get non-sensible results due to numerical error

Best Regards,
Lorenzo

Thanks a lot for your reply.

Ok I get it: 1+ epsilon > 1 means epsilon must be close to the smallest absolute number a double can store when the exponent of the double is fixed at 0. so something close to 10^-16 because a double has a precision of approximately 16 decimal digits.

But the the defenition of fTol in the root manual is still wrong because it says there that fTol is the sqrt of this epsilon. So something around 10^-8.

So either I still do not get something or the maual at:
root.cern.ch/root/html528/TMatri … uble_:fTol
is wrong …

kind regards

Moritz Nadler

Hi,

Yes, the documentation should be updated to just epsilon and not swrt(epsilon). However, I remind you that this tolerance value can be modified by the user for every matrix.

Lorenzo