Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle case when sparse solver return nan result following what scipy 0.... #7

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Handle case when sparse solver return nan result following what scipy…
… 0.13 did
  • Loading branch information
Chenyang Liu committed Oct 30, 2014
commit c8bbdd41e66ca4b58ff6a2a5f66fdce918545165
4 changes: 4 additions & 0 deletions optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,10 @@ def call_cb():
100. * J.nnz / (J.shape[0] * J.shape[1])))

d_gn = col(solve(A, g)) if g.size>1 else np.atleast_1d(g.ravel()[0]/A[0,0])

if np.isnan(np.min(d_gn)):
d_gn = g

pif('sparse solve...done in %.2fs' % (time.time() - tm))
else:
pif('dense solve...')
Expand Down