1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278
|
"""
Low-level LAPACK functions
==========================
This module contains low-level functions from the LAPACK library.
.. versionadded:: 0.12.0
.. warning::
These functions do little to no error checking.
It is possible to cause crashes by mis-using them,
so prefer using the higher-level routines in `scipy.linalg`.
Finding functions
=================
.. autosummary::
get_lapack_funcs
All functions
=============
.. autosummary::
:toctree: generated/
cgbsv
cgbtrf
cgbtrs
cgebal
cgees
cgeev
cgegv
cgehrd
cgelss
cgeqp3
cgeqrf
cgerqf
cgesdd
cgesv
cgetrf
cgetri
cgetrs
cgges
cggev
chbevd
chbevx
cheev
cheevd
cheevr
chegv
chegvd
chegvx
claswp
clauum
cpbsv
cpbtrf
cpbtrs
cposv
cpotrf
cpotri
cpotrs
ctrsyl
ctrtri
ctrtrs
cungqr
cungrq
cunmqr
dgbsv
dgbtrf
dgbtrs
dgebal
dgees
dgeev
dgegv
dgehrd
dgelss
dgeqp3
dgeqrf
dgerqf
dgesdd
dgesv
dgetrf
dgetri
dgetrs
dgges
dggev
dlamch
dlaswp
dlauum
dorgqr
dorgrq
dormqr
dpbsv
dpbtrf
dpbtrs
dposv
dpotrf
dpotri
dpotrs
dsbev
dsbevd
dsbevx
dsyev
dsyevd
dsyevr
dsygv
dsygvd
dsygvx
dtrsyl
dtrtri
dtrtrs
sgbsv
sgbtrf
sgbtrs
sgebal
sgees
sgeev
sgegv
sgehrd
sgelss
sgeqp3
sgeqrf
sgerqf
sgesdd
sgesv
sgetrf
sgetri
sgetrs
sgges
sggev
slamch
slaswp
slauum
sorgqr
sorgrq
sormqr
spbsv
spbtrf
spbtrs
sposv
spotrf
spotri
spotrs
ssbev
ssbevd
ssbevx
ssyev
ssyevd
ssyevr
ssygv
ssygvd
ssygvx
strsyl
strtri
strtrs
zgbsv
zgbtrf
zgbtrs
zgebal
zgees
zgeev
zgegv
zgehrd
zgelss
zgeqp3
zgeqrf
zgerqf
zgesdd
zgesv
zgetrf
zgetri
zgetrs
zgges
zggev
zhbevd
zhbevx
zheev
zheevd
zheevr
zhegv
zhegvd
zhegvx
zlaswp
zlauum
zpbsv
zpbtrf
zpbtrs
zposv
zpotrf
zpotri
zpotrs
ztrsyl
ztrtri
ztrtrs
zungqr
zungrq
zunmqr
"""
#
# Author: Pearu Peterson, March 2002
#
from __future__ import division, print_function, absolute_import
__all__ = ['get_lapack_funcs']
from .blas import _get_funcs
# Backward compatibility:
from .blas import find_best_blas_type as find_best_lapack_type
from scipy.linalg import _flapack
try:
from scipy.linalg import _clapack
except ImportError:
_clapack = None
# Backward compatibility
from scipy.lib._util import DeprecatedImport as _DeprecatedImport
clapack = _DeprecatedImport("scipy.linalg.blas.clapack", "scipy.linalg.lapack")
flapack = _DeprecatedImport("scipy.linalg.blas.flapack", "scipy.linalg.lapack")
# Expose all functions (only flapack --- clapack is an implementation detail)
empty_module = None
from scipy.linalg._flapack import *
del empty_module
# some convenience alias for complex functions
_lapack_alias = {
'corgqr': 'cungqr', 'zorgqr': 'zungqr',
'cormqr': 'cunmqr', 'zormqr': 'zunmqr',
'corgrq': 'cungrq', 'zorgrq': 'zungrq',
}
def get_lapack_funcs(names, arrays=(), dtype=None):
"""Return available LAPACK function objects from names.
Arrays are used to determine the optimal prefix of LAPACK routines.
Parameters
----------
names : str or sequence of str
Name(s) of LAPACK functions without type prefix.
arrays : sequence of ndarrays, optional
Arrays can be given to determine optimal prefix of LAPACK
routines. If not given, double-precision routines will be
used, otherwise the most generic type in arrays will be used.
dtype : str or dtype, optional
Data-type specifier. Not used if `arrays` is non-empty.
Returns
-------
funcs : list
List containing the found function(s).
Notes
-----
This routine automatically chooses between Fortran/C
interfaces. Fortran code is used whenever possible for arrays with
column major order. In all other cases, C code is preferred.
In LAPACK, the naming convention is that all functions start with a
type prefix, which depends on the type of the principal
matrix. These can be one of {'s', 'd', 'c', 'z'} for the numpy
types {float32, float64, complex64, complex128} respectevely, and
are stored in attribute `typecode` of the returned functions.
"""
return _get_funcs(names, arrays, dtype,
"LAPACK", _flapack, _clapack,
"flapack", "clapack", _lapack_alias)
|