I am using svd to invert matrices. For the majority of events it appears to work ok but every so often I get the following message which causes my simulations to crash:
[quote]Error in : no convergence after 31 steps
Fatal in TMatrixD::: IsValid() violated at line 354 of `matrix/src/TMatrixDBase.cxx’
aborting
Generating stack trace…
0x0033df84 in TMatrixDBase::ResizeTo(int, int) + 0x62 from /usr/local/root/lib/libMatrix.so
0x00329c58 in TDecompBase::Invert() + 0x78 from /usr/local/root/lib/libMatrix.so
0x08053bc9 in Hit::ReconstructVertex(Neutrino, Array*, Visuals*, int, int) + 0x875 from ./NeutrinoPulse
0x080521b0 in Hit::RegisterHits(Spectrum*, Array*, Visuals*, int, int, int) + 0x166c from ./NeutrinoPulse
0x0804c831 in main + 0x609 from ./NeutrinoPulse
0x05020770 in __libc_start_main + 0xf0 from /lib/tls/libc.so.6
0x0804c199 in TFile::TFile[in-charge](char const*, char const*, char const*, int) + 0x41 from ./NeutrinoPulse
Aborted[/quote]
Is there a way I can test the matrix before I invert it to prevent this from happening? I have played around with the IsValid(), tolerance and the condition but haven’t had any success.
Cheers
Jon
I run root 4.00/04 on Linux Fedora Core 1 with g++ 3.3.2
The columns represent the difference in x, y and z coordinate between 1 reference sensor and the other sensors (in a 3-dimensional lattice-like array) that are hit during an event. By measuring the difference in arrival times of the signals we can reconstruct the vertex location. A matrix like the one above indicates all the sensors that are hit lie in the same plane along one axis direction- which would not allow for a 3 dimensional vertex reconstruction.
The Decompose() method thus proves to be good method for cutting these events!
I’m facing the same problem. I have to SVD decompose a lot of 3x3 matrices. Strangely, some fail. This happens for matrices with always the same configuration : all elements equal to 0 and 2 different of 0 on the second column. Exemple:
You seem to be facing the same problem as Jon above, the
diagonalization is not converging in case of a particular singular
matrix .
Most SVD algorithms on the market are variations on the
work by Golub and Kahn . So currently I am looking into
alternatives for my implementation of the diagonalization part .
Fairly tough problem , so it is going to take me some time .
Concerning your inquiry about decomposing complex matrices .
We are releasing in January a templated version of the matrix
package . However, things like matrix norms have not been
adjusted (yet ?) for complex numbers .
If you need this feature to solve complex linear systems, you
can also the current implementation in a slightly less
efficient way:
You seem to be facing the same problem as Jon above, the
diagonalization is not converging in case of a particular singular
matrix .
Most SVD algorithms on the market are variations on the
work by Golub and Kahn . So currently I am looking into
alternatives for my implementation of the diagonalization part .
Fairly tough problem , so it is going to take me some time .
Concerning your inquiry about decomposing complex matrices .
We are releasing in January a templated version of the matrix
package . However, things like matrix norms have not been
adjusted (yet ?) for complex numbers .
If you need this feature to solve complex linear systems, you
can also the current implementation in a slightly less
efficient way: