8000 Linear Algebra routines as generalized ufuncs by ovillellas · Pull Request #2954 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

Linear Algebra routines as generalized ufuncs #2954

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 77 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
1613e09
BUG: Fix generalized ufunc so repeating labels in one input/output is ok
mwiebe Oct 19, 2012
be911e8
BUG: Missed case of broadcasting onto core dimensions in gufunc
mwiebe Oct 19, 2012
9a70cfd
BUG: Make sure the nditer doesn't complain when 0 broadcast dims
mwiebe Oct 24, 2012
b5c7733
TST: Add test for gufunc scalar case
mwiebe Nov 7, 2012
12be5b7
BUG: Fix bug in gufunc scalar case
mwiebe Nov 7, 2012
fa9dbef
TST: Test for a generalized ufunc bug, for zero-sized inputs
mwiebe Jan 7, 2013
cac3de5
BUG: Fix for generalized ufunc zero-sized input case
mwiebe Jan 7, 2013
153e02e
created a new module to hold linalg ufuncs.
Jan 21, 2013
06613da
inner1d and mat_mult implemented using blas.
Sep 21, 2012
0ab4a14
refactored some code, make it cleaner overall and ready to reuse some…
Sep 24, 2012
e6d08ea
det and slogdet working
Oct 2, 2012
a3baf1c
eigh and eigvalsh working
Oct 4, 2012
e53b3d3
solve gufunc working
Oct 5, 2012
6ad2738
solve1 and inv working
Oct 5, 2012
1276782
fixed possible issues with BLAS _copy (0 is not a valid incx/incy val…
Oct 6, 2012
ee4138d
working eig and eigvals priority 2 functions.
Oct 9, 2012
b1c3e09
svd implemented. Single output working. Multiple options not function…
Oct 11, 2012
c229ba0
modified the code so it just used external definitions of blas/lapack…
Oct 12, 2012
4b5f777
lapack_lite for builds of umath_linalg without an optimized lapack in…
Oct 17, 2012
b29fa3c
added some single precision functions to f2c_lite.c that were missing…
Oct 17, 2012
56d70ff
added plenty of simple functions (quadratic_form plus all the "inspir…
Oct 23, 2012
3cde140
added information about the contents of umath-linalg module
Oct 23, 2012
f26444d
fixed gufuncs so that they use the proper signature (mwiebe fix present)
Oct 24, 2012
839e597
fixed a warning in f2c_lite.c for umath/lapack_lite
Oct 29, 2012
4f2a508
poinv and chosolve working. Rebuilt lapack_lite to support them. Used…
Oct 31, 2012
b7d0f7b
updated umath_linalg_content.txt
Oct 31, 2012
6100e8a
wrote a wrapper module for umath_linalg. Named gufuncs_linalg (in pyt…
Nov 2, 2012
fdeafbd
first iteration with tests. Incomplete and some failing. Just a start…
Nov 9, 2012
3bfb914
work on tests and related fixes. Getting things in shape to commit to…
Nov 13, 2012
c4a2cff
removed some wrappers that weren't needed with the harness fix, just …
Nov 13, 2012
23a6380
modified umath_linalg_content.txt to reflect changes.
Nov 13, 2012
0735c95
updated the umath_linalg_content.txt adding a mention to the wrapper …
Jan 21, 2013
6e0ea34
fixed bug in matrix_multiply when using cdoubles
Nov 15, 2012
250786b
fixed the problem in eigvals (apparently)
Nov 15, 2012
8565a63
work in progress: proper tests for eig.
Nov 16, 2012
f9372ab
added tests for ufuncs in gufuncs_linalg (the ones based on pdl). Add…
Nov 19, 2012
d8ed21d
reverted matrix_dot in umath_gufuncs to matrix_multiply.
Nov 20, 2012
a5e5833
updated documentation
Jan 14, 2013
f2c81b4
compile fix on linux/mac
Jan 21, 2013
c25e0b7
Merge branch 'gufunc-fix' into gufunc-linalg-stable
Jan 21, 2013
a4f540d
BLD: Windows build fixes + some tabs removed
Jan 23, 2013
6a09b5c
STY: made sure that split strings had \ at the end
Jan 24, 2013
e7b6a2b
updated api version, as one merge changed it.
Jan 28, 2013
05d0146
fixed testdet test. It failed due to eigvails failing in single preci…
Jan 28, 2013
32b0617
TST: fixed test for gufuncs_linalg Det
Jan 28, 2013
22b163c
ENH: cholesky handling of _potrf failures (set result to nan)
Jan 30, 2013
6e1b48c
ENH: eigh, eigvalsh set result to nan on LAPACK error (_ssyevd, _heevd)
Jan 30, 2013
69f6464
ENH: solve sets result to nan on LAPACK error (_gesv)
Jan 30, 2013
48c4ab4
ENH: inv sets result to nan on LAPACK error (_gesv)
Jan 30, 2013
a5a1b83
ENH: svd sets results to nan on LAPACK error (_gesdd)
Jan 30, 2013
40d3746
ENH: chosolve sets result to nan on LAPACK error (_potrf, _potrs)
Jan 30, 2013
01186ca
DOC: Added docstring for eigh
Jan 30, 2013
d7b2a58
DOC: Added docstring to eigvalsh
Jan 30, 2013
a6c51c6
DOC: added docstring to solve
Jan 30, 2013
89083d4
DOC: added docstring for svd
Jan 30, 2013
e538255
8000 DOC: Added docstring to chosolve
Jan 30, 2013
f008fdb
DOC: added docstring for poinv
Jan 30, 2013
fa1c5f8
DOC: Added notes on error handling.
Jan 30, 2013
3a970dc
MAINT: renamed umath_linalg module to _umath_linalg as it is internal.
Jan 30, 2013
6cf6586
MAINT: renamed the file describing the gufuncs_linalg module
Jan 30, 2013
b686a76
MAINT: Rewrote the gufuncs_linalg_contents as a rst file and updated it.
Jan 30, 2013
2b334c6
STY: PEP8
Feb 8, 2013
7ad0b50
DOC: corrected documentation - arrays of functions -> arrays of matrices
Feb 8, 2013
19240e0
ENH: Added np.seterr handling of errors
Feb 8, 2013
38c2de2
BLD: python 3.x compile fix
Feb 11, 2013
7d8396e
BLD: Python3 build problem fixed
Feb 11, 2013
1fc7a3a
DOC: Added doctests to docstring for fused operations
Feb 12, 2013
3e15fa8
DOC: added more doctests
Feb 14, 2013
adcad92
DOC: changed doctests for eig and eigh to be more robust
Feb 20, 2013
3fe3ea3
DOC: fixed doctest in poinv so that the example matrix is positive-de…
Feb 20, 2013
5efdd41
BUG: fixed a bug in eig for complex numbers. Eigenvector results are …
Feb 20, 2013
41b51bd
FIX: problems with eig and eigvals. Enhanced tests.
Mar 1, 2013
b6f6d85
ENH: added complex version for inner1d. Also added dotc1d
Mar 22, 2013
0e23dbb
FIX: matrix_multiply now works when given a column matrix
Mar 22, 2013
d31d830
DOC: changed <NDIMS> to … in shape descriptions in docstrings
Apr 5, 2013
83556f6
MAINT: added from __future__ as suggested by charris
Apr 5, 2013
a344d47
BLD: reverted api version back to 8
Apr 5, 2013
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions numpy/core/bento.info
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ Library:
Extension: umath_tests
Sources:
src/umath/umath_tests.c.src
Extension: umath_linalg
Sources:
src/umath/umath_linalg.c.src
Extension: scalarmath
Sources:
src/scalarmathmodule.c.src
Expand Down
1 change: 1 addition & 0 deletions numpy/core/bscript
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,7 @@ def pre_build(context):
context.tweak_extension("scalarmath", use="npymath", includes=["src/private"])
context.tweak_extension("multiarray_tests", use="npymath", includes=["src/private"])
context.tweak_extension("umath_tests", use="npymath", includes=["src/private"])
context.tweak_extension("umath_linalg", use="npymath", includes=["src/private"])

def build_dotblas(extension):
if bld.env.HAS_CBLAS:
Expand Down
32 changes: 32 additions & 0 deletions numpy/core/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,38 @@ def get_dotblas_sources(ext, build_dir):
config.add_extension('umath_tests',
sources = [join('src','umath', 'umath_tests.c.src')])

#######################################################################
# umath_linalg module #
#######################################################################

lapack_info = get_info('lapack_opt', 0)
def get_lapack_lite_sources(ext, build_dir):
if not lapack_info:
print("### Warning: Using unoptimized lapack ###")
return ext.depends[:-1]
else:
if sys.platform=='win32':
print("### Warning: python_xerbla.c is disabled ###")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • What is python_xerbla.c?
  • What effect does disabling it have?
  • Why is it disabled?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In LAPACK xerbla is an error handling function. LAPACK routines print out their errors using that function. python_xerbla is a version of the function friendly with Python.

I had to make a version of lapack_lite, following the instructions present in lapack_lite inside the linalg package. I needed to do so as I use some routines not present on the current lapack_lite (notably the single precision ones and some extra).

The build configuration is inspired by the build configuration of linalg (i.e. ruthlessly copied :) ).

return ext.depends[:1]
return ext.depends[:2]

config.add_extension('_umath_linalg',
685C sources = [get_lapack_lite_sources,
join('src', 'umath', 'umath_linalg.c.src'),
join('src', 'umath', 'lapack_lite', 'python_xerbla.c'),
join('src', 'umath', 'lapack_lite', 'zlapack_lite.c'),
join('src', 'umath', 'lapack_lite', 'dlapack_lite.c'),
join('src', 'umath', 'lapack_lite', 'blas_lite.c'),
join('src', 'umath', 'lapack_lite', 'dlamch.c'),
join('src', 'umath', 'lapack_lite', 'f2c_lite.c')
],
depends = [join('src', 'umath', 'gufuncs_linalg.py'),
join('src', 'umath', 'lapack_lite', 'f2c.h'),
],
extra_info = lapack_info,
libraries = ['npymath'],
)

#######################################################################
# multiarray_tests module #
#######################################################################
Expand Down
Loading
0