scipy/scipy — pull request #3996 by argriffing (2014-09-15 18:49:08+00:00)
Title: MAINT: stricter linalg argument checking

This extra checking has been applied to functions in linalg/basic.py and linalg/decomp.py.

---------------------------------------------------------------------------

```python
a = scipy.sparse.identity(2).tocsc()
print scipy.linalg.eigh(a)
```

before:
```
[...] line 8, in
print scipy.linalg.eigh(a)
[...] line 301, in eigh
raise ValueError('expected square matrix')
ValueError: expected square matrix
```

after:
```
[...] line 334, in eigh
a1 = _asarray_validated(a, check_finite=check_finite)
[...] line 66, in _asarray_validated
raise ValueError('sparse matrices are not supported')
```

---------------------------------------------------------------------------

```python
a = scipy.sparse.identity(2).tocsc()
b = np.atleast_2d(a)
print scipy.linalg.eigh(b)
```

before:
```
[...] line 11, in
print scipy.linalg.eigh(b)
[...] line 359, in eigh
iu=a1.shape[0], overwrite_a=overwrite_a)
ValueError: setting an array element with a sequence.
```

after:
```
[...] line 334, in eigh
a1 = _asarray_validated(a, check_finite=check_finite)
[...] line 73, in _asarray_validated
raise ValueError('object arrays are not supported')
ValueError: object arrays are not supported
```