Quote:
Originally Posted by RyanCahoon
C code implementing Cholesky decomposition-based solver. With minimal optimization, the calculation runs in 3.02 seconds on my system.
|
Hi Ryan. I compiled it with Borland C++ 5.5 and ran it on the computer described in
this post. It took 80 seconds:
ryan.exe 2509 N.dat d.dat x.dat
Reading: 1.312000 seconds
Calculation: 79.953000 seconds
So I dug up an old piece of code I wrote back in 1990 with a Cholesky factoring algorithm in it
1 and modified it for this application and ran it. It took about 22.5 seconds:
Nx=d build 5/26/2013 921p
CPU Hz (example 3.4e9 for 3.4GHz): 3.4e9
N matrix size (example 2509): 2509
N matrix filename (example N.dat): N.dat
d vector filename (example d.dat): d.dat
output filename (example x.dat): x.dat
reading N & d...
0.59 seconds
Cholesky...
22.37 seconds
Fwd & Back Subst...
0.08 seconds
Writing solution x...
0.01 seconds
done. press ENTER
If your code took only 3 seconds to run on your machine, but 80 on mine, I'm wondering what the Rice algorithm would do on your machine.
1John Rischard Rice, Numerical Methods, Software, and Analysis, 1983, Page 139 (see attachments)