8000 Raise warning when condition number is too high? · Issue #3755 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
< 8000 /react-partial>
Raise warning when condition number is too high? #3755
Closed
@astrojuanlu

Description

@astrojuanlu

In certain cases, when trying to solve singular linear systems, no feedback is given about the singular nature of the solution. For example:

>>> import numpy
>>> from numpy import array
>>> from numpy.linalg import solve
>>> A=array([[1,2,3],[4,5,6],[7,8,9]])
>>> b=array([15,15,15])
>>> solve(A,b)
array([-39.,  63., -24.])

But, on other cas 5B79 es:

>>> C=array([[1,1,1],[1,1,1],[1,1,1]])
>>> x=solve(C,b)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/juanlu/.local/lib/python3.3/site-packages/numpy/linalg/linalg.py", line 328, in solve
    raise LinAlgError('Singular matrix')
numpy.linalg.linalg.LinAlgError: Singular matrix

This issue was raised here:

http://web.archive.org/liveweb/http://www.walkingrandomly.com/?p=5092

A warning based on the condition number of the matrix has been suggested as a possible solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    64 - Good IdeaInactive PR with a good start or idea. Consider studying it if you are working on a related issue.Proposalcomponent: numpy.linalg

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0