change identity matrix format to csr in cram (#2771)

This commit is contained in:
Ethan Peterson 2023-11-21 17:22:42 -05:00 committed by GitHub
parent 24e1c95161
commit 9830efaf2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -77,7 +77,7 @@ class IPFCramSolver(DepSystemSolver):
"""
A = sp.csr_matrix(A * dt, dtype=np.float64)
y = n0.copy()
ident = sp.eye(A.shape[0])
ident = sp.eye(A.shape[0], format='csr')
for alpha, theta in zip(self.alpha, self.theta):
y += 2*np.real(alpha*sla.spsolve(A - theta*ident, y))
return y * self.alpha0