| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
ENH: Add namedtuple return types to linalg functions that return tuples
|
| | |
|
| |
| |
| | |
Co-authored-by: Bas van Beek <43369155+BvB93@users.noreply.github.com>
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
That is, eig(), eigh(), qr(), slogdet(), and svd(). For those functions that
return non-tuples with certain keyword arguments, the return type is
unchanged. This change should be completely backwards compatible.
The namedtuple attribute names come from the array API specification (see,
e.g.,
https://data-apis.org/array-api/latest/extensions/generated/signatures.linalg.eigh.html),
with the exception of eig() which is just the same as eigh(). The name of the
namedtuple object itself is not part of the specification or the public API.
I have not used a namedtuple for the tuple output for qr(mode='raw'), which
returns (h, tau).
This updates the docstrings to use the updated namedtuple return names, and
also the examples to use those names more consistently. This also updates the
tests to check each function for the namedtuple attributes at least once.
|
| |
| |
| |
| | |
[skip cirrus]
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The finfo contains a cache for dtypes, but the np.complex128 dtype does not end up in the cache. The reason is that the np.complex128 is converted to np.float64 which is in the cache.
Performance improvement for finfo(np.complex128):
Main: 2.07 µs ± 75 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)
Pr: 324 ns ± 28.9 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)
Improve performance of finfo by making the cache check the first action in the __new__
Improve performance of _commonType by re-using the expression for a.dtype.type and eliminating variables
The finfo and _commonType was part of the computatation time in lstsq when using scikit-rf. Since these methods are used in various other methods performance can improve there slightly as well.
|
|\ \
| | |
| | | |
MAINT: changing the method of checking for nan / inf values linalg.eig
|
| | | |
|
| | |
| | |
| | |
| | | |
Changing numpy to use the same function from numpy.lib.function_base as scipy. Tests pass.
|
| |/
|/| |
|
| | |
|
|\ \
| | |
| | | |
DEP: Deprecate fastCopyAndTranspose
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Deprecate the fastCopyAndTranspose function from the Python API, and the
underlying PyArray_CopyAndTranspose function from the C-API.
Also removes an internal, private function _fastCopyAndTranspose which
was the original Python wrapper around the C-function.
|
|/ / |
|
|/ |
|
| |
|
|
|
|
| |
Reduce the overhead of np.linalg.norm by replacing dot(x,x) with x.dot(x).
This is OK, since `x` is converted to a base-class array here.
|
|
|
|
|
|
|
|
|
| |
Previously, numpy.linalg.norm would return values with the same floating-point
type as input arrays for most values of the ``ord`` parameter, but not all.
This PR fixes this so that the output dtype matches the input for all (valid) values
of ``ord``.
Co-authored-by: Kenichi Maehashi <webmaster@kenichimaehashi.com>
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
|
|
| |
Co-authored-by: Melissa Weber Mendonça <melissawm@gmail.com>
|
|
|
| |
Co-authored-by: Charles Harris <charlesr.harris@gmail.com>
|
|
|
| |
`u @ np.diag(s) @ vh` can only reproduce the original matrix when `full_matrices` is `False`, otherwise dimension does not match.
|
|
|
|
|
| |
It is in fact always lower-triangular. The errorenous note might
date to when function was forked from SciPy?
|
|
|
|
|
|
|
|
| |
`array.reshape(-1, size)` doesn't work with 0 in the dimensions.
The fix is to use explicit shape instead of `-1`. For "non-square"
tensors the `ValueError` would come from the reshape call, while previously
`LinAlgError` appeared from the solve call. To have the same error type
I added a check for squareness before the reshape.
|
|\
| |
| | |
DOC: Fixed docstring for parameters 2 and -2 on linalg.cond
|
| | |
|
| | |
|
|/ |
|
| |
|
|\
| |
| | |
ENH: Vectorising np.linalg.qr
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
|\ \
| | |
| | | |
MAINT: Removed suitable unused variables shown in LGTM
|
| | |
| | |
| | |
| | | |
'_linalgRealType(t)' function from linalg.py
|
| |/ |
|
|\ \
| |/ |
|
| |
| |
| | |
[ci skip]
|
| |
| |
| |
| |
| |
| |
| | |
It turns out that lstsq also minimizes the 2-norm of x when a is
rank-deficient. I found that by searching the documentation for the
LAPACK library, which is the current implementation of lstsq (as of Dec
2020). Ref: https://www.netlib.org/lapack/lug/node27.html
|