Skip to content

Commit

Permalink
ENH: Added wrappers for remaining LAPACK auxiliary routines included …
Browse files Browse the repository at this point in the history
…with

LAPCK 3.1.0 that are present without interface changes in each version
through 3.5.0.
  • Loading branch information
insertinterestingnamehere committed Mar 18, 2015
1 parent 1199297 commit 488682e
Show file tree
Hide file tree
Showing 6 changed files with 4,265 additions and 716 deletions.
15 changes: 2 additions & 13 deletions scipy/linalg/_cython_signature_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,17 @@ def make_signature(filename):
def get_sig_name(line):
return line.split('(')[0].split(' ')[-1]

def sigs_from_dir(directory, outfile, manual_wrappers=None, exclusions=None,
auxiliaries=None):
def sigs_from_dir(directory, outfile, manual_wrappers=None, exclusions=None):
if directory[-1] in ['/', '\\']:
directory = directory[:-1]
files = glob.glob(directory + '/*.f*')
if exclusions is None:
exclusions = []
if auxiliaries is None:
auxiliaries = []
if manual_wrappers is not None:
exclusions += [get_sig_name(l) for l in manual_wrappers.split('\n')]
signatures = []
for filename in files:
name = filename.split('\\')[-1][:-2]
if name[1:3] == 'la' and name[1:] not in auxiliaries:
continue
if name in exclusions:
continue
signatures.append(make_signature(filename))
Expand Down Expand Up @@ -108,12 +103,6 @@ def sigs_from_dir(directory, outfile, manual_wrappers=None, exclusions=None,
if libname.lower() == 'blas':
sigs_from_dir(src_dir, outfile, exclusions=['scabs1', 'xerbla'])
elif libname.lower() == 'lapack':
# Auxiliary routines are excluded unless explicitly included.
auxiliaries = ['laenv', 'lacon', 'lacn2', 'laswp', 'larf', 'larz',
'lauum', 'lacon', 'langb', 'lange', 'langt', 'lanhb',
'lanhe', 'lanhp', 'lanhs', 'lanht', 'lansb', 'lansp',
'lanst', 'lansy', 'lantb', 'lantp', 'lantr', 'lanv2',
'lartg', 'larfg', 'lasd4']
# Exclude all routines that do not have consistent interfaces from
# LAPACK 3.1.0 through 3.5.0.
# Also exclude routines with string arguments to avoid
Expand All @@ -125,4 +114,4 @@ def sigs_from_dir(directory, outfile, manual_wrappers=None, exclusions=None,
'dlazq4', 'slazq3', 'slazq4', 'dlasq3', 'dlasq4',
'slasq3', 'slasq4', 'dlasq5', 'slasq5', 'slaneg']
sigs_from_dir(src_dir, outfile, manual_wrappers=lapack_manual_wrappers,
exclusions=exclusions, auxiliaries=auxiliaries)
exclusions=exclusions)
69 changes: 69 additions & 0 deletions scipy/linalg/_lapack_subroutine_wrappers.f
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
c This file was generated by _cython_wrapper_generators.py.
c Do not edit this file directly.

subroutine cladivwrp(ret, x, y)
external wcladiv
complex wcladiv
complex ret
complex x
complex y
ret = wcladiv(x, y)
end

subroutine clangbwrp(ret, norm, n, kl, ku, ab, ldab, work)
external wclangb
real wclangb
Expand Down Expand Up @@ -200,6 +209,19 @@ subroutine dlamchwrp(ret, cmach)
ret = dlamch(cmach)
end

subroutine dlanegwrp(ret, n, d, lld, sigma, pivmin, r)
external dlaneg
integer dlaneg
integer ret
integer n
double precision d(*)
double precision lld(*)
double precision sigma
double precision pivmin
integer r
ret = dlaneg(n, d, lld, sigma, pivmin, r)
end

subroutine dlangbwrp(ret, norm, n, kl, ku, ab, ldab, work)
external dlangb
double precision dlangb
Expand Down Expand Up @@ -344,6 +366,25 @@ subroutine dlantrwrp(ret, norm, uplo, diag, m, n, a, lda, work)
ret = dlantr(norm, uplo, diag, m, n, a, lda, work)
end

subroutine dlapy2wrp(ret, x, y)
external dlapy2
double precision dlapy2
double precision ret
double precision x
double precision y
ret = dlapy2(x, y)
end

subroutine dlapy3wrp(ret, x, y, z)
external dlapy3
double precision dlapy3
double precision ret
double precision x
double precision y
double precision z
ret = dlapy3(x, y, z)
end

subroutine dzsum1wrp(ret, n, cx, incx)
external dzsum1
double precision dzsum1
Expand Down Expand Up @@ -546,6 +587,34 @@ subroutine slantrwrp(ret, norm, uplo, diag, m, n, a, lda, work)
ret = wslantr(norm, uplo, diag, m, n, a, lda, work)
end

subroutine slapy2wrp(ret, x, y)
external wslapy2
real wslapy2
real ret
real x
real y
ret = wslapy2(x, y)
end

subroutine slapy3wrp(ret, x, y, z)
external wslapy3
real wslapy3
real ret
real x
real y
real z
ret = wslapy3(x, y, z)
end

subroutine zladivwrp(ret, x, y)
external wzladiv
complex*16 wzladiv
complex*16 ret
complex*16 x
complex*16 y
ret = wzladiv(x, y)
end

subroutine zlangbwrp(ret, norm, n, kl, ku, ab, ldab, work)
external zlangb
double precision zlangb
Expand Down
Loading

0 comments on commit 488682e

Please sign in to comment.