summaryrefslogtreecommitdiff
path: root/numpy/linalg
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #22786 from asmeurer/linalg-namedtuplesHEADmainCharles Harris2023-05-173-159/+220
|\ | | | | ENH: Add namedtuple return types to linalg functions that return tuples
| * TYP: Update type annotations for the new linalg named tuplesBas van Beek2023-05-172-36/+51
| |
| * MAINT: Update numpy/linalg/linalg.pyCharles Harris2023-05-171-1/+1
| | | | | | Co-authored-by: Bas van Beek <43369155+BvB93@users.noreply.github.com>
| * Fix a doctestAaron Meurer2022-12-131-1/+1
| |
| * Add namedtuple return types to linalg functions that return tuplesAaron Meurer2022-12-122-133/+179
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge pull request #22493 from mwtoews/maint-openSebastian Berg2023-04-282-4/+4
|\ \ | | | | | | MAINT: remove redundant open() modes and io.open() alias
| * | MAINT: remove redundant open() modes and io.open() aliasMike Taves2022-10-292-4/+4
| | |
* | | ENH: Raise C++ standard to C++17Sayed Adel2023-04-041-2/+0
| | |
* | | DEP: deprecate `product`, `cumproduct`, `sometrue`, `alltrue`Ralf Gommers2023-03-021-2/+2
| | | | | | | | | | | | [skip cirrus]
* | | MAINT: Only set memory error when we know it was one (and fix second occurance)Sebastian Berg2023-02-211-20/+32
| | | | | | | | | | | | | | | This assumes lapack errors already report something reasonable, that may not be true, but is a different issue probably.
* | | BUG,MAINT: Avoid malloc(0) in linalg and improve error paths.Sebastian Berg2023-02-211-8/+28
| | |
* | | ENH: Improve performance of finfo and _commonType (#23088)Pieter Eendebak2023-02-151-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Add missing <type_traits> header.Peter Hawkins2023-01-301-0/+1
| | | | | | | | | | | | | | | `std::is_scalar` is defined in `type_traits`, which is missing from the includes.
* | | Merge pull request #21888 from WillTirone/fix_scipy_1339Matti Picus2023-01-251-2/+2
|\ \ \ | | | | | | | | MAINT: changing the method of checking for nan / inf values linalg.eig
| * | | ENH: unifying error type for gh scipy #1339Will Tirone2023-01-241-5/+9
| | | |
| * | | MAINT: changing the method of checking for nan / inf values in numpy.linalg.eig.Will Tirone2022-06-291-7/+3
| | | | | | | | | | | | | | | | Changing numpy to use the same function from numpy.lib.function_base as scipy. Tests pass.
* | | | MAINT: Fix stacklevels for the new C dispatcher not adding oneSebastian Berg2023-01-171-3/+3
| |_|/ |/| |
* | | TST: Adapt test for modification to == and != deprecation/futurewarningSebastian Berg2022-12-011-4/+1
| | |
* | | Merge pull request #22619 from seberg/move-set_moduleMatti Picus2022-11-291-2/+2
|\ \ \ | | | | | | | | MAINT: Move set_module from numpy.core to numpy._utils
| * | | MAINT: Move set_module to numpy.core to use without C importSebastian Berg2022-11-241-2/+2
| | | |
* | | | BLD: enable building NumPy with MesonRalf Gommers2022-11-251-0/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This enables building with NumPy on Linux and macOS. Windows support should be complete to, but is untested as of now and may need a few tweaks. This contains: - A set of `meson.build` files and related code generation script tweaks, header templates, etc. - One CI job on Linux - Basic docs on using Meson to build NumPy (not yet integrated in the html docs, it's too early for that - this is for early adopters right now). The build should be complete, with the major exception of SIMD support. The full test suite passes. See gh-22546 for the tracking issue with detailed notes on the plan for switching NumPy to Meson as its build system. Co-authored-by: Stefan van der Walt <stefanv@berkeley.edu>
* | | | BLD: fix missing `Python.h` includesRalf Gommers2022-11-252-0/+7
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `Python.h` must be included before including and standard library headers, if it's pulled in (which happens when you include numpy headers). Otherwise we see build warnings like: ``` 142/244] Compiling C object numpy/core/_multiarray_umath.cpython-311-x86_64-linux-gnu.so.p/src_multiarray_textreading_field_types.c.o In file included from /opt/hostedtoolcache/Python/3.11.0/x64/include/python3.11/Python.h:86, from ../numpy/core/include/numpy/npy_common.h:5, from ../numpy/core/include/numpy/ndarraytypes.h:4, from ../numpy/core/src/multiarray/textreading/field_types.h:9, from ../numpy/core/src/multiarray/textreading/field_types.c:1: /opt/hostedtoolcache/Python/3.11.0/x64/include/python3.11/cpython/pytime.h:208:60: warning: ‘struct timespec’ declared inside parameter list will not be visible outside of this definition or declaration 208 | PyAPI_FUNC(int) _PyTime_FromTimespec(_PyTime_t *tp, struct timespec *ts); | ^~~~~~~~ /opt/hostedtoolcache/Python/3.11.0/x64/include/python3.11/cpython/pytime.h:213:56: warning: ‘struct timespec’ declared inside parameter list will not be visible outside of this definition or declaration 213 | PyAPI_FUNC(int) _PyTime_AsTimespec(_PyTime_t t, struct timespec *ts); | ^~~~~~~~ /opt/hostedtoolcache/Python/3.11.0/x64/include/python3.11/cpython/pytime.h:217:63: warning: ‘struct timespec’ declared inside parameter list will not be visible outside of this definition or declaration 217 | PyAPI_FUNC(void) _PyTime_AsTimespec_clamp(_PyTime_t t, struct timespec *ts); | ^~~~~~~~ ```
* | | Merge pull request #21895 from hoodmane/emscripten-ciRalf Gommers2022-11-151-1/+4
|\ \ \ | | | | | | | | ENH, CI: Add Emscripten to CI
| * | | TST: Skip tests that are not currently supported in wasmHood Chatham2022-11-111-1/+4
| | |/ | |/|
* | | MAINT: Patch to remove ncola variable from f2c_blas.cCharles Harris2022-11-131-0/+112
| | | | | | | | | | | | [skip ci]
* | | BLD: remove unused `ncola` variables from lapack-liteRalf Gommers2022-11-131-16/+4
|/ / | | | | | | This fixes some annoying build warnings.
* | Revert "MAINT: fix typo in f2c_lapack.c"Rohit Goswami2022-10-161-1/+1
| | | | | | | | This reverts commit 5d6b8b0d5658418919fbaef0e843655262291dbc.
* | MAINT: fix typo in f2c_lapack.cIkko Ashimine2022-10-161-1/+1
| | | | | | inifinity -> infinity
* | Merge pull request #22313 from rossbar/deprecate-fastCopyAndTransposeMatti Picus2022-10-071-16/+2
|\ \ | | | | | | DEP: Deprecate fastCopyAndTranspose
| * | MAINT: rm private, unused linalg function.Ross Barnowski2022-10-061-11/+0
| | |
| * | DEP: fastCopyAndTranspose and PyArray_CopyAndTransposeRoss Barnowski2022-10-061-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge pull request #22147 from eelregit/eelregit_tensorsolve_doc_fixSebastian Berg2022-09-301-1/+1
|\ \ \ | |/ / |/| | DOC: fix linalg.tensorsolve docstring
| * | Fix linalg.tensorsolve docstringYin Li2022-08-181-1/+1
| | |
* | | BUG: Support using libunwind for backtrackRin Cat (鈴猫)2022-08-181-0/+4
|/ / | | | | | | | | | | | | Some system (e.g. musl) do not have "execinfo.h", and the backtracking is provided by libunwind. Fix: #22084
* | remove redundant reversal of eigenvalues orderKIU Shueng Chuan2022-08-121-1/+0
|/
* MAINT: Fix non-void function does not return a value warningHood Chatham2022-06-291-2/+4
|
* Merge pull request #21626 from seberg/weak-scalarsCharles Harris2022-06-261-3/+3
|\ | | | | API: Introduce optional (and partial) NEP 50 weak scalar logic
| * API: Add leading underscore to `no_nep50_warning` and `get/set_promotion_state`Sebastian Berg2022-06-151-1/+1
| |
| * TST: Ignore promotion warning in linalg test calculating atolSebastian Berg2022-06-151-3/+3
| |
* | Merge pull request #21789 from hoodmane/void-to-int-return-values-f2cCharles Harris2022-06-192-11/+12
|\ \ | |/ |/| ENH: Change f2c declarations with void return type to int
| * ENH: Change f2c declarations with void return type to intHood Chatham2022-06-172-11/+12
| | | | | | | | | | | | When using f2c, the generated C functions for all of these actually return int. WebAssembly is strict on return types and will crash due to the discrepancy.
* | Update comment according to seberg's reviewHood Chatham2022-06-121-1/+3
| |
* | Fix lintHood Chatham2022-06-121-1/+1
| |
* | Handle windowsHood Chatham2022-06-121-1/+6
| |
* | Update numpy/linalg/setup.pyHood Chatham2022-06-111-1/+1
| | | | | | Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
* | ENH: Fix pointer size determination for cross buildHood Chatham2022-06-111-1/+2
|/ | | | | | | | | Using `sys` to ask about the build Python is hostile to cross building because it is very hard to replace the sys module with one that gives info about the target system. On the other hand, the sysconfig data can be replaced by setting _PYTHON_SYSCONFIGDATA_NAME. So instead of using `sys.maxsize` to determine pointer size, use `sysconfig.get_config_var("SIZEOF_VOID_P")`
* Merge pull request #21504 from Yulv-git/typos1Ralf Gommers2022-05-254-18/+18
|\ | | | | MAINT: Fix some typos.
| * Fix some typos.Yulv-git2022-05-144-18/+18
| |
* | DOC:linalg: Remove ref to scipy.linalg.pinv2Ilhan Polat2022-05-221-1/+0
|/
* PERF: Reduce overhead of np.linalg.norm for small arrays (#21394)Pieter Eendebak2022-05-031-2/+4
| | | | 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.