| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|\ |
|
| |
| |
| |
| |
| | |
This is in preparation for deprecation and eventual removal
of the matrix class.
|
|/
|
|
|
| |
Since linalg allows stacks of matrices generally, there is no
reason not to allow it for matrix_power.
|
|
|
|
|
| |
That function is nose specific and has not worked since `__init__` files
were added to the tests directories.
|
|
|
|
|
|
|
|
|
|
|
| |
Use standard pytest markers everywhere in the numpy tests. At this point
there should be no nose dependency. However, nose is required to test
the legacy decorators if so desired.
At this point, numpy test cannot be run in the way with runtests, rather
installed numpy can be tested with `pytest --pyargs numpy` as long as
that is not run from the repo. Run it from the tools directory or some
such.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make np.linalg.cond(A, p) always use SVD for p=+-2 and not only p=None.
Ensure inf is returned instead of nan when the condition number diverges
for +/-2 norm.
Ignore errors when inverting matrices for p = +-1, 'fro', +-inf, so that
spurious LinAlgErrors are not raised. In those cases, report
non-invertible matrices as having cond=inf.
Add additional tests for cond().
|
| |
|
| |
|
|
|
|
|
| |
With a symmetric matrix, the more efficient `eigvalsh` method
can be used to find singular values.
|
|
|
|
| |
Fixes #8826
|
|
|
|
|
| |
The default parameter used by LAPACK (which was our default) is not
very good, so implement a FutureWarning to change to a better default.
|
|
|
|
|
|
|
| |
This is the case for x in {int, bool, str, float, complex, object}.
Using the np.{x} version is deceptive as it suggests that there is a
difference. This change doesn't affect any external behaviour. The
`long` type is missing in python 3, so np.long is still useful
|
|
|
|
| |
Bare except is very rarely the right thing
|
|
|
|
|
|
|
|
|
| |
The necessary fixup on the C-side of linalg has been done already
(i.e. the gufuncs correctly work for these empty arrays).
This also enables cholesky decomposition and fixes a small bug in pinv
handling.
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
|
|\
| |
| | |
ENH: allow argument to matrix_rank to be stacked
|
| |
| |
| |
| | |
Fixes #5905
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fixes #8212
det: return ones of the right shape
slogdet: return sign=ones, log=zeros of the right shape
pinv, eigvals(h?), eig(h?): return empty array(s?) of the right shape
svd & qr: not implemented, due to complex return value rules
|
|/ |
|
|\
| |
| | |
MAINT: Use the same exception for all bad axis requests
|
| |
| |
| |
| | |
These were tested by temporarily removing the base classes from AxisError
|
| |
| |
| |
| |
| |
| |
| | |
As a result, some exceptions change from ValueError to IndexError
This also changes the exception types raised in places where
normalize_axis_index is not quite appropriate
|
| | |
|
| |
| |
| |
| |
| |
| | |
These testcases were never used in the first place, due to a typo. This makes
their dimensions match the order of the other test cases, even though those
also did not run
|
| |
| |
| |
| |
| | |
Allows each individual function to inspect the flags of a certain test, and
decide whether an exception will be thrown
|
| |
| |
| |
| |
| | |
SVD was previously being too generous with accuracy on doubles. This allows
pinv, the test for which was previously was too imprecise, to pass.
|
| | |
|
| | |
|
| | |
|
| | |
|
|/
|
|
| |
atleast_2d(array([], dtype=double)) returns an array of shape (1, 0), not (0, 0)
|
|
|
|
|
|
|
|
| |
In some places, just remove aparently unnecessary filters.
After this, all cases of ignore filters should be removed from
the tests, making testing (even multiple runs) normally fully
predictable.
|
|
|
|
| |
closes gh-7897
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
* use SkipTest in numpy tests instead of importing it from nose
* add a KnownFailureException as an alias for KnownFailureTest
(the former is preferred, but the latter is kept for backcompat)
* rename the KnownFailure nose plugin into KnownFailurePlugin,
and keep the old name for backcompat
|
|
|
|
|
|
|
| |
This was buggy, because the underlying functions supported it
partially but cond was not aware of this.
Closes gh-6351
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Add our python_xerbla to the multiarray sources. That function is
needed for all modules that link to the ATLAS 3.10 libraries, which
are now all located in two files, libsatlas and libtatlas.
Also make the test for xerbla linkage work better. If xerbla is not
linked the test will be skipped with a message.
Closes #5362.
|
|
|
|
|
|
|
|
|
|
|
| |
`np.linalg.multi_dot` computes the dot product of two or more arrays in
a single function call, while automatically selecting the fastest evaluation
order.
The algorithm for selecting the fastest evaluation order uses dynamic
programming and closely follows:
Cormen, "Introduction to Algorithms", Chapter 15.2, p. 370-378
|
|
|
|
|
|
| |
These three tests don't make use of the infrastructre in
_TestNorm. This means they are identical tests when run
as part of TestNorm(Double,Single,Int64). Once is enough.
|
| |
|
| |
|
|
|
|
|
|
| |
asfarray truncates the complex part, so it must be avoided for complex
types.
Closes gh-4156.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes the following bug with longdouble:
>>> x = np.arange(10, dtype=np.longdouble)
>>> np.linalg.norm(x, ord=3)
Traceback (most recent call last):
File "<ipython-input-5-7ee53a8ac142>", line 1, in <module>
np.linalg.norm(x, ord=3)
File "/tmp/v/lib/python2.7/site-packages/numpy/linalg/linalg.py", line 2090, in norm
return add.reduce(absx**ord, axis=axis)**(1.0/ord)
UnboundLocalError: local variable 'absx' referenced before assignment
As well as the handling of minimal values for signed integers:
>>> x = np.array([-2**31], dtype=np.int32)
>>> np.linalg.norm(x, ord=3)
/tmp/v/lib/python2.7/site-packages/numpy/linalg/linalg.py:2090: RuntimeWarning: invalid value encountered in double_scalars
return add.reduce(absx**ord, axis=axis)**(1.0/ord)
nan
|
|
|
|
|
|
| |
Do not convert the UPLO argument to a bytestring, it is not necessary.
Distribute parts of the eigh tests into the appropriate TestEigvalsh or
TestEigh test class.
|