jacobi icon indicating copy to clipboard operation
jacobi copied to clipboard

Make `diagonal=True` smarter?

Open HDembinski opened this issue 1 year ago • 8 comments

From discussion with @mdhaber

It looks like step[0] is a relative (to the value of x) initial step size and step[1] is a reduction factor for each iteration. However, when diagonal=True, step[0] effectively becomes an absolute step due to the way the wrapper function works. @HDembinski HDembinski Jun 26, 2023

Yes, that's a speed trade-off. I am assuming here that the x-values are roughly of equal scale and don't vary a lot in magnitude. If they do, then diagonal=True should not be used. This needs to be properly documented at the very least.

The ideal solution in my view would be an algorithm that first groups x-values of similar magnitude together in blocks and then does the calculation using the same absolute step for those blocks. The speed of jacobi comes from doing array calculations as much as possible. Such an algorithm would give the same result as diagonal=True in the ideal case and would fall back to the slow "one-x value at a time" worst case if necessary.

HDembinski avatar Jun 26 '23 08:06 HDembinski