numerical-mathematics / extrapolation

Parallel extrapolation for ODEs
MIT License
6 stars 1 forks source link

Sparse Jacobian is not treated as sparse #38

Closed mcr222 closed 8 years ago

mcr222 commented 8 years ago

The code must use: methodargs["Isparse"] = scipy.sparse.identity(len(y0), dtype=float).

Because if Isparse is not sparse then Isparse+J00 (being J00 sparse) is not sparse and the problem is solved as a nonsparse problem.

mcr222 commented 8 years ago

PS: it's an easy solve, I am just not working with the latest update (to avoid the refactoring)

ketch commented 8 years ago

In the current code, you don't need to do anything manually. The code calls your Jacobian function once at the start and checks if the return value is sparse. If it is, then a sparse identity matrix is used.

mcr222 commented 8 years ago

Yes, but the Isparse matrix is not sparse, what's currently on the code: methodargs["Isparse"] = np.identity(len(y0), dtype=float)

ketch commented 8 years ago

Wow, either you or @HumamAlwassel must have done a push --force and completely clobbered a lot of the code! No more pushing to master. It will take me some work to sort this out. From now on, pull request only, and only I will merge.

ketch commented 8 years ago

(the code you are seeing is old code resulting from that push --force)