[SciPy-User] Saving result of sparse.linalg.splu and spilu to file\disk

Dave Smith davesmivers@gmail....
Mon Aug 6 13:11:49 CDT 2012

Hi guys/girls,

I'm trying to save the result of a (sparse.linalg.spilu) LU decomposition
of A such that  Ax = b to disk. I only need the result once to apply to
many sets of b (solutions). The spilu takes  ~ 4hours to compute.

Unfortunately, the object returned is a 'factored_lu' type and I don't know
how to save this to disk. It won't pickel or mashal:

Below is some test code that builds a small ILU 'factored_lu' object called
from scipy.sparse import lil_matrix
from scipy.sparse.linalg import spsolve,spilu
from numpy.linalg import solve, norm, inv
from numpy.random import rand

size = 250

A = lil_matrix((size, size))
A[0, :size] = rand(size)

A = A.tocsc()
b = rand(size)

EquSpaInvish = spilu(A)
iluelap = tm.time() - ilustart
x =  EquSpaInvish.solve(b)

I want to save\load EquSpaInvish to\from disk so i don't have to calculate
it each time.

Any ideas......?

Kind Regards

Dave :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20120806/0d72ccf1/attachment.html 

More information about the SciPy-User mailing list