Compare commits

...
254 Commits
Author SHA1 Message Date
thijssteel 7094cb0f7c add steqr wrappers for comparison 2024-03-06 17:07:20 +01:00
thijssteel 7a2ecc24e5 add fortran wrappers for steqr3 2024-03-06 16:33:46 +01:00
thijssteel b44c64faef add steqr3 2024-03-06 15:58:48 +01:00
thijssteel a4c4a4eb52 add steqr3 2024-03-06 14:24:35 +01:00
thijssteel 0d9803a29c add c wrapper to cpp rot 2024-03-06 11:58:41 +01:00
thijssteel 81be118bcb change filenames 2024-03-04 09:41:25 +01:00
thijssteel f57a792304 use direct overloading for rot 2024-03-01 18:10:27 +01:00
thijssteel 2bdd724ecf small change in template of lasr3 2024-03-01 18:10:08 +01:00
thijssteel 1a95ff9b67 add fortran wrappers for lasr3 2024-02-29 16:21:40 +01:00
thijssteel 5b521e6ccc copy over files from lapackv4 repo 2024-02-29 16:04:38 +01:00
langou fe843f99d6 Merge pull request #989 from angsch/bdsqr
Two small fixes of bdsqr
2024-02-26 06:19:52 -07:00
Angelika Schwarz 230b8c4862 Fix -ZERO singular value in bdsqr
[D,Z]BDSQR returns for

D = [ -4.0, -3.0, -2.0, -1.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0]
E = [ 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0]

as singular value  D(10) = -ZERO. By definition, singular values
are non-negative. LASQ1 already fixes the sign and returns +ZERO.
2024-02-23 19:46:45 +01:00
Angelika Schwarz acbac1092c Update documentation of work size in bdsqr (thanks @TarcioV)
In https://github.com/Reference-LAPACK/lapack/pull/234
only dbdsqr was updated. This updates the documentation
of the other precisions.
2024-02-23 19:46:34 +01:00
langou c6bc40164a Merge pull request #888 from mkrainiuk/lapacke_64
Add Index-64 API as extended API with _64 suffix for LAPACKE
2024-02-10 13:08:07 -07:00
Maria Kraynyuk bc5d836a31 resolve conflicts after rebasing 2024-02-05 11:37:53 -08:00
Maria Kraynyuk 15d05b4fbc fix code style in LAPACKE DGESV examples 2024-02-05 10:54:16 -08:00
Maria Kraynyuk 41909fd0c5 Add missed memory deallocation to LAPACKE DGESV examples 2024-02-05 10:54:16 -08:00
Maria Kraynyuk 21299d28eb Enable Index-64 extended API only for Intel and GNU compilers
Other compilers might not fully support preprocessing
2024-02-05 10:54:15 -08:00
Maria Kraynyuk 40ca7a2713 Include lapack_64.h only during the build 2024-02-05 10:54:04 -08:00
Maria Kraynyuk ee213a3ed3 resolve conflicts after rebasing 2024-02-05 10:32:21 -08:00
Maria Kraynyuk fe3e793c16 Remove unused lapack_64.h from la_constants 2024-02-05 10:32:21 -08:00
Maria Kraynyuk 81823e958c Fix -Werror=conversion problems in LAPACK with integer-8 2024-02-05 10:32:17 -08:00
Maria Kraynyuk ac2c5681bc MATGEN fix -Werror=conversion problems 2024-02-05 10:28:27 -08:00
Maria Kraynyuk 56aa979416 Fix problem with missed mod files in parallel LAPACK build 2024-02-05 10:28:27 -08:00
Maria Kraynyuk dae4c5a3a4 Add LAPACKE examples for extended _64 API 2024-02-05 10:28:27 -08:00
Maria Kraynyuk ba11da8301 MATGEN long lines updated by script 2024-02-05 10:28:27 -08:00
Maria Kraynyuk 19d3a4e638 Add extended API with _64 suffix to MATGEN 2024-02-05 10:28:26 -08:00
Maria Kraynyuk 3ccdccea9b LAPACK SRC long lines updated manually 2024-02-05 10:28:26 -08:00
Maria Kraynyuk a1e8cb4845 LAPACK SRC long lines updated by script 2024-02-05 10:28:25 -08:00
Maria Kraynyuk b891145899 Add extended API with _64 suffix to LAPACK with lapack_64.h 2024-02-05 10:28:08 -08:00
Maria Kraynyuk 907725572a Wrap all functions to macro for Index-64 API in LAPACKE 2024-02-05 10:21:06 -08:00
Maria Kraynyuk 741a2c2ee0 Add extended API with _64 suffix to LAPACKE 2024-02-05 10:20:49 -08:00
langou 50d689057a Merge pull request #984 from FrK5E/lapack_testing_py_typo
Typo
2024-01-25 14:35:21 -07:00
FrK5E cc90d869b0 Typo 2024-01-25 22:09:22 +01:00
langou add94979e9 Merge pull request #981 from christoph-conrads/980-CZLARFGP-must-re-scale-when-ALPHA-is-not-real
{C,Z}LARFGP: re-scale input vector more often
2024-01-18 08:33:55 -07:00
Christoph Conrads 827cb8e8eb {C,Z}LARFGP: re-scale input vector more often
Re-scale the input vector even if `X` is negligibly small in norm if the
imaginary part of `ALPHA` is nonzero. For otherwise `XNORM` will not be
computed with a small _relative_ error.

fixes #980
2024-01-17 18:52:16 +01:00
langou 0a3aa4db40 Merge pull request #979 from turboencabulator/doxygen-warnings
Fix Doxygen warnings
2024-01-16 22:40:41 -07:00
Kyle Guinn dead4e4dfd Fix missing DONE parameter name
SRC/slaqp3rk.f:585: warning: unexpected command endverbatim
SRC/dlaqp3rk.f:585: warning: unexpected command endverbatim
SRC/claqp3rk.f:579: warning: unexpected command endverbatim
SRC/zlaqp3rk.f:579: warning: unexpected command endverbatim
2024-01-16 22:46:23 -06:00
Kyle Guinn 6597d4803b Fix mismatched verbatim/endverbatim commands
SRC/zgedmd.f90:213: warning: reached end of comment while inside a \verbatim block; check for missing \endverbatim tag!
SRC/zgedmdq.f90:710: warning: unexpected command endverbatim
2024-01-16 22:46:23 -06:00
Kyle Guinn aa41ed6b5e Fix ZWORK parameter name
SRC/cgedmdq.f90:548: warning: argument 'lzwork' from the argument list of cgedmdq has multiple @param documentation sections
SRC/zgedmdq.f90:546: warning: argument 'lzwork' from the argument list of zgedmdq has multiple @param documentation sections
2024-01-16 22:46:13 -06:00
Kyle Guinn 79a0785334 Normalize line endings
sed -i 's/\s\+$//' SRC/*dmd* TESTING/EIG/*dmd*
Plus manually stripping empty lines at EOF.
2024-01-16 22:43:58 -06:00
langou 5d705a1a20 Merge pull request #978 from turboencabulator/doxygen-sync
Re-sync Doxyfile with CMake
2024-01-16 20:57:46 -07:00
Kyle Guinn 55d73a2ef2 Prevent html options from being applied to manpage generation
When both BUILD_HTML_DOCUMENTATION and BUILD_MAN_DOCUMENTATION are ON,
DOXYGEN_GENERATE_HTML was set to YES (and some other HTML-only variables
were set) whenever Doxyfile.man was generated, and therefore `make man`
would also populate DOCS/explore-html, but with less detail due to the
other differences between Doxyfile.man and Doxyfile.html.
2024-01-15 23:11:04 -06:00
Kyle Guinn 7952995ba0 Adjust Doxygen source and output paths
This removes another difference with DOCS/Doxyfile.

From the CMake 3.9.6 documentation (earliest version describing
doxygen_add_docs, I've updated cmake_minimum_required to match):

"So that relative input paths work as expected, by default the working
directory of the Doxygen command will be the current source directory
(i.e. CMAKE_CURRENT_SOURCE_DIR)."

Likewise for the output directory:

"Set to CMAKE_CURRENT_BINARY_DIR by this module.  Note that if the
project provides its own value for this and it is a relative path, it
will be converted to an absolute path relative to the current binary
directory.  This is necessary because doxygen will normally be run from
a directory within the source tree so that relative source paths work as
expected."
2024-01-15 22:35:16 -06:00
Kyle Guinn cf9b217c50 Add options missing from the existing Doxyfile
Both have been present in DOCS/Doxyfile since that file was added.
2024-01-15 21:55:08 -06:00
Kyle Guinn bd6fece37b Reset several Doxygen options to their default values
The goal is to minimize the output of `doxygen -x DOCS/Doxyfile` so that
it contains only the settings specified in CMakeLists.txt.  In all
cases, the changed values are intended to match what CMake is generating
when using -DBUILD_HTML_DOCUMENTATION=ON, and ideally the changes should
have no effect.

Comments for ABBREVIATE_BRIEF and EXAMPLE_PATTERNS describe the default
behavior when they are blank, but our blank values show up in the output
of `doxygen -x DOCS/Doxyfile` indicating that blank is not the default
value.  Setting values to match the current default behavior should have
no effect, unless Doxygen changes in the future.  On the other hand,
MATHJAX_RELPATH has changed and will change again in newer Doxygen
versions.

CMake automatically inserts its own set of EXCLUDE_PATTERNS that
contains none of the patterns previously listed here.  Neither the
previous values nor the CMake-generated ones should have any effect due
to our choice of INPUT and FILE_PATTERNS.

MATHJAX_RELPATH, LATEX_CMD_NAME, RTF_HYPERLINKS, and MAN_LINKS all
require some other option (USE_MATHJAX, GENERATE_LATEX, GENERATE_RTF,
and GENERATE_MAN, respectively) to be set to YES to take effect, and all
are set to NO, so these changes should have no effect.  Note that the
CMake-generated Doxyfile.man sets MAN_LINKS=YES in addition to
GENERATE_MAN=YES.
2024-01-15 21:31:50 -06:00
Kyle Guinn 62c9cd885a Skip setting Doxygen options to default values
QUIET defaults to NO, WARNINGS defaults to YES.
2024-01-15 15:55:41 -06:00
Kyle Guinn f81db935ca Sort Doxygen lists for comparison purposes 2024-01-15 15:54:41 -06:00
langou 8254fbdd80 Merge pull request #976 from christoph-conrads/975-LAPACK-requires-CMake-3.11-or-newer
CMake: restore compatibility with v3.10 and older
2024-01-13 09:48:01 -07:00
Christoph Conrads ec2805b5e9 CMake: restore compatibility with v3.10 and older
The COMPILE_OPTIONS property exists only from CMake 3.11 onwards.

fixes #975
2024-01-13 17:08:59 +01:00
langou d7ea9c52b9 Merge pull request #970 from turboencabulator/perms 2024-01-06 18:44:07 -07:00
Kyle Guinn 464f532552 Remove executable permissions from source files 2024-01-06 18:20:41 -06:00
langou db501d91ba Merge pull request #959 from dklyuchinskiy/lapack-fix-dmd-issues
fix some DMD issues
2023-12-12 09:00:09 -07:00
Dmitry Klyuchinsky 4787915207 init variable SSUM before call of LASSQ in DMD 2023-12-12 13:42:37 +07:00
Dmitry Klyuchinsky 101800018d add DMD tests into CMakeLists 2023-12-12 12:42:50 +07:00
langou c2255a8d4d Merge pull request #942 from dklyuchinskiy/lapack-257-zero-lwork 2023-12-04 08:15:01 -07:00
Dmitry Klyuchinsky 280e16145d add missed usage of sroundup_lwork in several functions 2023-12-04 18:29:06 +07:00
Dmitry Klyuchinsky cd7523d5b2 handle corner case of lwork in evr/evr_2stage and fix output format in chkxer 2023-12-04 16:35:36 +07:00
Dmitry Klyuchinsky 9dc24803a2 handle and document corner cases of lwork in lapack, align all precisions 2023-12-04 16:35:36 +07:00
Elizaveta Tokmasheva 7d15f830c2 handle and document corner cases of lwork in lapack, double complex precision 2023-12-04 16:35:35 +07:00
Elizaveta Tokmasheva e0d8afbed6 handle and document corner cases of lwork in lapack, single complex precision 2023-12-04 16:35:35 +07:00
Dmitry Klyuchinsky 0c1e0c3e75 handle and document corner cases of lwork in lapack, single precision 2023-12-04 16:35:35 +07:00
Dmitry Klyuchinsky 6032a6bca0 handle and document corner cases of lwork in lapack, double precision 2023-12-04 16:35:35 +07:00
langou a4298d5ff6 Merge pull request #954 from ACSimon33/lapack_testing_python_summary_bug
Fixed search phrase for determining the amount of successful tests
2023-12-01 07:37:55 -07:00
Simon Maertens 5b0687f429 Fixed search phrase for determining the amount of successful tests 2023-12-01 14:05:54 +00:00
langou 3200980553 Merge pull request #953 from ACSimon33/test_memory_leak
Fixed memory leak in testing framework
2023-11-29 08:43:39 -07:00
Simon Maertens 3d2b9cbdcd Fixed memory leak in testing framework (?chkaa.F) 2023-11-29 15:18:49 +00:00
langou af77ebfa6c Merge pull request #950 from ACSimon33/cblas_weak_attribute 2023-11-29 08:08:00 -07:00
langou 9560fe2fe3 Merge pull request #951 from ACSimon33/nagfor_imag_fix 2023-11-29 08:06:10 -07:00
Simon Maertens 2a0aea9c4c Added missing comma in FORMAT expression 2023-11-29 14:34:26 +00:00
Simon Maertens c69a96ea9e Added missing comma in FORMAT expression 2023-11-29 14:33:00 +00:00
Simon Maertens 8c54a57d66 Replaced non-standard IMAG function with its standard counterpart `AIMAG. 2023-11-29 14:31:16 +00:00
Simon Maertens 26db2da3eb Fixed Fortran compiler flags check for nagfor compiler and usage in CBLAS target 2023-11-29 14:30:30 +00:00
Simon Maertens 10432bb5e8 Fixed HAS_ATTRIBUTE_WEAK_SUPPORT flag for CBLAS objects 2023-11-29 12:53:09 +00:00
langou e78a2ad18c Merge pull request #948 from weslleyspereira/fix-945
Enables Fortran before including CheckFortranFunctionExists in CMakeL…
2023-11-27 12:04:16 -07:00
Weslley S Pereira cbb553627e Enables Fortran before including CheckFortranFunctionExists in CMakeLists.txt 2023-11-27 10:29:11 -07:00
langou 04b044e020 Merge pull request #944 from julielangou/master
LAPACK 3.12.0 release
2023-11-24 13:41:15 -07:00
Julie d7be813203 LAPACK 3.12.0 release
Update documentation for coming release
2023-11-24 12:36:54 -08:00
langou b231dd57cd Merge pull request #941 from Reference-LAPACK/lapack-new-feature
Update of the documentation to the pull request "Truncated QR with Pivoting #891"
2023-11-21 07:14:44 -07:00
scr2016 bd4455fb82 updated descriptions for the truncated QR routines second time 2023-11-21 03:02:10 -08:00
scr2016 dcbd80331e updated descriptions for the truncated QR routines 2023-11-20 23:07:59 -08:00
scr2016 aec6cb3281 Fixed an error in the description of complex routines, changed othogonal into unitary 2023-11-20 22:58:28 -08:00
langou d811d855d8 Merge pull request #940 from ACSimon33/void_main_fix_for_apple_clang 2023-11-15 08:16:04 -07:00
Simon Maertens d2c2de1d54 Changed void main() to int main() in CMake check because AppleClang doesn't allow it 2023-11-15 15:04:56 +00:00
langou 4b8a925006 Merge pull request #939 from ACSimon33/nagfor_fix
Fixed Fortran preprocessor flag for NAG Fortran compiler
2023-11-15 07:40:26 -07:00
Simon Maertens b29d75131e Fixed Fortran preprocessor flag for NAG Fortran compiler 2023-11-15 14:22:26 +00:00
langou d58d59a99d Merge pull request #891 from Reference-LAPACK/lapack-new-feature
Truncated QR with Pivoting
2023-11-14 21:02:04 -07:00
scr2016 8d44861982 fixed a type for adding TESTING/LIN/zchkqp3rk.f into CMakeLists.txt 2023-11-14 05:35:24 -08:00
scr2016 a1322ff40e merged with git pull 2023-11-14 05:16:11 -08:00
scr2016 21e33bd707 final trucated QR 2023-11-14 04:42:11 -08:00
scr2016 d64a6ca96d fixed a typo-bug for intrinsics in dlaqp3rk.f 2023-11-14 04:42:11 -08:00
scr2016 7603b62709 UPDATED the descriptions of the new truncated QR routines 2023-11-14 04:42:11 -08:00
scr2016 ea4787ca59 added complex precision truncated QR and testing for CGEQP3RK, CLAQP2RK, CLAQP3RK 2023-11-14 04:42:11 -08:00
scr2016 6a15917836 added declaration of intrinsics REAL or DBLE in SRC/dchkqp3rk.f zchkqp3rk.f schkqp3rk.f 2023-11-14 04:42:11 -08:00
scr2016 ee81706f4f fxed comments in zchkqp3rk.f schkqp3rk.f 2023-11-14 04:42:11 -08:00
scr2016 036fef485f fixed description in SRC/zlaqp2rk.f SRC/zlaqp3rk.f 2023-11-14 04:42:10 -08:00
scr2016 0a6744177a fixed comments in SLAQP3RK 2023-11-14 04:42:10 -08:00
scr2016 c2228e10e1 forgot add in the previous commit TESTING/LIN/schkqp3rk.f, adding now 2023-11-14 04:42:10 -08:00
scr2016 7019c6345c added single precision ant testing for truncated QR i.e. SGEQP3RK, SLAQP2RK, SLAQP3RK 2023-11-14 04:42:10 -08:00
scr2016 540e4eb0a9 Changed ArrayE allocation from static to dynamic 2023-11-14 04:42:10 -08:00
scr2016 0c440488d9 changed LWORK_DORMQR into LWORK_MQR name in LIN/dchkqp3rk.f LIN/zchkqp3rk.f 2023-11-14 04:42:10 -08:00
scr2016 10e12a4001 Intrinsic DBLE declaration from DLAQP3RK, since it is not used 2023-11-14 04:42:10 -08:00
scr2016 bd42f8ebaf DOWNDATED comments in TESTING/LIN/dchkqp3rk.f 2023-11-14 04:42:10 -08:00
scr2016 5bcd5859e5 added comments symbols '*' in TESTING/LIN/zchkqp3rk.f 2023-11-14 04:42:10 -08:00
scr2016 c64027aa5e DOWNDATED commnets in SRC/dgeqp3rk.f SRC/dlaqp2rk.f SRC/dlaqp3rk.f 2023-11-14 04:42:10 -08:00
scr2016 349a295b93 removed one comment sign * in SRC/zlaqp3rk.f 2023-11-14 04:42:10 -08:00
scr2016 d086a3d5b8 DOWNDATED comments in LIN/zchkqp3rk.f 2023-11-14 04:42:10 -08:00
scr2016 bfbd799e1a DOWNDATED comments in SRC/zgeqp3rk.f SRC/zlaqp2rk.f SRC/zlaqp3rk.f 2023-11-14 04:42:10 -08:00
scr2016 7656583a53 changed formatting in the RELTOL description WE recomment RELTOL to be ... and for complex case added a factor of 10 as min( 10*max(M,N)*EPS, sqrt(EPS) ) <= RELTOL 2023-11-14 04:42:10 -08:00
scr2016 e3b58c4cda added testing code for DGEQP3RK 2023-11-14 04:42:10 -08:00
scr2016 c037c322b7 added SRC/zgeqp3rk.f SRC/zlaqp2rk.f SRC/zlaqp2rk.f and changed Makefile and CMakeLists.txt accordingly 2023-11-14 04:42:10 -08:00
scr2016 c3eaab30c6 corrected comments in TESTING/LIN/dchkqp3rk.f for KMAX loop 2023-11-14 04:42:09 -08:00
scr2016 667f08c385 corrected comment in update the i-th row of A in DLAQP3RK 2023-11-14 04:42:09 -08:00
scr2016 1309b6c5cc fixed an DLARFG index bug in dlaqp2rk.f and inserted debug statement in dlaqp3rk.f 2023-11-14 04:42:09 -08:00
scr2016 231dd99d0c changed alligment of if statements in generation matrices with zeros in TESTINg/LIN/dchkqp3rk.f 2023-11-14 04:42:09 -08:00
scr2016 6abbd2b64d merged if MINMN contition with matrix types conditon for matrixces with ZEROes generation in DCHKQP3RK 2023-11-14 04:42:09 -08:00
scr2016 35634f322c changed the matrix IMAT in DCHKQP3RK to call DLATB4 to 14 2023-11-14 04:42:09 -08:00
scr2016 8e888aaa61 changed comments in dlatb4.f and changed text allignment for function calls in dchkqp3rk.f 2023-11-14 04:42:09 -08:00
scr2016 59fc007bc2 simplified the formula in the descriotion from LWORK >= (2*N + N+NRHS - 1) to LWORK >= (3*N + NRHS - 1) 2023-11-14 04:42:09 -08:00
scr2016 93b5bc325e changed comments in dlatb4.f 2023-11-14 04:42:09 -08:00
scr2016 f1bbf6c1c3 fixed comments of function signature description in TESTING/LIN/dchkqp3rk.f 2023-11-14 04:42:09 -08:00
scr2016 86cf705308 Updated description of the INFO about NaN detection in DGEQP3RK, DLAQP3RK, DLAQP2RK 2023-11-14 04:42:09 -08:00
scr2016 2c939526a5 changed comments about checking TAU for NaN in dlaqp2rk.f and dlaqp3rk.f and changed aligment of IMPLICIT NONE in the description of DGEQP3RK in dgeqp3rk.f 2023-11-14 04:42:09 -08:00
scr2016 8ecf1119ab changed text aligment for DGEMM and DGEMV function calls in DLAQP3RK 2023-11-14 04:42:09 -08:00
scr2016 a39a28f68c changed comments about TAU in dlaqp2rk.f and dlaqp3rk.f 2023-11-14 04:42:09 -08:00
scr2016 37b19bffed changed the description of DLAQP3RK to include real 2023-11-14 04:42:09 -08:00
scr2016 b20545c6d4 cnanged doxigen comments in \brief for dgeqp3rk.f dlaqp2rk.f dlaqp3rk.f to have real in matrix A and B description 2023-11-14 04:42:09 -08:00
scr2016 a020ed05b8 changed comment in DLAQP2RK in the code section about IF guard for DLARF 2023-11-14 04:42:09 -08:00
scr2016 f1a95eebeb changed comment for LWORK in dgeqp3rk.f for minimum LWORK brackets, cosmetic change 2023-11-14 04:42:08 -08:00
scr2016 8e5b70565c Removed blank line in the comments of dgeqp3rk.f 2023-11-14 04:42:08 -08:00
scr2016 8482937cfa added GEQP3RK to ILAENV routine, it changed ilaenv.f and dgeqp3rk.f 2023-11-14 04:42:08 -08:00
scr2016 4161851dd6 changed padding of parameters in the function signature of DGEQP3RK 2023-11-14 04:42:08 -08:00
scr2016 12e939727a Corrected WORK array size requirements for minimum and optimal size in DGEQP3RK and tests as well. Also reduces the requirement for WORK array size in DLAQP2RK to from N to N-1 2023-11-14 04:42:08 -08:00
scr2016 18c19a461c fixed a typo in TESTING/LIN/alahd.f 2023-11-14 04:42:08 -08:00
scr2016 46ef59fcee fixed description from '\ingroup heqp3rk' to '\ingroup geqp3rk' in SRC/dgeqp3rk.f 2023-11-14 04:42:08 -08:00
scr2016 36fa12432d added IMPLICIT NONE to TESTING/LIN/dchkqp3rk.f 2023-11-14 04:42:08 -08:00
scr2016 8d7f615330 added DQK test path for DGEQP3RK into TESTING/dtest.in 2023-11-14 04:42:08 -08:00
scr2016 2eac2f6332 replaced GO TO statements with DO J=1,M ... END DO in dqrt12.f and corrected description formula 2023-11-14 04:42:08 -08:00
scr2016 ea810c995c replaced GO TO statements with DO J=1,M ... END DO in dqrt11.f 2023-11-14 04:42:08 -08:00
scr2016 a111c9bb61 Changed comments and updated GOTO statements in LIN/dqpt01.f 2023-11-14 04:42:08 -08:00
scr2016 14e5f471f3 matrix configuration for DGEQP3RK in LIN/dlatb4.f 2023-11-14 04:42:08 -08:00
scr2016 e209e73925 added test matrices types reporting and test type reporinting for DGEQP3RK in TESTING/LIN/alahd.f 2023-11-14 04:42:08 -08:00
scr2016 7c1c8b0271 updated LIN/alaerh.f with GEQP3RK 2023-11-14 04:42:08 -08:00
scr2016 79f4d030e3 added testing for truncated Qr TESTING/LIN/dchkq3rk.f 2023-11-14 04:42:08 -08:00
scr2016 a0341b292d added a new file for testing TESTING/LIN/dchkqp3rk.f LIN/Makefile LIN/CMakeLists.txt 2023-11-14 04:42:08 -08:00
scr2016 395d04e7f6 Changed tha text alignment in INFO description in DGEQP3RK and DLAQP3RK 2023-11-14 04:42:07 -08:00
scr2016 1798bdba70 Renamed parameter the number of factorized columns so far KF into K , and column loop index into K into KK in DLAQP2RK 2023-11-14 04:42:07 -08:00
scr2016 bfbcec20f6 optimized, deleted not needed setting of MAXC2NRMK and RELMAXC2NRMK when (IOFFSET + K) =1 in DLAQP3RK 2023-11-14 04:42:07 -08:00
scr2016 3fc6c23e44 optimized, deleted not neede setting of MAXC2NRMK and RELMAXC2NRMK when (IOFFSET + K) =1 2023-11-14 04:42:07 -08:00
scr2016 f84ee6c9cc Revert "renamed old auxiliary index J into J1 in DLAQP2RK"
This reverts commit ea0c1ca130a0e628a28651db0475f6da6be07813.

This reverts a rename of J into J1 in DLAQP2RK.
2023-11-14 04:42:07 -08:00
scr2016 1b7bf32c20 renamed old auxiliary index J into J1 in DLAQP2RK 2023-11-14 04:42:07 -08:00
scr2016 4603e69a5f updated the description of DLAQP3RK 2023-11-14 04:42:07 -08:00
scr2016 46e75194d1 changed the description of DGEQP3RK (added imlicit stopping criterion for the residual zero matrix) and fixed a typo in DLAQP3RK 2023-11-14 04:42:07 -08:00
scr2016 e9e939400f changed the description of DGEQP3RK, DLAQP3RK, DLAQP2RK and removed the KMAX parameter from DLAQP3RK 2023-11-14 04:42:07 -08:00
scr2016 8ebb7c88fd fixed INFO NaN and Inf reporting bug in DGEQP3RK and added debug code to DLAQP3RK and DLAQP2RK 2023-11-14 04:42:07 -08:00
scr2016 33c8a2a392 modified descriptions after review number 1 in dgeqp3rk.f dlaqp2rk.f dlaqp3rk.f 2023-11-14 04:42:07 -08:00
scr2016 785b734760 modified descriptions and corrected grammatical errors in dgeqp3rk.f dlaqp2rk.f dlaqp3rk.f 2023-11-14 04:42:07 -08:00
scr2016 352ffe958f fixed grammatical error in the description of INFO in dgeqp3rk.f dlaqp2rk.f dlaqp3rk.f 2023-11-14 04:42:07 -08:00
scr2016 6aac08032d added NaN and INf checks to dgeqp3rk.f dlaqp2rk.f dlaqp3rk.f 2023-11-14 04:42:07 -08:00
scr2016 ecaf99b88c removed KF argument in DLAQP3RK, KF is the number of factorized partial columns in the whole original matrix indexing 2023-11-14 04:42:07 -08:00
scr2016 214842c9bd changed the meaing of K to mean the rank of R instead of the number of fctorizaed colums 2023-11-14 04:42:07 -08:00
scr2016 8391371122 added to the description of DGEQP3Rk, DLAQP2RK and DLAQP3RK references to Zlatko Drmac paper in ACM Trans. Math. Softw. 2023-11-14 04:42:07 -08:00
scr2016 9ea14cddad in DLAQP2RK moved ABSTOL condition into ELSE clause of IF(I.EQ.1) 2023-11-14 04:42:06 -08:00
scr2016 115d5a4c46 in DLAQP3RK chahged ABSTOL and RELTOL condition to return from the look rather then exit from the loop and return at the end of the routine 2023-11-14 04:42:06 -08:00
scr2016 39828c7f67 Changed bar length in the comments in DLAQP3RK 2023-11-14 04:42:06 -08:00
scr2016 43eb003a74 Moved ABSTOL and RELTOL verification in DLAQP3RK in ELSE clause of IF(I.EQ.1) 2023-11-14 04:42:06 -08:00
scr2016 9c0a21ebd3 changed comments and variable names and assigment for KB, IF, KF in DLAQP3RK 2023-11-14 04:42:06 -08:00
scr2016 7bc3615d79 removed redundant IF(.NOT.DONE.) statement at the end of the DGEQP3RK routine 2023-11-14 04:42:06 -08:00
scr2016 762496f6fc moved zero submatrix check in (if(ioffset ==0) else) clause into else part in DLAQP3RK 2023-11-14 04:42:06 -08:00
scr2016 9de1ee7775 changed indent in in one line in SRC/dlaqp2rk.f 2023-11-14 04:42:06 -08:00
scr2016 d152705578 added zero submatrix check to DLAQP3RK and changed the position of DONE parameter in the calling sequence 2023-11-14 04:42:06 -08:00
scr2016 b943dee7c7 in dlaqp3rk.f added comments TODO 2023-11-14 04:42:06 -08:00
scr2016 46f90f6f87 in dlaqp2rk.f moved ZERO submatrix condition check under if statement, when I!=1 2023-11-14 04:42:06 -08:00
scr2016 3fc469a5dd changes in dlaqp2rk.f IF( IOFFSET.EQ.0 .AND. K.EQ.1 ) THEN into IF( I.QE.1 ) THEN and F( MAXC2NRMK.EQ.ZERO ) THEN into IF( I.NE.1 .AND. MAXC2NRMK.EQ.ZERO ) THEN 2023-11-14 04:42:06 -08:00
scr2016 73bfa95e71 replaced MAXK with KMAX in dgeqp3rk.f 2023-11-14 04:42:06 -08:00
scr2016 8da81bc473 replaced MAXK with KMAX in glaqp3rk.f 2023-11-14 04:42:06 -08:00
scr2016 4c09d8efbf changed comments in SRC/dlaqp2rk.f 2023-11-14 04:42:06 -08:00
scr2016 e965983eb9 Added zero submatrix optimization and changed MAXK into KMAX in dlaqp2k.f 2023-11-14 04:42:06 -08:00
scr2016 f0b12a2193 fixed a bug in dgeqp3rk.f in quick return if possible for the whole original matrix when MAXC2NRM<= ABSTOL and ONE <=RELTOL 2023-11-14 04:42:05 -08:00
scr2016 8d5c716a64 fixe the comment in dgeqp3rk.f and changed design in dlaqp2rk.f to return from the loop instead of exiting the loop when ABSTOL or RELTOL criterion is satisfied 2023-11-14 04:42:05 -08:00
scr2016 f8edd87189 added quick return if possible at the beginning for 1) MAXK = 0; 2) ABSTOL and RELTOL criteria satisfaction for the whole original matrix A 2023-11-14 04:42:05 -08:00
scr2016 1287f67c9e added quick return if possible for MAXK = 0 in dgeqp3rk.f 2023-11-14 04:42:05 -08:00
scr2016 614452f28e changed KMAX into MAXK in dlaqp2rk.f, dgeqp3rk.f 2023-11-14 04:42:05 -08:00
scr2016 f5a907d796 changed comments for JPIV in dgeqp3rk.f dlaqp2rk.f dlaqp3rk.f 2023-11-14 04:42:05 -08:00
scr2016 e8517680f9 changed order of code blocks at the beginning in dgeqp3rk.f and added comments at the end of dlaqp2rk.f about setting MAXC2NRMK, RELMAXC2NRMK and TAU 2023-11-14 04:42:05 -08:00
scr2016 6e9d74860c Changed KP0 to KP1 in dgeqp3rk.f dlaqp2rk.f dlaqp3rk.f 2023-11-14 04:42:05 -08:00
scr2016 dd4c896894 added IMPLCIT NONE to dgeqp3rk.f dlaqp2rk.f dlaqp3rk.f and fixed comments in dlaqp3rk.f 2023-11-14 04:42:05 -08:00
scr2016 ba5afcdadb modified comments in TESTING/LIN/alareq.f TESTING/EIG/alareq.f TESTING/EIG/alarqg.f 2023-11-14 04:42:05 -08:00
scr2016 f238faeafb fixes to implicit declarations 2023-11-14 04:42:05 -08:00
scr2016 706fd1a7f5 added dgeqp3rk.f dlaqp2rk.f dlaqp3rk.f 2023-11-14 04:42:05 -08:00
scr2016 af1bb9e4b4 changed comment in dchkq3 2023-11-14 04:42:05 -08:00
langou ae9c818530 Merge pull request #925 from angsch/master
Add Anderson's tests of NRM2
2023-11-12 08:43:44 -07:00
Angelika Schwarz 26df4b3599 Improve testing of NRM2
Add tests covering arrays with extreme numbers provided in
Anderson E. (2017)
Algorithm 978: Safe Scaling in the Level 1 BLAS
ACM Trans Math Softw 44:1--28
https://doi.org/10.1145/3061665

[D,S]NRM2 coverage improves
lines     59.1% -> 100.0%
branches  30.0% ->  90.0%.

[DZ,SC]NRM2 coverage improves
lines     67.0% -> 100.0%
branches  41.7% ->  91.7%
2023-11-12 07:44:37 +01:00
Weslley S. Pereira f568a60945 Merge pull request #936 from Reference-LAPACK/DMD_improve_comments
make the DMD comments in the header Doxygen compliant
2023-11-11 14:47:37 -07:00
Julien Langou 466401c52b defgroup for DMD in groups-usr.dox 2023-11-11 14:44:58 -07:00
Julien Langou 3ac3bf9fa4 some more improvements to the doxygen documentation 2023-11-11 14:40:20 -07:00
Julien Langou 5d35af84fd add Tennessee, Berkeley, Colorado and NAG 2023-11-11 10:42:03 -07:00
Weslley S. Pereira 2382be4f23 Merge pull request #926 from weslleyspereira/fix-nan-propag-gecon
GECON returns 1 if RCOND is NaN
2023-11-11 10:35:32 -07:00
langou 6261d629e1 Merge pull request #930 from christoph-conrads/917-sorcsd2by1-computes-inaccurate-result
Make vector orthogonalization more reliable
2023-11-11 09:46:20 -07:00
Julien Langou a383745e50 make the DMD comments in the header Doxygen compliant 2023-11-10 20:36:27 -07:00
Christoph Conrads 64897c4474 xLARFGP: avoid overflows
Avoid overflows when XNORM << ABS(ALPHA) << 1.

fixes #934
2023-11-10 20:08:50 +01:00
Weslley S. Pereira d469b91278 Merge pull request #929 from martin-frbg/appv-flang11
Appveyor CI: Expressly request flang 11.0.1 from conda
2023-11-10 09:25:50 -07:00
Weslley S. Pereira 43a55bc960 Merge pull request #933 from Reference-LAPACK/issue931_timdavis__incorrect_blas_level_in_dtrsv
fix #931
2023-11-10 09:02:14 -07:00
Julien Langou 44e942df6d fix #931
fix typo for the blas level of BLAS/SRC/DTRSV
2023-11-10 08:49:41 -07:00
Christoph Conrads 5b0bc5e555 xORBDB5/xUNBDB5: ensure xORBDB6 input has unit norm
Call sites may run into problems when this subroutine computes nonzero
vectors that are very small in norm.
2023-11-10 16:29:41 +01:00
Christoph Conrads 7eb4057d6d xORBDB5/xUNBDB5: detect numerically zero vectors
Do not call xORBDB6/xUNBDB6 with input vectors x that are numerically
zero because this can cause problems at the call sites (xLARFGP
computations might underflow) leading to, e.g., the computation of
nonunitary matrices in the xORCSD2BY1/xUNCSD2BY1 output.
2023-11-09 17:14:58 +01:00
Christoph Conrads 80d7c69a52 xORBDB5/xUNBDB5: introduce real zero parameter
* introduce a parameter representing a real zero for consistency
* stop comparing real values with complex zero
2023-11-09 17:14:58 +01:00
Christoph Conrads ad3d9b8fc4 xORBDB6/xUNBDB6: use safe termination criterion
With a modest amount of random testing on a work station, it is possible
to detect the loss of orthogonality caused by the old early termination
criterion.
2023-11-09 17:14:58 +01:00
Christoph Conrads bc2b374725 xORBDB6/xUNBDB6: do not require unit-norm vector
Do not assume that the vector x passed to these subroutines has
Euclidean norm one (the norm is almost surely smaller than one when
xORBDB5/xUNBDB5 calls this subroutine for the first time).

This commit fixes the occasional inaccurate results computed by
xORCSD2BY1/xUNCSD2BY1.
2023-11-09 17:14:58 +01:00
Weslley S Pereira 68eafc69a8 Makes NaN an illegal value for ANORM on input of GECON. Let NaNs propagate in the computation of RCOND 2023-11-09 09:10:49 -07:00
Martin Kroeker eaa105b0e0 Expressly request flang 11.0.1 from conda 2023-11-08 23:35:08 +01:00
langou 8ecaaf9869 Merge pull request #928 from christoph-conrads/fix-critical-xUNBDB6-typo
xORBDB6/xUNBDB6: fix a constant
2023-11-06 13:47:02 -07:00
Christoph Conrads e0370cabce xORBDB6/xUNBDB6: fix a constant
The commits listed below updated xORBDB6/xUNBDB6 with the aim of
improving numerical stability by avoiding the use of squared values.
With the exception of SORBDB6 these commits did not properly up a magic
constant called `ALPHA` in the code. SORBDB6 was initially updated
correctly before commit a015b21445
inserted an incorrect value again.

The incorrect magic constant may lead to early returns with only
partially orthogonalized output vectors.

Relevant commits:
* 54b3964b0f
* 6479e0f531
* 94419e8bfa
2023-11-06 19:25:22 +01:00
Weslley S. Pereira ada20a01db Merge pull request #927 from pleshkovvli/fix-complex-bdsqr-maxit
Fix complex BDSQR maxit
2023-11-03 08:36:29 -06:00
Vladimir Pleshkov da7f21005e Fix complex BDSQR maxit 2023-11-03 10:29:44 +07:00
Weslley S Pereira 09abbd017b GECON returns 1 if RCOND is NaN 2023-11-02 11:21:34 -06:00
Weslley S. Pereira 3a6f4629e3 Merge pull request #922 from colleeneb/master
Adding in quotes in cmake for Intel ifx and linux build
2023-11-01 11:21:52 -06:00
Weslley S. Pereira e18529f945 Merge pull request #844 from weslleyspereira/try-valgrind
Uses Valgrind for ExperimentalMemCheck in ctest
2023-11-01 11:07:10 -06:00
Weslley S Pereira cfe1114651 Avoid spourious memory leaks in valgrind 2023-11-01 10:56:57 -06:00
Weslley S Pereira 88277c5b8e Solves two memory leaks in the examples 2023-11-01 09:32:50 -06:00
langou 7a29cfe543 Merge pull request #920 from weslleyspereira/makes-cmake-independent-from-Fortran
Always use C as linker language for CBLAS
2023-10-31 19:18:07 -06:00
Weslley S Pereira d8f668cf50 Add option to disable usage of Python in the tests 2023-10-31 17:57:52 -06:00
Weslley S Pereira 833ae881d3 Use Debug mode in valgrind CI 2023-10-31 16:24:52 -06:00
Weslley S Pereira 1cae5392c0 Trying to improve time of the memory check job 2023-10-31 15:02:09 -06:00
Weslley S Pereira 7216a7cd1b Uses Valgrind for ExperimentalMemCheck in ctest 2023-10-31 15:00:42 -06:00
Colleen Bertoni bfc7838cd9 Update CheckLAPACKCompilerFlags.cmake
Adding quotes around a flag passed to the Intel compiler.
2023-10-31 15:40:21 -05:00
Weslley S Pereira dfb84d0c3b Always use C as linker language for CBLAS 2023-10-31 12:40:38 -06:00
langou 33b3a45a90 Merge pull request #834 from weslleyspereira/makes-cmake-independent-from-Fortran
Compilation of LAPACKE possibly independent from Fortran
2023-10-31 12:09:06 -06:00
Weslley S Pereira bf50aff0de Adds test in the CI for the installation of CBLAS and LAPACKE without Fortran compiler 2023-10-31 11:59:50 -06:00
langou 163820243e Merge pull request #904 from kleineLi/apply-roundup_lwork-in-lapack
Apply ROUNDUP_LWORK function in lapack
2023-10-31 11:20:29 -06:00
Weslley S Pereira 981af1160b Fix a minor bug 2023-10-31 11:18:28 -06:00
Weslley S Pereira 6a74005272 Solve a few bugs generated in the previous commit 2023-10-31 11:18:28 -06:00
Weslley S Pereira f70c3febac Some changes to make a possible compilation of LAPACKE independent from a Fortran compiler 2023-10-31 11:18:28 -06:00
langou 02ea2d3c77 Merge pull request #909 from weslleyspereira/fix-xlassq
Fix issue #908 related to accumulation in xLASSQ
2023-10-31 10:42:28 -06:00
langou 461cc2cc8b Merge pull request #896 from weslleyspereira/master
Adds OpenSSF Scorecard badge
2023-10-31 10:41:53 -06:00
Weslley S. Pereira aca7ad1ec6 Merge pull request #907 from soypat/master
dtgex2: add 2 to iwork length to prevent OOB interaction in Dtgsy2
2023-10-31 10:40:59 -06:00
Weslley S. Pereira fa75a821b6 Merge pull request #893 from chayleaf/gnu-install-dirs
allow absolute GNU install dirs
2023-10-31 10:40:31 -06:00
Weslley S. Pereira 62e6bdfc71 Merge pull request #880 from martin-frbg/issue879
Update C prototypes and LAPACKE interfaces for ?GEDMD/?GEDMDQ
2023-10-31 10:40:09 -06:00
kleine_li 88810e4079 Apply ROUNDUP_LWORK func in SRC/VARIANTS/qr/LL 2023-10-31 21:53:13 +07:00
kleine_li f01a4d7c5f Apply ROUNDUP_LWORK func in lapack 2023-10-31 21:53:10 +07:00
Weslley S Pereira c4f8085e66 Applies fix following @angsch's suggestions 2023-09-15 15:31:30 -06:00
Weslley S Pereira 78b3aab273 fix issue #908 2023-09-14 13:05:08 -06:00
chayleaf ddca8374dc respect GNU install dirs
CMAKE_INSTALL_LIBDIR is allowed to be an absolute path. Use
CMAKE_INSTALL_FULL_LIBDIR instead.
2023-09-13 11:15:53 +07:00
soypat 710c8bb61d same change to stgex2 2023-09-12 18:35:00 -03:00
soypat f43a41db80 dtgex2: add 2 to iwork length to prevent OOB interaction in Dtgsy2 2023-09-08 20:10:54 -03:00
Weslley S Pereira d5c4999fcb Adds OpenSSF Scorecard badge 2023-08-22 16:19:26 -06:00
scr2016 30b43ed625 fixes to implicit declarations 2023-08-11 14:43:09 -07:00
scr2016 b8475a728d added dgeqp3rk.f dlaqp2rk.f dlaqp3rk.f 2023-08-09 09:07:52 -07:00
scr2016 fffd38fedc changed comment in dchkq3 2023-08-08 17:00:44 -07:00
Martin Kroeker 914f719422 properly cast from zwork_query result to lzwork 2023-07-12 15:29:39 +02:00
Martin Kroeker b85e2bd578 fix types of work and zwork array in c/zgedmd interfaces 2023-07-11 23:25:46 +02:00
Martin Kroeker 6eecdf6c0c update to match c/zgedmd interface fixes 2023-07-11 23:24:10 +02:00
Martin Kroeker cc4798ea38 Adjust prototypes of Dynamic Mode Decomposition functions 2023-07-09 18:20:22 +02:00
Martin Kroeker 1575bb8e19 Update LAPACKE interfaces for Dynamic Mode Decomposition 2023-07-09 18:10:48 +02:00
4385 changed files with 91262 additions and 44462 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ environment:
install:
- call %CONDA_INSTALL_LOCN%\Scripts\activate.bat
# - conda config --set auto_update_conda false
- conda install -c conda-forge --yes --quiet flang jom
- conda install -c conda-forge --yes --quiet flang=11.0.1 jom
- call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
- set "LIB=%CONDA_INSTALL_LOCN%\Library\lib;%LIB%"
- set "CPATH=%CONDA_INSTALL_LOCN%\Library\include;%CPATH%"
+88 -1
View File
@@ -130,11 +130,14 @@ jobs:
- name: Checkout LAPACK
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Install ninja-build tool
uses: seanmiddleditch/gha-setup-ninja@16b940825621068d98711680b6c3ff92201f8fc0 # v3
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: >
cmake -B build
cmake -B build -G Ninja
-D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
-D CMAKE_INSTALL_PREFIX=${{github.workspace}}/lapack_install
-D CBLAS:BOOL=ON
@@ -151,3 +154,87 @@ jobs:
echo "Coverage"
cmake --build build --target coverage
bash <(curl -s https://codecov.io/bash) -X gcov
test-install-cblas-lapacke-without-fortran-compiler:
runs-on: ubuntu-latest
steps:
- name: Checkout LAPACK
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Install ninja-build tool
uses: seanmiddleditch/gha-setup-ninja@16b940825621068d98711680b6c3ff92201f8fc0 # v3
- name: Install basics
run: |
sudo apt update
sudo apt install -y cmake liblapack-dev libblas-dev
sudo apt purge gfortran
- name: Configure CMake
run: >
cmake -B build -G Ninja
-D CMAKE_BUILD_TYPE=Release
-D CMAKE_INSTALL_PREFIX=${{github.workspace}}/lapack_install
-D CBLAS:BOOL=ON
-D LAPACKE:BOOL=ON
-D USE_OPTIMIZED_BLAS:BOOL=ON
-D USE_OPTIMIZED_LAPACK:BOOL=ON
-D BUILD_TESTING:BOOL=OFF
-D LAPACKE_WITH_TMG:BOOL=OFF
-D BUILD_SHARED_LIBS:BOOL=ON
- name: Install
run: cmake --build build --target install -j2
memory-check:
runs-on: ubuntu-latest
env:
BUILD_TYPE: Debug
steps:
- name: Checkout LAPACK
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Install ninja-build tool
uses: seanmiddleditch/gha-setup-ninja@16b940825621068d98711680b6c3ff92201f8fc0 # v3
- name: Install APT packages
run: |
sudo apt update
sudo apt install -y cmake valgrind gfortran
- name: Configure CMake
run: >
cmake -B build -G Ninja
-D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
-D CBLAS:BOOL=ON
-D LAPACKE:BOOL=ON
-D BUILD_TESTING:BOOL=ON
-D LAPACKE_WITH_TMG:BOOL=ON
-D BUILD_SHARED_LIBS:BOOL=ON
-D LAPACK_TESTING_USE_PYTHON:BOOL=OFF
- name: Build
run: cmake --build build --config ${{env.BUILD_TYPE}}
- name: Test
working-directory: ${{github.workspace}}/build
run: |
ctest -C ${{env.BUILD_TYPE}} --schedule-random -j2 -T memcheck > memcheck.out
cat memcheck.out
if tail -n 1 memcheck.out | grep -q "Memory checking results:"; then
exit 0
else
for f in Testing/Temporary/MemoryChecker.*.log; do
if tail -n 1 $f | grep -q "ERROR SUMMARY: 0 errors"; then
tail -n 1 $f
continue
else
echo "Memory check failed in $f"
cat $f
exit 1
fi
done
exit 0
fi
+3
View File
@@ -43,3 +43,6 @@ build*
DOCS/man
DOCS/explore-html
output_err
# Editor config files
.vscode/
+6
View File
@@ -1,3 +1,9 @@
enable_language(Fortran)
# Check for any necessary platform specific compiler flags
include(CheckLAPACKCompilerFlags)
CheckLAPACKCompilerFlags()
add_subdirectory(SRC)
if(BUILD_TESTING)
add_subdirectory(TESTING)
+18 -14
View File
@@ -123,20 +123,24 @@ if(BUILD_INDEX64_EXT_API)
set_target_properties(${BLASLIB}_64_obj PROPERTIES POSITION_INDEPENDENT_CODE ON)
#Add _64 suffix to all Fortran functions via macros
foreach(F IN LISTS SOURCES_64_F)
set(COPT_64_F -cpp)
file(STRINGS ${F} ${F}.lst)
list(FILTER ${F}.lst INCLUDE REGEX "subroutine|SUBROUTINE|external|EXTERNAL|function|FUNCTION")
list(FILTER ${F}.lst EXCLUDE REGEX "^!.*")
list(FILTER ${F}.lst EXCLUDE REGEX "^[*].*")
list(FILTER ${F}.lst EXCLUDE REGEX "end|END")
foreach(FUNC IN LISTS ${F}.lst)
string(REGEX REPLACE "^[a-zA-Z0-9_ *]*(subroutine|SUBROUTINE|external|EXTERNAL|function|FUNCTION)[ ]*[*]?" "" FUNC ${FUNC})
string(REGEX REPLACE "[(][a-zA-Z0-9_, )]*$" "" FUNC ${FUNC})
string(STRIP ${FUNC} FUNC)
list(APPEND COPT_64_F "-D${FUNC}=${FUNC}_64")
endforeach()
list(REMOVE_DUPLICATES COPT_64_F)
set_source_files_properties(${F} PROPERTIES COMPILE_OPTIONS "${COPT_64_F}")
if(CMAKE_Fortran_COMPILER_ID STREQUAL "NAG")
set_source_files_properties(${F} PROPERTIES COMPILE_FLAGS "-fpp")
else()
set_source_files_properties(${F} PROPERTIES COMPILE_FLAGS "-cpp")
endif()
file(STRINGS ${F} ${F}.lst)
list(FILTER ${F}.lst INCLUDE REGEX "subroutine|SUBROUTINE|external|EXTERNAL|function|FUNCTION")
list(FILTER ${F}.lst EXCLUDE REGEX "^!.*")
list(FILTER ${F}.lst EXCLUDE REGEX "^[*].*")
list(FILTER ${F}.lst EXCLUDE REGEX "end|END")
foreach(FUNC IN LISTS ${F}.lst)
string(REGEX REPLACE "^[a-zA-Z0-9_ *]*(subroutine|SUBROUTINE|external|EXTERNAL|function|FUNCTION)[ ]*[*]?" "" FUNC ${FUNC})
string(REGEX REPLACE "[(][a-zA-Z0-9_, )]*$" "" FUNC ${FUNC})
string(STRIP ${FUNC} FUNC)
list(APPEND COPT_64_F "${FUNC}=${FUNC}_64")
endforeach()
list(REMOVE_DUPLICATES COPT_64_F)
set_source_files_properties(${F} PROPERTIES COMPILE_DEFINITIONS "${COPT_64_F}")
endforeach()
endif()
+1 -1
View File
@@ -141,7 +141,7 @@
* =====================================================================
SUBROUTINE DTRSV(UPLO,TRANS,DIAG,N,A,LDA,X,INCX)
*
* -- Reference BLAS level1 routine --
* -- Reference BLAS level2 routine --
* -- Reference BLAS is a software package provided by Univ. of Tennessee, --
* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
*
+232 -2
View File
@@ -121,7 +121,8 @@
SUBROUTINE CHECK1(SFAC)
* .. Parameters ..
INTEGER NOUT
PARAMETER (NOUT=6)
REAL THRESH
PARAMETER (NOUT=6, THRESH=10.0E0)
* .. Scalar Arguments ..
REAL SFAC
* .. Scalars in Common ..
@@ -141,7 +142,7 @@
INTEGER ICAMAX
EXTERNAL SCASUM, SCNRM2, ICAMAX
* .. External Subroutines ..
EXTERNAL CSCAL, CSSCAL, CTEST, ITEST1, STEST1
EXTERNAL CB1NRM2, CSCAL, CSSCAL, CTEST, ITEST1, STEST1
* .. Intrinsic Functions ..
INTRINSIC MAX
* .. Common blocks ..
@@ -256,6 +257,10 @@
20 CONTINUE
IF (ICASE.EQ.6) THEN
* .. SCNRM2 ..
* Test scaling when some entries are tiny or huge
CALL CB1NRM2(N,(INCX-2)*2,THRESH)
CALL CB1NRM2(N,INCX,THRESH)
* Test with hardcoded mid range entries
CALL STEST1(SCNRM2(N,CX,INCX),STRUE2(NP1),STRUE2(NP1),
+ SFAC)
ELSE IF (ICASE.EQ.7) THEN
@@ -782,3 +787,228 @@
* End of ITEST1
*
END
SUBROUTINE CB1NRM2(N,INCX,THRESH)
* Compare NRM2 with a reference computation using combinations
* of the following values:
*
* 0, very small, small, ulp, 1, 1/ulp, big, very big, infinity, NaN
*
* one of these values is used to initialize x(1) and x(2:N) is
* filled with random values from [-1,1] scaled by another of
* these values.
*
* This routine is adapted from the test suite provided by
* Anderson E. (2017)
* Algorithm 978: Safe Scaling in the Level 1 BLAS
* ACM Trans Math Softw 44:1--28
* https://doi.org/10.1145/3061665
*
* .. Scalar Arguments ..
INTEGER INCX, N
REAL THRESH
*
* =====================================================================
* .. Parameters ..
INTEGER NMAX, NOUT, NV
PARAMETER (NMAX=20, NOUT=6, NV=10)
REAL HALF, ONE, THREE, TWO, ZERO
PARAMETER (HALF=0.5E+0, ONE=1.0E+0, TWO= 2.0E+0,
& THREE=3.0E+0, ZERO=0.0E+0)
* .. External Functions ..
REAL SCNRM2
EXTERNAL SCNRM2
* .. Intrinsic Functions ..
INTRINSIC AIMAG, ABS, CMPLX, MAX, MIN, REAL, SQRT
* .. Model parameters ..
REAL BIGNUM, SAFMAX, SAFMIN, SMLNUM, ULP
PARAMETER (BIGNUM=0.1014120480E+32,
& SAFMAX=0.8507059173E+38,
& SAFMIN=0.1175494351E-37,
& SMLNUM=0.9860761315E-31,
& ULP=0.1192092896E-06)
* .. Local Scalars ..
COMPLEX ROGUE
REAL SNRM, TRAT, V0, V1, WORKSSQ, Y1, Y2,
& YMAX, YMIN, YNRM, ZNRM
INTEGER I, IV, IW, IX, KS
LOGICAL FIRST
* .. Local Arrays ..
COMPLEX X(NMAX), Z(NMAX)
REAL VALUES(NV), WORK(NMAX)
* .. Executable Statements ..
VALUES(1) = ZERO
VALUES(2) = TWO*SAFMIN
VALUES(3) = SMLNUM
VALUES(4) = ULP
VALUES(5) = ONE
VALUES(6) = ONE / ULP
VALUES(7) = BIGNUM
VALUES(8) = SAFMAX
VALUES(9) = SXVALS(V0,2)
VALUES(10) = SXVALS(V0,3)
ROGUE = CMPLX(1234.5678E+0,-1234.5678E+0)
FIRST = .TRUE.
*
* Check that the arrays are large enough
*
IF (N*ABS(INCX).GT.NMAX) THEN
WRITE (NOUT,99) "SCNRM2", NMAX, INCX, N, N*ABS(INCX)
RETURN
END IF
*
* Zero-sized inputs are tested in STEST1.
IF (N.LE.0) THEN
RETURN
END IF
*
* Generate 2*(N-1) values in (-1,1).
*
KS = 2*(N-1)
DO I = 1, KS
CALL RANDOM_NUMBER(WORK(I))
WORK(I) = ONE - TWO*WORK(I)
END DO
*
* Compute the sum of squares of the random values
* by an unscaled algorithm.
*
WORKSSQ = ZERO
DO I = 1, KS
WORKSSQ = WORKSSQ + WORK(I)*WORK(I)
END DO
*
* Construct the test vector with one known value
* and the rest from the random work array multiplied
* by a scaling factor.
*
DO IV = 1, NV
V0 = VALUES(IV)
IF (ABS(V0).GT.ONE) THEN
V0 = V0*HALF*HALF
END IF
Z(1) = CMPLX(V0,-THREE*V0)
DO IW = 1, NV
V1 = VALUES(IW)
IF (ABS(V1).GT.ONE) THEN
V1 = (V1*HALF) / SQRT(REAL(KS+1))
END IF
DO I = 1, N-1
Z(I+1) = CMPLX(V1*WORK(2*I-1),V1*WORK(2*I))
END DO
*
* Compute the expected value of the 2-norm
*
Y1 = ABS(V0) * SQRT(10.0E0)
IF (N.GT.1) THEN
Y2 = ABS(V1)*SQRT(WORKSSQ)
ELSE
Y2 = ZERO
END IF
YMIN = MIN(Y1, Y2)
YMAX = MAX(Y1, Y2)
*
* Expected value is NaN if either is NaN. The test
* for YMIN == YMAX avoids further computation if both
* are infinity.
*
IF ((Y1.NE.Y1).OR.(Y2.NE.Y2)) THEN
* add to propagate NaN
YNRM = Y1 + Y2
ELSE IF (YMIN == YMAX) THEN
YNRM = SQRT(TWO)*YMAX
ELSE IF (YMAX == ZERO) THEN
YNRM = ZERO
ELSE
YNRM = YMAX*SQRT(ONE + (YMIN / YMAX)**2)
END IF
*
* Fill the input array to SCNRM2 with steps of incx
*
DO I = 1, N
X(I) = ROGUE
END DO
IX = 1
IF (INCX.LT.0) IX = 1 - (N-1)*INCX
DO I = 1, N
X(IX) = Z(I)
IX = IX + INCX
END DO
*
* Call SCNRM2 to compute the 2-norm
*
SNRM = SCNRM2(N,X,INCX)
*
* Compare SNRM and ZNRM. Roundoff error grows like O(n)
* in this implementation so we scale the test ratio accordingly.
*
IF (INCX.EQ.0) THEN
Y1 = ABS(REAL(X(1)))
Y2 = ABS(AIMAG(X(1)))
YMIN = MIN(Y1, Y2)
YMAX = MAX(Y1, Y2)
IF ((Y1.NE.Y1).OR.(Y2.NE.Y2)) THEN
* add to propagate NaN
ZNRM = Y1 + Y2
ELSE IF (YMIN == YMAX) THEN
ZNRM = SQRT(TWO)*YMAX
ELSE IF (YMAX == ZERO) THEN
ZNRM = ZERO
ELSE
ZNRM = YMAX * SQRT(ONE + (YMIN / YMAX)**2)
END IF
ZNRM = SQRT(REAL(n)) * ZNRM
ELSE
ZNRM = YNRM
END IF
*
* The tests for NaN rely on the compiler not being overly
* aggressive and removing the statements altogether.
IF ((SNRM.NE.SNRM).OR.(ZNRM.NE.ZNRM)) THEN
IF ((SNRM.NE.SNRM).NEQV.(ZNRM.NE.ZNRM)) THEN
TRAT = ONE / ULP
ELSE
TRAT = ZERO
END IF
ELSE IF (ZNRM == ZERO) THEN
TRAT = SNRM / ULP
ELSE
TRAT = (ABS(SNRM-ZNRM) / ZNRM) / (TWO*REAL(N)*ULP)
END IF
IF ((TRAT.NE.TRAT).OR.(TRAT.GE.THRESH)) THEN
IF (FIRST) THEN
FIRST = .FALSE.
WRITE(NOUT,99999)
END IF
WRITE (NOUT,98) "SCNRM2", N, INCX, IV, IW, TRAT
END IF
END DO
END DO
99999 FORMAT (' FAIL')
99 FORMAT ( ' Not enough space to test ', A6, ': NMAX = ',I6,
+ ', INCX = ',I6,/,' N = ',I6,', must be at least ',I6 )
98 FORMAT( 1X, A6, ': N=', I6,', INCX=', I4, ', IV=', I2, ', IW=',
+ I2, ', test=', E15.8 )
RETURN
CONTAINS
REAL FUNCTION SXVALS(XX,K)
* .. Scalar Arguments ..
REAL XX
INTEGER K
* .. Local Scalars ..
REAL X, Y, YY, Z
* .. Intrinsic Functions ..
INTRINSIC HUGE
* .. Executable Statements ..
Y = HUGE(XX)
Z = YY
IF (K.EQ.1) THEN
X = -Z
ELSE IF (K.EQ.2) THEN
X = Z
ELSE IF (K.EQ.3) THEN
X = Z / Z
END IF
SXVALS = X
RETURN
END
END
+217 -2
View File
@@ -247,8 +247,9 @@
END
SUBROUTINE CHECK1(SFAC)
* .. Parameters ..
DOUBLE PRECISION THRESH
INTEGER NOUT
PARAMETER (NOUT=6)
PARAMETER (NOUT=6, THRESH=10.0D0)
* .. Scalar Arguments ..
DOUBLE PRECISION SFAC
* .. Scalars in Common ..
@@ -266,7 +267,7 @@
INTEGER IDAMAX
EXTERNAL DASUM, DNRM2, IDAMAX
* .. External Subroutines ..
EXTERNAL ITEST1, DSCAL, STEST, STEST1
EXTERNAL ITEST1, DB1NRM2, DSCAL, STEST, STEST1
* .. Intrinsic Functions ..
INTRINSIC MAX
* .. Common blocks ..
@@ -319,6 +320,10 @@
*
IF (ICASE.EQ.7) THEN
* .. DNRM2 ..
* Test scaling when some entries are tiny or huge
CALL DB1NRM2(N,(INCX-2)*2,THRESH)
CALL DB1NRM2(N,INCX,THRESH)
* Test with hardcoded mid range entries
STEMP(1) = DTRUE1(NP1)
CALL STEST1(DNRM2(N,SX,INCX),STEMP(1),STEMP,SFAC)
ELSE IF (ICASE.EQ.8) THEN
@@ -1129,3 +1134,213 @@
* End of ITEST1
*
END
SUBROUTINE DB1NRM2(N,INCX,THRESH)
* Compare NRM2 with a reference computation using combinations
* of the following values:
*
* 0, very small, small, ulp, 1, 1/ulp, big, very big, infinity, NaN
*
* one of these values is used to initialize x(1) and x(2:N) is
* filled with random values from [-1,1] scaled by another of
* these values.
*
* This routine is adapted from the test suite provided by
* Anderson E. (2017)
* Algorithm 978: Safe Scaling in the Level 1 BLAS
* ACM Trans Math Softw 44:1--28
* https://doi.org/10.1145/3061665
*
* .. Scalar Arguments ..
INTEGER INCX, N
DOUBLE PRECISION THRESH
*
* =====================================================================
* .. Parameters ..
INTEGER NMAX, NOUT, NV
PARAMETER (NMAX=20, NOUT=6, NV=10)
DOUBLE PRECISION HALF, ONE, TWO, ZERO
PARAMETER (HALF=0.5D+0, ONE=1.0D+0, TWO= 2.0D+0,
& ZERO=0.0D+0)
* .. External Functions ..
DOUBLE PRECISION DNRM2
EXTERNAL DNRM2
* .. Intrinsic Functions ..
INTRINSIC ABS, DBLE, MAX, MIN, SQRT
* .. Model parameters ..
DOUBLE PRECISION BIGNUM, SAFMAX, SAFMIN, SMLNUM, ULP
PARAMETER (BIGNUM=0.99792015476735990583D+292,
& SAFMAX=0.44942328371557897693D+308,
& SAFMIN=0.22250738585072013831D-307,
& SMLNUM=0.10020841800044863890D-291,
& ULP=0.22204460492503130808D-015)
* .. Local Scalars ..
DOUBLE PRECISION ROGUE, SNRM, TRAT, V0, V1, WORKSSQ, Y1, Y2,
& YMAX, YMIN, YNRM, ZNRM
INTEGER I, IV, IW, IX
LOGICAL FIRST
* .. Local Arrays ..
DOUBLE PRECISION VALUES(NV), WORK(NMAX), X(NMAX), Z(NMAX)
* .. Executable Statements ..
VALUES(1) = ZERO
VALUES(2) = TWO*SAFMIN
VALUES(3) = SMLNUM
VALUES(4) = ULP
VALUES(5) = ONE
VALUES(6) = ONE / ULP
VALUES(7) = BIGNUM
VALUES(8) = SAFMAX
VALUES(9) = DXVALS(V0,2)
VALUES(10) = DXVALS(V0,3)
ROGUE = -1234.5678D+0
FIRST = .TRUE.
*
* Check that the arrays are large enough
*
IF (N*ABS(INCX).GT.NMAX) THEN
WRITE (NOUT,99) "DNRM2", NMAX, INCX, N, N*ABS(INCX)
RETURN
END IF
*
* Zero-sized inputs are tested in STEST1.
IF (N.LE.0) THEN
RETURN
END IF
*
* Generate (N-1) values in (-1,1).
*
DO I = 2, N
CALL RANDOM_NUMBER(WORK(I))
WORK(I) = ONE - TWO*WORK(I)
END DO
*
* Compute the sum of squares of the random values
* by an unscaled algorithm.
*
WORKSSQ = ZERO
DO I = 2, N
WORKSSQ = WORKSSQ + WORK(I)*WORK(I)
END DO
*
* Construct the test vector with one known value
* and the rest from the random work array multiplied
* by a scaling factor.
*
DO IV = 1, NV
V0 = VALUES(IV)
IF (ABS(V0).GT.ONE) THEN
V0 = V0*HALF
END IF
Z(1) = V0
DO IW = 1, NV
V1 = VALUES(IW)
IF (ABS(V1).GT.ONE) THEN
V1 = (V1*HALF) / SQRT(DBLE(N))
END IF
DO I = 2, N
Z(I) = V1*WORK(I)
END DO
*
* Compute the expected value of the 2-norm
*
Y1 = ABS(V0)
IF (N.GT.1) THEN
Y2 = ABS(V1)*SQRT(WORKSSQ)
ELSE
Y2 = ZERO
END IF
YMIN = MIN(Y1, Y2)
YMAX = MAX(Y1, Y2)
*
* Expected value is NaN if either is NaN. The test
* for YMIN == YMAX avoids further computation if both
* are infinity.
*
IF ((Y1.NE.Y1).OR.(Y2.NE.Y2)) THEN
* Add to propagate NaN
YNRM = Y1 + Y2
ELSE IF (YMAX == ZERO) THEN
YNRM = ZERO
ELSE IF (YMIN == YMAX) THEN
YNRM = SQRT(TWO)*YMAX
ELSE
YNRM = YMAX*SQRT(ONE + (YMIN / YMAX)**2)
END IF
*
* Fill the input array to DNRM2 with steps of incx
*
DO I = 1, N
X(I) = ROGUE
END DO
IX = 1
IF (INCX.LT.0) IX = 1 - (N-1)*INCX
DO I = 1, N
X(IX) = Z(I)
IX = IX + INCX
END DO
*
* Call DNRM2 to compute the 2-norm
*
SNRM = DNRM2(N,X,INCX)
*
* Compare SNRM and ZNRM. Roundoff error grows like O(n)
* in this implementation so we scale the test ratio accordingly.
*
IF (INCX.EQ.0) THEN
ZNRM = SQRT(DBLE(N))*ABS(X(1))
ELSE
ZNRM = YNRM
END IF
*
* The tests for NaN rely on the compiler not being overly
* aggressive and removing the statements altogether.
IF ((SNRM.NE.SNRM).OR.(ZNRM.NE.ZNRM)) THEN
IF ((SNRM.NE.SNRM).NEQV.(ZNRM.NE.ZNRM)) THEN
TRAT = ONE / ULP
ELSE
TRAT = ZERO
END IF
ELSE IF (SNRM == ZNRM) THEN
TRAT = ZERO
ELSE IF (ZNRM == ZERO) THEN
TRAT = SNRM / ULP
ELSE
TRAT = (ABS(SNRM-ZNRM) / ZNRM) / (DBLE(N)*ULP)
END IF
IF ((TRAT.NE.TRAT).OR.(TRAT.GE.THRESH)) THEN
IF (FIRST) THEN
FIRST = .FALSE.
WRITE(NOUT,99999)
END IF
WRITE (NOUT,98) "DNRM2", N, INCX, IV, IW, TRAT
END IF
END DO
END DO
99999 FORMAT (' FAIL')
99 FORMAT ( ' Not enough space to test ', A6, ': NMAX = ',I6,
+ ', INCX = ',I6,/,' N = ',I6,', must be at least ',I6 )
98 FORMAT( 1X, A6, ': N=', I6,', INCX=', I4, ', IV=', I2, ', IW=',
+ I2, ', test=', E15.8 )
RETURN
CONTAINS
DOUBLE PRECISION FUNCTION DXVALS(XX,K)
* .. Scalar Arguments ..
DOUBLE PRECISION XX
INTEGER K
* .. Local Scalars ..
DOUBLE PRECISION X, Y, YY, Z
* .. Intrinsic Functions ..
INTRINSIC HUGE
* .. Executable Statements ..
Y = HUGE(XX)
Z = YY
IF (K.EQ.1) THEN
X = -Z
ELSE IF (K.EQ.2) THEN
X = Z
ELSE IF (K.EQ.3) THEN
X = Z / Z
END IF
DXVALS = X
RETURN
END
END
+218 -2
View File
@@ -248,7 +248,8 @@
SUBROUTINE CHECK1(SFAC)
* .. Parameters ..
INTEGER NOUT
PARAMETER (NOUT=6)
REAL THRESH
PARAMETER (NOUT=6, THRESH=10.0E0)
* .. Scalar Arguments ..
REAL SFAC
* .. Scalars in Common ..
@@ -266,7 +267,7 @@
INTEGER ISAMAX
EXTERNAL SASUM, SNRM2, ISAMAX
* .. External Subroutines ..
EXTERNAL ITEST1, SSCAL, STEST, STEST1
EXTERNAL ITEST1, SB1NRM2, SSCAL, STEST, STEST1
* .. Intrinsic Functions ..
INTRINSIC MAX
* .. Common blocks ..
@@ -319,6 +320,10 @@
*
IF (ICASE.EQ.7) THEN
* .. SNRM2 ..
* Test scaling when some entries are tiny or huge
CALL SB1NRM2(N,(INCX-2)*2,THRESH)
CALL SB1NRM2(N,INCX,THRESH)
* Test with hardcoded mid range entries
STEMP(1) = DTRUE1(NP1)
CALL STEST1(SNRM2(N,SX,INCX),STEMP(1),STEMP,SFAC)
ELSE IF (ICASE.EQ.8) THEN
@@ -1080,3 +1085,214 @@
* End of ITEST1
*
END
SUBROUTINE SB1NRM2(N,INCX,THRESH)
* Compare NRM2 with a reference computation using combinations
* of the following values:
*
* 0, very small, small, ulp, 1, 1/ulp, big, very big, infinity, NaN
*
* one of these values is used to initialize x(1) and x(2:N) is
* filled with random values from [-1,1] scaled by another of
* these values.
*
* This routine is adapted from the test suite provided by
* Anderson E. (2017)
* Algorithm 978: Safe Scaling in the Level 1 BLAS
* ACM Trans Math Softw 44:1--28
* https://doi.org/10.1145/3061665
*
IMPLICIT NONE
* .. Scalar Arguments ..
INTEGER INCX, N
REAL THRESH
*
* =====================================================================
* .. Parameters ..
INTEGER NMAX, NOUT, NV
PARAMETER (NMAX=20, NOUT=6, NV=10)
REAL HALF, ONE, TWO, ZERO
PARAMETER (HALF=0.5E+0, ONE=1.0E+0, TWO= 2.0E+0,
& ZERO=0.0E+0)
* .. External Functions ..
REAL SNRM2
EXTERNAL SNRM2
* .. Intrinsic Functions ..
INTRINSIC ABS, MAX, MIN, REAL, SQRT
* .. Model parameters ..
REAL BIGNUM, SAFMAX, SAFMIN, SMLNUM, ULP
PARAMETER (BIGNUM=0.1014120480E+32,
& SAFMAX=0.8507059173E+38,
& SAFMIN=0.1175494351E-37,
& SMLNUM=0.9860761315E-31,
& ULP=0.1192092896E-06)
* .. Local Scalars ..
REAL ROGUE, SNRM, TRAT, V0, V1, WORKSSQ, Y1, Y2,
& YMAX, YMIN, YNRM, ZNRM
INTEGER I, IV, IW, IX
LOGICAL FIRST
* .. Local Arrays ..
REAL VALUES(NV), WORK(NMAX), X(NMAX), Z(NMAX)
* .. Executable Statements ..
VALUES(1) = ZERO
VALUES(2) = TWO*SAFMIN
VALUES(3) = SMLNUM
VALUES(4) = ULP
VALUES(5) = ONE
VALUES(6) = ONE / ULP
VALUES(7) = BIGNUM
VALUES(8) = SAFMAX
VALUES(9) = SXVALS(V0,2)
VALUES(10) = SXVALS(V0,3)
ROGUE = -1234.5678E+0
FIRST = .TRUE.
*
* Check that the arrays are large enough
*
IF (N*ABS(INCX).GT.NMAX) THEN
WRITE (NOUT,99) "SNRM2", NMAX, INCX, N, N*ABS(INCX)
RETURN
END IF
*
* Zero-sized inputs are tested in STEST1.
IF (N.LE.0) THEN
RETURN
END IF
*
* Generate (N-1) values in (-1,1).
*
DO I = 2, N
CALL RANDOM_NUMBER(WORK(I))
WORK(I) = ONE - TWO*WORK(I)
END DO
*
* Compute the sum of squares of the random values
* by an unscaled algorithm.
*
WORKSSQ = ZERO
DO I = 2, N
WORKSSQ = WORKSSQ + WORK(I)*WORK(I)
END DO
*
* Construct the test vector with one known value
* and the rest from the random work array multiplied
* by a scaling factor.
*
DO IV = 1, NV
V0 = VALUES(IV)
IF (ABS(V0).GT.ONE) THEN
V0 = V0*HALF
END IF
Z(1) = V0
DO IW = 1, NV
V1 = VALUES(IW)
IF (ABS(V1).GT.ONE) THEN
V1 = (V1*HALF) / SQRT(REAL(N))
END IF
DO I = 2, N
Z(I) = V1*WORK(I)
END DO
*
* Compute the expected value of the 2-norm
*
Y1 = ABS(V0)
IF (N.GT.1) THEN
Y2 = ABS(V1)*SQRT(WORKSSQ)
ELSE
Y2 = ZERO
END IF
YMIN = MIN(Y1, Y2)
YMAX = MAX(Y1, Y2)
*
* Expected value is NaN if either is NaN. The test
* for YMIN == YMAX avoids further computation if both
* are infinity.
*
IF ((Y1.NE.Y1).OR.(Y2.NE.Y2)) THEN
* add to propagate NaN
YNRM = Y1 + Y2
ELSE IF (YMIN == YMAX) THEN
YNRM = SQRT(TWO)*YMAX
ELSE IF (YMAX == ZERO) THEN
YNRM = ZERO
ELSE
YNRM = YMAX*SQRT(ONE + (YMIN / YMAX)**2)
END IF
*
* Fill the input array to SNRM2 with steps of incx
*
DO I = 1, N
X(I) = ROGUE
END DO
IX = 1
IF (INCX.LT.0) IX = 1 - (N-1)*INCX
DO I = 1, N
X(IX) = Z(I)
IX = IX + INCX
END DO
*
* Call SNRM2 to compute the 2-norm
*
SNRM = SNRM2(N,X,INCX)
*
* Compare SNRM and ZNRM. Roundoff error grows like O(n)
* in this implementation so we scale the test ratio accordingly.
*
IF (INCX.EQ.0) THEN
ZNRM = SQRT(REAL(N))*ABS(X(1))
ELSE
ZNRM = YNRM
END IF
*
* The tests for NaN rely on the compiler not being overly
* aggressive and removing the statements altogether.
IF ((SNRM.NE.SNRM).OR.(ZNRM.NE.ZNRM)) THEN
IF ((SNRM.NE.SNRM).NEQV.(ZNRM.NE.ZNRM)) THEN
TRAT = ONE / ULP
ELSE
TRAT = ZERO
END IF
ELSE IF (SNRM == ZNRM) THEN
TRAT = ZERO
ELSE IF (ZNRM == ZERO) THEN
TRAT = SNRM / ULP
ELSE
TRAT = (ABS(SNRM-ZNRM) / ZNRM) / (REAL(N)*ULP)
END IF
IF ((TRAT.NE.TRAT).OR.(TRAT.GE.THRESH)) THEN
IF (FIRST) THEN
FIRST = .FALSE.
WRITE(NOUT,99999)
END IF
WRITE (NOUT,98) "SNRM2", N, INCX, IV, IW, TRAT
END IF
END DO
END DO
99999 FORMAT (' FAIL')
99 FORMAT ( ' Not enough space to test ', A6, ': NMAX = ',I6,
+ ', INCX = ',I6,/,' N = ',I6,', must be at least ',I6 )
98 FORMAT( 1X, A6, ': N=', I6,', INCX=', I4, ', IV=', I2, ', IW=',
+ I2, ', test=', E15.8 )
RETURN
CONTAINS
REAL FUNCTION SXVALS(XX,K)
* .. Scalar Arguments ..
REAL XX
INTEGER K
* .. Local Scalars ..
REAL X, Y, YY, Z
* .. Intrinsic Functions ..
INTRINSIC HUGE
* .. Executable Statements ..
Y = HUGE(XX)
Z = YY
IF (K.EQ.1) THEN
X = -Z
ELSE IF (K.EQ.2) THEN
X = Z
ELSE IF (K.EQ.3) THEN
X = Z / Z
END IF
SXVALS = X
RETURN
END
END
+232 -2
View File
@@ -121,7 +121,8 @@
SUBROUTINE CHECK1(SFAC)
* .. Parameters ..
INTEGER NOUT
PARAMETER (NOUT=6)
DOUBLE PRECISION THRESH
PARAMETER (NOUT=6, THRESH=10.0D0)
* .. Scalar Arguments ..
DOUBLE PRECISION SFAC
* .. Scalars in Common ..
@@ -141,7 +142,7 @@
INTEGER IZAMAX
EXTERNAL DZASUM, DZNRM2, IZAMAX
* .. External Subroutines ..
EXTERNAL ZSCAL, ZDSCAL, CTEST, ITEST1, STEST1
EXTERNAL ZB1NRM2, ZSCAL, ZDSCAL, CTEST, ITEST1, STEST1
* .. Intrinsic Functions ..
INTRINSIC MAX
* .. Common blocks ..
@@ -256,6 +257,10 @@
20 CONTINUE
IF (ICASE.EQ.6) THEN
* .. DZNRM2 ..
* Test scaling when some entries are tiny or huge
CALL ZB1NRM2(N,(INCX-2)*2,THRESH)
CALL ZB1NRM2(N,INCX,THRESH)
* Test with hardcoded mid range entries
CALL STEST1(DZNRM2(N,CX,INCX),STRUE2(NP1),STRUE2(NP1),
+ SFAC)
ELSE IF (ICASE.EQ.7) THEN
@@ -782,3 +787,228 @@
* End of ITEST1
*
END
SUBROUTINE ZB1NRM2(N,INCX,THRESH)
* Compare NRM2 with a reference computation using combinations
* of the following values:
*
* 0, very small, small, ulp, 1, 1/ulp, big, very big, infinity, NaN
*
* one of these values is used to initialize x(1) and x(2:N) is
* filled with random values from [-1,1] scaled by another of
* these values.
*
* This routine is adapted from the test suite provided by
* Anderson E. (2017)
* Algorithm 978: Safe Scaling in the Level 1 BLAS
* ACM Trans Math Softw 44:1--28
* https://doi.org/10.1145/3061665
*
* .. Scalar Arguments ..
INTEGER INCX, N
DOUBLE PRECISION THRESH
*
* =====================================================================
* .. Parameters ..
INTEGER NMAX, NOUT, NV
PARAMETER (NMAX=20, NOUT=6, NV=10)
DOUBLE PRECISION HALF, ONE, THREE, TWO, ZERO
PARAMETER (HALF=0.5D+0, ONE=1.0D+0, TWO= 2.0D+0,
& THREE=3.0D+0, ZERO=0.0D+0)
* .. External Functions ..
DOUBLE PRECISION DZNRM2
EXTERNAL DZNRM2
* .. Intrinsic Functions ..
INTRINSIC AIMAG, ABS, DCMPLX, DBLE, MAX, MIN, SQRT
* .. Model parameters ..
DOUBLE PRECISION BIGNUM, SAFMAX, SAFMIN, SMLNUM, ULP
PARAMETER (BIGNUM=0.99792015476735990583D+292,
& SAFMAX=0.44942328371557897693D+308,
& SAFMIN=0.22250738585072013831D-307,
& SMLNUM=0.10020841800044863890D-291,
& ULP=0.22204460492503130808D-015)
* .. Local Scalars ..
COMPLEX*16 ROGUE
DOUBLE PRECISION SNRM, TRAT, V0, V1, WORKSSQ, Y1, Y2,
& YMAX, YMIN, YNRM, ZNRM
INTEGER I, IV, IW, IX, KS
LOGICAL FIRST
* .. Local Arrays ..
COMPLEX*16 X(NMAX), Z(NMAX)
DOUBLE PRECISION VALUES(NV), WORK(NMAX)
* .. Executable Statements ..
VALUES(1) = ZERO
VALUES(2) = TWO*SAFMIN
VALUES(3) = SMLNUM
VALUES(4) = ULP
VALUES(5) = ONE
VALUES(6) = ONE / ULP
VALUES(7) = BIGNUM
VALUES(8) = SAFMAX
VALUES(9) = DXVALS(V0,2)
VALUES(10) = DXVALS(V0,3)
ROGUE = DCMPLX(1234.5678D+0,-1234.5678D+0)
FIRST = .TRUE.
*
* Check that the arrays are large enough
*
IF (N*ABS(INCX).GT.NMAX) THEN
WRITE (NOUT,99) "DZNRM2", NMAX, INCX, N, N*ABS(INCX)
RETURN
END IF
*
* Zero-sized inputs are tested in STEST1.
IF (N.LE.0) THEN
RETURN
END IF
*
* Generate 2*(N-1) values in (-1,1).
*
KS = 2*(N-1)
DO I = 1, KS
CALL RANDOM_NUMBER(WORK(I))
WORK(I) = ONE - TWO*WORK(I)
END DO
*
* Compute the sum of squares of the random values
* by an unscaled algorithm.
*
WORKSSQ = ZERO
DO I = 1, KS
WORKSSQ = WORKSSQ + WORK(I)*WORK(I)
END DO
*
* Construct the test vector with one known value
* and the rest from the random work array multiplied
* by a scaling factor.
*
DO IV = 1, NV
V0 = VALUES(IV)
IF (ABS(V0).GT.ONE) THEN
V0 = V0*HALF*HALF
END IF
Z(1) = DCMPLX(V0,-THREE*V0)
DO IW = 1, NV
V1 = VALUES(IW)
IF (ABS(V1).GT.ONE) THEN
V1 = (V1*HALF) / SQRT(DBLE(KS+1))
END IF
DO I = 1, N-1
Z(I+1) = DCMPLX(V1*WORK(2*I-1),V1*WORK(2*I))
END DO
*
* Compute the expected value of the 2-norm
*
Y1 = ABS(V0) * SQRT(10.0D0)
IF (N.GT.1) THEN
Y2 = ABS(V1)*SQRT(WORKSSQ)
ELSE
Y2 = ZERO
END IF
YMIN = MIN(Y1, Y2)
YMAX = MAX(Y1, Y2)
*
* Expected value is NaN if either is NaN. The test
* for YMIN == YMAX avoids further computation if both
* are infinity.
*
IF ((Y1.NE.Y1).OR.(Y2.NE.Y2)) THEN
* add to propagate NaN
YNRM = Y1 + Y2
ELSE IF (YMIN == YMAX) THEN
YNRM = SQRT(TWO)*YMAX
ELSE IF (YMAX == ZERO) THEN
YNRM = ZERO
ELSE
YNRM = YMAX*SQRT(ONE + (YMIN / YMAX)**2)
END IF
*
* Fill the input array to DZNRM2 with steps of incx
*
DO I = 1, N
X(I) = ROGUE
END DO
IX = 1
IF (INCX.LT.0) IX = 1 - (N-1)*INCX
DO I = 1, N
X(IX) = Z(I)
IX = IX + INCX
END DO
*
* Call DZNRM2 to compute the 2-norm
*
SNRM = DZNRM2(N,X,INCX)
*
* Compare SNRM and ZNRM. Roundoff error grows like O(n)
* in this implementation so we scale the test ratio accordingly.
*
IF (INCX.EQ.0) THEN
Y1 = ABS(DBLE(X(1)))
Y2 = ABS(AIMAG(X(1)))
YMIN = MIN(Y1, Y2)
YMAX = MAX(Y1, Y2)
IF ((Y1.NE.Y1).OR.(Y2.NE.Y2)) THEN
* add to propagate NaN
ZNRM = Y1 + Y2
ELSE IF (YMIN == YMAX) THEN
ZNRM = SQRT(TWO)*YMAX
ELSE IF (YMAX == ZERO) THEN
ZNRM = ZERO
ELSE
ZNRM = YMAX * SQRT(ONE + (YMIN / YMAX)**2)
END IF
ZNRM = SQRT(DBLE(n)) * ZNRM
ELSE
ZNRM = YNRM
END IF
*
* The tests for NaN rely on the compiler not being overly
* aggressive and removing the statements altogether.
IF ((SNRM.NE.SNRM).OR.(ZNRM.NE.ZNRM)) THEN
IF ((SNRM.NE.SNRM).NEQV.(ZNRM.NE.ZNRM)) THEN
TRAT = ONE / ULP
ELSE
TRAT = ZERO
END IF
ELSE IF (ZNRM == ZERO) THEN
TRAT = SNRM / ULP
ELSE
TRAT = (ABS(SNRM-ZNRM) / ZNRM) / (TWO*DBLE(N)*ULP)
END IF
IF ((TRAT.NE.TRAT).OR.(TRAT.GE.THRESH)) THEN
IF (FIRST) THEN
FIRST = .FALSE.
WRITE(NOUT,99999)
END IF
WRITE (NOUT,98) "DZNRM2", N, INCX, IV, IW, TRAT
END IF
END DO
END DO
99999 FORMAT (' FAIL')
99 FORMAT ( ' Not enough space to test ', A6, ': NMAX = ',I6,
+ ', INCX = ',I6,/,' N = ',I6,', must be at least ',I6 )
98 FORMAT( 1X, A6, ': N=', I6,', INCX=', I4, ', IV=', I2, ', IW=',
+ I2, ', test=', E15.8 )
RETURN
CONTAINS
DOUBLE PRECISION FUNCTION DXVALS(XX,K)
* .. Scalar Arguments ..
DOUBLE PRECISION XX
INTEGER K
* .. Local Scalars ..
DOUBLE PRECISION X, Y, YY, Z
* .. Intrinsic Functions ..
INTRINSIC HUGE
* .. Executable Statements ..
Y = HUGE(XX)
Z = YY
IF (K.EQ.1) THEN
X = -Z
ELSE IF (K.EQ.2) THEN
X = Z
ELSE IF (K.EQ.3) THEN
X = Z / Z
END IF
DXVALS = X
RETURN
END
END
+17 -8
View File
@@ -1,15 +1,24 @@
message(STATUS "CBLAS enable")
message(STATUS "CBLAS enabled")
enable_language(C)
set(LAPACK_INSTALL_EXPORT_NAME ${CBLASLIB}-targets)
# Create a header file cblas.h for the routines called in my C programs
include(FortranCInterface)
## Ensure that the fortran compiler and c compiler specified are compatible
FortranCInterface_VERIFY()
FortranCInterface_HEADER(${LAPACK_BINARY_DIR}/include/cblas_mangling.h
MACRO_NAMESPACE "F77_"
SYMBOL_NAMESPACE "F77_")
include(CheckLanguage)
check_language(Fortran)
if(CMAKE_Fortran_COMPILER)
enable_language(Fortran)
include(FortranCInterface)
## Ensure that the fortran compiler and c compiler specified are compatible
FortranCInterface_VERIFY()
FortranCInterface_HEADER(${LAPACK_BINARY_DIR}/include/cblas_mangling.h
MACRO_NAMESPACE "F77_"
SYMBOL_NAMESPACE "F77_")
# Check for any necessary platform specific compiler flags
include(CheckLAPACKCompilerFlags)
CheckLAPACKCompilerFlags()
endif()
if(NOT FortranCInterface_GLOBAL_FOUND OR NOT FortranCInterface_MODULE_FOUND)
message(WARNING "Reverting to pre-defined include/cblas_mangling.h")
configure_file(include/cblas_mangling_with_flags.h.in
@@ -17,7 +26,7 @@ if(NOT FortranCInterface_GLOBAL_FOUND OR NOT FortranCInterface_MODULE_FOUND)
endif()
include(CheckCSourceCompiles)
check_c_source_compiles("void __attribute__((weak)) main() {};"
check_c_source_compiles("int __attribute__((weak)) main() {};"
HAS_ATTRIBUTE_WEAK_SUPPORT)
include_directories(include ${LAPACK_BINARY_DIR}/include)
+2 -6
View File
@@ -1,11 +1,8 @@
# Compute locations from <prefix>/@{LIBRARY_DIR@/cmake/lapacke-<v>/<self>.cmake
get_filename_component(_CBLAS_SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component(_CBLAS_PREFIX "${_CBLAS_SELF_DIR}" PATH)
get_filename_component(_CBLAS_PREFIX "${_CBLAS_PREFIX}" PATH)
get_filename_component(_CBLAS_PREFIX "${_CBLAS_PREFIX}" PATH)
# Load the LAPACK package with which we were built.
set(LAPACK_DIR "${_CBLAS_PREFIX}/@CMAKE_INSTALL_LIBDIR@/cmake/@LAPACKLIB@-@LAPACK_VERSION@")
set(LAPACK_DIR "@CMAKE_INSTALL_FULL_LIBDIR@/cmake/@LAPACKLIB@-@LAPACK_VERSION@")
find_package(LAPACK NO_MODULE)
# Load lapacke targets from the install tree.
@@ -14,10 +11,9 @@ if(NOT TARGET @CBLASLIB@)
endif()
# Report lapacke header search locations.
set(CBLAS_INCLUDE_DIRS ${_CBLAS_PREFIX}/include)
set(CBLAS_INCLUDE_DIRS @CMAKE_INSTALL_FULL_INCLUDEDIR@)
# Report lapacke libraries.
set(CBLAS_LIBRARIES @CBLASLIB@)
unset(_CBLAS_PREFIX)
unset(_CBLAS_SELF_DIR)
+9 -5
View File
@@ -119,6 +119,9 @@ list(REMOVE_DUPLICATES SOURCES)
add_library(${CBLASLIB}_obj OBJECT ${SOURCES})
set_target_properties(${CBLASLIB}_obj PROPERTIES POSITION_INDEPENDENT_CODE ON)
if(HAS_ATTRIBUTE_WEAK_SUPPORT)
target_compile_definitions(${CBLASLIB}_obj PRIVATE HAS_ATTRIBUTE_WEAK_SUPPORT)
endif()
if(BUILD_INDEX64_EXT_API)
# 64bit Integer Interface
@@ -139,9 +142,13 @@ if(BUILD_INDEX64_EXT_API)
add_library(${CBLASLIB}_64_fobj OBJECT ${SOURCES_64_F})
set_target_properties(${CBLASLIB}_64_cobj ${CBLASLIB}_64_fobj PROPERTIES
POSITION_INDEPENDENT_CODE ON
Fortran_PREPROCESS ON)
Fortran_PREPROCESS ON
LINKER_LANGUAGE C)
target_compile_options(${CBLASLIB}_64_cobj PRIVATE -DWeirdNEC -DCBLAS_API64)
target_compile_options(${CBLASLIB}_64_fobj PRIVATE ${FOPT_ILP64})
if(HAS_ATTRIBUTE_WEAK_SUPPORT)
target_compile_definitions(${CBLASLIB}_64_cobj PRIVATE HAS_ATTRIBUTE_WEAK_SUPPORT)
endif()
#Add suffix to all Fortran functions via macros
foreach(F IN LISTS SOURCES_64_F)
set(COPT_64_F)
@@ -168,11 +175,8 @@ set_target_properties(
SOVERSION ${LAPACK_MAJOR_VERSION}
POSITION_INDEPENDENT_CODE ON
)
if(HAS_ATTRIBUTE_WEAK_SUPPORT)
target_compile_definitions(${CBLASLIB} PRIVATE HAS_ATTRIBUTE_WEAK_SUPPORT)
endif()
target_include_directories(${CBLASLIB} PUBLIC
$<BUILD_INTERFACE:${LAPACK_BINARY_DIR}/include>
$<INSTALL_INTERFACE:include>
)
target_link_libraries(${CBLASLIB} PUBLIC ${BLAS_LIBRARIES})
+82 -1
View File
@@ -20,7 +20,7 @@ if( CMAKE_Fortran_COMPILER_ID MATCHES "Intel" )
if ( WIN32 )
set(FOPT_ILP64 /integer-size:64)
else ()
set(FOPT_ILP64 -integer-size 64)
set(FOPT_ILP64 "-integer-size 64")
endif()
elseif( (CMAKE_Fortran_COMPILER_ID STREQUAL "VisualAge" ) OR # CMake 2.6
(CMAKE_Fortran_COMPILER_ID STREQUAL "XL" ) ) # CMake 2.8
@@ -56,6 +56,10 @@ if( CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" )
if( "${CMAKE_Fortran_FLAGS}" MATCHES "-ffpe-trap=[izoupd]")
set( FPE_EXIT TRUE )
endif()
if( NOT ("${CMAKE_Fortran_FLAGS}" MATCHES "-frecursive") )
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -frecursive"
CACHE STRING "Recursive flag must be set" FORCE)
endif()
# Intel Fortran
elseif( CMAKE_Fortran_COMPILER_ID MATCHES "Intel" )
@@ -63,6 +67,15 @@ elseif( CMAKE_Fortran_COMPILER_ID MATCHES "Intel" )
set( FPE_EXIT TRUE )
endif()
if( NOT ("${CMAKE_Fortran_FLAGS}" MATCHES "-recursive") )
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -recursive"
CACHE STRING "Recursive flag must be set" FORCE)
endif()
if( UNIX AND NOT ("${CMAKE_Fortran_FLAGS}" MATCHES "-fp-model[ \t]strict") )
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fp-model strict")
endif()
# SunPro F95
elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "SunPro" )
if( ("${CMAKE_Fortran_FLAGS}" MATCHES "-ftrap=") AND
@@ -74,6 +87,12 @@ elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "SunPro" )
CACHE STRING "Flags for Fortran compiler." FORCE )
endif()
if(UNIX)
# Delete libmtsk in linking sequence for Sun/Oracle Fortran Compiler.
# This library is not present in the Sun package SolarisStudio12.3-linux-x86-bin
string(REPLACE \;mtsk\; \; CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES "${CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES}")
endif()
# IBM XL Fortran
elseif( (CMAKE_Fortran_COMPILER_ID STREQUAL "VisualAge" ) OR # CMake 2.6
(CMAKE_Fortran_COMPILER_ID STREQUAL "XL" ) ) # CMake 2.8
@@ -81,6 +100,20 @@ elseif( (CMAKE_Fortran_COMPILER_ID STREQUAL "VisualAge" ) OR # CMake 2.6
set( FPE_EXIT TRUE )
endif()
if( NOT ("${CMAKE_Fortran_FLAGS}" MATCHES "-qrecur") )
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -qrecur"
CACHE STRING "Recursive flag must be set" FORCE)
endif()
if( UNIX AND NOT ("${CMAKE_Fortran_FLAGS}" MATCHES "-qnosave") )
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -qnosave")
endif()
if( UNIX AND NOT ("${CMAKE_Fortran_FLAGS}" MATCHES "-qstrict") )
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -qstrict")
endif()
# HP Fortran
elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "HP" )
if( "${CMAKE_Fortran_FLAGS}" MATCHES "\\+fp_exception" )
@@ -138,7 +171,13 @@ elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "NAG" )
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -w=unused")
endif()
if( NOT ("${CMAKE_Fortran_FLAGS}" MATCHES "-recursive") )
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -recursive"
CACHE STRING "Recursive flag must be set" FORCE)
endif()
# Suppress compiler banner and summary
include(CheckFortranCompilerFlag)
check_fortran_compiler_flag("-quiet" _quiet)
if( _quiet AND NOT ("${CMAKE_Fortran_FLAGS}" MATCHES "[-/]quiet") )
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -quiet")
@@ -155,7 +194,49 @@ elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC" )
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Kieee")
endif()
if( NOT ("${CMAKE_Fortran_FLAGS}" MATCHES "-Mrecursive") )
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mrecursive"
CACHE STRING "Recursive flag must be set" FORCE)
endif()
# Flang Fortran
elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "Flang" )
if( NOT ("${CMAKE_Fortran_FLAGS}" MATCHES "-Mrecursive") )
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mrecursive"
CACHE STRING "Recursive flag must be set" FORCE)
endif()
# Compaq Fortran
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "Compaq")
if(WIN32)
if(CMAKE_GENERATOR STREQUAL "NMake Makefiles")
get_filename_component(CMAKE_Fortran_COMPILER_CMDNAM ${CMAKE_Fortran_COMPILER} NAME_WE)
message(STATUS "Using Compaq Fortran compiler with command name ${CMAKE_Fortran_COMPILER_CMDNAM}")
set(cmd ${CMAKE_Fortran_COMPILER_CMDNAM})
string(TOLOWER "${cmd}" cmdlc)
if(cmdlc STREQUAL "df")
message(STATUS "Assume the Compaq Visual Fortran Compiler is being used")
set(CMAKE_Fortran_USE_RESPONSE_FILE_FOR_OBJECTS 1)
set(CMAKE_Fortran_USE_RESPONSE_FILE_FOR_INCLUDES 1)
#This is a workaround that is needed to avoid forward-slashes in the
#filenames listed in response files from incorrectly being interpreted as
#introducing compiler command options
if(${BUILD_SHARED_LIBS})
message(FATAL_ERROR "Making of shared libraries with CVF has not been tested.")
endif()
set(str "NMake version 9 or later should be used. NMake version 6.0 which is\n")
set(str "${str} included with the CVF distribution fails to build Lapack because\n")
set(str "${str} the number of source files exceeds the limit for NMake v6.0\n")
message(STATUS ${str})
set(CMAKE_Fortran_LINK_EXECUTABLE "LINK /out:<TARGET> <LINK_FLAGS> <LINK_LIBRARIES> <OBJECTS>")
endif()
endif()
endif()
else()
message(WARNING "Fortran local arrays should be allocated on the stack."
" Please use a compiler which guarantees that feature."
" See https://github.com/Reference-LAPACK/lapack/pull/188 and references therein.")
endif()
if( "${CMAKE_Fortran_FLAGS_RELEASE}" MATCHES "O[3-9]" )
+88 -142
View File
@@ -1,9 +1,9 @@
cmake_minimum_required(VERSION 3.6)
cmake_minimum_required(VERSION 3.9)
project(LAPACK Fortran C)
project(LAPACK)
set(LAPACK_MAJOR_VERSION 3)
set(LAPACK_MINOR_VERSION 11)
set(LAPACK_MINOR_VERSION 12)
set(LAPACK_PATCH_VERSION 0)
set(
LAPACK_VERSION
@@ -45,6 +45,14 @@ if(_is_coverage_build)
find_package(codecov)
endif()
# Use valgrind if it is found
option( LAPACK_TESTING_USE_PYTHON "Use Python for testing. Disable it on memory checks." ON )
find_program( MEMORYCHECK_COMMAND valgrind )
if( MEMORYCHECK_COMMAND )
message( STATUS "Found valgrind: ${MEMORYCHECK_COMMAND}" )
set( MEMORYCHECK_COMMAND_OPTIONS "--leak-check=full --show-leak-kinds=all --track-origins=yes" )
endif()
# By default test Fortran compiler complex abs and complex division
option(TEST_FORTRAN_COMPILER "Test Fortran compiler complex abs and complex division" OFF)
if( TEST_FORTRAN_COMPILER )
@@ -99,8 +107,10 @@ else()
set(LAPACKELIB "lapacke")
set(TMGLIB "tmglib")
endif()
# By default build standard API and extended _64 API
# By default build extended _64 API for supported compilers only
set(INDEX64_EXT_API_COMPILERS "Intel|GNU")
option(BUILD_INDEX64_EXT_API "Build Index-64 API as extended API with _64 suffix" ON)
message(STATUS "Build Index-64 API as extended API with _64 suffix: ${BUILD_INDEX64_EXT_API}")
include(GNUInstallDirs)
@@ -129,92 +139,6 @@ configure_file(
include(PreventInSourceBuilds)
include(PreventInBuildInstalls)
# Check if recursive flag exists
include(CheckFortranCompilerFlag)
if(CMAKE_Fortran_COMPILER_ID STREQUAL Flang)
check_fortran_compiler_flag("-Mrecursive" _MrecursiveFlag)
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL GNU)
check_fortran_compiler_flag("-frecursive" _frecursiveFlag)
elseif(CMAKE_Fortran_COMPILER_ID MATCHES Intel)
check_fortran_compiler_flag("-recursive" _recursiveFlag)
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL XL)
check_fortran_compiler_flag("-qrecur" _qrecurFlag)
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL NAG)
check_fortran_compiler_flag("-recursive" _recursiveFlag)
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL NVHPC)
check_fortran_compiler_flag("-Mrecursive" _MrecursiveFlag)
else()
message(WARNING "Fortran local arrays should be allocated on the stack."
" Please use a compiler which guarantees that feature."
" See https://github.com/Reference-LAPACK/lapack/pull/188 and references therein.")
endif()
# Add recursive flag
if(_MrecursiveFlag)
string(REGEX MATCH "-Mrecursive" output_test <string> "${CMAKE_Fortran_FLAGS}")
if(NOT output_test)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mrecursive"
CACHE STRING "Recursive flag must be set" FORCE)
endif()
elseif(_frecursiveFlag)
string(REGEX MATCH "-frecursive" output_test <string> "${CMAKE_Fortran_FLAGS}")
if(NOT output_test)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -frecursive"
CACHE STRING "Recursive flag must be set" FORCE)
endif()
elseif(_recursiveFlag)
string(REGEX MATCH "-recursive" output_test <string> "${CMAKE_Fortran_FLAGS}")
if(NOT output_test)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -recursive"
CACHE STRING "Recursive flag must be set" FORCE)
endif()
elseif(_qrecurFlag)
string(REGEX MATCH "-qrecur" output_test <string> "${CMAKE_Fortran_FLAGS}")
if(NOT output_test)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -qrecur"
CACHE STRING "Recursive flag must be set" FORCE)
endif()
endif()
if(UNIX)
if(CMAKE_Fortran_COMPILER_ID MATCHES Intel)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fp-model strict")
endif()
if(CMAKE_Fortran_COMPILER_ID STREQUAL XL)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -qnosave -qstrict")
endif()
# Delete libmtsk in linking sequence for Sun/Oracle Fortran Compiler.
# This library is not present in the Sun package SolarisStudio12.3-linux-x86-bin
string(REPLACE \;mtsk\; \; CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES "${CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES}")
endif()
if(CMAKE_Fortran_COMPILER_ID STREQUAL Compaq)
if(WIN32)
if(CMAKE_GENERATOR STREQUAL "NMake Makefiles")
get_filename_component(CMAKE_Fortran_COMPILER_CMDNAM ${CMAKE_Fortran_COMPILER} NAME_WE)
message(STATUS "Using Compaq Fortran compiler with command name ${CMAKE_Fortran_COMPILER_CMDNAM}")
set(cmd ${CMAKE_Fortran_COMPILER_CMDNAM})
string(TOLOWER "${cmd}" cmdlc)
if(cmdlc STREQUAL "df")
message(STATUS "Assume the Compaq Visual Fortran Compiler is being used")
set(CMAKE_Fortran_USE_RESPONSE_FILE_FOR_OBJECTS 1)
set(CMAKE_Fortran_USE_RESPONSE_FILE_FOR_INCLUDES 1)
#This is a workaround that is needed to avoid forward-slashes in the
#filenames listed in response files from incorrectly being interpreted as
#introducing compiler command options
if(${BUILD_SHARED_LIBS})
message(FATAL_ERROR "Making of shared libraries with CVF has not been tested.")
endif()
set(str "NMake version 9 or later should be used. NMake version 6.0 which is\n")
set(str "${str} included with the CVF distribution fails to build Lapack because\n")
set(str "${str} the number of source files exceeds the limit for NMake v6.0\n")
message(STATUS ${str})
set(CMAKE_Fortran_LINK_EXECUTABLE "LINK /out:<TARGET> <LINK_FLAGS> <LINK_LIBRARIES> <OBJECTS>")
endif()
endif()
endif()
endif()
# Add option to enable flat namespace for symbol resolution on macOS
if(APPLE)
option(USE_FLAT_NAMESPACE "Use flat namespaces for symbol resolution during build and runtime." OFF)
@@ -272,26 +196,6 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LAPACK_BINARY_DIR}/bin)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LAPACK_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LAPACK_BINARY_DIR}/lib)
# --------------------------------------------------
# Check for any necessary platform specific compiler flags
include(CheckLAPACKCompilerFlags)
CheckLAPACKCompilerFlags()
# --------------------------------------------------
# Check second function
include(CheckTimeFunction)
set(TIME_FUNC NONE)
CHECK_TIME_FUNCTION(NONE TIME_FUNC)
CHECK_TIME_FUNCTION(INT_CPU_TIME TIME_FUNC)
CHECK_TIME_FUNCTION(EXT_ETIME TIME_FUNC)
CHECK_TIME_FUNCTION(EXT_ETIME_ TIME_FUNC)
CHECK_TIME_FUNCTION(INT_ETIME TIME_FUNC)
message(STATUS "--> Will use second_${TIME_FUNC}.f and dsecnd_${TIME_FUNC}.f as timing function.")
set(SECOND_SRC ${LAPACK_SOURCE_DIR}/INSTALL/second_${TIME_FUNC}.f)
set(DSECOND_SRC ${LAPACK_SOURCE_DIR}/INSTALL/dsecnd_${TIME_FUNC}.f)
# deprecated LAPACK and LAPACKE routines
option(BUILD_DEPRECATED "Build deprecated routines" OFF)
message(STATUS "Build deprecated routines: ${BUILD_DEPRECATED}")
@@ -321,6 +225,7 @@ option(USE_OPTIMIZED_BLAS "Whether or not to use an optimized BLAS library inste
# Check the usage of the user provided BLAS libraries
if(BLAS_LIBRARIES)
enable_language(Fortran)
include(CheckFortranFunctionExists)
set(CMAKE_REQUIRED_LIBRARIES ${BLAS_LIBRARIES})
CHECK_FORTRAN_FUNCTION_EXISTS("dgemm" BLAS_FOUND)
@@ -384,18 +289,27 @@ endif()
# Check the usage of the user provided or automatically found LAPACK libraries
if(LAPACK_LIBRARIES)
include(CheckFortranFunctionExists)
set(CMAKE_REQUIRED_LIBRARIES ${LAPACK_LIBRARIES})
# Check if new routine of 3.4.0 is in LAPACK_LIBRARIES
CHECK_FORTRAN_FUNCTION_EXISTS("dgeqrt" LATESTLAPACK_FOUND)
unset(CMAKE_REQUIRED_LIBRARIES)
if(LATESTLAPACK_FOUND)
message(STATUS "--> LAPACK supplied by user is WORKING, will use ${LAPACK_LIBRARIES}.")
include(CheckLanguage)
check_language(Fortran)
if(CMAKE_Fortran_COMPILER)
enable_language(Fortran)
include(CheckFortranFunctionExists)
set(CMAKE_REQUIRED_LIBRARIES ${LAPACK_LIBRARIES})
# Check if new routine of 3.4.0 is in LAPACK_LIBRARIES
CHECK_FORTRAN_FUNCTION_EXISTS("dgeqrt" LATESTLAPACK_FOUND)
unset(CMAKE_REQUIRED_LIBRARIES)
if(LATESTLAPACK_FOUND)
message(STATUS "--> LAPACK supplied by user is WORKING, will use ${LAPACK_LIBRARIES}.")
else()
message(ERROR "--> LAPACK supplied by user is not WORKING or is older than LAPACK 3.4.0, CANNOT USE ${LAPACK_LIBRARIES}.")
message(ERROR "--> Will use REFERENCE LAPACK (by default)")
message(ERROR "--> Or Correct your LAPACK_LIBRARIES entry ")
message(ERROR "--> Or Consider checking USE_OPTIMIZED_LAPACK")
endif()
else()
message(ERROR "--> LAPACK supplied by user is not WORKING or is older than LAPACK 3.4.0, CANNOT USE ${LAPACK_LIBRARIES}.")
message(ERROR "--> Will use REFERENCE LAPACK (by default)")
message(ERROR "--> Or Correct your LAPACK_LIBRARIES entry ")
message(ERROR "--> Or Consider checking USE_OPTIMIZED_LAPACK")
message(STATUS "--> LAPACK supplied by user is ${LAPACK_LIBRARIES}.")
message(STATUS "--> CMake couldn't find a Fortran compiler, so it cannot check if the provided LAPACK library works.")
set(LATESTLAPACK_FOUND TRUE)
endif()
endif()
@@ -403,6 +317,27 @@ endif()
if(NOT LATESTLAPACK_FOUND)
message(STATUS "Using supplied NETLIB LAPACK implementation")
set(LAPACK_LIBRARIES ${LAPACKLIB})
enable_language(Fortran)
# Check for any necessary platform specific compiler flags
include(CheckLAPACKCompilerFlags)
CheckLAPACKCompilerFlags()
# Check second function
include(CheckTimeFunction)
set(TIME_FUNC NONE)
CHECK_TIME_FUNCTION(NONE TIME_FUNC)
CHECK_TIME_FUNCTION(INT_CPU_TIME TIME_FUNC)
CHECK_TIME_FUNCTION(EXT_ETIME TIME_FUNC)
CHECK_TIME_FUNCTION(EXT_ETIME_ TIME_FUNC)
CHECK_TIME_FUNCTION(INT_ETIME TIME_FUNC)
# Set second function
message(STATUS "--> Will use second_${TIME_FUNC}.f and dsecnd_${TIME_FUNC}.f as timing function.")
set(SECOND_SRC ${LAPACK_SOURCE_DIR}/INSTALL/second_${TIME_FUNC}.f)
set(DSECOND_SRC ${LAPACK_SOURCE_DIR}/INSTALL/dsecnd_${TIME_FUNC}.f)
add_subdirectory(SRC)
else()
set(CMAKE_EXE_LINKER_FLAGS
@@ -435,9 +370,11 @@ endif()
# Cache export target
set(LAPACK_INSTALL_EXPORT_NAME_CACHE ${LAPACK_INSTALL_EXPORT_NAME})
if(BUILD_TESTING OR LAPACKE_WITH_TMG)
enable_language(Fortran)
if(LATESTLAPACK_FOUND AND LAPACKE_WITH_TMG)
set(CMAKE_REQUIRED_LIBRARIES ${LAPACK_LIBRARIES})
# Check if dlatms (part of tmg) is found
include(CheckFortranFunctionExists)
CHECK_FORTRAN_FUNCTION_EXISTS("dlatms" LAPACK_WITH_TMGLIB_FOUND)
unset(CMAKE_REQUIRED_LIBRARIES)
if(NOT LAPACK_WITH_TMGLIB_FOUND)
@@ -452,6 +389,12 @@ endif()
set(LAPACK_INSTALL_EXPORT_NAME ${LAPACK_INSTALL_EXPORT_NAME_CACHE})
unset(LAPACK_INSTALL_EXPORT_NAME_CACHE)
#-------------------------------------
# LAPACKE
# Include lapack.h and lapacke_mangling.h even if LAPACKE is not built
add_subdirectory(LAPACKE/include)
if(LAPACKE)
add_subdirectory(LAPACKE)
endif()
@@ -674,24 +617,21 @@ if(BUILD_HTML_DOCUMENTATION OR BUILD_MAN_DOCUMENTATION)
set(DOXYGEN_PROJECT_BRIEF "LAPACK: Linear Algebra PACKage")
set(DOXYGEN_PROJECT_NUMBER ${LAPACK_VERSION})
set(DOXYGEN_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/DOCS)
set(DOXYGEN_PROJECT_LOGO ${CMAKE_CURRENT_SOURCE_DIR}/DOCS/lapack.png)
set(DOXYGEN_OUTPUT_DIRECTORY DOCS)
set(DOXYGEN_PROJECT_LOGO DOCS/lapack.png)
set(DOXYGEN_OPTIMIZE_FOR_FORTRAN YES)
set(DOXYGEN_SOURCE_BROWSER YES)
set(DOXYGEN_CREATE_SUBDIRS YES)
set(DOXYGEN_SEPARATE_MEMBER_PAGES YES)
set(DOXYGEN_TAB_SIZE 8)
set(DOXYGEN_EXTRACT_ALL YES)
set(DOXYGEN_FILE_PATTERNS *.f *.f90 *.c *.h )
set(DOXYGEN_RECURSIVE YES)
set(DOXYGEN_GENERATE_TREEVIEW YES)
set(DOXYGEN_DOT_IMAGE_FORMAT svg)
set(DOXYGEN_INTERACTIVE_SVG YES)
set(DOXYGEN_QUIET NO)
set(DOXYGEN_WARNINGS YES)
set(DOXYGEN_WARN_NO_PARAMDOC YES)
set(DOXYGEN_WARN_LOGFILE doxygen_error)
set(DOXYGEN_GENERATE_HTML NO)
set(DOXYGEN_GENERATE_MAN NO)
set(DOXYGEN_LAYOUT_FILE "DOCS/DoxygenLayout.xml")
# Exclude functions that are duplicated, creating conflicts.
@@ -706,46 +646,52 @@ if(BUILD_HTML_DOCUMENTATION OR BUILD_MAN_DOCUMENTATION)
if (BUILD_HTML_DOCUMENTATION)
set(DOXYGEN_GENERATE_HTML YES)
set(DOXYGEN_HTML_OUTPUT explore-html)
set(DOXYGEN_GENERATE_MAN NO)
set(DOXYGEN_INLINE_SOURCES YES)
set(DOXYGEN_CALL_GRAPH YES)
set(DOXYGEN_CALLER_GRAPH YES)
set(DOXYGEN_HTML_OUTPUT explore-html)
set(DOXYGEN_HTML_TIMESTAMP YES)
doxygen_add_docs(
html
# Doxygen INPUT =
${PROJECT_SOURCE_DIR}/README.md
${PROJECT_SOURCE_DIR}/BLAS
${PROJECT_SOURCE_DIR}/CBLAS
${PROJECT_SOURCE_DIR}/SRC
${PROJECT_SOURCE_DIR}/INSTALL
${PROJECT_SOURCE_DIR}/TESTING
${PROJECT_SOURCE_DIR}/DOCS/groups-usr.dox
BLAS
CBLAS
SRC
INSTALL
TESTING
DOCS/groups-usr.dox
README.md
COMMENT "Generating html LAPACK documentation (it will take some time... time to grab a coffee)"
)
unset(DOXYGEN_HTML_OUTPUT)
unset(DOXYGEN_HTML_TIMESTAMP)
endif()
if (BUILD_MAN_DOCUMENTATION)
set(DOXYGEN_GENERATE_HTML NO)
set(DOXYGEN_GENERATE_MAN YES)
set(DOXYGEN_MAN_LINKS YES)
set(DOXYGEN_INLINE_SOURCES NO)
set(DOXYGEN_CALL_GRAPH NO)
set(DOXYGEN_CALLER_GRAPH NO)
set(DOXYGEN_MAN_LINKS YES)
doxygen_add_docs(
man
# Doxygen INPUT =
${PROJECT_SOURCE_DIR}/BLAS
${PROJECT_SOURCE_DIR}/CBLAS
${PROJECT_SOURCE_DIR}/SRC
${PROJECT_SOURCE_DIR}/INSTALL
${PROJECT_SOURCE_DIR}/TESTING
${PROJECT_SOURCE_DIR}/DOCS/groups-usr.dox
BLAS
CBLAS
SRC
INSTALL
TESTING
DOCS/groups-usr.dox
COMMENT "Generating man LAPACK documentation"
)
unset(DOXYGEN_MAN_LINKS)
endif()
endif()
+2 -1
View File
@@ -48,7 +48,8 @@ set(CTEST_CUSTOM_WARNING_EXCEPTION
# Only run post test if suitable python interpreter was found
set(PYTHON_EXECUTABLE @PYTHON_EXECUTABLE@)
if(PYTHON_EXECUTABLE)
set(LAPACK_TESTING_USE_PYTHON @LAPACK_TESTING_USE_PYTHON@)
if(PYTHON_EXECUTABLE AND LAPACK_TESTING_USE_PYTHON)
set(CTEST_CUSTOM_POST_TEST "${PYTHON_EXECUTABLE} ./lapack_testing.py -s -d TESTING")
endif()
+20 -14
View File
@@ -38,7 +38,7 @@ PROJECT_NAME = LAPACK
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = 3.11.0
PROJECT_NUMBER = 3.12.0
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
@@ -126,7 +126,17 @@ REPEAT_BRIEF = YES
# the entity):The $name class, The $name widget, The $name file, is, provides,
# specifies, contains, represents, a, an and the.
ABBREVIATE_BRIEF =
ABBREVIATE_BRIEF = "The $name class" \
"The $name widget" \
"The $name file" \
is \
provides \
specifies \
contains \
represents \
a \
an \
the
# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
# doxygen will generate a detailed section even if there is only a brief
@@ -885,9 +895,9 @@ INPUT_ENCODING = UTF-8
# *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd, *.vhdl,
# *.ucf, *.qsf and *.ice.
FILE_PATTERNS = *.c \
*.f \
FILE_PATTERNS = *.f \
*.f90 \
*.c \
*.h
# The RECURSIVE tag can be used to specify whether or not subdirectories should
@@ -927,11 +937,7 @@ EXCLUDE_SYMLINKS = NO
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories for example use the pattern */test/*
EXCLUDE_PATTERNS = *.py \
*.txt \
*.in \
*.inc \
Makefile
EXCLUDE_PATTERNS =
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
@@ -955,7 +961,7 @@ EXAMPLE_PATH =
# *.h) to filter out the source-files in the directories. If left blank all
# files are included.
EXAMPLE_PATTERNS =
EXAMPLE_PATTERNS = *
# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
# searched for input files to be used with the \include or \dontinclude commands
@@ -1602,7 +1608,7 @@ MATHJAX_FORMAT = HTML-CSS
# The default value is: https://cdn.jsdelivr.net/npm/mathjax@2.
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_RELPATH = http://www.mathjax.org/mathjax
MATHJAX_RELPATH = https://cdn.jsdelivr.net/npm/mathjax@2
# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
# extension names that should be enabled during MathJax rendering. For example
@@ -1735,7 +1741,7 @@ LATEX_OUTPUT = latex
# the output language.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_CMD_NAME = latex
LATEX_CMD_NAME =
# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
# index for LaTeX.
@@ -1938,7 +1944,7 @@ COMPACT_RTF = NO
# The default value is: NO.
# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_HYPERLINKS = YES
RTF_HYPERLINKS = NO
# Load stylesheet definitions from file. Syntax is similar to doxygen's
# configuration file, i.e. a series of assignments. You only have to provide
@@ -2009,7 +2015,7 @@ MAN_SUBDIR =
# The default value is: NO.
# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_LINKS = YES
MAN_LINKS = NO
#---------------------------------------------------------------------------
# Configuration options related to the XML output
+2
View File
@@ -476,6 +476,8 @@
@defgroup ggesx ggesx: Schur form, expert
@}
@defgroup gedmd DMD driver, Dynamic Mode Decomposition
@defgroup geev_comp_grp Eig computational routines
@{
@defgroup gebal gebal: balance matrix
+2 -1
View File
@@ -76,7 +76,8 @@
*
IF( INT( DROUNDUP_LWORK ) .LT. LWORK ) THEN
* Force round up of LWORK
DROUNDUP_LWORK = DROUNDUP_LWORK * ( 1.0D+0 + EPSILON(0.0D+0) )
DROUNDUP_LWORK = DROUNDUP_LWORK *
$ ( 1.0D+0 + EPSILON(0.0D+0) )
ENDIF
*
RETURN
+1 -1
View File
@@ -58,7 +58,7 @@
INTEGER VERS_MAJOR, VERS_MINOR, VERS_PATCH
* =====================================================================
VERS_MAJOR = 3
VERS_MINOR = 11
VERS_MINOR = 12
VERS_PATCH = 0
* =====================================================================
*
+2 -1
View File
@@ -76,7 +76,8 @@
*
IF( INT( SROUNDUP_LWORK ) .LT. LWORK ) THEN
* Force round up of LWORK
SROUNDUP_LWORK = SROUNDUP_LWORK * ( 1.0E+0 + EPSILON(0.0E+0) )
SROUNDUP_LWORK = SROUNDUP_LWORK *
$ ( 1.0E+0 + EPSILON(0.0E+0) )
ENDIF
*
RETURN
+24 -22
View File
@@ -1,24 +1,3 @@
# Create a header file lapacke_mangling.h for the routines called in my C programs
include(FortranCInterface)
## Ensure that the fortran compiler and c compiler specified are compatible
FortranCInterface_VERIFY()
FortranCInterface_HEADER(${LAPACK_BINARY_DIR}/include/lapacke_mangling.h
MACRO_NAMESPACE "LAPACK_"
SYMBOL_NAMESPACE "LAPACK_")
if(NOT FortranCInterface_GLOBAL_FOUND OR NOT FortranCInterface_MODULE_FOUND)
message(WARNING "Reverting to pre-defined include/lapacke_mangling.h")
configure_file(include/lapacke_mangling_with_flags.h.in
${LAPACK_BINARY_DIR}/include/lapacke_mangling.h)
endif()
add_subdirectory(include)
if(NOT LAPACKE)
return()
endif()
message(STATUS "LAPACKE enabled")
enable_language(C)
@@ -88,12 +67,35 @@ if(LAPACKE_WITH_TMG)
endif()
list(APPEND SOURCES ${UTILS})
add_library(${LAPACKELIB} ${SOURCES})
add_library(${LAPACKELIB}_obj OBJECT ${SOURCES})
set_target_properties(${LAPACKELIB}_obj PROPERTIES POSITION_INDEPENDENT_CODE ON)
if(BUILD_INDEX64_EXT_API)
# 64bit Integer Extended Interface
set(SOURCES_64_C)
list(APPEND SOURCES_64_C ${SOURCES})
list(REMOVE_ITEM SOURCES_64_C src/lapacke_nancheck.c)
list(REMOVE_ITEM SOURCES_64_C utils/lapacke_make_complex_float.c)
list(REMOVE_ITEM SOURCES_64_C utils/lapacke_make_complex_double.c)
add_library(${LAPACKELIB}_64_obj OBJECT ${SOURCES_64_C})
set_target_properties(${LAPACKELIB}_64_obj PROPERTIES
POSITION_INDEPENDENT_CODE ON)
target_compile_options(${LAPACKELIB}_64_obj PRIVATE
-DLAPACK_ILP64
-DLAPACKE_API64
-DWeirdNEC
-DCBLAS_API64)
endif()
add_library(${LAPACKELIB} $<TARGET_OBJECTS:${LAPACKELIB}_obj>
$<$<BOOL:${BUILD_INDEX64_EXT_API}>: $<TARGET_OBJECTS:${LAPACKELIB}_64_obj>>)
set_target_properties(
${LAPACKELIB} PROPERTIES
LINKER_LANGUAGE C
VERSION ${LAPACK_VERSION}
SOVERSION ${LAPACK_MAJOR_VERSION}
POSITION_INDEPENDENT_CODE ON
)
target_include_directories(${LAPACKELIB} PUBLIC
$<BUILD_INTERFACE:${LAPACK_BINARY_DIR}/include>
@@ -1,11 +1,8 @@
# Compute locations from <prefix>/@{LIBRARY_DIR@/cmake/lapacke-<v>/<self>.cmake
get_filename_component(_LAPACKE_SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component(_LAPACKE_PREFIX "${_LAPACKE_SELF_DIR}" PATH)
get_filename_component(_LAPACKE_PREFIX "${_LAPACKE_PREFIX}" PATH)
get_filename_component(_LAPACKE_PREFIX "${_LAPACKE_PREFIX}" PATH)
# Load the LAPACK package with which we were built.
set(LAPACK_DIR "${_LAPACKE_PREFIX}/@CMAKE_INSTALL_LIBDIR@/cmake/@LAPACKLIB@-@LAPACK_VERSION@")
set(LAPACK_DIR "@CMAKE_INSTALL_FULL_LIBDIR@/cmake/@LAPACKLIB@-@LAPACK_VERSION@")
find_package(LAPACK NO_MODULE)
# Load lapacke targets from the install tree.
@@ -17,10 +14,9 @@ endif()
set(LAPACKE_Fortran_COMPILER_ID ${LAPACK_Fortran_COMPILER_ID})
# Report lapacke header search locations.
set(LAPACKE_INCLUDE_DIRS ${_LAPACKE_PREFIX}/include)
set(LAPACKE_INCLUDE_DIRS @CMAKE_INSTALL_FULL_INCLUDEDIR@)
# Report lapacke libraries.
set(LAPACKE_LIBRARIES @LAPACKELIB@ ${LAPACK_LIBRARIES})
unset(_LAPACKE_PREFIX)
unset(_LAPACKE_SELF_DIR)
+21 -4
View File
@@ -3,12 +3,29 @@ add_executable(xexample_DGESV_colmajor example_DGESV_colmajor.c lapacke_example_
add_executable(xexample_DGELS_rowmajor example_DGELS_rowmajor.c lapacke_example_aux.c lapacke_example_aux.h)
add_executable(xexample_DGELS_colmajor example_DGELS_colmajor.c lapacke_example_aux.c lapacke_example_aux.h)
target_link_libraries(xexample_DGESV_rowmajor ${LAPACKELIB})
target_link_libraries(xexample_DGESV_colmajor ${LAPACKELIB})
target_link_libraries(xexample_DGELS_rowmajor ${LAPACKELIB})
target_link_libraries(xexample_DGELS_colmajor ${LAPACKELIB})
target_link_libraries(xexample_DGESV_rowmajor ${LAPACKELIB} ${BLAS_LIBRARIES})
target_link_libraries(xexample_DGESV_colmajor ${LAPACKELIB} ${BLAS_LIBRARIES})
target_link_libraries(xexample_DGELS_rowmajor ${LAPACKELIB} ${BLAS_LIBRARIES})
target_link_libraries(xexample_DGELS_colmajor ${LAPACKELIB} ${BLAS_LIBRARIES})
add_test(example_DGESV_rowmajor ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/xexample_DGESV_rowmajor)
add_test(example_DGESV_colmajor ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/xexample_DGESV_colmajor)
add_test(example_DGELS_rowmajor ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/xexample_DGELS_rowmajor)
add_test(example_DGELS_colmajor ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/xexample_DGELS_colmajor)
if(BUILD_INDEX64_EXT_API)
add_executable(xexample_DGESV_rowmajor_64 example_DGESV_rowmajor_64.c lapacke_example_aux.c lapacke_example_aux.h)
add_executable(xexample_DGESV_colmajor_64 example_DGESV_colmajor_64.c lapacke_example_aux.c lapacke_example_aux.h)
add_executable(xexample_DGELS_rowmajor_64 example_DGELS_rowmajor_64.c lapacke_example_aux.c lapacke_example_aux.h)
add_executable(xexample_DGELS_colmajor_64 example_DGELS_colmajor_64.c lapacke_example_aux.c lapacke_example_aux.h)
target_link_libraries(xexample_DGESV_rowmajor_64 ${LAPACKELIB} ${BLAS_LIBRARIES})
target_link_libraries(xexample_DGESV_colmajor_64 ${LAPACKELIB} ${BLAS_LIBRARIES})
target_link_libraries(xexample_DGELS_rowmajor_64 ${LAPACKELIB} ${BLAS_LIBRARIES})
target_link_libraries(xexample_DGELS_colmajor_64 ${LAPACKELIB} ${BLAS_LIBRARIES})
add_test(example_DGESV_rowmajor_64 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/xexample_DGESV_rowmajor_64)
add_test(example_DGESV_colmajor_64 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/xexample_DGESV_colmajor_64)
add_test(example_DGELS_rowmajor_64 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/xexample_DGELS_rowmajor_64)
add_test(example_DGELS_colmajor_64 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/xexample_DGELS_colmajor_64)
endif()
@@ -0,0 +1,93 @@
/*
LAPACKE Example : Calling DGELS using col-major layout
=====================================================
The program computes the solution to the system of linear
equations with a square matrix A and multiple
right-hand sides B, where A is the coefficient matrix
and b is the right-hand side matrix:
Description
===========
In this example, we wish solve the least squares problem min_x || B - Ax ||
for two right-hand sides using the LAPACK routine DGELS. For input we will
use the 5-by-3 matrix
( 1 1 1 )
( 2 3 4 )
A = ( 3 5 2 )
( 4 2 5 )
( 5 4 3 )
and the 5-by-2 matrix
( -10 -3 )
( 12 14 )
B = ( 14 12 )
( 16 16 )
( 18 16 )
We will first store the input matrix as a static C two-dimensional array,
which is stored in col-major layout, and let LAPACKE handle the work space
array allocation. The LAPACK base name for this function is gels, and we
will use double precision (d), so the LAPACKE function name is LAPACKE_dgels.
lda=5 and ldb=5. The output for each right hand side is stored in b as
consecutive vectors of length 3. The correct answer for this problem is
the 3-by-2 matrix
( 2 1 )
( 1 1 )
( 1 2 )
A complete C program for this example is given below. Note that when the arrays
are passed to the LAPACK routine, they must be dereferenced, since LAPACK is
expecting arrays of type double *, not double **.
LAPACKE Interface
=================
LAPACKE_dgels (col-major, high-level) Example Program Results
-- LAPACKE Example routine --
-- LAPACK is a software package provided by Univ. of Tennessee, --
-- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
*/
/* Calling DGELS using col-major layout */
/* Includes */
#include <stdio.h>
#include <lapacke_64.h>
#include "lapacke_example_aux.h"
/* Main program */
int main (int argc, const char * argv[])
{
/* Locals */
double A[5][3] = {{1,2,3},{4,5,1},{3,5,2},{4,1,4},{2,5,3}};
double b[5][2] = {{-10,12},{14,16},{18,-3},{14,12},{16,16}};
int64_t info,m,n,lda,ldb,nrhs;
/* Initialization */
m = 5;
n = 3;
nrhs = 2;
lda = 5;
ldb = 5;
/* Print Entry Matrix */
print_matrix_colmajor_64( "Entry Matrix A", m, n, *A, lda );
/* Print Right Rand Side */
print_matrix_colmajor_64( "Right Hand Side b", n, nrhs, *b, ldb );
printf( "\n" );
/* Executable statements */
printf( "LAPACKE_dgels_64 (col-major, high-level) Example Program Results\n" );
/* Solve least squares problem*/
info = LAPACKE_dgels_64(LAPACK_COL_MAJOR,'N',m,n,nrhs,*A,lda,*b,ldb);
/* Print Solution */
print_matrix_colmajor_64( "Solution", n, nrhs, *b, ldb );
printf( "\n" );
exit( info );
} /* End of LAPACKE_dgels Example */
@@ -0,0 +1,93 @@
/*
LAPACKE Example : Calling DGELS using row-major layout
=====================================================
The program computes the solution to the system of linear
equations with a square matrix A and multiple
right-hand sides B, where A is the coefficient matrix
and b is the right-hand side matrix:
Description
===========
In this example, we wish solve the least squares problem min_x || B - Ax ||
for two right-hand sides using the LAPACK routine DGELS. For input we will
use the 5-by-3 matrix
( 1 1 1 )
( 2 3 4 )
A = ( 3 5 2 )
( 4 2 5 )
( 5 4 3 )
and the 5-by-2 matrix
( -10 -3 )
( 12 14 )
B = ( 14 12 )
( 16 16 )
( 18 16 )
We will first store the input matrix as a static C two-dimensional array,
which is stored in row-major layout, and let LAPACKE handle the work space
array allocation. The LAPACK base name for this function is gels, and we
will use double precision (d), so the LAPACKE function name is LAPACKE_dgels.
thus lda=3 and ldb=2. The output for each right hand side is stored in b as
consecutive vectors of length 3. The correct answer for this problem is
the 3-by-2 matrix
( 2 1 )
( 1 1 )
( 1 2 )
A complete C program for this example is given below. Note that when the arrays
are passed to the LAPACK routine, they must be dereferenced, since LAPACK is
expecting arrays of type double *, not double **.
LAPACKE Interface
=================
LAPACKE_dgels (row-major, high-level) Example Program Results
-- LAPACKE Example routine --
-- LAPACK is a software package provided by Univ. of Tennessee, --
-- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
*/
/* Calling DGELS using row-major layout */
/* Includes */
#include <stdio.h>
#include <lapacke_64.h>
#include "lapacke_example_aux.h"
/* Main program */
int main (int argc, const char * argv[])
{
/* Locals */
double A[5][3] = {{1,1,1},{2,3,4},{3,5,2},{4,2,5},{5,4,3}};
double b[5][2] = {{-10,-3},{12,14},{14,12},{16,16},{18,16}};
int64_t info,m,n,lda,ldb,nrhs;
/* Initialization */
m = 5;
n = 3;
nrhs = 2;
lda = 3;
ldb = 2;
/* Print Entry Matrix */
print_matrix_rowmajor_64( "Entry Matrix A", m, n, *A, lda );
/* Print Right Rand Side */
print_matrix_rowmajor_64( "Right Hand Side b", n, nrhs, *b, ldb );
printf( "\n" );
/* Executable statements */
printf( "LAPACKE_dgels_64 (row-major, high-level) Example Program Results\n" );
/* Solve least squares problem*/
info = LAPACKE_dgels_64(LAPACK_ROW_MAJOR,'N',m,n,nrhs,*A,lda,*b,ldb);
/* Print Solution */
print_matrix_rowmajor_64( "Solution", n, nrhs, *b, ldb );
printf( "\n" );
exit( 0 );
} /* End of LAPACKE_dgels Example */
+42 -28
View File
@@ -41,41 +41,41 @@ int main(int argc, char **argv) {
/* Locals */
lapack_int n, nrhs, lda, ldb, info;
int i, j;
int i, j;
/* Local arrays */
double *A, *b;
lapack_int *ipiv;
double *A, *b;
lapack_int *ipiv;
/* Default Value */
n = 5; nrhs = 1;
n = 5; nrhs = 1;
/* Arguments */
for( i = 1; i < argc; i++ ) {
if( strcmp( argv[i], "-n" ) == 0 ) {
n = atoi(argv[i+1]);
i++;
}
if( strcmp( argv[i], "-nrhs" ) == 0 ) {
nrhs = atoi(argv[i+1]);
i++;
}
}
for( i = 1; i < argc; i++ ) {
if( strcmp( argv[i], "-n" ) == 0 ) {
n = atoi(argv[i+1]);
i++;
}
if( strcmp( argv[i], "-nrhs" ) == 0 ) {
nrhs = atoi(argv[i+1]);
i++;
}
}
/* Initialization */
lda=n, ldb=n;
A = (double *)malloc(n*n*sizeof(double)) ;
if (A==NULL){ printf("error of memory allocation\n"); exit(0); }
b = (double *)malloc(n*nrhs*sizeof(double)) ;
if (b==NULL){ printf("error of memory allocation\n"); exit(0); }
ipiv = (lapack_int *)malloc(n*sizeof(lapack_int)) ;
if (ipiv==NULL){ printf("error of memory allocation\n"); exit(0); }
A = (double *)malloc(n*n*sizeof(double)) ;
if (A==NULL){ printf("error of memory allocation\n"); exit(0); }
b = (double *)malloc(n*nrhs*sizeof(double)) ;
if (b==NULL){ printf("error of memory allocation\n"); free(A); exit(0); }
ipiv = (lapack_int *)malloc(n*sizeof(lapack_int)) ;
if (ipiv==NULL){ printf("error of memory allocation\n"); free(A); free(b); exit(0); }
for( i = 0; i < n; i++ ) {
for( j = 0; j < n; j++ ) A[i+j*lda] = ((double) rand()) / ((double) RAND_MAX) - 0.5;
}
}
for(i=0;i<n*nrhs;i++)
b[i] = ((double) rand()) / ((double) RAND_MAX) - 0.5;
for(i=0;i<n*nrhs;i++)
b[i] = ((double) rand()) / ((double) RAND_MAX) - 0.5;
/* Print Entry Matrix */
print_matrix_colmajor( "Entry Matrix A", n, n, A, lda );
@@ -91,18 +91,32 @@ int main(int argc, char **argv) {
/* Check for the exact singularity */
if( info > 0 ) {
printf( "The diagonal element of the triangular factor of A,\n" );
printf( "U(%" LAPACK_IFMT ",%" LAPACK_IFMT ") is zero, so that A is singular;\n", info, info );
printf( "the solution could not be computed.\n" );
exit( 1 );
printf( "The diagonal element of the triangular factor of A,\n" );
printf( "U(%" LAPACK_IFMT ",%" LAPACK_IFMT ") is zero, so that A is singular;\n", info, info );
printf( "the solution could not be computed.\n" );
free(A);
free(b);
free(ipiv);
exit( 1 );
}
if (info <0) {
free(A);
free(b);
free(ipiv);
exit( 1 );
}
if (info <0) exit( 1 );
/* Print solution */
print_matrix_colmajor( "Solution", n, nrhs, b, ldb );
/* Print details of LU factorization */
print_matrix_colmajor( "Details of LU factorization", n, n, A, lda );
/* Print pivot indices */
print_vector( "Pivot indices", n, ipiv );
/* Free matrices and vectors */
free(A);
free(b);
free(ipiv);
exit( 0 );
} /* End of LAPACKE_dgesv Example */
+119
View File
@@ -0,0 +1,119 @@
/*
LAPACKE_dgesv Example
=====================
The program computes the solution to the system of linear
equations with a square matrix A and multiple
right-hand sides B, where A is the coefficient matrix
and b is the right-hand side matrix:
Description
===========
The routine solves for X the system of linear equations A*X = B,
where A is an n-by-n matrix, the columns of matrix B are individual
right-hand sides, and the columns of X are the corresponding
solutions.
The LU decomposition with partial pivoting and row interchanges is
used to factor A as A = P*L*U, where P is a permutation matrix, L
is unit lower triangular, and U is upper triangular. The factored
form of A is then used to solve the system of equations A*X = B.
LAPACKE Interface
=================
LAPACKE_dgesv (col-major, high-level) Example Program Results
-- LAPACKE Example routine --
-- LAPACK is a software package provided by Univ. of Tennessee, --
-- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
*/
/* Includes */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "lapacke_64.h"
#include "lapacke_example_aux.h"
/* Main program */
int main(int argc, char **argv) {
/* Locals */
int64_t n, nrhs, lda, ldb, info;
int i, j;
/* Local arrays */
double *A, *b;
int64_t *ipiv;
/* Default Value */
n = 5; nrhs = 1;
/* Arguments */
for( i = 1; i < argc; i++ ) {
if( strcmp( argv[i], "-n" ) == 0 ) {
n = atoi(argv[i+1]);
i++;
}
if( strcmp( argv[i], "-nrhs" ) == 0 ) {
nrhs = atoi(argv[i+1]);
i++;
}
}
/* Initialization */
lda=n, ldb=n;
A = (double *)malloc(n*n*sizeof(double)) ;
if (A==NULL){ printf("error of memory allocation\n"); exit(0); }
b = (double *)malloc(n*nrhs*sizeof(double)) ;
if (b==NULL){ printf("error of memory allocation\n"); free(A); exit(0); }
ipiv = (int64_t *)malloc(n*sizeof(int64_t)) ;
if (ipiv==NULL){ printf("error of memory allocation\n"); free(A); free(b); exit(0); }
for( i = 0; i < n; i++ ) {
for( j = 0; j < n; j++ ) A[i+j*lda] = ((double) rand()) / ((double) RAND_MAX) - 0.5;
}
for(i=0;i<n*nrhs;i++)
b[i] = ((double) rand()) / ((double) RAND_MAX) - 0.5;
/* Print Entry Matrix */
print_matrix_colmajor_64( "Entry Matrix A", n, n, A, lda );
/* Print Right Rand Side */
print_matrix_colmajor_64( "Right Rand Side b", n, nrhs, b, ldb );
printf( "\n" );
/* Executable statements */
printf( "LAPACKE_dgesv_64 (row-major, high-level) Example Program Results\n" );
/* Solve the equations A*X = B */
info = LAPACKE_dgesv_64( LAPACK_COL_MAJOR, n, nrhs, A, lda, ipiv,
b, ldb );
/* Check for the exact singularity */
if( info > 0 ) {
printf( "The diagonal element of the triangular factor of A,\n" );
printf( "U(%" LAPACK_IFMT ",%" LAPACK_IFMT ") is zero, so that A is singular;\n", info, info );
printf( "the solution could not be computed.\n" );
free(A);
free(b);
free(ipiv);
exit( 1 );
}
if (info <0) {
free(A);
free(b);
free(ipiv);
exit( 1 );
}
/* Print solution */
print_matrix_colmajor_64( "Solution", n, nrhs, b, ldb );
/* Print details of LU factorization */
print_matrix_colmajor_64( "Details of LU factorization", n, n, A, lda );
/* Print pivot indices */
print_vector_64( "Pivot indices", n, ipiv );
free(A);
free(b);
free(ipiv);
exit( 0 );
} /* End of LAPACKE_dgesv Example */
+41 -28
View File
@@ -40,41 +40,41 @@ int main(int argc, char **argv) {
/* Locals */
lapack_int n, nrhs, lda, ldb, info;
int i, j;
int i, j;
/* Local arrays */
double *A, *b;
lapack_int *ipiv;
double *A, *b;
lapack_int *ipiv;
/* Default Value */
n = 5; nrhs = 1;
n = 5; nrhs = 1;
/* Arguments */
for( i = 1; i < argc; i++ ) {
if( strcmp( argv[i], "-n" ) == 0 ) {
n = atoi(argv[i+1]);
i++;
}
if( strcmp( argv[i], "-nrhs" ) == 0 ) {
nrhs = atoi(argv[i+1]);
i++;
}
}
for( i = 1; i < argc; i++ ) {
if( strcmp( argv[i], "-n" ) == 0 ) {
n = atoi(argv[i+1]);
i++;
}
if( strcmp( argv[i], "-nrhs" ) == 0 ) {
nrhs = atoi(argv[i+1]);
i++;
}
}
/* Initialization */
lda=n, ldb=nrhs;
A = (double *)malloc(n*n*sizeof(double)) ;
if (A==NULL){ printf("error of memory allocation\n"); exit(0); }
b = (double *)malloc(n*nrhs*sizeof(double)) ;
if (b==NULL){ printf("error of memory allocation\n"); exit(0); }
ipiv = (lapack_int *)malloc(n*sizeof(lapack_int)) ;
if (ipiv==NULL){ printf("error of memory allocation\n"); exit(0); }
A = (double *)malloc(n*n*sizeof(double)) ;
if (A==NULL){ printf("error of memory allocation\n"); exit(0); }
b = (double *)malloc(n*nrhs*sizeof(double)) ;
if (b==NULL){ printf("error of memory allocation\n"); free(A); exit(0); }
ipiv = (lapack_int *)malloc(n*sizeof(lapack_int)) ;
if (ipiv==NULL){ printf("error of memory allocation\n"); free(A); free(b); exit(0); }
for( i = 0; i < n; i++ ) {
for( j = 0; j < n; j++ ) A[i*lda+j] = ((double) rand()) / ((double) RAND_MAX) - 0.5;
}
}
for(i=0;i<n*nrhs;i++)
b[i] = ((double) rand()) / ((double) RAND_MAX) - 0.5;
for(i=0;i<n*nrhs;i++)
b[i] = ((double) rand()) / ((double) RAND_MAX) - 0.5;
/* Print Entry Matrix */
print_matrix_rowmajor( "Entry Matrix A", n, n, A, lda );
@@ -88,18 +88,31 @@ int main(int argc, char **argv) {
b, ldb );
/* Check for the exact singularity */
if( info > 0 ) {
printf( "The diagonal element of the triangular factor of A,\n" );
printf( "U(%" LAPACK_IFMT ",%" LAPACK_IFMT ") is zero, so that A is singular;\n", info, info );
printf( "the solution could not be computed.\n" );
exit( 1 );
printf( "The diagonal element of the triangular factor of A,\n" );
printf( "U(%" LAPACK_IFMT ",%" LAPACK_IFMT ") is zero, so that A is singular;\n", info, info );
printf( "the solution could not be computed.\n" );
free(A);
free(b);
free(ipiv);
exit( 1 );
}
if (info <0) {
free(A);
free(b);
free(ipiv);
exit( 1 );
}
if (info <0) exit( 1 );
/* Print solution */
print_matrix_rowmajor( "Solution", n, nrhs, b, ldb );
/* Print details of LU factorization */
print_matrix_rowmajor( "Details of LU factorization", n, n, A, lda );
/* Print pivot indices */
print_vector( "Pivot indices", n, ipiv );
/* Free matrices and vectors */
free(A);
free(b);
free(ipiv);
exit( 0 );
} /* End of LAPACKE_dgesv Example */
+116
View File
@@ -0,0 +1,116 @@
/*
LAPACKE_dgesv Example
=====================
The program computes the solution to the system of linear
equations with a square matrix A and multiple
right-hand sides B, where A is the coefficient matrix
and b is the right-hand side matrix:
Description
===========
The routine solves for X the system of linear equations A*X = B,
where A is an n-by-n matrix, the columns of matrix B are individual
right-hand sides, and the columns of X are the corresponding
solutions.
The LU decomposition with partial pivoting and row interchanges is
used to factor A as A = P*L*U, where P is a permutation matrix, L
is unit lower triangular, and U is upper triangular. The factored
form of A is then used to solve the system of equations A*X = B.
LAPACKE Interface
=================
LAPACKE_dgesv (row-major, high-level) Example Program Results
-- LAPACKE Example routine --
-- LAPACK is a software package provided by Univ. of Tennessee, --
-- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <lapacke_64.h>
#include "lapacke_example_aux.h"
/* Main program */
int main(int argc, char **argv) {
/* Locals */
int64_t n, nrhs, lda, ldb, info;
int i, j;
/* Local arrays */
double *A, *b;
int64_t *ipiv;
/* Default Value */
n = 5; nrhs = 1;
/* Arguments */
for( i = 1; i < argc; i++ ) {
if( strcmp( argv[i], "-n" ) == 0 ) {
n = atoi(argv[i+1]);
i++;
}
if( strcmp( argv[i], "-nrhs" ) == 0 ) {
nrhs = atoi(argv[i+1]);
i++;
}
}
/* Initialization */
lda=n, ldb=nrhs;
A = (double *)malloc(n*n*sizeof(double)) ;
if (A==NULL){ printf("error of memory allocation\n"); exit(0); }
b = (double *)malloc(n*nrhs*sizeof(double)) ;
if (b==NULL){ printf("error of memory allocation\n"); free(A); exit(0); }
ipiv = (int64_t *)malloc(n*sizeof(int64_t)) ;
if (ipiv==NULL){ printf("error of memory allocation\n"); free(A); free(b); exit(0); }
for( i = 0; i < n; i++ ) {
for( j = 0; j < n; j++ ) A[i*lda+j] = ((double) rand()) / ((double) RAND_MAX) - 0.5;
}
for(i=0;i<n*nrhs;i++)
b[i] = ((double) rand()) / ((double) RAND_MAX) - 0.5;
/* Print Entry Matrix */
print_matrix_rowmajor_64( "Entry Matrix A", n, n, A, lda );
/* Print Right Rand Side */
print_matrix_rowmajor_64( "Right Rand Side b", n, nrhs, b, ldb );
printf( "\n" );
/* Executable statements */
printf( "LAPACKE_dgesv_64 (row-major, high-level) Example Program Results\n" );
/* Solve the equations A*X = B */
info = LAPACKE_dgesv_64( LAPACK_ROW_MAJOR, n, nrhs, A, lda, ipiv,
b, ldb );
/* Check for the exact singularity */
if( info > 0 ) {
printf( "The diagonal element of the triangular factor of A,\n" );
printf( "U(%" LAPACK_IFMT ",%" LAPACK_IFMT ") is zero, so that A is singular;\n", info, info );
printf( "the solution could not be computed.\n" );
free(A);
free(b);
free(ipiv);
exit( 1 );
}
if (info <0) {
free(A);
free(b);
free(ipiv);
exit( 1 );
}
/* Print solution */
print_matrix_rowmajor_64( "Solution", n, nrhs, b, ldb );
/* Print details of LU factorization */
print_matrix_rowmajor_64( "Details of LU factorization", n, n, A, lda );
/* Print pivot indices */
print_vector_64( "Pivot indices", n, ipiv );
free(A);
free(b);
free(ipiv);
exit( 0 );
} /* End of LAPACKE_dgesv Example */
+32
View File
@@ -31,3 +31,35 @@ void print_vector( char* desc, lapack_int n, lapack_int* vec ) {
for( j = 0; j < n; j++ ) printf( " %6" LAPACK_IFMT, vec[j] );
printf( "\n" );
}
/* ILP64 routines */
/* Auxiliary routine: printing a matrix */
void print_matrix_rowmajor_64( char* desc, int64_t m, int64_t n, double* mat, int64_t ldm ) {
int64_t i, j;
printf( "\n %s\n", desc );
for( i = 0; i < m; i++ ) {
for( j = 0; j < n; j++ ) printf( " %6.2f", mat[i*ldm+j] );
printf( "\n" );
}
}
/* Auxiliary routine: printing a matrix */
void print_matrix_colmajor_64( char* desc, int64_t m, int64_t n, double* mat, int64_t ldm ) {
int64_t i, j;
printf( "\n %s\n", desc );
for( i = 0; i < m; i++ ) {
for( j = 0; j < n; j++ ) printf( " %6.2f", mat[i+j*ldm] );
printf( "\n" );
}
}
/* Auxiliary routine: printing a vector of integers */
void print_vector_64( char* desc, int64_t n, int64_t* vec ) {
int64_t j;
printf( "\n %s\n", desc );
for( j = 0; j < n; j++ ) printf( " %6" LAPACK_IFMT, vec[j] );
printf( "\n" );
}
+4
View File
@@ -6,4 +6,8 @@ void print_matrix_rowmajor( char* desc, lapack_int m, lapack_int n, double* mat,
void print_matrix_colmajor( char* desc, lapack_int m, lapack_int n, double* mat, lapack_int ldm );
void print_vector( char* desc, lapack_int n, lapack_int* vec );
void print_matrix_rowmajor_64( char* desc, int64_t m, int64_t n, double* mat, int64_t ldm );
void print_matrix_colmajor_64( char* desc, int64_t m, int64_t n, double* mat, int64_t ldm );
void print_vector_64( char* desc, int64_t n, int64_t* vec );
#endif /* _LAPACKE_EXAMPLE_AUX_*/
+20 -1
View File
@@ -1,7 +1,26 @@
set(LAPACKE_INCLUDE lapack.h)
IF(LAPACKE)
list(APPEND LAPACKE_INCLUDE lapacke.h lapacke_config.h lapacke_utils.h)
endif()
file(COPY ${LAPACKE_INCLUDE} DESTINATION ${LAPACK_BINARY_DIR}/include)
# Create a header file lapacke_mangling.h for the routines called in my C programs
include(CheckLanguage)
check_language(Fortran)
check_language(C)
if(CMAKE_Fortran_COMPILER AND CMAKE_C_COMPILER)
enable_language(Fortran)
enable_language(C)
include(FortranCInterface)
## Ensure that the fortran compiler and c compiler specified are compatible
FortranCInterface_VERIFY()
FortranCInterface_HEADER(${LAPACK_BINARY_DIR}/include/lapacke_mangling.h
MACRO_NAMESPACE "LAPACK_"
SYMBOL_NAMESPACE "LAPACK_")
endif()
if(NOT FortranCInterface_GLOBAL_FOUND OR NOT FortranCInterface_MODULE_FOUND)
message(WARNING "Reverting to pre-defined include/lapacke_mangling.h")
configure_file(lapacke_mangling_with_flags.h.in
${LAPACK_BINARY_DIR}/include/lapacke_mangling.h)
endif()
+1463 -1371
View File
File diff suppressed because it is too large Load Diff
+69 -52
View File
@@ -58,6 +58,21 @@ extern "C" {
lapack_complex_float lapack_make_complex_float( float re, float im );
lapack_complex_double lapack_make_complex_double( double re, double im );
/*
* Integer specific API
*/
#ifdef LAPACKE_API64
#ifndef API_SUFFIX
#define API_SUFFIX(a) a##_64
#endif
#include "lapacke_64.h"
#else
#ifndef API_SUFFIX
#define API_SUFFIX(a) a
#endif
#endif
/* C-LAPACK function prototypes */
lapack_int LAPACKE_sbdsdc( int matrix_layout, char uplo, char compq,
@@ -5713,55 +5728,59 @@ lapack_int LAPACKE_zgesdd_work( int matrix_layout, char jobz, lapack_int m,
double* rwork, lapack_int* iwork );
lapack_int LAPACKE_sgedmd_work( int matrix_layout, char jobs, char jobz,
char jobf, lapack_int whtsvd, lapack_int m,
lapack_int n, float* x, lapack_int ldx,
float* y, lapack_int ldy, lapack_int k,
float* reig, float* imeig, float* z,
lapack_int ldz, float* res, float* b,
lapack_int ldb, float* w, lapack_int ldw,
float* s, lapack_int lds, float* work,
lapack_int lwork, lapack_int* iwork,
lapack_int liwork );
char jobr, char jobf, lapack_int whtsvd,
lapack_int m, lapack_int n, float* x,
lapack_int ldx, float* y, lapack_int ldy,
lapack_int nrnk, float* tol, lapack_int k,
float* reig, float* imeig,
float* z, lapack_int ldz, float* res,
float* b, lapack_int ldb, float* w,
lapack_int ldw, float* s, lapack_int lds,
float* work, lapack_int lwork,
lapack_int* iwork, lapack_int liwork );
lapack_int LAPACKE_dgedmd_work( int matrix_layout, char jobs, char jobz,
char jobf, lapack_int whtsvd, lapack_int m,
lapack_int n, double* x, lapack_int ldx,
double* y, lapack_int ldy, lapack_int k,
double* reig, double* imeig, double* z,
lapack_int ldz, double* res, double* b,
lapack_int ldb, double* w, lapack_int ldw,
double* s, lapack_int lds, double* work,
lapack_int lwork, lapack_int* iwork,
lapack_int liwork );
char jobr, char jobf, lapack_int whtsvd,
lapack_int m, lapack_int n, double* x,
lapack_int ldx, double* y, lapack_int ldy,
lapack_int nrnk, double* tol, lapack_int k,
double* reig, double *imeig,
double* z, lapack_int ldz, double* res,
double* b, lapack_int ldb, double* w,
lapack_int ldw, double* s, lapack_int lds,
double* work, lapack_int lwork,
lapack_int* iwork, lapack_int liwork );
lapack_int LAPACKE_cgedmd_work( int matrix_layout, char jobs, char jobz,
char jobf, lapack_int whtsvd, lapack_int m,
lapack_int n, lapack_complex_float* x,
lapack_int ldx, lapack_complex_float* y,
lapack_int ldy, lapack_int k,
lapack_complex_float* reig,
lapack_complex_float* imeig,
char jobr, char jobf, lapack_int whtsvd,
lapack_int m, lapack_int n,
lapack_complex_float* x, lapack_int ldx,
lapack_complex_float* y, lapack_int ldy,
lapack_int nrnk, float* tol, lapack_int k,
lapack_complex_float* eigs,
lapack_complex_float* z, lapack_int ldz,
lapack_complex_float* res,
float* res,
lapack_complex_float* b, lapack_int ldb,
lapack_complex_float* w, lapack_int ldw,
lapack_complex_float* s, lapack_int lds,
lapack_complex_float* work, lapack_int lwork,
lapack_complex_float* zwork, lapack_int lzwork,
float* work, lapack_int lwork,
lapack_int* iwork, lapack_int liwork );
lapack_int LAPACKE_zgedmd_work( int matrix_layout, char jobs, char jobz,
char jobf, lapack_int whtsvd, lapack_int m,
lapack_int n, lapack_complex_double* x,
lapack_int ldx, lapack_complex_double* y,
lapack_int ldy, lapack_int k,
lapack_complex_double* reig,
lapack_complex_double* imeig,
char jobr, char jobf, lapack_int whtsvd,
lapack_int m, lapack_int n,
lapack_complex_double* x, lapack_int ldx,
lapack_complex_double* y, lapack_int ldy,
lapack_int nrnk, double* tol, lapack_int k,
lapack_complex_double* eigs,
lapack_complex_double* z, lapack_int ldz,
lapack_complex_double* res,
double* res,
lapack_complex_double* b, lapack_int ldb,
lapack_complex_double* w, lapack_int ldw,
lapack_complex_double* s, lapack_int lds,
lapack_complex_double* work, lapack_int lwork,
lapack_complex_double* zwork, lapack_int lzwork,
double* work, lapack_int lwork,
lapack_int* iwork, lapack_int liwork );
lapack_int LAPACKE_sgedmdq_work( int matrix_layout, char jobs, char jobz,
@@ -5769,8 +5788,8 @@ lapack_int LAPACKE_sgedmdq_work( int matrix_layout, char jobs, char jobz,
lapack_int whtsvd, lapack_int m, lapack_int n,
float* f, lapack_int ldf, float* x,
lapack_int ldx, float* y, lapack_int ldy,
lapack_int nrnk, float tol, lapack_int k,
float* reig, float* imeig, float* z,
lapack_int nrnk, float* tol, lapack_int k,
float* reig, float *imeig, float* z,
lapack_int ldz, float* res, float* b,
lapack_int ldb, float* v, lapack_int ldv,
float* s, lapack_int lds, float* work,
@@ -5782,8 +5801,8 @@ lapack_int LAPACKE_dgedmdq_work( int matrix_layout, char jobs, char jobz,
lapack_int whtsvd, lapack_int m, lapack_int n,
double* f, lapack_int ldf, double* x,
lapack_int ldx, double* y, lapack_int ldy,
lapack_int nrnk, double tol, lapack_int k,
double* reig, double* imeig, double* z,
lapack_int nrnk, double* tol, lapack_int k,
double* reig, double* imeig, double* z,
lapack_int ldz, double* res, double* b,
lapack_int ldb, double* v, lapack_int ldv,
double* s, lapack_int lds, double* work,
@@ -5796,17 +5815,16 @@ lapack_int LAPACKE_cgedmdq_work( int matrix_layout, char jobs, char jobz,
lapack_complex_float* f, lapack_int ldf,
lapack_complex_float* x, lapack_int ldx,
lapack_complex_float* y, lapack_int ldy,
lapack_int nrnk, float tol, lapack_int k,
lapack_complex_float* reig,
lapack_complex_float* imeig,
lapack_int nrnk, float* tol, lapack_int k,
lapack_complex_float* eigs,
lapack_complex_float* z, lapack_int ldz,
lapack_complex_float* res,
float* res,
lapack_complex_float* b, lapack_int ldb,
lapack_complex_float* v, lapack_int ldv,
lapack_complex_float* s, lapack_int lds,
lapack_complex_float* work, lapack_int lwork,
lapack_int* iwork,
lapack_int liwork );
lapack_complex_float* zwork, lapack_int lzwork,
float* work, lapack_int lwork,
lapack_int* iwork, lapack_int liwork);
lapack_int LAPACKE_zgedmdq_work( int matrix_layout, char jobs, char jobz,
char jobr, char jobq, char jobt, char jobf,
@@ -5814,17 +5832,16 @@ lapack_int LAPACKE_zgedmdq_work( int matrix_layout, char jobs, char jobz,
lapack_complex_double* f, lapack_int ldf,
lapack_complex_double* x, lapack_int ldx,
lapack_complex_double* y, lapack_int ldy,
lapack_int nrnk, double tol, lapack_int k,
lapack_complex_double* reig,
lapack_complex_double* imeig,
lapack_int nrnk, double* tol, lapack_int k,
lapack_complex_double* eigs,
lapack_complex_double* z, lapack_int ldz,
lapack_complex_double* res,
double* res,
lapack_complex_double* b, lapack_int ldb,
lapack_complex_double* v, lapack_int ldv,
lapack_complex_double* s, lapack_int lds,
lapack_complex_double* work, lapack_int lwork,
lapack_int* iwork,
lapack_int liwork );
lapack_complex_double* zwork, lapack_int lzwork,
double* work, lapack_int lwork,
lapack_int* iwork, lapack_int liwork);
lapack_int LAPACKE_sgesv_work( int matrix_layout, lapack_int n, lapack_int nrhs,
float* a, lapack_int lda, lapack_int* ipiv,
File diff suppressed because it is too large Load Diff
+154 -154
View File
@@ -63,240 +63,240 @@ extern "C" {
IS_D_NONZERO(*(((double*)&x)+1)) )
/* Error handler */
void LAPACKE_xerbla( const char *name, lapack_int info );
void API_SUFFIX(LAPACKE_xerbla)( const char *name, lapack_int info );
/* Compare two chars (case-insensitive) */
lapack_logical LAPACKE_lsame( char ca, char cb )
lapack_logical API_SUFFIX(LAPACKE_lsame)( char ca, char cb )
#if defined __GNUC__
__attribute__((const))
#endif
;
/* Functions to convert column-major to row-major 2d arrays and vice versa. */
void LAPACKE_cgb_trans( int matrix_layout, lapack_int m, lapack_int n,
void API_SUFFIX(LAPACKE_cgb_trans)( int matrix_layout, lapack_int m, lapack_int n,
lapack_int kl, lapack_int ku,
const lapack_complex_float *in, lapack_int ldin,
lapack_complex_float *out, lapack_int ldout );
void LAPACKE_cge_trans( int matrix_layout, lapack_int m, lapack_int n,
void API_SUFFIX(LAPACKE_cge_trans)( int matrix_layout, lapack_int m, lapack_int n,
const lapack_complex_float* in, lapack_int ldin,
lapack_complex_float* out, lapack_int ldout );
void LAPACKE_cgg_trans( int matrix_layout, lapack_int m, lapack_int n,
void API_SUFFIX(LAPACKE_cgg_trans)( int matrix_layout, lapack_int m, lapack_int n,
const lapack_complex_float* in, lapack_int ldin,
lapack_complex_float* out, lapack_int ldout );
void LAPACKE_chb_trans( int matrix_layout, char uplo, lapack_int n,
void API_SUFFIX(LAPACKE_chb_trans)( int matrix_layout, char uplo, lapack_int n,
lapack_int kd,
const lapack_complex_float *in, lapack_int ldin,
lapack_complex_float *out, lapack_int ldout );
void LAPACKE_che_trans( int matrix_layout, char uplo, lapack_int n,
void API_SUFFIX(LAPACKE_che_trans)( int matrix_layout, char uplo, lapack_int n,
const lapack_complex_float *in, lapack_int ldin,
lapack_complex_float *out, lapack_int ldout );
void LAPACKE_chp_trans( int matrix_layout, char uplo, lapack_int n,
void API_SUFFIX(LAPACKE_chp_trans)( int matrix_layout, char uplo, lapack_int n,
const lapack_complex_float *in,
lapack_complex_float *out );
void LAPACKE_chs_trans( int matrix_layout, lapack_int n,
void API_SUFFIX(LAPACKE_chs_trans)( int matrix_layout, lapack_int n,
const lapack_complex_float *in, lapack_int ldin,
lapack_complex_float *out, lapack_int ldout );
void LAPACKE_cpb_trans( int matrix_layout, char uplo, lapack_int n,
void API_SUFFIX(LAPACKE_cpb_trans)( int matrix_layout, char uplo, lapack_int n,
lapack_int kd,
const lapack_complex_float *in, lapack_int ldin,
lapack_complex_float *out, lapack_int ldout );
void LAPACKE_cpf_trans( int matrix_layout, char transr, char uplo,
void API_SUFFIX(LAPACKE_cpf_trans)( int matrix_layout, char transr, char uplo,
lapack_int n, const lapack_complex_float *in,
lapack_complex_float *out );
void LAPACKE_cpo_trans( int matrix_layout, char uplo, lapack_int n,
void API_SUFFIX(LAPACKE_cpo_trans)( int matrix_layout, char uplo, lapack_int n,
const lapack_complex_float *in, lapack_int ldin,
lapack_complex_float *out, lapack_int ldout );
void LAPACKE_cpp_trans( int matrix_layout, char uplo, lapack_int n,
void API_SUFFIX(LAPACKE_cpp_trans)( int matrix_layout, char uplo, lapack_int n,
const lapack_complex_float *in,
lapack_complex_float *out );
void LAPACKE_csp_trans( int matrix_layout, char uplo, lapack_int n,
void API_SUFFIX(LAPACKE_csp_trans)( int matrix_layout, char uplo, lapack_int n,
const lapack_complex_float *in,
lapack_complex_float *out );
void LAPACKE_csy_trans( int matrix_layout, char uplo, lapack_int n,
void API_SUFFIX(LAPACKE_csy_trans)( int matrix_layout, char uplo, lapack_int n,
const lapack_complex_float *in, lapack_int ldin,
lapack_complex_float *out, lapack_int ldout );
void LAPACKE_ctb_trans( int matrix_layout, char uplo, char diag,
void API_SUFFIX(LAPACKE_ctb_trans)( int matrix_layout, char uplo, char diag,
lapack_int n, lapack_int kd,
const lapack_complex_float *in, lapack_int ldin,
lapack_complex_float *out, lapack_int ldout );
void LAPACKE_ctf_trans( int matrix_layout, char transr, char uplo, char diag,
void API_SUFFIX(LAPACKE_ctf_trans)( int matrix_layout, char transr, char uplo, char diag,
lapack_int n, const lapack_complex_float *in,
lapack_complex_float *out );
void LAPACKE_ctp_trans( int matrix_layout, char uplo, char diag,
void API_SUFFIX(LAPACKE_ctp_trans)( int matrix_layout, char uplo, char diag,
lapack_int n, const lapack_complex_float *in,
lapack_complex_float *out );
void LAPACKE_ctr_trans( int matrix_layout, char uplo, char diag, lapack_int n,
void API_SUFFIX(LAPACKE_ctr_trans)( int matrix_layout, char uplo, char diag, lapack_int n,
const lapack_complex_float *in, lapack_int ldin,
lapack_complex_float *out, lapack_int ldout );
void LAPACKE_ctz_trans( int matrix_layout, char direct, char uplo,
void API_SUFFIX(LAPACKE_ctz_trans)( int matrix_layout, char direct, char uplo,
char diag, lapack_int m, lapack_int n,
const lapack_complex_float *in, lapack_int ldin,
lapack_complex_float *out, lapack_int ldout );
void LAPACKE_dgb_trans( int matrix_layout, lapack_int m, lapack_int n,
void API_SUFFIX(LAPACKE_dgb_trans)( int matrix_layout, lapack_int m, lapack_int n,
lapack_int kl, lapack_int ku,
const double *in, lapack_int ldin,
double *out, lapack_int ldout );
void LAPACKE_dge_trans( int matrix_layout, lapack_int m, lapack_int n,
void API_SUFFIX(LAPACKE_dge_trans)( int matrix_layout, lapack_int m, lapack_int n,
const double* in, lapack_int ldin,
double* out, lapack_int ldout );
void LAPACKE_dgg_trans( int matrix_layout, lapack_int m, lapack_int n,
void API_SUFFIX(LAPACKE_dgg_trans)( int matrix_layout, lapack_int m, lapack_int n,
const double* in, lapack_int ldin,
double* out, lapack_int ldout );
void LAPACKE_dhs_trans( int matrix_layout, lapack_int n,
void API_SUFFIX(LAPACKE_dhs_trans)( int matrix_layout, lapack_int n,
const double *in, lapack_int ldin,
double *out, lapack_int ldout );
void LAPACKE_dpb_trans( int matrix_layout, char uplo, lapack_int n,
void API_SUFFIX(LAPACKE_dpb_trans)( int matrix_layout, char uplo, lapack_int n,
lapack_int kd,
const double *in, lapack_int ldin,
double *out, lapack_int ldout );
void LAPACKE_dpf_trans( int matrix_layout, char transr, char uplo,
void API_SUFFIX(LAPACKE_dpf_trans)( int matrix_layout, char transr, char uplo,
lapack_int n, const double *in,
double *out );
void LAPACKE_dpo_trans( int matrix_layout, char uplo, lapack_int n,
void API_SUFFIX(LAPACKE_dpo_trans)( int matrix_layout, char uplo, lapack_int n,
const double *in, lapack_int ldin,
double *out, lapack_int ldout );
void LAPACKE_dpp_trans( int matrix_layout, char uplo, lapack_int n,
void API_SUFFIX(LAPACKE_dpp_trans)( int matrix_layout, char uplo, lapack_int n,
const double *in,
double *out );
void LAPACKE_dsb_trans( int matrix_layout, char uplo, lapack_int n,
void API_SUFFIX(LAPACKE_dsb_trans)( int matrix_layout, char uplo, lapack_int n,
lapack_int kd,
const double *in, lapack_int ldin,
double *out, lapack_int ldout );
void LAPACKE_dsp_trans( int matrix_layout, char uplo, lapack_int n,
void API_SUFFIX(LAPACKE_dsp_trans)( int matrix_layout, char uplo, lapack_int n,
const double *in,
double *out );
void LAPACKE_dsy_trans( int matrix_layout, char uplo, lapack_int n,
void API_SUFFIX(LAPACKE_dsy_trans)( int matrix_layout, char uplo, lapack_int n,
const double *in, lapack_int ldin,
double *out, lapack_int ldout );
void LAPACKE_dtb_trans( int matrix_layout, char uplo, char diag,
void API_SUFFIX(LAPACKE_dtb_trans)( int matrix_layout, char uplo, char diag,
lapack_int n, lapack_int kd,
const double *in, lapack_int ldin,
double *out, lapack_int ldout );
void LAPACKE_dtf_trans( int matrix_layout, char transr, char uplo, char diag,
void API_SUFFIX(LAPACKE_dtf_trans)( int matrix_layout, char transr, char uplo, char diag,
lapack_int n, const double *in,
double *out );
void LAPACKE_dtp_trans( int matrix_layout, char uplo, char diag,
void API_SUFFIX(LAPACKE_dtp_trans)( int matrix_layout, char uplo, char diag,
lapack_int n, const double *in,
double *out );
void LAPACKE_dtr_trans( int matrix_layout, char uplo, char diag, lapack_int n,
void API_SUFFIX(LAPACKE_dtr_trans)( int matrix_layout, char uplo, char diag, lapack_int n,
const double *in, lapack_int ldin,
double *out, lapack_int ldout );
void LAPACKE_dtz_trans( int matrix_layout, char direct, char uplo,
void API_SUFFIX(LAPACKE_dtz_trans)( int matrix_layout, char direct, char uplo,
char diag, lapack_int m, lapack_int n,
const double *in, lapack_int ldin,
double *out, lapack_int ldout );
void LAPACKE_sgb_trans( int matrix_layout, lapack_int m, lapack_int n,
void API_SUFFIX(LAPACKE_sgb_trans)( int matrix_layout, lapack_int m, lapack_int n,
lapack_int kl, lapack_int ku,
const float *in, lapack_int ldin,
float *out, lapack_int ldout );
void LAPACKE_sge_trans( int matrix_layout, lapack_int m, lapack_int n,
void API_SUFFIX(LAPACKE_sge_trans)( int matrix_layout, lapack_int m, lapack_int n,
const float* in, lapack_int ldin,
float* out, lapack_int ldout );
void LAPACKE_sgg_trans( int matrix_layout, lapack_int m, lapack_int n,
void API_SUFFIX(LAPACKE_sgg_trans)( int matrix_layout, lapack_int m, lapack_int n,
const float* in, lapack_int ldin,
float* out, lapack_int ldout );
void LAPACKE_shs_trans( int matrix_layout, lapack_int n,
void API_SUFFIX(LAPACKE_shs_trans)( int matrix_layout, lapack_int n,
const float *in, lapack_int ldin,
float *out, lapack_int ldout );
void LAPACKE_spb_trans( int matrix_layout, char uplo, lapack_int n,
void API_SUFFIX(LAPACKE_spb_trans)( int matrix_layout, char uplo, lapack_int n,
lapack_int kd,
const float *in, lapack_int ldin,
float *out, lapack_int ldout );
void LAPACKE_spf_trans( int matrix_layout, char transr, char uplo,
void API_SUFFIX(LAPACKE_spf_trans)( int matrix_layout, char transr, char uplo,
lapack_int n, const float *in,
float *out );
void LAPACKE_spo_trans( int matrix_layout, char uplo, lapack_int n,
void API_SUFFIX(LAPACKE_spo_trans)( int matrix_layout, char uplo, lapack_int n,
const float *in, lapack_int ldin,
float *out, lapack_int ldout );
void LAPACKE_spp_trans( int matrix_layout, char uplo, lapack_int n,
void API_SUFFIX(LAPACKE_spp_trans)( int matrix_layout, char uplo, lapack_int n,
const float *in,
float *out );
void LAPACKE_ssb_trans( int matrix_layout, char uplo, lapack_int n,
void API_SUFFIX(LAPACKE_ssb_trans)( int matrix_layout, char uplo, lapack_int n,
lapack_int kd,
const float *in, lapack_int ldin,
float *out, lapack_int ldout );
void LAPACKE_ssp_trans( int matrix_layout, char uplo, lapack_int n,
void API_SUFFIX(LAPACKE_ssp_trans)( int matrix_layout, char uplo, lapack_int n,
const float *in,
float *out );
void LAPACKE_ssy_trans( int matrix_layout, char uplo, lapack_int n,
void API_SUFFIX(LAPACKE_ssy_trans)( int matrix_layout, char uplo, lapack_int n,
const float *in, lapack_int ldin,
float *out, lapack_int ldout );
void LAPACKE_stb_trans( int matrix_layout, char uplo, char diag,
void API_SUFFIX(LAPACKE_stb_trans)( int matrix_layout, char uplo, char diag,
lapack_int n, lapack_int kd,
const float *in, lapack_int ldin,
float *out, lapack_int ldout );
void LAPACKE_stf_trans( int matrix_layout, char transr, char uplo, char diag,
void API_SUFFIX(LAPACKE_stf_trans)( int matrix_layout, char transr, char uplo, char diag,
lapack_int n, const float *in,
float *out );
void LAPACKE_stp_trans( int matrix_layout, char uplo, char diag,
void API_SUFFIX(LAPACKE_stp_trans)( int matrix_layout, char uplo, char diag,
lapack_int n, const float *in,
float *out );
void LAPACKE_str_trans( int matrix_layout, char uplo, char diag, lapack_int n,
void API_SUFFIX(LAPACKE_str_trans)( int matrix_layout, char uplo, char diag, lapack_int n,
const float *in, lapack_int ldin,
float *out, lapack_int ldout );
void LAPACKE_stz_trans( int matrix_layout, char direct, char uplo,
void API_SUFFIX(LAPACKE_stz_trans)( int matrix_layout, char direct, char uplo,
char diag, lapack_int m, lapack_int n,
const float *in, lapack_int ldin,
float *out, lapack_int ldout );
void LAPACKE_zgb_trans( int matrix_layout, lapack_int m, lapack_int n,
void API_SUFFIX(LAPACKE_zgb_trans)( int matrix_layout, lapack_int m, lapack_int n,
lapack_int kl, lapack_int ku,
const lapack_complex_double *in, lapack_int ldin,
lapack_complex_double *out, lapack_int ldout );
void LAPACKE_zge_trans( int matrix_layout, lapack_int m, lapack_int n,
void API_SUFFIX(LAPACKE_zge_trans)( int matrix_layout, lapack_int m, lapack_int n,
const lapack_complex_double* in, lapack_int ldin,
lapack_complex_double* out, lapack_int ldout );
void LAPACKE_zgg_trans( int matrix_layout, lapack_int m, lapack_int n,
void API_SUFFIX(LAPACKE_zgg_trans)( int matrix_layout, lapack_int m, lapack_int n,
const lapack_complex_double* in, lapack_int ldin,
lapack_complex_double* out, lapack_int ldout );
void LAPACKE_zhb_trans( int matrix_layout, char uplo, lapack_int n,
void API_SUFFIX(LAPACKE_zhb_trans)( int matrix_layout, char uplo, lapack_int n,
lapack_int kd,
const lapack_complex_double *in, lapack_int ldin,
lapack_complex_double *out, lapack_int ldout );
void LAPACKE_zhe_trans( int matrix_layout, char uplo, lapack_int n,
void API_SUFFIX(LAPACKE_zhe_trans)( int matrix_layout, char uplo, lapack_int n,
const lapack_complex_double *in, lapack_int ldin,
lapack_complex_double *out, lapack_int ldout );
void LAPACKE_zhp_trans( int matrix_layout, char uplo, lapack_int n,
void API_SUFFIX(LAPACKE_zhp_trans)( int matrix_layout, char uplo, lapack_int n,
const lapack_complex_double *in,
lapack_complex_double *out );
void LAPACKE_zhs_trans( int matrix_layout, lapack_int n,
void API_SUFFIX(LAPACKE_zhs_trans)( int matrix_layout, lapack_int n,
const lapack_complex_double *in, lapack_int ldin,
lapack_complex_double *out, lapack_int ldout );
void LAPACKE_zpb_trans( int matrix_layout, char uplo, lapack_int n,
void API_SUFFIX(LAPACKE_zpb_trans)( int matrix_layout, char uplo, lapack_int n,
lapack_int kd,
const lapack_complex_double *in, lapack_int ldin,
lapack_complex_double *out, lapack_int ldout );
void LAPACKE_zpf_trans( int matrix_layout, char transr, char uplo,
void API_SUFFIX(LAPACKE_zpf_trans)( int matrix_layout, char transr, char uplo,
lapack_int n, const lapack_complex_double *in,
lapack_complex_double *out );
void LAPACKE_zpo_trans( int matrix_layout, char uplo, lapack_int n,
void API_SUFFIX(LAPACKE_zpo_trans)( int matrix_layout, char uplo, lapack_int n,
const lapack_complex_double *in, lapack_int ldin,
lapack_complex_double *out, lapack_int ldout );
void LAPACKE_zpp_trans( int matrix_layout, char uplo, lapack_int n,
void API_SUFFIX(LAPACKE_zpp_trans)( int matrix_layout, char uplo, lapack_int n,
const lapack_complex_double *in,
lapack_complex_double *out );
void LAPACKE_zsp_trans( int matrix_layout, char uplo, lapack_int n,
void API_SUFFIX(LAPACKE_zsp_trans)( int matrix_layout, char uplo, lapack_int n,
const lapack_complex_double *in,
lapack_complex_double *out );
void LAPACKE_zsy_trans( int matrix_layout, char uplo, lapack_int n,
void API_SUFFIX(LAPACKE_zsy_trans)( int matrix_layout, char uplo, lapack_int n,
const lapack_complex_double *in, lapack_int ldin,
lapack_complex_double *out, lapack_int ldout );
void LAPACKE_ztb_trans( int matrix_layout, char uplo, char diag,
void API_SUFFIX(LAPACKE_ztb_trans)( int matrix_layout, char uplo, char diag,
lapack_int n, lapack_int kd,
const lapack_complex_double *in, lapack_int ldin,
lapack_complex_double *out, lapack_int ldout );
void LAPACKE_ztf_trans( int matrix_layout, char transr, char uplo, char diag,
void API_SUFFIX(LAPACKE_ztf_trans)( int matrix_layout, char transr, char uplo, char diag,
lapack_int n, const lapack_complex_double *in,
lapack_complex_double *out );
void LAPACKE_ztp_trans( int matrix_layout, char uplo, char diag,
void API_SUFFIX(LAPACKE_ztp_trans)( int matrix_layout, char uplo, char diag,
lapack_int n, const lapack_complex_double *in,
lapack_complex_double *out );
void LAPACKE_ztr_trans( int matrix_layout, char uplo, char diag, lapack_int n,
void API_SUFFIX(LAPACKE_ztr_trans)( int matrix_layout, char uplo, char diag, lapack_int n,
const lapack_complex_double *in, lapack_int ldin,
lapack_complex_double *out, lapack_int ldout );
void LAPACKE_ztz_trans( int matrix_layout, char direct, char uplo,
void API_SUFFIX(LAPACKE_ztz_trans)( int matrix_layout, char direct, char uplo,
char diag, lapack_int m, lapack_int n,
const lapack_complex_double *in, lapack_int ldin,
lapack_complex_double *out, lapack_int ldout );
@@ -310,297 +310,297 @@ void LAPACKE_ztz_trans( int matrix_layout, char direct, char uplo,
LAPACK_DISNAN(*(((double*)&x)+1)) )
/* NaN checkers for vectors */
lapack_logical LAPACKE_c_nancheck( lapack_int n,
lapack_logical API_SUFFIX(LAPACKE_c_nancheck)( lapack_int n,
const lapack_complex_float *x,
lapack_int incx );
lapack_logical LAPACKE_d_nancheck( lapack_int n,
lapack_logical API_SUFFIX(LAPACKE_d_nancheck)( lapack_int n,
const double *x,
lapack_int incx );
lapack_logical LAPACKE_s_nancheck( lapack_int n,
lapack_logical API_SUFFIX(LAPACKE_s_nancheck)( lapack_int n,
const float *x,
lapack_int incx );
lapack_logical LAPACKE_z_nancheck( lapack_int n,
lapack_logical API_SUFFIX(LAPACKE_z_nancheck)( lapack_int n,
const lapack_complex_double *x,
lapack_int incx );
/* NaN checkers for matrices */
lapack_logical LAPACKE_cgb_nancheck( int matrix_layout, lapack_int m,
lapack_logical API_SUFFIX(LAPACKE_cgb_nancheck)( int matrix_layout, lapack_int m,
lapack_int n, lapack_int kl,
lapack_int ku,
const lapack_complex_float *ab,
lapack_int ldab );
lapack_logical LAPACKE_cge_nancheck( int matrix_layout, lapack_int m,
lapack_logical API_SUFFIX(LAPACKE_cge_nancheck)( int matrix_layout, lapack_int m,
lapack_int n,
const lapack_complex_float *a,
lapack_int lda );
lapack_logical LAPACKE_cgg_nancheck( int matrix_layout, lapack_int m,
lapack_logical API_SUFFIX(LAPACKE_cgg_nancheck)( int matrix_layout, lapack_int m,
lapack_int n,
const lapack_complex_float *a,
lapack_int lda );
lapack_logical LAPACKE_cgt_nancheck( lapack_int n,
lapack_logical API_SUFFIX(LAPACKE_cgt_nancheck)( lapack_int n,
const lapack_complex_float *dl,
const lapack_complex_float *d,
const lapack_complex_float *du );
lapack_logical LAPACKE_chb_nancheck( int matrix_layout, char uplo,
lapack_logical API_SUFFIX(LAPACKE_chb_nancheck)( int matrix_layout, char uplo,
lapack_int n, lapack_int kd,
const lapack_complex_float* ab,
lapack_int ldab );
lapack_logical LAPACKE_che_nancheck( int matrix_layout, char uplo,
lapack_logical API_SUFFIX(LAPACKE_che_nancheck)( int matrix_layout, char uplo,
lapack_int n,
const lapack_complex_float *a,
lapack_int lda );
lapack_logical LAPACKE_chp_nancheck( lapack_int n,
lapack_logical API_SUFFIX(LAPACKE_chp_nancheck)( lapack_int n,
const lapack_complex_float *ap );
lapack_logical LAPACKE_chs_nancheck( int matrix_layout, lapack_int n,
lapack_logical API_SUFFIX(LAPACKE_chs_nancheck)( int matrix_layout, lapack_int n,
const lapack_complex_float *a,
lapack_int lda );
lapack_logical LAPACKE_cpb_nancheck( int matrix_layout, char uplo,
lapack_logical API_SUFFIX(LAPACKE_cpb_nancheck)( int matrix_layout, char uplo,
lapack_int n, lapack_int kd,
const lapack_complex_float* ab,
lapack_int ldab );
lapack_logical LAPACKE_cpf_nancheck( lapack_int n,
lapack_logical API_SUFFIX(LAPACKE_cpf_nancheck)( lapack_int n,
const lapack_complex_float *a );
lapack_logical LAPACKE_cpo_nancheck( int matrix_layout, char uplo,
lapack_logical API_SUFFIX(LAPACKE_cpo_nancheck)( int matrix_layout, char uplo,
lapack_int n,
const lapack_complex_float *a,
lapack_int lda );
lapack_logical LAPACKE_cpp_nancheck( lapack_int n,
lapack_logical API_SUFFIX(LAPACKE_cpp_nancheck)( lapack_int n,
const lapack_complex_float *ap );
lapack_logical LAPACKE_cpt_nancheck( lapack_int n,
lapack_logical API_SUFFIX(LAPACKE_cpt_nancheck)( lapack_int n,
const float *d,
const lapack_complex_float *e );
lapack_logical LAPACKE_csp_nancheck( lapack_int n,
lapack_logical API_SUFFIX(LAPACKE_csp_nancheck)( lapack_int n,
const lapack_complex_float *ap );
lapack_logical LAPACKE_cst_nancheck( lapack_int n,
lapack_logical API_SUFFIX(LAPACKE_cst_nancheck)( lapack_int n,
const lapack_complex_float *d,
const lapack_complex_float *e );
lapack_logical LAPACKE_csy_nancheck( int matrix_layout, char uplo,
lapack_logical API_SUFFIX(LAPACKE_csy_nancheck)( int matrix_layout, char uplo,
lapack_int n,
const lapack_complex_float *a,
lapack_int lda );
lapack_logical LAPACKE_ctb_nancheck( int matrix_layout, char uplo, char diag,
lapack_logical API_SUFFIX(LAPACKE_ctb_nancheck)( int matrix_layout, char uplo, char diag,
lapack_int n, lapack_int kd,
const lapack_complex_float* ab,
lapack_int ldab );
lapack_logical LAPACKE_ctf_nancheck( int matrix_layout, char transr,
lapack_logical API_SUFFIX(LAPACKE_ctf_nancheck)( int matrix_layout, char transr,
char uplo, char diag,
lapack_int n,
const lapack_complex_float *a );
lapack_logical LAPACKE_ctp_nancheck( int matrix_layout, char uplo, char diag,
lapack_logical API_SUFFIX(LAPACKE_ctp_nancheck)( int matrix_layout, char uplo, char diag,
lapack_int n,
const lapack_complex_float *ap );
lapack_logical LAPACKE_ctr_nancheck( int matrix_layout, char uplo, char diag,
lapack_logical API_SUFFIX(LAPACKE_ctr_nancheck)( int matrix_layout, char uplo, char diag,
lapack_int n,
const lapack_complex_float *a,
lapack_int lda );
lapack_logical LAPACKE_ctz_nancheck( int matrix_layout, char direct, char uplo,
lapack_logical API_SUFFIX(LAPACKE_ctz_nancheck)( int matrix_layout, char direct, char uplo,
char diag, lapack_int m, lapack_int n,
const lapack_complex_float *a,
lapack_int lda );
lapack_logical LAPACKE_dgb_nancheck( int matrix_layout, lapack_int m,
lapack_logical API_SUFFIX(LAPACKE_dgb_nancheck)( int matrix_layout, lapack_int m,
lapack_int n, lapack_int kl,
lapack_int ku,
const double *ab,
lapack_int ldab );
lapack_logical LAPACKE_dge_nancheck( int matrix_layout, lapack_int m,
lapack_logical API_SUFFIX(LAPACKE_dge_nancheck)( int matrix_layout, lapack_int m,
lapack_int n,
const double *a,
lapack_int lda );
lapack_logical LAPACKE_dgg_nancheck( int matrix_layout, lapack_int m,
lapack_logical API_SUFFIX(LAPACKE_dgg_nancheck)( int matrix_layout, lapack_int m,
lapack_int n,
const double *a,
lapack_int lda );
lapack_logical LAPACKE_dgt_nancheck( lapack_int n,
lapack_logical API_SUFFIX(LAPACKE_dgt_nancheck)( lapack_int n,
const double *dl,
const double *d,
const double *du );
lapack_logical LAPACKE_dhs_nancheck( int matrix_layout, lapack_int n,
lapack_logical API_SUFFIX(LAPACKE_dhs_nancheck)( int matrix_layout, lapack_int n,
const double *a,
lapack_int lda );
lapack_logical LAPACKE_dpb_nancheck( int matrix_layout, char uplo,
lapack_logical API_SUFFIX(LAPACKE_dpb_nancheck)( int matrix_layout, char uplo,
lapack_int n, lapack_int kd,
const double* ab,
lapack_int ldab );
lapack_logical LAPACKE_dpf_nancheck( lapack_int n,
lapack_logical API_SUFFIX(LAPACKE_dpf_nancheck)( lapack_int n,
const double *a );
lapack_logical LAPACKE_dpo_nancheck( int matrix_layout, char uplo,
lapack_logical API_SUFFIX(LAPACKE_dpo_nancheck)( int matrix_layout, char uplo,
lapack_int n,
const double *a,
lapack_int lda );
lapack_logical LAPACKE_dpp_nancheck( lapack_int n,
lapack_logical API_SUFFIX(LAPACKE_dpp_nancheck)( lapack_int n,
const double *ap );
lapack_logical LAPACKE_dpt_nancheck( lapack_int n,
lapack_logical API_SUFFIX(LAPACKE_dpt_nancheck)( lapack_int n,
const double *d,
const double *e );
lapack_logical LAPACKE_dsb_nancheck( int matrix_layout, char uplo,
lapack_logical API_SUFFIX(LAPACKE_dsb_nancheck)( int matrix_layout, char uplo,
lapack_int n, lapack_int kd,
const double* ab,
lapack_int ldab );
lapack_logical LAPACKE_dsp_nancheck( lapack_int n,
lapack_logical API_SUFFIX(LAPACKE_dsp_nancheck)( lapack_int n,
const double *ap );
lapack_logical LAPACKE_dst_nancheck( lapack_int n,
lapack_logical API_SUFFIX(LAPACKE_dst_nancheck)( lapack_int n,
const double *d,
const double *e );
lapack_logical LAPACKE_dsy_nancheck( int matrix_layout, char uplo,
lapack_logical API_SUFFIX(LAPACKE_dsy_nancheck)( int matrix_layout, char uplo,
lapack_int n,
const double *a,
lapack_int lda );
lapack_logical LAPACKE_dtb_nancheck( int matrix_layout, char uplo, char diag,
lapack_logical API_SUFFIX(LAPACKE_dtb_nancheck)( int matrix_layout, char uplo, char diag,
lapack_int n, lapack_int kd,
const double* ab,
lapack_int ldab );
lapack_logical LAPACKE_dtf_nancheck( int matrix_layout, char transr,
lapack_logical API_SUFFIX(LAPACKE_dtf_nancheck)( int matrix_layout, char transr,
char uplo, char diag,
lapack_int n,
const double *a );
lapack_logical LAPACKE_dtp_nancheck( int matrix_layout, char uplo, char diag,
lapack_logical API_SUFFIX(LAPACKE_dtp_nancheck)( int matrix_layout, char uplo, char diag,
lapack_int n,
const double *ap );
lapack_logical LAPACKE_dtr_nancheck( int matrix_layout, char uplo, char diag,
lapack_logical API_SUFFIX(LAPACKE_dtr_nancheck)( int matrix_layout, char uplo, char diag,
lapack_int n,
const double *a,
lapack_int lda );
lapack_logical LAPACKE_dtz_nancheck( int matrix_layout, char direct, char uplo,
lapack_logical API_SUFFIX(LAPACKE_dtz_nancheck)( int matrix_layout, char direct, char uplo,
char diag, lapack_int m, lapack_int n,
const double *a, lapack_int lda );
lapack_logical LAPACKE_sgb_nancheck( int matrix_layout, lapack_int m,
lapack_logical API_SUFFIX(LAPACKE_sgb_nancheck)( int matrix_layout, lapack_int m,
lapack_int n, lapack_int kl,
lapack_int ku,
const float *ab,
lapack_int ldab );
lapack_logical LAPACKE_sge_nancheck( int matrix_layout, lapack_int m,
lapack_logical API_SUFFIX(LAPACKE_sge_nancheck)( int matrix_layout, lapack_int m,
lapack_int n,
const float *a,
lapack_int lda );
lapack_logical LAPACKE_sgg_nancheck( int matrix_layout, lapack_int m,
lapack_logical API_SUFFIX(LAPACKE_sgg_nancheck)( int matrix_layout, lapack_int m,
lapack_int n,
const float *a,
lapack_int lda );
lapack_logical LAPACKE_sgt_nancheck( lapack_int n,
lapack_logical API_SUFFIX(LAPACKE_sgt_nancheck)( lapack_int n,
const float *dl,
const float *d,
const float *du );
lapack_logical LAPACKE_shs_nancheck( int matrix_layout, lapack_int n,
lapack_logical API_SUFFIX(LAPACKE_shs_nancheck)( int matrix_layout, lapack_int n,
const float *a,
lapack_int lda );
lapack_logical LAPACKE_spb_nancheck( int matrix_layout, char uplo,
lapack_logical API_SUFFIX(LAPACKE_spb_nancheck)( int matrix_layout, char uplo,
lapack_int n, lapack_int kd,
const float* ab,
lapack_int ldab );
lapack_logical LAPACKE_spf_nancheck( lapack_int n,
lapack_logical API_SUFFIX(LAPACKE_spf_nancheck)( lapack_int n,
const float *a );
lapack_logical LAPACKE_spo_nancheck( int matrix_layout, char uplo,
lapack_logical API_SUFFIX(LAPACKE_spo_nancheck)( int matrix_layout, char uplo,
lapack_int n,
const float *a,
lapack_int lda );
lapack_logical LAPACKE_spp_nancheck( lapack_int n,
lapack_logical API_SUFFIX(LAPACKE_spp_nancheck)( lapack_int n,
const float *ap );
lapack_logical LAPACKE_spt_nancheck( lapack_int n,
lapack_logical API_SUFFIX(LAPACKE_spt_nancheck)( lapack_int n,
const float *d,
const float *e );
lapack_logical LAPACKE_ssb_nancheck( int matrix_layout, char uplo,
lapack_logical API_SUFFIX(LAPACKE_ssb_nancheck)( int matrix_layout, char uplo,
lapack_int n, lapack_int kd,
const float* ab,
lapack_int ldab );
lapack_logical LAPACKE_ssp_nancheck( lapack_int n,
lapack_logical API_SUFFIX(LAPACKE_ssp_nancheck)( lapack_int n,
const float *ap );
lapack_logical LAPACKE_sst_nancheck( lapack_int n,
lapack_logical API_SUFFIX(LAPACKE_sst_nancheck)( lapack_int n,
const float *d,
const float *e );
lapack_logical LAPACKE_ssy_nancheck( int matrix_layout, char uplo,
lapack_logical API_SUFFIX(LAPACKE_ssy_nancheck)( int matrix_layout, char uplo,
lapack_int n,
const float *a,
lapack_int lda );
lapack_logical LAPACKE_stb_nancheck( int matrix_layout, char uplo, char diag,
lapack_logical API_SUFFIX(LAPACKE_stb_nancheck)( int matrix_layout, char uplo, char diag,
lapack_int n, lapack_int kd,
const float* ab,
lapack_int ldab );
lapack_logical LAPACKE_stf_nancheck( int matrix_layout, char transr,
lapack_logical API_SUFFIX(LAPACKE_stf_nancheck)( int matrix_layout, char transr,
char uplo, char diag,
lapack_int n,
const float *a );
lapack_logical LAPACKE_stp_nancheck( int matrix_layout, char uplo, char diag,
lapack_logical API_SUFFIX(LAPACKE_stp_nancheck)( int matrix_layout, char uplo, char diag,
lapack_int n,
const float *ap );
lapack_logical LAPACKE_str_nancheck( int matrix_layout, char uplo, char diag,
lapack_logical API_SUFFIX(LAPACKE_str_nancheck)( int matrix_layout, char uplo, char diag,
lapack_int n,
const float *a,
lapack_int lda );
lapack_logical LAPACKE_stz_nancheck( int matrix_layout, char direct, char uplo,
lapack_logical API_SUFFIX(LAPACKE_stz_nancheck)( int matrix_layout, char direct, char uplo,
char diag, lapack_int m, lapack_int n,
const float *a, lapack_int lda );
lapack_logical LAPACKE_zgb_nancheck( int matrix_layout, lapack_int m,
lapack_logical API_SUFFIX(LAPACKE_zgb_nancheck)( int matrix_layout, lapack_int m,
lapack_int n, lapack_int kl,
lapack_int ku,
const lapack_complex_double *ab,
lapack_int ldab );
lapack_logical LAPACKE_zge_nancheck( int matrix_layout, lapack_int m,
lapack_logical API_SUFFIX(LAPACKE_zge_nancheck)( int matrix_layout, lapack_int m,
lapack_int n,
const lapack_complex_double *a,
lapack_int lda );
lapack_logical LAPACKE_zgg_nancheck( int matrix_layout, lapack_int m,
lapack_logical API_SUFFIX(LAPACKE_zgg_nancheck)( int matrix_layout, lapack_int m,
lapack_int n,
const lapack_complex_double *a,
lapack_int lda );
lapack_logical LAPACKE_zgt_nancheck( lapack_int n,
lapack_logical API_SUFFIX(LAPACKE_zgt_nancheck)( lapack_int n,
const lapack_complex_double *dl,
const lapack_complex_double *d,
const lapack_complex_double *du );
lapack_logical LAPACKE_zhb_nancheck( int matrix_layout, char uplo,
lapack_logical API_SUFFIX(LAPACKE_zhb_nancheck)( int matrix_layout, char uplo,
lapack_int n, lapack_int kd,
const lapack_complex_double* ab,
lapack_int ldab );
lapack_logical LAPACKE_zhe_nancheck( int matrix_layout, char uplo,
lapack_logical API_SUFFIX(LAPACKE_zhe_nancheck)( int matrix_layout, char uplo,
lapack_int n,
const lapack_complex_double *a,
lapack_int lda );
lapack_logical LAPACKE_zhp_nancheck( lapack_int n,
lapack_logical API_SUFFIX(LAPACKE_zhp_nancheck)( lapack_int n,
const lapack_complex_double *ap );
lapack_logical LAPACKE_zhs_nancheck( int matrix_layout, lapack_int n,
lapack_logical API_SUFFIX(LAPACKE_zhs_nancheck)( int matrix_layout, lapack_int n,
const lapack_complex_double *a,
lapack_int lda );
lapack_logical LAPACKE_zpb_nancheck( int matrix_layout, char uplo,
lapack_logical API_SUFFIX(LAPACKE_zpb_nancheck)( int matrix_layout, char uplo,
lapack_int n, lapack_int kd,
const lapack_complex_double* ab,
lapack_int ldab );
lapack_logical LAPACKE_zpf_nancheck( lapack_int n,
lapack_logical API_SUFFIX(LAPACKE_zpf_nancheck)( lapack_int n,
const lapack_complex_double *a );
lapack_logical LAPACKE_zpo_nancheck( int matrix_layout, char uplo,
lapack_logical API_SUFFIX(LAPACKE_zpo_nancheck)( int matrix_layout, char uplo,
lapack_int n,
const lapack_complex_double *a,
lapack_int lda );
lapack_logical LAPACKE_zpp_nancheck( lapack_int n,
lapack_logical API_SUFFIX(LAPACKE_zpp_nancheck)( lapack_int n,
const lapack_complex_double *ap );
lapack_logical LAPACKE_zpt_nancheck( lapack_int n,
lapack_logical API_SUFFIX(LAPACKE_zpt_nancheck)( lapack_int n,
const double *d,
const lapack_complex_double *e );
lapack_logical LAPACKE_zsp_nancheck( lapack_int n,
lapack_logical API_SUFFIX(LAPACKE_zsp_nancheck)( lapack_int n,
const lapack_complex_double *ap );
lapack_logical LAPACKE_zst_nancheck( lapack_int n,
lapack_logical API_SUFFIX(LAPACKE_zst_nancheck)( lapack_int n,
const lapack_complex_double *d,
const lapack_complex_double *e );
lapack_logical LAPACKE_zsy_nancheck( int matrix_layout, char uplo,
lapack_logical API_SUFFIX(LAPACKE_zsy_nancheck)( int matrix_layout, char uplo,
lapack_int n,
const lapack_complex_double *a,
lapack_int lda );
lapack_logical LAPACKE_ztb_nancheck( int matrix_layout, char uplo, char diag,
lapack_logical API_SUFFIX(LAPACKE_ztb_nancheck)( int matrix_layout, char uplo, char diag,
lapack_int n, lapack_int kd,
const lapack_complex_double* ab,
lapack_int ldab );
lapack_logical LAPACKE_ztf_nancheck( int matrix_layout, char transr,
lapack_logical API_SUFFIX(LAPACKE_ztf_nancheck)( int matrix_layout, char transr,
char uplo, char diag,
lapack_int n,
const lapack_complex_double *a );
lapack_logical LAPACKE_ztp_nancheck( int matrix_layout, char uplo, char diag,
lapack_logical API_SUFFIX(LAPACKE_ztp_nancheck)( int matrix_layout, char uplo, char diag,
lapack_int n,
const lapack_complex_double *ap );
lapack_logical LAPACKE_ztr_nancheck( int matrix_layout, char uplo, char diag,
lapack_logical API_SUFFIX(LAPACKE_ztr_nancheck)( int matrix_layout, char uplo, char diag,
lapack_int n,
const lapack_complex_double *a,
lapack_int lda );
lapack_logical LAPACKE_ztz_nancheck( int matrix_layout, char direct, char uplo,
lapack_logical API_SUFFIX(LAPACKE_ztz_nancheck)( int matrix_layout, char direct, char uplo,
char diag, lapack_int m, lapack_int n,
const lapack_complex_double *a,
lapack_int lda );
+16 -16
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cbbcsd( int matrix_layout, char jobu1, char jobu2,
lapack_int API_SUFFIX(LAPACKE_cbbcsd)( int matrix_layout, char jobu1, char jobu2,
char jobv1t, char jobv2t, char trans, lapack_int m,
lapack_int p, lapack_int q, float* theta, float* phi,
lapack_complex_float* u1, lapack_int ldu1,
@@ -48,10 +48,10 @@ lapack_int LAPACKE_cbbcsd( int matrix_layout, char jobu1, char jobu2,
float rwork_query;
int lapack_layout;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_cbbcsd", -1 );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cbbcsd", -1 );
return -1;
}
if( LAPACKE_lsame( trans, 'n' ) && matrix_layout == LAPACK_COL_MAJOR ) {
if( API_SUFFIX(LAPACKE_lsame)( trans, 'n' ) && matrix_layout == LAPACK_COL_MAJOR ) {
lapack_layout = LAPACK_COL_MAJOR;
} else {
lapack_layout = LAPACK_ROW_MAJOR;
@@ -59,36 +59,36 @@ lapack_int LAPACKE_cbbcsd( int matrix_layout, char jobu1, char jobu2,
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_s_nancheck( q-1, phi, 1 ) ) {
if( API_SUFFIX(LAPACKE_s_nancheck)( q-1, phi, 1 ) ) {
return -11;
}
if( LAPACKE_s_nancheck( q, theta, 1 ) ) {
if( API_SUFFIX(LAPACKE_s_nancheck)( q, theta, 1 ) ) {
return -10;
}
if( LAPACKE_lsame( jobu1, 'y' ) ) {
if( LAPACKE_cge_nancheck( lapack_layout, p, p, u1, ldu1 ) ) {
if( API_SUFFIX(LAPACKE_lsame)( jobu1, 'y' ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( lapack_layout, p, p, u1, ldu1 ) ) {
return -12;
}
}
if( LAPACKE_lsame( jobu2, 'y' ) ) {
if( LAPACKE_cge_nancheck( lapack_layout, m-p, m-p, u2, ldu2 ) ) {
if( API_SUFFIX(LAPACKE_lsame)( jobu2, 'y' ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( lapack_layout, m-p, m-p, u2, ldu2 ) ) {
return -14;
}
}
if( LAPACKE_lsame( jobv1t, 'y' ) ) {
if( LAPACKE_cge_nancheck( lapack_layout, q, q, v1t, ldv1t ) ) {
if( API_SUFFIX(LAPACKE_lsame)( jobv1t, 'y' ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( lapack_layout, q, q, v1t, ldv1t ) ) {
return -16;
}
}
if( LAPACKE_lsame( jobv2t, 'y' ) ) {
if( LAPACKE_cge_nancheck( lapack_layout, m-q, m-q, v2t, ldv2t ) ) {
if( API_SUFFIX(LAPACKE_lsame)( jobv2t, 'y' ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( lapack_layout, m-q, m-q, v2t, ldv2t ) ) {
return -18;
}
}
}
#endif
/* Query optimal working array(s) size */
info = LAPACKE_cbbcsd_work( matrix_layout, jobu1, jobu2, jobv1t, jobv2t,
info = API_SUFFIX(LAPACKE_cbbcsd_work)( matrix_layout, jobu1, jobu2, jobv1t, jobv2t,
trans, m, p, q, theta, phi, u1, ldu1, u2, ldu2,
v1t, ldv1t, v2t, ldv2t, b11d, b11e, b12d, b12e,
b21d, b21e, b22d, b22e, &rwork_query, lrwork );
@@ -103,7 +103,7 @@ lapack_int LAPACKE_cbbcsd( int matrix_layout, char jobu1, char jobu2,
goto exit_level_0;
}
/* Call middle-level interface */
info = LAPACKE_cbbcsd_work( matrix_layout, jobu1, jobu2, jobv1t, jobv2t,
info = API_SUFFIX(LAPACKE_cbbcsd_work)( matrix_layout, jobu1, jobu2, jobv1t, jobv2t,
trans, m, p, q, theta, phi, u1, ldu1, u2, ldu2,
v1t, ldv1t, v2t, ldv2t, b11d, b11e, b12d, b12e,
b21d, b21e, b22d, b22e, rwork, lrwork );
@@ -111,7 +111,7 @@ lapack_int LAPACKE_cbbcsd( int matrix_layout, char jobu1, char jobu2,
LAPACKE_free( rwork );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cbbcsd", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cbbcsd", info );
}
return info;
}
+3 -3
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cbbcsd_work( int matrix_layout, char jobu1, char jobu2,
lapack_int API_SUFFIX(LAPACKE_cbbcsd_work)( int matrix_layout, char jobu1, char jobu2,
char jobv1t, char jobv2t, char trans,
lapack_int m, lapack_int p, lapack_int q,
float* theta, float* phi,
@@ -63,7 +63,7 @@ lapack_int LAPACKE_cbbcsd_work( int matrix_layout, char jobu1, char jobu2,
if( matrix_layout == LAPACK_COL_MAJOR ||
matrix_layout == LAPACK_ROW_MAJOR ) {
char ltrans;
if( !LAPACKE_lsame( trans, 't' ) && matrix_layout == LAPACK_COL_MAJOR ) {
if( !API_SUFFIX(LAPACKE_lsame)( trans, 't' ) && matrix_layout == LAPACK_COL_MAJOR ) {
ltrans = 'n';
} else {
ltrans = 't';
@@ -78,7 +78,7 @@ lapack_int LAPACKE_cbbcsd_work( int matrix_layout, char jobu1, char jobu2,
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_cbbcsd_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cbbcsd_work", info );
}
return info;
}
+9 -9
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cbdsqr( int matrix_layout, char uplo, lapack_int n,
lapack_int API_SUFFIX(LAPACKE_cbdsqr)( int matrix_layout, char uplo, lapack_int n,
lapack_int ncvt, lapack_int nru, lapack_int ncc,
float* d, float* e, lapack_complex_float* vt,
lapack_int ldvt, lapack_complex_float* u,
@@ -42,30 +42,30 @@ lapack_int LAPACKE_cbdsqr( int matrix_layout, char uplo, lapack_int n,
lapack_int info = 0;
float* work = NULL;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_cbdsqr", -1 );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cbdsqr", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( ncc != 0 ) {
if( LAPACKE_cge_nancheck( matrix_layout, n, ncc, c, ldc ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, n, ncc, c, ldc ) ) {
return -13;
}
}
if( LAPACKE_s_nancheck( n, d, 1 ) ) {
if( API_SUFFIX(LAPACKE_s_nancheck)( n, d, 1 ) ) {
return -7;
}
if( LAPACKE_s_nancheck( n-1, e, 1 ) ) {
if( API_SUFFIX(LAPACKE_s_nancheck)( n-1, e, 1 ) ) {
return -8;
}
if( nru != 0 ) {
if( LAPACKE_cge_nancheck( matrix_layout, nru, n, u, ldu ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, nru, n, u, ldu ) ) {
return -11;
}
}
if( ncvt != 0 ) {
if( LAPACKE_cge_nancheck( matrix_layout, n, ncvt, vt, ldvt ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, n, ncvt, vt, ldvt ) ) {
return -9;
}
}
@@ -78,13 +78,13 @@ lapack_int LAPACKE_cbdsqr( int matrix_layout, char uplo, lapack_int n,
goto exit_level_0;
}
/* Call middle-level interface */
info = LAPACKE_cbdsqr_work( matrix_layout, uplo, n, ncvt, nru, ncc, d, e, vt,
info = API_SUFFIX(LAPACKE_cbdsqr_work)( matrix_layout, uplo, n, ncvt, nru, ncc, d, e, vt,
ldvt, u, ldu, c, ldc, work );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cbdsqr", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cbdsqr", info );
}
return info;
}
+12 -12
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cbdsqr_work( int matrix_layout, char uplo, lapack_int n,
lapack_int API_SUFFIX(LAPACKE_cbdsqr_work)( int matrix_layout, char uplo, lapack_int n,
lapack_int ncvt, lapack_int nru, lapack_int ncc,
float* d, float* e, lapack_complex_float* vt,
lapack_int ldvt, lapack_complex_float* u,
@@ -57,17 +57,17 @@ lapack_int LAPACKE_cbdsqr_work( int matrix_layout, char uplo, lapack_int n,
/* Check leading dimension(s) */
if( ldc < ncc ) {
info = -14;
LAPACKE_xerbla( "LAPACKE_cbdsqr_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cbdsqr_work", info );
return info;
}
if( ldu < n ) {
info = -12;
LAPACKE_xerbla( "LAPACKE_cbdsqr_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cbdsqr_work", info );
return info;
}
if( ldvt < ncvt ) {
info = -10;
LAPACKE_xerbla( "LAPACKE_cbdsqr_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cbdsqr_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
@@ -100,13 +100,13 @@ lapack_int LAPACKE_cbdsqr_work( int matrix_layout, char uplo, lapack_int n,
}
/* Transpose input matrices */
if( ncvt != 0 ) {
LAPACKE_cge_trans( matrix_layout, n, ncvt, vt, ldvt, vt_t, ldvt_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, n, ncvt, vt, ldvt, vt_t, ldvt_t );
}
if( nru != 0 ) {
LAPACKE_cge_trans( matrix_layout, nru, n, u, ldu, u_t, ldu_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, nru, n, u, ldu, u_t, ldu_t );
}
if( ncc != 0 ) {
LAPACKE_cge_trans( matrix_layout, n, ncc, c, ldc, c_t, ldc_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, n, ncc, c, ldc, c_t, ldc_t );
}
/* Call LAPACK function and adjust info */
LAPACK_cbdsqr( &uplo, &n, &ncvt, &nru, &ncc, d, e, vt_t, &ldvt_t, u_t,
@@ -116,14 +116,14 @@ lapack_int LAPACKE_cbdsqr_work( int matrix_layout, char uplo, lapack_int n,
}
/* Transpose output matrices */
if( ncvt != 0 ) {
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, ncvt, vt_t, ldvt_t, vt,
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, n, ncvt, vt_t, ldvt_t, vt,
ldvt );
}
if( nru != 0 ) {
LAPACKE_cge_trans( LAPACK_COL_MAJOR, nru, n, u_t, ldu_t, u, ldu );
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, nru, n, u_t, ldu_t, u, ldu );
}
if( ncc != 0 ) {
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, ncc, c_t, ldc_t, c, ldc );
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, n, ncc, c_t, ldc_t, c, ldc );
}
/* Release memory and exit */
if( ncc != 0 ) {
@@ -139,11 +139,11 @@ exit_level_1:
}
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cbdsqr_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cbdsqr_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_cbdsqr_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cbdsqr_work", info );
}
return info;
}
+6 -6
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgbbrd( int matrix_layout, char vect, lapack_int m,
lapack_int API_SUFFIX(LAPACKE_cgbbrd)( int matrix_layout, char vect, lapack_int m,
lapack_int n, lapack_int ncc, lapack_int kl,
lapack_int ku, lapack_complex_float* ab,
lapack_int ldab, float* d, float* e,
@@ -44,17 +44,17 @@ lapack_int LAPACKE_cgbbrd( int matrix_layout, char vect, lapack_int m,
float* rwork = NULL;
lapack_complex_float* work = NULL;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_cgbbrd", -1 );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbbrd", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_cgb_nancheck( matrix_layout, m, n, kl, ku, ab, ldab ) ) {
if( API_SUFFIX(LAPACKE_cgb_nancheck)( matrix_layout, m, n, kl, ku, ab, ldab ) ) {
return -8;
}
if( ncc != 0 ) {
if( LAPACKE_cge_nancheck( matrix_layout, m, ncc, c, ldc ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, m, ncc, c, ldc ) ) {
return -16;
}
}
@@ -73,7 +73,7 @@ lapack_int LAPACKE_cgbbrd( int matrix_layout, char vect, lapack_int m,
goto exit_level_1;
}
/* Call middle-level interface */
info = LAPACKE_cgbbrd_work( matrix_layout, vect, m, n, ncc, kl, ku, ab, ldab,
info = API_SUFFIX(LAPACKE_cgbbrd_work)( matrix_layout, vect, m, n, ncc, kl, ku, ab, ldab,
d, e, q, ldq, pt, ldpt, c, ldc, work, rwork );
/* Release memory and exit */
LAPACKE_free( work );
@@ -81,7 +81,7 @@ exit_level_1:
LAPACKE_free( rwork );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgbbrd", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbbrd", info );
}
return info;
}
+19 -19
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgbbrd_work( int matrix_layout, char vect, lapack_int m,
lapack_int API_SUFFIX(LAPACKE_cgbbrd_work)( int matrix_layout, char vect, lapack_int m,
lapack_int n, lapack_int ncc, lapack_int kl,
lapack_int ku, lapack_complex_float* ab,
lapack_int ldab, float* d, float* e,
@@ -61,22 +61,22 @@ lapack_int LAPACKE_cgbbrd_work( int matrix_layout, char vect, lapack_int m,
/* Check leading dimension(s) */
if( ldab < n ) {
info = -9;
LAPACKE_xerbla( "LAPACKE_cgbbrd_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbbrd_work", info );
return info;
}
if( ldc < ncc ) {
info = -17;
LAPACKE_xerbla( "LAPACKE_cgbbrd_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbbrd_work", info );
return info;
}
if( ldpt < n ) {
info = -15;
LAPACKE_xerbla( "LAPACKE_cgbbrd_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbbrd_work", info );
return info;
}
if( ldq < m ) {
info = -13;
LAPACKE_xerbla( "LAPACKE_cgbbrd_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbbrd_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
@@ -86,7 +86,7 @@ lapack_int LAPACKE_cgbbrd_work( int matrix_layout, char vect, lapack_int m,
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
if( LAPACKE_lsame( vect, 'b' ) || LAPACKE_lsame( vect, 'q' ) ) {
if( API_SUFFIX(LAPACKE_lsame)( vect, 'b' ) || API_SUFFIX(LAPACKE_lsame)( vect, 'q' ) ) {
q_t = (lapack_complex_float*)
LAPACKE_malloc( sizeof(lapack_complex_float) *
ldq_t * MAX(1,m) );
@@ -95,7 +95,7 @@ lapack_int LAPACKE_cgbbrd_work( int matrix_layout, char vect, lapack_int m,
goto exit_level_1;
}
}
if( LAPACKE_lsame( vect, 'b' ) || LAPACKE_lsame( vect, 'p' ) ) {
if( API_SUFFIX(LAPACKE_lsame)( vect, 'b' ) || API_SUFFIX(LAPACKE_lsame)( vect, 'p' ) ) {
pt_t = (lapack_complex_float*)
LAPACKE_malloc( sizeof(lapack_complex_float) *
ldpt_t * MAX(1,n) );
@@ -114,9 +114,9 @@ lapack_int LAPACKE_cgbbrd_work( int matrix_layout, char vect, lapack_int m,
}
}
/* Transpose input matrices */
LAPACKE_cgb_trans( matrix_layout, m, n, kl, ku, ab, ldab, ab_t, ldab_t );
API_SUFFIX(LAPACKE_cgb_trans)( matrix_layout, m, n, kl, ku, ab, ldab, ab_t, ldab_t );
if( ncc != 0 ) {
LAPACKE_cge_trans( matrix_layout, m, ncc, c, ldc, c_t, ldc_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, m, ncc, c, ldc, c_t, ldc_t );
}
/* Call LAPACK function and adjust info */
LAPACK_cgbbrd( &vect, &m, &n, &ncc, &kl, &ku, ab_t, &ldab_t, d, e, q_t,
@@ -125,38 +125,38 @@ lapack_int LAPACKE_cgbbrd_work( int matrix_layout, char vect, lapack_int m,
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_cgb_trans( LAPACK_COL_MAJOR, m, n, kl, ku, ab_t, ldab_t, ab,
API_SUFFIX(LAPACKE_cgb_trans)( LAPACK_COL_MAJOR, m, n, kl, ku, ab_t, ldab_t, ab,
ldab );
if( LAPACKE_lsame( vect, 'b' ) || LAPACKE_lsame( vect, 'q' ) ) {
LAPACKE_cge_trans( LAPACK_COL_MAJOR, m, m, q_t, ldq_t, q, ldq );
if( API_SUFFIX(LAPACKE_lsame)( vect, 'b' ) || API_SUFFIX(LAPACKE_lsame)( vect, 'q' ) ) {
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, m, m, q_t, ldq_t, q, ldq );
}
if( LAPACKE_lsame( vect, 'b' ) || LAPACKE_lsame( vect, 'p' ) ) {
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, pt_t, ldpt_t, pt, ldpt );
if( API_SUFFIX(LAPACKE_lsame)( vect, 'b' ) || API_SUFFIX(LAPACKE_lsame)( vect, 'p' ) ) {
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, n, n, pt_t, ldpt_t, pt, ldpt );
}
if( ncc != 0 ) {
LAPACKE_cge_trans( LAPACK_COL_MAJOR, m, ncc, c_t, ldc_t, c, ldc );
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, m, ncc, c_t, ldc_t, c, ldc );
}
/* Release memory and exit */
if( ncc != 0 ) {
LAPACKE_free( c_t );
}
exit_level_3:
if( LAPACKE_lsame( vect, 'b' ) || LAPACKE_lsame( vect, 'p' ) ) {
if( API_SUFFIX(LAPACKE_lsame)( vect, 'b' ) || API_SUFFIX(LAPACKE_lsame)( vect, 'p' ) ) {
LAPACKE_free( pt_t );
}
exit_level_2:
if( LAPACKE_lsame( vect, 'b' ) || LAPACKE_lsame( vect, 'q' ) ) {
if( API_SUFFIX(LAPACKE_lsame)( vect, 'b' ) || API_SUFFIX(LAPACKE_lsame)( vect, 'q' ) ) {
LAPACKE_free( q_t );
}
exit_level_1:
LAPACKE_free( ab_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgbbrd_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbbrd_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_cgbbrd_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbbrd_work", info );
}
return info;
}
+6 -6
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgbcon( int matrix_layout, char norm, lapack_int n,
lapack_int API_SUFFIX(LAPACKE_cgbcon)( int matrix_layout, char norm, lapack_int n,
lapack_int kl, lapack_int ku,
const lapack_complex_float* ab, lapack_int ldab,
const lapack_int* ipiv, float anorm, float* rcond )
@@ -41,16 +41,16 @@ lapack_int LAPACKE_cgbcon( int matrix_layout, char norm, lapack_int n,
float* rwork = NULL;
lapack_complex_float* work = NULL;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_cgbcon", -1 );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbcon", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_cgb_nancheck( matrix_layout, n, n, kl, kl+ku, ab, ldab ) ) {
if( API_SUFFIX(LAPACKE_cgb_nancheck)( matrix_layout, n, n, kl, kl+ku, ab, ldab ) ) {
return -6;
}
if( LAPACKE_s_nancheck( 1, &anorm, 1 ) ) {
if( API_SUFFIX(LAPACKE_s_nancheck)( 1, &anorm, 1 ) ) {
return -9;
}
}
@@ -68,7 +68,7 @@ lapack_int LAPACKE_cgbcon( int matrix_layout, char norm, lapack_int n,
goto exit_level_1;
}
/* Call middle-level interface */
info = LAPACKE_cgbcon_work( matrix_layout, norm, n, kl, ku, ab, ldab, ipiv,
info = API_SUFFIX(LAPACKE_cgbcon_work)( matrix_layout, norm, n, kl, ku, ab, ldab, ipiv,
anorm, rcond, work, rwork );
/* Release memory and exit */
LAPACKE_free( work );
@@ -76,7 +76,7 @@ exit_level_1:
LAPACKE_free( rwork );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgbcon", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbcon", info );
}
return info;
}
+5 -5
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgbcon_work( int matrix_layout, char norm, lapack_int n,
lapack_int API_SUFFIX(LAPACKE_cgbcon_work)( int matrix_layout, char norm, lapack_int n,
lapack_int kl, lapack_int ku,
const lapack_complex_float* ab, lapack_int ldab,
const lapack_int* ipiv, float anorm,
@@ -53,7 +53,7 @@ lapack_int LAPACKE_cgbcon_work( int matrix_layout, char norm, lapack_int n,
/* Check leading dimension(s) */
if( ldab < n ) {
info = -7;
LAPACKE_xerbla( "LAPACKE_cgbcon_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbcon_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
@@ -64,7 +64,7 @@ lapack_int LAPACKE_cgbcon_work( int matrix_layout, char norm, lapack_int n,
goto exit_level_0;
}
/* Transpose input matrices */
LAPACKE_cgb_trans( matrix_layout, n, n, kl, kl+ku, ab, ldab, ab_t,
API_SUFFIX(LAPACKE_cgb_trans)( matrix_layout, n, n, kl, kl+ku, ab, ldab, ab_t,
ldab_t );
/* Call LAPACK function and adjust info */
LAPACK_cgbcon( &norm, &n, &kl, &ku, ab_t, &ldab_t, ipiv, &anorm, rcond,
@@ -76,11 +76,11 @@ lapack_int LAPACKE_cgbcon_work( int matrix_layout, char norm, lapack_int n,
LAPACKE_free( ab_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgbcon_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbcon_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_cgbcon_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbcon_work", info );
}
return info;
}
+4 -4
View File
@@ -32,24 +32,24 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgbequ( int matrix_layout, lapack_int m, lapack_int n,
lapack_int API_SUFFIX(LAPACKE_cgbequ)( int matrix_layout, lapack_int m, lapack_int n,
lapack_int kl, lapack_int ku,
const lapack_complex_float* ab, lapack_int ldab,
float* r, float* c, float* rowcnd, float* colcnd,
float* amax )
{
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_cgbequ", -1 );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbequ", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_cgb_nancheck( matrix_layout, m, n, kl, ku, ab, ldab ) ) {
if( API_SUFFIX(LAPACKE_cgb_nancheck)( matrix_layout, m, n, kl, ku, ab, ldab ) ) {
return -6;
}
}
#endif
return LAPACKE_cgbequ_work( matrix_layout, m, n, kl, ku, ab, ldab, r, c,
return API_SUFFIX(LAPACKE_cgbequ_work)( matrix_layout, m, n, kl, ku, ab, ldab, r, c,
rowcnd, colcnd, amax );
}
+5 -5
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgbequ_work( int matrix_layout, lapack_int m, lapack_int n,
lapack_int API_SUFFIX(LAPACKE_cgbequ_work)( int matrix_layout, lapack_int m, lapack_int n,
lapack_int kl, lapack_int ku,
const lapack_complex_float* ab, lapack_int ldab,
float* r, float* c, float* rowcnd,
@@ -52,7 +52,7 @@ lapack_int LAPACKE_cgbequ_work( int matrix_layout, lapack_int m, lapack_int n,
/* Check leading dimension(s) */
if( ldab < n ) {
info = -7;
LAPACKE_xerbla( "LAPACKE_cgbequ_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbequ_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
@@ -63,7 +63,7 @@ lapack_int LAPACKE_cgbequ_work( int matrix_layout, lapack_int m, lapack_int n,
goto exit_level_0;
}
/* Transpose input matrices */
LAPACKE_cgb_trans( matrix_layout, m, n, kl, ku, ab, ldab, ab_t, ldab_t );
API_SUFFIX(LAPACKE_cgb_trans)( matrix_layout, m, n, kl, ku, ab, ldab, ab_t, ldab_t );
/* Call LAPACK function and adjust info */
LAPACK_cgbequ( &m, &n, &kl, &ku, ab_t, &ldab_t, r, c, rowcnd, colcnd,
amax, &info );
@@ -74,11 +74,11 @@ lapack_int LAPACKE_cgbequ_work( int matrix_layout, lapack_int m, lapack_int n,
LAPACKE_free( ab_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgbequ_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbequ_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_cgbequ_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbequ_work", info );
}
return info;
}
+4 -4
View File
@@ -32,24 +32,24 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgbequb( int matrix_layout, lapack_int m, lapack_int n,
lapack_int API_SUFFIX(LAPACKE_cgbequb)( int matrix_layout, lapack_int m, lapack_int n,
lapack_int kl, lapack_int ku,
const lapack_complex_float* ab, lapack_int ldab,
float* r, float* c, float* rowcnd, float* colcnd,
float* amax )
{
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_cgbequb", -1 );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbequb", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_cgb_nancheck( matrix_layout, m, n, kl, ku, ab, ldab ) ) {
if( API_SUFFIX(LAPACKE_cgb_nancheck)( matrix_layout, m, n, kl, ku, ab, ldab ) ) {
return -6;
}
}
#endif
return LAPACKE_cgbequb_work( matrix_layout, m, n, kl, ku, ab, ldab, r, c,
return API_SUFFIX(LAPACKE_cgbequb_work)( matrix_layout, m, n, kl, ku, ab, ldab, r, c,
rowcnd, colcnd, amax );
}
+5 -5
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgbequb_work( int matrix_layout, lapack_int m, lapack_int n,
lapack_int API_SUFFIX(LAPACKE_cgbequb_work)( int matrix_layout, lapack_int m, lapack_int n,
lapack_int kl, lapack_int ku,
const lapack_complex_float* ab,
lapack_int ldab, float* r, float* c,
@@ -52,7 +52,7 @@ lapack_int LAPACKE_cgbequb_work( int matrix_layout, lapack_int m, lapack_int n,
/* Check leading dimension(s) */
if( ldab < n ) {
info = -7;
LAPACKE_xerbla( "LAPACKE_cgbequb_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbequb_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
@@ -63,7 +63,7 @@ lapack_int LAPACKE_cgbequb_work( int matrix_layout, lapack_int m, lapack_int n,
goto exit_level_0;
}
/* Transpose input matrices */
LAPACKE_cgb_trans( matrix_layout, m, n, kl, ku, ab, ldab, ab_t, ldab_t );
API_SUFFIX(LAPACKE_cgb_trans)( matrix_layout, m, n, kl, ku, ab, ldab, ab_t, ldab_t );
/* Call LAPACK function and adjust info */
LAPACK_cgbequb( &m, &n, &kl, &ku, ab_t, &ldab_t, r, c, rowcnd, colcnd,
amax, &info );
@@ -74,11 +74,11 @@ lapack_int LAPACKE_cgbequb_work( int matrix_layout, lapack_int m, lapack_int n,
LAPACKE_free( ab_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgbequb_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbequb_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_cgbequb_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbequb_work", info );
}
return info;
}
+8 -8
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgbrfs( int matrix_layout, char trans, lapack_int n,
lapack_int API_SUFFIX(LAPACKE_cgbrfs)( int matrix_layout, char trans, lapack_int n,
lapack_int kl, lapack_int ku, lapack_int nrhs,
const lapack_complex_float* ab, lapack_int ldab,
const lapack_complex_float* afb, lapack_int ldafb,
@@ -45,22 +45,22 @@ lapack_int LAPACKE_cgbrfs( int matrix_layout, char trans, lapack_int n,
float* rwork = NULL;
lapack_complex_float* work = NULL;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_cgbrfs", -1 );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbrfs", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_cgb_nancheck( matrix_layout, n, n, kl, ku, ab, ldab ) ) {
if( API_SUFFIX(LAPACKE_cgb_nancheck)( matrix_layout, n, n, kl, ku, ab, ldab ) ) {
return -7;
}
if( LAPACKE_cgb_nancheck( matrix_layout, n, n, kl, kl+ku, afb, ldafb ) ) {
if( API_SUFFIX(LAPACKE_cgb_nancheck)( matrix_layout, n, n, kl, kl+ku, afb, ldafb ) ) {
return -9;
}
if( LAPACKE_cge_nancheck( matrix_layout, n, nrhs, b, ldb ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, n, nrhs, b, ldb ) ) {
return -12;
}
if( LAPACKE_cge_nancheck( matrix_layout, n, nrhs, x, ldx ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, n, nrhs, x, ldx ) ) {
return -14;
}
}
@@ -78,7 +78,7 @@ lapack_int LAPACKE_cgbrfs( int matrix_layout, char trans, lapack_int n,
goto exit_level_1;
}
/* Call middle-level interface */
info = LAPACKE_cgbrfs_work( matrix_layout, trans, n, kl, ku, nrhs, ab, ldab,
info = API_SUFFIX(LAPACKE_cgbrfs_work)( matrix_layout, trans, n, kl, ku, nrhs, ab, ldab,
afb, ldafb, ipiv, b, ldb, x, ldx, ferr, berr,
work, rwork );
/* Release memory and exit */
@@ -87,7 +87,7 @@ exit_level_1:
LAPACKE_free( rwork );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgbrfs", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbrfs", info );
}
return info;
}
+12 -12
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgbrfs_work( int matrix_layout, char trans, lapack_int n,
lapack_int API_SUFFIX(LAPACKE_cgbrfs_work)( int matrix_layout, char trans, lapack_int n,
lapack_int kl, lapack_int ku, lapack_int nrhs,
const lapack_complex_float* ab, lapack_int ldab,
const lapack_complex_float* afb,
@@ -62,22 +62,22 @@ lapack_int LAPACKE_cgbrfs_work( int matrix_layout, char trans, lapack_int n,
/* Check leading dimension(s) */
if( ldab < n ) {
info = -8;
LAPACKE_xerbla( "LAPACKE_cgbrfs_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbrfs_work", info );
return info;
}
if( ldafb < n ) {
info = -10;
LAPACKE_xerbla( "LAPACKE_cgbrfs_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbrfs_work", info );
return info;
}
if( ldb < nrhs ) {
info = -13;
LAPACKE_xerbla( "LAPACKE_cgbrfs_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbrfs_work", info );
return info;
}
if( ldx < nrhs ) {
info = -15;
LAPACKE_xerbla( "LAPACKE_cgbrfs_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbrfs_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
@@ -108,11 +108,11 @@ lapack_int LAPACKE_cgbrfs_work( int matrix_layout, char trans, lapack_int n,
goto exit_level_3;
}
/* Transpose input matrices */
LAPACKE_cgb_trans( matrix_layout, n, n, kl, ku, ab, ldab, ab_t, ldab_t );
LAPACKE_cgb_trans( matrix_layout, n, n, kl, kl+ku, afb, ldafb, afb_t,
API_SUFFIX(LAPACKE_cgb_trans)( matrix_layout, n, n, kl, ku, ab, ldab, ab_t, ldab_t );
API_SUFFIX(LAPACKE_cgb_trans)( matrix_layout, n, n, kl, kl+ku, afb, ldafb, afb_t,
ldafb_t );
LAPACKE_cge_trans( matrix_layout, n, nrhs, b, ldb, b_t, ldb_t );
LAPACKE_cge_trans( matrix_layout, n, nrhs, x, ldx, x_t, ldx_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, n, nrhs, b, ldb, b_t, ldb_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, n, nrhs, x, ldx, x_t, ldx_t );
/* Call LAPACK function and adjust info */
LAPACK_cgbrfs( &trans, &n, &kl, &ku, &nrhs, ab_t, &ldab_t, afb_t,
&ldafb_t, ipiv, b_t, &ldb_t, x_t, &ldx_t, ferr, berr,
@@ -121,7 +121,7 @@ lapack_int LAPACKE_cgbrfs_work( int matrix_layout, char trans, lapack_int n,
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, nrhs, x_t, ldx_t, x, ldx );
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, n, nrhs, x_t, ldx_t, x, ldx );
/* Release memory and exit */
LAPACKE_free( x_t );
exit_level_3:
@@ -132,11 +132,11 @@ exit_level_1:
LAPACKE_free( ab_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgbrfs_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbrfs_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_cgbrfs_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbrfs_work", info );
}
return info;
}
+13 -13
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgbrfsx( int matrix_layout, char trans, char equed,
lapack_int API_SUFFIX(LAPACKE_cgbrfsx)( int matrix_layout, char trans, char equed,
lapack_int n, lapack_int kl, lapack_int ku,
lapack_int nrhs, const lapack_complex_float* ab,
lapack_int ldab, const lapack_complex_float* afb,
@@ -48,37 +48,37 @@ lapack_int LAPACKE_cgbrfsx( int matrix_layout, char trans, char equed,
float* rwork = NULL;
lapack_complex_float* work = NULL;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_cgbrfsx", -1 );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbrfsx", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_cgb_nancheck( matrix_layout, n, n, kl, ku, ab, ldab ) ) {
if( API_SUFFIX(LAPACKE_cgb_nancheck)( matrix_layout, n, n, kl, ku, ab, ldab ) ) {
return -8;
}
if( LAPACKE_cgb_nancheck( matrix_layout, n, n, kl, kl+ku, afb, ldafb ) ) {
if( API_SUFFIX(LAPACKE_cgb_nancheck)( matrix_layout, n, n, kl, kl+ku, afb, ldafb ) ) {
return -10;
}
if( LAPACKE_cge_nancheck( matrix_layout, n, nrhs, b, ldb ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, n, nrhs, b, ldb ) ) {
return -15;
}
if( LAPACKE_lsame( equed, 'b' ) || LAPACKE_lsame( equed, 'c' ) ) {
if( LAPACKE_s_nancheck( n, c, 1 ) ) {
if( API_SUFFIX(LAPACKE_lsame)( equed, 'b' ) || API_SUFFIX(LAPACKE_lsame)( equed, 'c' ) ) {
if( API_SUFFIX(LAPACKE_s_nancheck)( n, c, 1 ) ) {
return -14;
}
}
if( nparams>0 ) {
if( LAPACKE_s_nancheck( nparams, params, 1 ) ) {
if( API_SUFFIX(LAPACKE_s_nancheck)( nparams, params, 1 ) ) {
return -25;
}
}
if( LAPACKE_lsame( equed, 'b' ) || LAPACKE_lsame( equed, 'r' ) ) {
if( LAPACKE_s_nancheck( n, r, 1 ) ) {
if( API_SUFFIX(LAPACKE_lsame)( equed, 'b' ) || API_SUFFIX(LAPACKE_lsame)( equed, 'r' ) ) {
if( API_SUFFIX(LAPACKE_s_nancheck)( n, r, 1 ) ) {
return -13;
}
}
if( LAPACKE_cge_nancheck( matrix_layout, n, nrhs, x, ldx ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, n, nrhs, x, ldx ) ) {
return -17;
}
}
@@ -96,7 +96,7 @@ lapack_int LAPACKE_cgbrfsx( int matrix_layout, char trans, char equed,
goto exit_level_1;
}
/* Call middle-level interface */
info = LAPACKE_cgbrfsx_work( matrix_layout, trans, equed, n, kl, ku, nrhs,
info = API_SUFFIX(LAPACKE_cgbrfsx_work)( matrix_layout, trans, equed, n, kl, ku, nrhs,
ab, ldab, afb, ldafb, ipiv, r, c, b, ldb, x,
ldx, rcond, berr, n_err_bnds, err_bnds_norm,
err_bnds_comp, nparams, params, work, rwork );
@@ -106,7 +106,7 @@ exit_level_1:
LAPACKE_free( rwork );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgbrfsx", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbrfsx", info );
}
return info;
}
+14 -14
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgbrfsx_work( int matrix_layout, char trans, char equed,
lapack_int API_SUFFIX(LAPACKE_cgbrfsx_work)( int matrix_layout, char trans, char equed,
lapack_int n, lapack_int kl, lapack_int ku,
lapack_int nrhs,
const lapack_complex_float* ab,
@@ -72,22 +72,22 @@ lapack_int LAPACKE_cgbrfsx_work( int matrix_layout, char trans, char equed,
/* Check leading dimension(s) */
if( ldab < n ) {
info = -9;
LAPACKE_xerbla( "LAPACKE_cgbrfsx_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbrfsx_work", info );
return info;
}
if( ldafb < n ) {
info = -11;
LAPACKE_xerbla( "LAPACKE_cgbrfsx_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbrfsx_work", info );
return info;
}
if( ldb < nrhs ) {
info = -16;
LAPACKE_xerbla( "LAPACKE_cgbrfsx_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbrfsx_work", info );
return info;
}
if( ldx < nrhs ) {
info = -18;
LAPACKE_xerbla( "LAPACKE_cgbrfsx_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbrfsx_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
@@ -130,11 +130,11 @@ lapack_int LAPACKE_cgbrfsx_work( int matrix_layout, char trans, char equed,
goto exit_level_5;
}
/* Transpose input matrices */
LAPACKE_cgb_trans( matrix_layout, n, n, kl, ku, ab, ldab, ab_t, ldab_t );
LAPACKE_cgb_trans( matrix_layout, n, n, kl, kl+ku, afb, ldafb, afb_t,
API_SUFFIX(LAPACKE_cgb_trans)( matrix_layout, n, n, kl, ku, ab, ldab, ab_t, ldab_t );
API_SUFFIX(LAPACKE_cgb_trans)( matrix_layout, n, n, kl, kl+ku, afb, ldafb, afb_t,
ldafb_t );
LAPACKE_cge_trans( matrix_layout, n, nrhs, b, ldb, b_t, ldb_t );
LAPACKE_cge_trans( matrix_layout, n, nrhs, x, ldx, x_t, ldx_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, n, nrhs, b, ldb, b_t, ldb_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, n, nrhs, x, ldx, x_t, ldx_t );
/* Call LAPACK function and adjust info */
LAPACK_cgbrfsx( &trans, &equed, &n, &kl, &ku, &nrhs, ab_t, &ldab_t,
afb_t, &ldafb_t, ipiv, r, c, b_t, &ldb_t, x_t, &ldx_t,
@@ -144,10 +144,10 @@ lapack_int LAPACKE_cgbrfsx_work( int matrix_layout, char trans, char equed,
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, nrhs, x_t, ldx_t, x, ldx );
LAPACKE_sge_trans( LAPACK_COL_MAJOR, nrhs, n_err_bnds, err_bnds_norm_t,
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, n, nrhs, x_t, ldx_t, x, ldx );
API_SUFFIX(LAPACKE_sge_trans)( LAPACK_COL_MAJOR, nrhs, n_err_bnds, err_bnds_norm_t,
nrhs, err_bnds_norm, nrhs );
LAPACKE_sge_trans( LAPACK_COL_MAJOR, nrhs, n_err_bnds, err_bnds_comp_t,
API_SUFFIX(LAPACKE_sge_trans)( LAPACK_COL_MAJOR, nrhs, n_err_bnds, err_bnds_comp_t,
nrhs, err_bnds_comp, nrhs );
/* Release memory and exit */
LAPACKE_free( err_bnds_comp_t );
@@ -163,11 +163,11 @@ exit_level_1:
LAPACKE_free( ab_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgbrfsx_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbrfsx_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_cgbrfsx_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbrfsx_work", info );
}
return info;
}
+5 -5
View File
@@ -32,27 +32,27 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgbsv( int matrix_layout, lapack_int n, lapack_int kl,
lapack_int API_SUFFIX(LAPACKE_cgbsv)( int matrix_layout, lapack_int n, lapack_int kl,
lapack_int ku, lapack_int nrhs,
lapack_complex_float* ab, lapack_int ldab,
lapack_int* ipiv, lapack_complex_float* b,
lapack_int ldb )
{
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_cgbsv", -1 );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbsv", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_cgb_nancheck( matrix_layout, n, n, kl, kl+ku, ab, ldab ) ) {
if( API_SUFFIX(LAPACKE_cgb_nancheck)( matrix_layout, n, n, kl, kl+ku, ab, ldab ) ) {
return -6;
}
if( LAPACKE_cge_nancheck( matrix_layout, n, nrhs, b, ldb ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, n, nrhs, b, ldb ) ) {
return -9;
}
}
#endif
return LAPACKE_cgbsv_work( matrix_layout, n, kl, ku, nrhs, ab, ldab, ipiv, b,
return API_SUFFIX(LAPACKE_cgbsv_work)( matrix_layout, n, kl, ku, nrhs, ab, ldab, ipiv, b,
ldb );
}
+9 -9
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgbsv_work( int matrix_layout, lapack_int n, lapack_int kl,
lapack_int API_SUFFIX(LAPACKE_cgbsv_work)( int matrix_layout, lapack_int n, lapack_int kl,
lapack_int ku, lapack_int nrhs,
lapack_complex_float* ab, lapack_int ldab,
lapack_int* ipiv, lapack_complex_float* b,
@@ -53,12 +53,12 @@ lapack_int LAPACKE_cgbsv_work( int matrix_layout, lapack_int n, lapack_int kl,
/* Check leading dimension(s) */
if( ldab < n ) {
info = -7;
LAPACKE_xerbla( "LAPACKE_cgbsv_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbsv_work", info );
return info;
}
if( ldb < nrhs ) {
info = -10;
LAPACKE_xerbla( "LAPACKE_cgbsv_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbsv_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
@@ -76,9 +76,9 @@ lapack_int LAPACKE_cgbsv_work( int matrix_layout, lapack_int n, lapack_int kl,
goto exit_level_1;
}
/* Transpose input matrices */
LAPACKE_cgb_trans( matrix_layout, n, n, kl, kl+ku, ab, ldab, ab_t,
API_SUFFIX(LAPACKE_cgb_trans)( matrix_layout, n, n, kl, kl+ku, ab, ldab, ab_t,
ldab_t );
LAPACKE_cge_trans( matrix_layout, n, nrhs, b, ldb, b_t, ldb_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, n, nrhs, b, ldb, b_t, ldb_t );
/* Call LAPACK function and adjust info */
LAPACK_cgbsv( &n, &kl, &ku, &nrhs, ab_t, &ldab_t, ipiv, b_t, &ldb_t,
&info );
@@ -86,20 +86,20 @@ lapack_int LAPACKE_cgbsv_work( int matrix_layout, lapack_int n, lapack_int kl,
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_cgb_trans( LAPACK_COL_MAJOR, n, n, kl, kl+ku, ab_t, ldab_t, ab,
API_SUFFIX(LAPACKE_cgb_trans)( LAPACK_COL_MAJOR, n, n, kl, kl+ku, ab_t, ldab_t, ab,
ldab );
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, nrhs, b_t, ldb_t, b, ldb );
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, n, nrhs, b_t, ldb_t, b, ldb );
/* Release memory and exit */
LAPACKE_free( b_t );
exit_level_1:
LAPACKE_free( ab_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgbsv_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbsv_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_cgbsv_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbsv_work", info );
}
return info;
}
+14 -14
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgbsvx( int matrix_layout, char fact, char trans,
lapack_int API_SUFFIX(LAPACKE_cgbsvx)( int matrix_layout, char fact, char trans,
lapack_int n, lapack_int kl, lapack_int ku,
lapack_int nrhs, lapack_complex_float* ab,
lapack_int ldab, lapack_complex_float* afb,
@@ -46,33 +46,33 @@ lapack_int LAPACKE_cgbsvx( int matrix_layout, char fact, char trans,
float* rwork = NULL;
lapack_complex_float* work = NULL;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_cgbsvx", -1 );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbsvx", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_cgb_nancheck( matrix_layout, n, n, kl, ku, ab, ldab ) ) {
if( API_SUFFIX(LAPACKE_cgb_nancheck)( matrix_layout, n, n, kl, ku, ab, ldab ) ) {
return -8;
}
if( LAPACKE_lsame( fact, 'f' ) ) {
if( LAPACKE_cgb_nancheck( matrix_layout, n, n, kl, kl+ku, afb,
if( API_SUFFIX(LAPACKE_lsame)( fact, 'f' ) ) {
if( API_SUFFIX(LAPACKE_cgb_nancheck)( matrix_layout, n, n, kl, kl+ku, afb,
ldafb ) ) {
return -10;
}
}
if( LAPACKE_cge_nancheck( matrix_layout, n, nrhs, b, ldb ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, n, nrhs, b, ldb ) ) {
return -16;
}
if( LAPACKE_lsame( fact, 'f' ) && ( LAPACKE_lsame( *equed, 'b' ) ||
LAPACKE_lsame( *equed, 'c' ) ) ) {
if( LAPACKE_s_nancheck( n, c, 1 ) ) {
if( API_SUFFIX(LAPACKE_lsame)( fact, 'f' ) && ( API_SUFFIX(LAPACKE_lsame)( *equed, 'b' ) ||
API_SUFFIX(LAPACKE_lsame)( *equed, 'c' ) ) ) {
if( API_SUFFIX(LAPACKE_s_nancheck)( n, c, 1 ) ) {
return -15;
}
}
if( LAPACKE_lsame( fact, 'f' ) && ( LAPACKE_lsame( *equed, 'b' ) ||
LAPACKE_lsame( *equed, 'r' ) ) ) {
if( LAPACKE_s_nancheck( n, r, 1 ) ) {
if( API_SUFFIX(LAPACKE_lsame)( fact, 'f' ) && ( API_SUFFIX(LAPACKE_lsame)( *equed, 'b' ) ||
API_SUFFIX(LAPACKE_lsame)( *equed, 'r' ) ) ) {
if( API_SUFFIX(LAPACKE_s_nancheck)( n, r, 1 ) ) {
return -14;
}
}
@@ -91,7 +91,7 @@ lapack_int LAPACKE_cgbsvx( int matrix_layout, char fact, char trans,
goto exit_level_1;
}
/* Call middle-level interface */
info = LAPACKE_cgbsvx_work( matrix_layout, fact, trans, n, kl, ku, nrhs, ab,
info = API_SUFFIX(LAPACKE_cgbsvx_work)( matrix_layout, fact, trans, n, kl, ku, nrhs, ab,
ldab, afb, ldafb, ipiv, equed, r, c, b, ldb, x,
ldx, rcond, ferr, berr, work, rwork );
/* Backup significant data from working array(s) */
@@ -102,7 +102,7 @@ exit_level_1:
LAPACKE_free( rwork );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgbsvx", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbsvx", info );
}
return info;
}
+20 -20
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgbsvx_work( int matrix_layout, char fact, char trans,
lapack_int API_SUFFIX(LAPACKE_cgbsvx_work)( int matrix_layout, char fact, char trans,
lapack_int n, lapack_int kl, lapack_int ku,
lapack_int nrhs, lapack_complex_float* ab,
lapack_int ldab, lapack_complex_float* afb,
@@ -64,22 +64,22 @@ lapack_int LAPACKE_cgbsvx_work( int matrix_layout, char fact, char trans,
/* Check leading dimension(s) */
if( ldab < n ) {
info = -9;
LAPACKE_xerbla( "LAPACKE_cgbsvx_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbsvx_work", info );
return info;
}
if( ldafb < n ) {
info = -11;
LAPACKE_xerbla( "LAPACKE_cgbsvx_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbsvx_work", info );
return info;
}
if( ldb < nrhs ) {
info = -17;
LAPACKE_xerbla( "LAPACKE_cgbsvx_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbsvx_work", info );
return info;
}
if( ldx < nrhs ) {
info = -19;
LAPACKE_xerbla( "LAPACKE_cgbsvx_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbsvx_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
@@ -110,12 +110,12 @@ lapack_int LAPACKE_cgbsvx_work( int matrix_layout, char fact, char trans,
goto exit_level_3;
}
/* Transpose input matrices */
LAPACKE_cgb_trans( matrix_layout, n, n, kl, ku, ab, ldab, ab_t, ldab_t );
if( LAPACKE_lsame( fact, 'f' ) ) {
LAPACKE_cgb_trans( matrix_layout, n, n, kl, kl+ku, afb, ldafb, afb_t,
API_SUFFIX(LAPACKE_cgb_trans)( matrix_layout, n, n, kl, ku, ab, ldab, ab_t, ldab_t );
if( API_SUFFIX(LAPACKE_lsame)( fact, 'f' ) ) {
API_SUFFIX(LAPACKE_cgb_trans)( matrix_layout, n, n, kl, kl+ku, afb, ldafb, afb_t,
ldafb_t );
}
LAPACKE_cge_trans( matrix_layout, n, nrhs, b, ldb, b_t, ldb_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, n, nrhs, b, ldb, b_t, ldb_t );
/* Call LAPACK function and adjust info */
LAPACK_cgbsvx( &fact, &trans, &n, &kl, &ku, &nrhs, ab_t, &ldab_t, afb_t,
&ldafb_t, ipiv, equed, r, c, b_t, &ldb_t, x_t, &ldx_t,
@@ -124,20 +124,20 @@ lapack_int LAPACKE_cgbsvx_work( int matrix_layout, char fact, char trans,
info = info - 1;
}
/* Transpose output matrices */
if( LAPACKE_lsame( fact, 'e' ) && ( LAPACKE_lsame( *equed, 'b' ) ||
LAPACKE_lsame( *equed, 'c' ) || LAPACKE_lsame( *equed, 'r' ) ) ) {
LAPACKE_cgb_trans( LAPACK_COL_MAJOR, n, n, kl, ku, ab_t, ldab_t, ab,
if( API_SUFFIX(LAPACKE_lsame)( fact, 'e' ) && ( API_SUFFIX(LAPACKE_lsame)( *equed, 'b' ) ||
API_SUFFIX(LAPACKE_lsame)( *equed, 'c' ) || API_SUFFIX(LAPACKE_lsame)( *equed, 'r' ) ) ) {
API_SUFFIX(LAPACKE_cgb_trans)( LAPACK_COL_MAJOR, n, n, kl, ku, ab_t, ldab_t, ab,
ldab );
}
if( LAPACKE_lsame( fact, 'e' ) || LAPACKE_lsame( fact, 'n' ) ) {
LAPACKE_cgb_trans( LAPACK_COL_MAJOR, n, n, kl, kl+ku, afb_t,
if( API_SUFFIX(LAPACKE_lsame)( fact, 'e' ) || API_SUFFIX(LAPACKE_lsame)( fact, 'n' ) ) {
API_SUFFIX(LAPACKE_cgb_trans)( LAPACK_COL_MAJOR, n, n, kl, kl+ku, afb_t,
ldafb_t, afb, ldafb );
}
if( LAPACKE_lsame( fact, 'f' ) && ( LAPACKE_lsame( *equed, 'b' ) ||
LAPACKE_lsame( *equed, 'c' ) || LAPACKE_lsame( *equed, 'r' ) ) ) {
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, nrhs, b_t, ldb_t, b, ldb );
if( API_SUFFIX(LAPACKE_lsame)( fact, 'f' ) && ( API_SUFFIX(LAPACKE_lsame)( *equed, 'b' ) ||
API_SUFFIX(LAPACKE_lsame)( *equed, 'c' ) || API_SUFFIX(LAPACKE_lsame)( *equed, 'r' ) ) ) {
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, n, nrhs, b_t, ldb_t, b, ldb );
}
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, nrhs, x_t, ldx_t, x, ldx );
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, n, nrhs, x_t, ldx_t, x, ldx );
/* Release memory and exit */
LAPACKE_free( x_t );
exit_level_3:
@@ -148,11 +148,11 @@ exit_level_1:
LAPACKE_free( ab_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgbsvx_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbsvx_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_cgbsvx_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbsvx_work", info );
}
return info;
}
+15 -15
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgbsvxx( int matrix_layout, char fact, char trans,
lapack_int API_SUFFIX(LAPACKE_cgbsvxx)( int matrix_layout, char fact, char trans,
lapack_int n, lapack_int kl, lapack_int ku,
lapack_int nrhs, lapack_complex_float* ab,
lapack_int ldab, lapack_complex_float* afb,
@@ -48,38 +48,38 @@ lapack_int LAPACKE_cgbsvxx( int matrix_layout, char fact, char trans,
float* rwork = NULL;
lapack_complex_float* work = NULL;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_cgbsvxx", -1 );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbsvxx", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_cgb_nancheck( matrix_layout, n, n, kl, ku, ab, ldab ) ) {
if( API_SUFFIX(LAPACKE_cgb_nancheck)( matrix_layout, n, n, kl, ku, ab, ldab ) ) {
return -8;
}
if( LAPACKE_lsame( fact, 'f' ) ) {
if( LAPACKE_cgb_nancheck( matrix_layout, n, n, kl, kl+ku, afb,
if( API_SUFFIX(LAPACKE_lsame)( fact, 'f' ) ) {
if( API_SUFFIX(LAPACKE_cgb_nancheck)( matrix_layout, n, n, kl, kl+ku, afb,
ldafb ) ) {
return -10;
}
}
if( LAPACKE_cge_nancheck( matrix_layout, n, nrhs, b, ldb ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, n, nrhs, b, ldb ) ) {
return -16;
}
if( LAPACKE_lsame( fact, 'f' ) && ( LAPACKE_lsame( *equed, 'b' ) ||
LAPACKE_lsame( *equed, 'c' ) ) ) {
if( LAPACKE_s_nancheck( n, c, 1 ) ) {
if( API_SUFFIX(LAPACKE_lsame)( fact, 'f' ) && ( API_SUFFIX(LAPACKE_lsame)( *equed, 'b' ) ||
API_SUFFIX(LAPACKE_lsame)( *equed, 'c' ) ) ) {
if( API_SUFFIX(LAPACKE_s_nancheck)( n, c, 1 ) ) {
return -15;
}
}
if( nparams>0 ) {
if( LAPACKE_s_nancheck( nparams, params, 1 ) ) {
if( API_SUFFIX(LAPACKE_s_nancheck)( nparams, params, 1 ) ) {
return -27;
}
}
if( LAPACKE_lsame( fact, 'f' ) && ( LAPACKE_lsame( *equed, 'b' ) ||
LAPACKE_lsame( *equed, 'r' ) ) ) {
if( LAPACKE_s_nancheck( n, r, 1 ) ) {
if( API_SUFFIX(LAPACKE_lsame)( fact, 'f' ) && ( API_SUFFIX(LAPACKE_lsame)( *equed, 'b' ) ||
API_SUFFIX(LAPACKE_lsame)( *equed, 'r' ) ) ) {
if( API_SUFFIX(LAPACKE_s_nancheck)( n, r, 1 ) ) {
return -14;
}
}
@@ -98,7 +98,7 @@ lapack_int LAPACKE_cgbsvxx( int matrix_layout, char fact, char trans,
goto exit_level_1;
}
/* Call middle-level interface */
info = LAPACKE_cgbsvxx_work( matrix_layout, fact, trans, n, kl, ku, nrhs, ab,
info = API_SUFFIX(LAPACKE_cgbsvxx_work)( matrix_layout, fact, trans, n, kl, ku, nrhs, ab,
ldab, afb, ldafb, ipiv, equed, r, c, b, ldb, x,
ldx, rcond, rpvgrw, berr, n_err_bnds,
err_bnds_norm, err_bnds_comp, nparams, params,
@@ -109,7 +109,7 @@ exit_level_1:
LAPACKE_free( rwork );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgbsvxx", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbsvxx", info );
}
return info;
}
+22 -22
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgbsvxx_work( int matrix_layout, char fact, char trans,
lapack_int API_SUFFIX(LAPACKE_cgbsvxx_work)( int matrix_layout, char fact, char trans,
lapack_int n, lapack_int kl, lapack_int ku,
lapack_int nrhs, lapack_complex_float* ab,
lapack_int ldab, lapack_complex_float* afb,
@@ -70,22 +70,22 @@ lapack_int LAPACKE_cgbsvxx_work( int matrix_layout, char fact, char trans,
/* Check leading dimension(s) */
if( ldab < n ) {
info = -9;
LAPACKE_xerbla( "LAPACKE_cgbsvxx_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbsvxx_work", info );
return info;
}
if( ldafb < n ) {
info = -11;
LAPACKE_xerbla( "LAPACKE_cgbsvxx_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbsvxx_work", info );
return info;
}
if( ldb < nrhs ) {
info = -17;
LAPACKE_xerbla( "LAPACKE_cgbsvxx_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbsvxx_work", info );
return info;
}
if( ldx < nrhs ) {
info = -19;
LAPACKE_xerbla( "LAPACKE_cgbsvxx_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbsvxx_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
@@ -128,12 +128,12 @@ lapack_int LAPACKE_cgbsvxx_work( int matrix_layout, char fact, char trans,
goto exit_level_5;
}
/* Transpose input matrices */
LAPACKE_cgb_trans( matrix_layout, n, n, kl, ku, ab, ldab, ab_t, ldab_t );
if( LAPACKE_lsame( fact, 'f' ) ) {
LAPACKE_cgb_trans( matrix_layout, n, n, kl, kl+ku, afb, ldafb, afb_t,
API_SUFFIX(LAPACKE_cgb_trans)( matrix_layout, n, n, kl, ku, ab, ldab, ab_t, ldab_t );
if( API_SUFFIX(LAPACKE_lsame)( fact, 'f' ) ) {
API_SUFFIX(LAPACKE_cgb_trans)( matrix_layout, n, n, kl, kl+ku, afb, ldafb, afb_t,
ldafb_t );
}
LAPACKE_cge_trans( matrix_layout, n, nrhs, b, ldb, b_t, ldb_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, n, nrhs, b, ldb, b_t, ldb_t );
/* Call LAPACK function and adjust info */
LAPACK_cgbsvxx( &fact, &trans, &n, &kl, &ku, &nrhs, ab_t, &ldab_t,
afb_t, &ldafb_t, ipiv, equed, r, c, b_t, &ldb_t, x_t,
@@ -144,23 +144,23 @@ lapack_int LAPACKE_cgbsvxx_work( int matrix_layout, char fact, char trans,
info = info - 1;
}
/* Transpose output matrices */
if( LAPACKE_lsame( fact, 'e' ) && ( LAPACKE_lsame( *equed, 'b' ) ||
LAPACKE_lsame( *equed, 'c' ) || LAPACKE_lsame( *equed, 'r' ) ) ) {
LAPACKE_cgb_trans( LAPACK_COL_MAJOR, n, n, kl, ku, ab_t, ldab_t, ab,
if( API_SUFFIX(LAPACKE_lsame)( fact, 'e' ) && ( API_SUFFIX(LAPACKE_lsame)( *equed, 'b' ) ||
API_SUFFIX(LAPACKE_lsame)( *equed, 'c' ) || API_SUFFIX(LAPACKE_lsame)( *equed, 'r' ) ) ) {
API_SUFFIX(LAPACKE_cgb_trans)( LAPACK_COL_MAJOR, n, n, kl, ku, ab_t, ldab_t, ab,
ldab );
}
if( LAPACKE_lsame( fact, 'e' ) || LAPACKE_lsame( fact, 'n' ) ) {
LAPACKE_cgb_trans( LAPACK_COL_MAJOR, n, n, kl, kl+ku, afb_t,
if( API_SUFFIX(LAPACKE_lsame)( fact, 'e' ) || API_SUFFIX(LAPACKE_lsame)( fact, 'n' ) ) {
API_SUFFIX(LAPACKE_cgb_trans)( LAPACK_COL_MAJOR, n, n, kl, kl+ku, afb_t,
ldafb_t, afb, ldafb );
}
if( LAPACKE_lsame( fact, 'f' ) && ( LAPACKE_lsame( *equed, 'b' ) ||
LAPACKE_lsame( *equed, 'c' ) || LAPACKE_lsame( *equed, 'r' ) ) ) {
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, nrhs, b_t, ldb_t, b, ldb );
if( API_SUFFIX(LAPACKE_lsame)( fact, 'f' ) && ( API_SUFFIX(LAPACKE_lsame)( *equed, 'b' ) ||
API_SUFFIX(LAPACKE_lsame)( *equed, 'c' ) || API_SUFFIX(LAPACKE_lsame)( *equed, 'r' ) ) ) {
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, n, nrhs, b_t, ldb_t, b, ldb );
}
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, nrhs, x_t, ldx_t, x, ldx );
LAPACKE_sge_trans( LAPACK_COL_MAJOR, nrhs, n_err_bnds, err_bnds_norm_t,
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, n, nrhs, x_t, ldx_t, x, ldx );
API_SUFFIX(LAPACKE_sge_trans)( LAPACK_COL_MAJOR, nrhs, n_err_bnds, err_bnds_norm_t,
nrhs, err_bnds_norm, n_err_bnds );
LAPACKE_sge_trans( LAPACK_COL_MAJOR, nrhs, n_err_bnds, err_bnds_comp_t,
API_SUFFIX(LAPACKE_sge_trans)( LAPACK_COL_MAJOR, nrhs, n_err_bnds, err_bnds_comp_t,
nrhs, err_bnds_comp, n_err_bnds );
/* Release memory and exit */
LAPACKE_free( err_bnds_comp_t );
@@ -176,11 +176,11 @@ exit_level_1:
LAPACKE_free( ab_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgbsvxx_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbsvxx_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_cgbsvxx_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbsvxx_work", info );
}
return info;
}
+4 -4
View File
@@ -32,22 +32,22 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgbtrf( int matrix_layout, lapack_int m, lapack_int n,
lapack_int API_SUFFIX(LAPACKE_cgbtrf)( int matrix_layout, lapack_int m, lapack_int n,
lapack_int kl, lapack_int ku,
lapack_complex_float* ab, lapack_int ldab,
lapack_int* ipiv )
{
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_cgbtrf", -1 );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbtrf", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_cgb_nancheck( matrix_layout, m, n, kl, kl+ku, ab, ldab ) ) {
if( API_SUFFIX(LAPACKE_cgb_nancheck)( matrix_layout, m, n, kl, kl+ku, ab, ldab ) ) {
return -6;
}
}
#endif
return LAPACKE_cgbtrf_work( matrix_layout, m, n, kl, ku, ab, ldab, ipiv );
return API_SUFFIX(LAPACKE_cgbtrf_work)( matrix_layout, m, n, kl, ku, ab, ldab, ipiv );
}
+6 -6
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgbtrf_work( int matrix_layout, lapack_int m, lapack_int n,
lapack_int API_SUFFIX(LAPACKE_cgbtrf_work)( int matrix_layout, lapack_int m, lapack_int n,
lapack_int kl, lapack_int ku,
lapack_complex_float* ab, lapack_int ldab,
lapack_int* ipiv )
@@ -50,7 +50,7 @@ lapack_int LAPACKE_cgbtrf_work( int matrix_layout, lapack_int m, lapack_int n,
/* Check leading dimension(s) */
if( ldab < n ) {
info = -7;
LAPACKE_xerbla( "LAPACKE_cgbtrf_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbtrf_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
@@ -61,7 +61,7 @@ lapack_int LAPACKE_cgbtrf_work( int matrix_layout, lapack_int m, lapack_int n,
goto exit_level_0;
}
/* Transpose input matrices */
LAPACKE_cgb_trans( matrix_layout, m, n, kl, kl+ku, ab, ldab, ab_t,
API_SUFFIX(LAPACKE_cgb_trans)( matrix_layout, m, n, kl, kl+ku, ab, ldab, ab_t,
ldab_t );
/* Call LAPACK function and adjust info */
LAPACK_cgbtrf( &m, &n, &kl, &ku, ab_t, &ldab_t, ipiv, &info );
@@ -69,17 +69,17 @@ lapack_int LAPACKE_cgbtrf_work( int matrix_layout, lapack_int m, lapack_int n,
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_cgb_trans( LAPACK_COL_MAJOR, m, n, kl, kl+ku, ab_t, ldab_t, ab,
API_SUFFIX(LAPACKE_cgb_trans)( LAPACK_COL_MAJOR, m, n, kl, kl+ku, ab_t, ldab_t, ab,
ldab );
/* Release memory and exit */
LAPACKE_free( ab_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgbtrf_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbtrf_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_cgbtrf_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbtrf_work", info );
}
return info;
}
+5 -5
View File
@@ -32,27 +32,27 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgbtrs( int matrix_layout, char trans, lapack_int n,
lapack_int API_SUFFIX(LAPACKE_cgbtrs)( int matrix_layout, char trans, lapack_int n,
lapack_int kl, lapack_int ku, lapack_int nrhs,
const lapack_complex_float* ab, lapack_int ldab,
const lapack_int* ipiv, lapack_complex_float* b,
lapack_int ldb )
{
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_cgbtrs", -1 );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbtrs", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_cgb_nancheck( matrix_layout, n, n, kl, kl+ku, ab, ldab ) ) {
if( API_SUFFIX(LAPACKE_cgb_nancheck)( matrix_layout, n, n, kl, kl+ku, ab, ldab ) ) {
return -7;
}
if( LAPACKE_cge_nancheck( matrix_layout, n, nrhs, b, ldb ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, n, nrhs, b, ldb ) ) {
return -10;
}
}
#endif
return LAPACKE_cgbtrs_work( matrix_layout, trans, n, kl, ku, nrhs, ab, ldab,
return API_SUFFIX(LAPACKE_cgbtrs_work)( matrix_layout, trans, n, kl, ku, nrhs, ab, ldab,
ipiv, b, ldb );
}
+8 -8
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgbtrs_work( int matrix_layout, char trans, lapack_int n,
lapack_int API_SUFFIX(LAPACKE_cgbtrs_work)( int matrix_layout, char trans, lapack_int n,
lapack_int kl, lapack_int ku, lapack_int nrhs,
const lapack_complex_float* ab, lapack_int ldab,
const lapack_int* ipiv, lapack_complex_float* b,
@@ -54,12 +54,12 @@ lapack_int LAPACKE_cgbtrs_work( int matrix_layout, char trans, lapack_int n,
/* Check leading dimension(s) */
if( ldab < n ) {
info = -8;
LAPACKE_xerbla( "LAPACKE_cgbtrs_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbtrs_work", info );
return info;
}
if( ldb < nrhs ) {
info = -11;
LAPACKE_xerbla( "LAPACKE_cgbtrs_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbtrs_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
@@ -77,9 +77,9 @@ lapack_int LAPACKE_cgbtrs_work( int matrix_layout, char trans, lapack_int n,
goto exit_level_1;
}
/* Transpose input matrices */
LAPACKE_cgb_trans( matrix_layout, n, n, kl, kl+ku, ab, ldab, ab_t,
API_SUFFIX(LAPACKE_cgb_trans)( matrix_layout, n, n, kl, kl+ku, ab, ldab, ab_t,
ldab_t );
LAPACKE_cge_trans( matrix_layout, n, nrhs, b, ldb, b_t, ldb_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, n, nrhs, b, ldb, b_t, ldb_t );
/* Call LAPACK function and adjust info */
LAPACK_cgbtrs( &trans, &n, &kl, &ku, &nrhs, ab_t, &ldab_t, ipiv, b_t,
&ldb_t, &info );
@@ -87,18 +87,18 @@ lapack_int LAPACKE_cgbtrs_work( int matrix_layout, char trans, lapack_int n,
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, nrhs, b_t, ldb_t, b, ldb );
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, n, nrhs, b_t, ldb_t, b, ldb );
/* Release memory and exit */
LAPACKE_free( b_t );
exit_level_1:
LAPACKE_free( ab_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgbtrs_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbtrs_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_cgbtrs_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgbtrs_work", info );
}
return info;
}
+5 -5
View File
@@ -32,26 +32,26 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgebak( int matrix_layout, char job, char side, lapack_int n,
lapack_int API_SUFFIX(LAPACKE_cgebak)( int matrix_layout, char job, char side, lapack_int n,
lapack_int ilo, lapack_int ihi, const float* scale,
lapack_int m, lapack_complex_float* v,
lapack_int ldv )
{
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_cgebak", -1 );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgebak", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_s_nancheck( n, scale, 1 ) ) {
if( API_SUFFIX(LAPACKE_s_nancheck)( n, scale, 1 ) ) {
return -7;
}
if( LAPACKE_cge_nancheck( matrix_layout, n, m, v, ldv ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, n, m, v, ldv ) ) {
return -9;
}
}
#endif
return LAPACKE_cgebak_work( matrix_layout, job, side, n, ilo, ihi, scale, m,
return API_SUFFIX(LAPACKE_cgebak_work)( matrix_layout, job, side, n, ilo, ihi, scale, m,
v, ldv );
}
+6 -6
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgebak_work( int matrix_layout, char job, char side,
lapack_int API_SUFFIX(LAPACKE_cgebak_work)( int matrix_layout, char job, char side,
lapack_int n, lapack_int ilo, lapack_int ihi,
const float* scale, lapack_int m,
lapack_complex_float* v, lapack_int ldv )
@@ -50,7 +50,7 @@ lapack_int LAPACKE_cgebak_work( int matrix_layout, char job, char side,
/* Check leading dimension(s) */
if( ldv < m ) {
info = -10;
LAPACKE_xerbla( "LAPACKE_cgebak_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgebak_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
@@ -61,7 +61,7 @@ lapack_int LAPACKE_cgebak_work( int matrix_layout, char job, char side,
goto exit_level_0;
}
/* Transpose input matrices */
LAPACKE_cge_trans( matrix_layout, n, m, v, ldv, v_t, ldv_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, n, m, v, ldv, v_t, ldv_t );
/* Call LAPACK function and adjust info */
LAPACK_cgebak( &job, &side, &n, &ilo, &ihi, scale, &m, v_t, &ldv_t,
&info );
@@ -69,16 +69,16 @@ lapack_int LAPACKE_cgebak_work( int matrix_layout, char job, char side,
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, m, v_t, ldv_t, v, ldv );
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, n, m, v_t, ldv_t, v, ldv );
/* Release memory and exit */
LAPACKE_free( v_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgebak_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgebak_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_cgebak_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgebak_work", info );
}
return info;
}
+6 -6
View File
@@ -32,24 +32,24 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgebal( int matrix_layout, char job, lapack_int n,
lapack_int API_SUFFIX(LAPACKE_cgebal)( int matrix_layout, char job, lapack_int n,
lapack_complex_float* a, lapack_int lda,
lapack_int* ilo, lapack_int* ihi, float* scale )
{
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_cgebal", -1 );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgebal", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_lsame( job, 'b' ) || LAPACKE_lsame( job, 'p' ) ||
LAPACKE_lsame( job, 's' ) ) {
if( LAPACKE_cge_nancheck( matrix_layout, n, n, a, lda ) ) {
if( API_SUFFIX(LAPACKE_lsame)( job, 'b' ) || API_SUFFIX(LAPACKE_lsame)( job, 'p' ) ||
API_SUFFIX(LAPACKE_lsame)( job, 's' ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, n, n, a, lda ) ) {
return -4;
}
}
}
#endif
return LAPACKE_cgebal_work( matrix_layout, job, n, a, lda, ilo, ihi, scale );
return API_SUFFIX(LAPACKE_cgebal_work)( matrix_layout, job, n, a, lda, ilo, ihi, scale );
}
+14 -14
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgebal_work( int matrix_layout, char job, lapack_int n,
lapack_int API_SUFFIX(LAPACKE_cgebal_work)( int matrix_layout, char job, lapack_int n,
lapack_complex_float* a, lapack_int lda,
lapack_int* ilo, lapack_int* ihi, float* scale )
{
@@ -49,12 +49,12 @@ lapack_int LAPACKE_cgebal_work( int matrix_layout, char job, lapack_int n,
/* Check leading dimension(s) */
if( lda < n ) {
info = -5;
LAPACKE_xerbla( "LAPACKE_cgebal_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgebal_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
if( LAPACKE_lsame( job, 'b' ) || LAPACKE_lsame( job, 'p' ) ||
LAPACKE_lsame( job, 's' ) ) {
if( API_SUFFIX(LAPACKE_lsame)( job, 'b' ) || API_SUFFIX(LAPACKE_lsame)( job, 'p' ) ||
API_SUFFIX(LAPACKE_lsame)( job, 's' ) ) {
a_t = (lapack_complex_float*)
LAPACKE_malloc( sizeof(lapack_complex_float) *
lda_t * MAX(1,n) );
@@ -64,9 +64,9 @@ lapack_int LAPACKE_cgebal_work( int matrix_layout, char job, lapack_int n,
}
}
/* Transpose input matrices */
if( LAPACKE_lsame( job, 'b' ) || LAPACKE_lsame( job, 'p' ) ||
LAPACKE_lsame( job, 's' ) ) {
LAPACKE_cge_trans( matrix_layout, n, n, a, lda, a_t, lda_t );
if( API_SUFFIX(LAPACKE_lsame)( job, 'b' ) || API_SUFFIX(LAPACKE_lsame)( job, 'p' ) ||
API_SUFFIX(LAPACKE_lsame)( job, 's' ) ) {
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, n, n, a, lda, a_t, lda_t );
}
/* Call LAPACK function and adjust info */
LAPACK_cgebal( &job, &n, a_t, &lda_t, ilo, ihi, scale, &info );
@@ -74,22 +74,22 @@ lapack_int LAPACKE_cgebal_work( int matrix_layout, char job, lapack_int n,
info = info - 1;
}
/* Transpose output matrices */
if( LAPACKE_lsame( job, 'b' ) || LAPACKE_lsame( job, 'p' ) ||
LAPACKE_lsame( job, 's' ) ) {
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda );
if( API_SUFFIX(LAPACKE_lsame)( job, 'b' ) || API_SUFFIX(LAPACKE_lsame)( job, 'p' ) ||
API_SUFFIX(LAPACKE_lsame)( job, 's' ) ) {
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda );
}
/* Release memory and exit */
if( LAPACKE_lsame( job, 'b' ) || LAPACKE_lsame( job, 'p' ) ||
LAPACKE_lsame( job, 's' ) ) {
if( API_SUFFIX(LAPACKE_lsame)( job, 'b' ) || API_SUFFIX(LAPACKE_lsame)( job, 'p' ) ||
API_SUFFIX(LAPACKE_lsame)( job, 's' ) ) {
LAPACKE_free( a_t );
}
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgebal_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgebal_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_cgebal_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgebal_work", info );
}
return info;
}
+6 -6
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgebrd( int matrix_layout, lapack_int m, lapack_int n,
lapack_int API_SUFFIX(LAPACKE_cgebrd)( int matrix_layout, lapack_int m, lapack_int n,
lapack_complex_float* a, lapack_int lda, float* d,
float* e, lapack_complex_float* tauq,
lapack_complex_float* taup )
@@ -42,19 +42,19 @@ lapack_int LAPACKE_cgebrd( int matrix_layout, lapack_int m, lapack_int n,
lapack_complex_float* work = NULL;
lapack_complex_float work_query;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_cgebrd", -1 );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgebrd", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_cge_nancheck( matrix_layout, m, n, a, lda ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, m, n, a, lda ) ) {
return -4;
}
}
#endif
/* Query optimal working array(s) size */
info = LAPACKE_cgebrd_work( matrix_layout, m, n, a, lda, d, e, tauq, taup,
info = API_SUFFIX(LAPACKE_cgebrd_work)( matrix_layout, m, n, a, lda, d, e, tauq, taup,
&work_query, lwork );
if( info != 0 ) {
goto exit_level_0;
@@ -68,13 +68,13 @@ lapack_int LAPACKE_cgebrd( int matrix_layout, lapack_int m, lapack_int n,
goto exit_level_0;
}
/* Call middle-level interface */
info = LAPACKE_cgebrd_work( matrix_layout, m, n, a, lda, d, e, tauq, taup,
info = API_SUFFIX(LAPACKE_cgebrd_work)( matrix_layout, m, n, a, lda, d, e, tauq, taup,
work, lwork );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgebrd", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgebrd", info );
}
return info;
}
+6 -6
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgebrd_work( int matrix_layout, lapack_int m, lapack_int n,
lapack_int API_SUFFIX(LAPACKE_cgebrd_work)( int matrix_layout, lapack_int m, lapack_int n,
lapack_complex_float* a, lapack_int lda,
float* d, float* e, lapack_complex_float* tauq,
lapack_complex_float* taup,
@@ -51,7 +51,7 @@ lapack_int LAPACKE_cgebrd_work( int matrix_layout, lapack_int m, lapack_int n,
/* Check leading dimension(s) */
if( lda < n ) {
info = -5;
LAPACKE_xerbla( "LAPACKE_cgebrd_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgebrd_work", info );
return info;
}
/* Query optimal working array(s) size if requested */
@@ -68,7 +68,7 @@ lapack_int LAPACKE_cgebrd_work( int matrix_layout, lapack_int m, lapack_int n,
goto exit_level_0;
}
/* Transpose input matrices */
LAPACKE_cge_trans( matrix_layout, m, n, a, lda, a_t, lda_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, m, n, a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
LAPACK_cgebrd( &m, &n, a_t, &lda_t, d, e, tauq, taup, work, &lwork,
&info );
@@ -76,16 +76,16 @@ lapack_int LAPACKE_cgebrd_work( int matrix_layout, lapack_int m, lapack_int n,
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_cge_trans( LAPACK_COL_MAJOR, m, n, a_t, lda_t, a, lda );
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, m, n, a_t, lda_t, a, lda );
/* Release memory and exit */
LAPACKE_free( a_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgebrd_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgebrd_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_cgebrd_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgebrd_work", info );
}
return info;
}
+6 -6
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgecon( int matrix_layout, char norm, lapack_int n,
lapack_int API_SUFFIX(LAPACKE_cgecon)( int matrix_layout, char norm, lapack_int n,
const lapack_complex_float* a, lapack_int lda,
float anorm, float* rcond )
{
@@ -40,16 +40,16 @@ lapack_int LAPACKE_cgecon( int matrix_layout, char norm, lapack_int n,
float* rwork = NULL;
lapack_complex_float* work = NULL;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_cgecon", -1 );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgecon", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_cge_nancheck( matrix_layout, n, n, a, lda ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, n, n, a, lda ) ) {
return -4;
}
if( LAPACKE_s_nancheck( 1, &anorm, 1 ) ) {
if( API_SUFFIX(LAPACKE_s_nancheck)( 1, &anorm, 1 ) ) {
return -6;
}
}
@@ -67,7 +67,7 @@ lapack_int LAPACKE_cgecon( int matrix_layout, char norm, lapack_int n,
goto exit_level_1;
}
/* Call middle-level interface */
info = LAPACKE_cgecon_work( matrix_layout, norm, n, a, lda, anorm, rcond,
info = API_SUFFIX(LAPACKE_cgecon_work)( matrix_layout, norm, n, a, lda, anorm, rcond,
work, rwork );
/* Release memory and exit */
LAPACKE_free( work );
@@ -75,7 +75,7 @@ exit_level_1:
LAPACKE_free( rwork );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgecon", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgecon", info );
}
return info;
}
+5 -5
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgecon_work( int matrix_layout, char norm, lapack_int n,
lapack_int API_SUFFIX(LAPACKE_cgecon_work)( int matrix_layout, char norm, lapack_int n,
const lapack_complex_float* a, lapack_int lda,
float anorm, float* rcond,
lapack_complex_float* work, float* rwork )
@@ -50,7 +50,7 @@ lapack_int LAPACKE_cgecon_work( int matrix_layout, char norm, lapack_int n,
/* Check leading dimension(s) */
if( lda < n ) {
info = -5;
LAPACKE_xerbla( "LAPACKE_cgecon_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgecon_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
@@ -61,7 +61,7 @@ lapack_int LAPACKE_cgecon_work( int matrix_layout, char norm, lapack_int n,
goto exit_level_0;
}
/* Transpose input matrices */
LAPACKE_cge_trans( matrix_layout, n, n, a, lda, a_t, lda_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, n, n, a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
LAPACK_cgecon( &norm, &n, a_t, &lda_t, &anorm, rcond, work, rwork,
&info );
@@ -72,11 +72,11 @@ lapack_int LAPACKE_cgecon_work( int matrix_layout, char norm, lapack_int n,
LAPACKE_free( a_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgecon_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgecon_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_cgecon_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgecon_work", info );
}
return info;
}
+43 -31
View File
@@ -32,84 +32,96 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgedmd( int matrix_layout, char jobs, char jobz, char jobf,
lapack_int whtsvd, lapack_int m, lapack_int n,
lapack_complex_float* x, lapack_int ldx,
lapack_complex_float* y, lapack_int ldy, lapack_int k,
lapack_complex_float* reig, lapack_complex_float* imeig,
lapack_complex_float* z, lapack_int ldz,
lapack_complex_float* res, lapack_complex_float* b,
lapack_int ldb, lapack_complex_float* w,
lapack_int ldw, lapack_complex_float* s, lapack_int lds)
lapack_int API_SUFFIX(LAPACKE_cgedmd)( int matrix_layout, char jobs, char jobz, char jobr,
char jobf, lapack_int whtsvd, lapack_int m,
lapack_int n, lapack_complex_float* x,
lapack_int ldx, lapack_complex_float* y,
lapack_int ldy, lapack_int nrnk, float* tol,
lapack_int k, lapack_complex_float* eigs,
lapack_complex_float* z, lapack_int ldz,
float* res, lapack_complex_float* b,
lapack_int ldb, lapack_complex_float* w,
lapack_int ldw, lapack_complex_float* s, lapack_int lds)
{
lapack_int info = 0;
lapack_int lwork = -1;
lapack_int liwork = -1;
lapack_complex_float* work = NULL;
lapack_int lzwork = -1;
lapack_complex_float* zwork = NULL;
float* work = NULL;
lapack_int* iwork = NULL;
lapack_complex_float work_query;
lapack_complex_float zwork_query;
float work_query;
lapack_int iwork_query;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_cgedmd", -1 );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgedmd", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_cge_nancheck( matrix_layout, m, n, x, ldx ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, m, n, x, ldx ) ) {
return -8;
}
if( LAPACKE_cge_nancheck( matrix_layout, m, n, y, ldy ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, m, n, y, ldy ) ) {
return -10;
}
if( LAPACKE_cge_nancheck( matrix_layout, m, n, z, ldz ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, m, n, z, ldz ) ) {
return -15;
}
if( LAPACKE_cge_nancheck( matrix_layout, m, n, b, ldb ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, m, n, b, ldb ) ) {
return -18;
}
if( LAPACKE_cge_nancheck( matrix_layout, m, n, w, ldw ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, m, n, w, ldw ) ) {
return -20;
}
if( LAPACKE_cge_nancheck( matrix_layout, m, n, s, lds ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, m, n, s, lds ) ) {
return -22;
}
}
#endif
/* Query optimal working array(s) size */
info = LAPACKE_cgedmd_work( matrix_layout, jobs, jobz, jobf, whtsvd, m, n,
x, ldx, y, ldy, k, reig, imeig, z, ldz, res,
b, ldb, w, ldw, s, lds, &work_query, lwork,
&iwork_query, liwork );
info = API_SUFFIX(LAPACKE_cgedmd_work)( matrix_layout, jobs, jobz, jobr, jobf, whtsvd,
m, n, x, ldx, y, ldy, nrnk, tol, k, eigs, z, ldz,
res, b, ldb, w, ldw, s, lds, &zwork_query,
lzwork, &work_query, lwork, &iwork_query, liwork );
if( info != 0 ) {
goto exit_level_0;
}
lzwork = LAPACK_C2INT( zwork_query );
lwork = LAPACK_C2INT( work_query );
liwork = iwork_query;
/* Allocate memory for work arrays */
work = (lapack_complex_float*)LAPACKE_malloc( sizeof(lapack_complex_float) * lwork );
if( work == NULL ) {
zwork = (lapack_complex_float*)LAPACKE_malloc( sizeof(lapack_complex_float) * lzwork );
if( zwork == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
work = (float*)LAPACKE_malloc( sizeof(float) * lwork );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_1;
}
iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * liwork );
if( iwork == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_1;
goto exit_level_2;
}
/* Call middle-level interface */
info = LAPACKE_cgedmd_work( matrix_layout, jobs, jobz, jobf, whtsvd, m, n,
x, ldx, y, ldy, k, reig, imeig, z, ldz, res,
b, ldb, w, ldw, s, lds, work, lwork, iwork,
liwork );
info = API_SUFFIX(LAPACKE_cgedmd_work)( matrix_layout, jobs, jobz, jobr, jobf, whtsvd,
m, n, x, ldx, y, ldy, nrnk, tol, k, eigs, z, ldz,
res, b, ldb, w, ldw, s, lds, zwork, lzwork,
work, lwork, iwork, liwork );
/* Release memory and exit */
LAPACKE_free( iwork );
exit_level_1:
exit_level_2:
LAPACKE_free( work );
exit_level_1:
LAPACKE_free( zwork );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgedmd", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgedmd", info );
}
return info;
}
+39 -35
View File
@@ -32,24 +32,26 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgedmd_work( int matrix_layout, char jobs, char jobz,
char jobf, lapack_int whtsvd, lapack_int m,
lapack_int API_SUFFIX(LAPACKE_cgedmd_work)( int matrix_layout, char jobs, char jobz,
char jobr, char jobf, lapack_int whtsvd, lapack_int m,
lapack_int n, lapack_complex_float* x, lapack_int ldx,
lapack_complex_float* y, lapack_int ldy, lapack_int k,
lapack_complex_float* reig, lapack_complex_float* imeig,
lapack_complex_float* y, lapack_int ldy, lapack_int nrnk,
float* tol, lapack_int k, lapack_complex_float* eigs,
lapack_complex_float* z, lapack_int ldz,
lapack_complex_float* res, lapack_complex_float* b,
float* res, lapack_complex_float* b,
lapack_int ldb, lapack_complex_float* w,
lapack_int ldw, lapack_complex_float* s, lapack_int lds,
lapack_complex_float* work, lapack_int lwork,
lapack_complex_float* zwork, lapack_int lzwork,
float* work, lapack_int lwork,
lapack_int* iwork, lapack_int liwork )
{
lapack_int info = 0;
if( matrix_layout == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_cgedmd( &jobs, &jobz, &jobf, &whtsvd, &m, &n, x, &ldx, y, &ldy,
&k, reig, imeig, z, &ldz, res, b, &ldb, w, &ldw, s, &lds,
work, &lwork, iwork, &liwork, &info );
LAPACK_cgedmd( &jobs, &jobz, &jobr, &jobf, &whtsvd, &m, &n, x, &ldx, y,
&ldy, &nrnk, tol, &k, eigs, z, &ldz, res, b, &ldb, w, &ldw,
s, &lds, zwork, &lzwork, work, &lwork, iwork, &liwork,
&info );
if( info < 0 ) {
info = info - 1;
}
@@ -69,39 +71,40 @@ lapack_int LAPACKE_cgedmd_work( int matrix_layout, char jobs, char jobz,
/* Check leading dimension(s) */
if( ldx < n ) {
info = -9;
LAPACKE_xerbla( "LAPACKE_cgedmd_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgedmd_work", info );
return info;
}
if( ldy < n ) {
info = -11;
LAPACKE_xerbla( "LAPACKE_cgedmd_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgedmd_work", info );
return info;
}
if( ldz < n ) {
info = -16;
LAPACKE_xerbla( "LAPACKE_cgedmd_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgedmd_work", info );
return info;
}
if( ldb < n ) {
info = -19;
LAPACKE_xerbla( "LAPACKE_cgedmd_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgedmd_work", info );
return info;
}
if( ldw < n ) {
info = -21;
LAPACKE_xerbla( "LAPACKE_cgedmd_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgedmd_work", info );
return info;
}
if( lds < n ) {
info = -23;
LAPACKE_xerbla( "LAPACKE_cgedmd_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgedmd_work", info );
return info;
}
/* Query optimal working array(s) size if requested */
if( lwork == -1 ) {
LAPACK_cgedmd( &jobs, &jobz, &jobf, &whtsvd, &m, &n, x, &ldx, y, &ldy,
&k, reig, imeig, z, &ldz, res, b, &ldb, w, &ldw, s, &lds,
work, &lwork, iwork, &liwork, &info );
LAPACK_cgedmd( &jobs, &jobz, &jobr, &jobf, &whtsvd, &m, &n, x,
&ldx, y, &ldy, &nrnk, tol, &k, eigs, z, &ldz, res, b,
&ldb, w, &ldw, s, &lds, zwork, &lzwork,
work, &lwork, iwork, &liwork, &info );
return (info < 0) ? (info - 1) : info;
}
/* Allocate memory for temporary array(s) */
@@ -136,26 +139,27 @@ lapack_int LAPACKE_cgedmd_work( int matrix_layout, char jobs, char jobz,
goto exit_level_5;
}
/* Transpose input matrices */
LAPACKE_cge_trans( matrix_layout, m, n, x, ldx, x_t, ldx_t );
LAPACKE_cge_trans( matrix_layout, m, n, y, ldy, y_t, ldy_t );
LAPACKE_cge_trans( matrix_layout, m, n, z, ldz, z_t, ldz_t );
LAPACKE_cge_trans( matrix_layout, m, n, b, ldb, b_t, ldb_t );
LAPACKE_cge_trans( matrix_layout, m, n, w, ldw, w_t, ldw_t );
LAPACKE_cge_trans( matrix_layout, m, n, s, lds, s_t, lds_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, m, n, x, ldx, x_t, ldx_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, m, n, y, ldy, y_t, ldy_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, m, n, z, ldz, z_t, ldz_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, m, n, b, ldb, b_t, ldb_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, m, n, w, ldw, w_t, ldw_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, m, n, s, lds, s_t, lds_t );
/* Call LAPACK function and adjust info */
LAPACK_cgedmd( &jobs, &jobz, &jobf, &whtsvd, &m, &n, x_t, &ldx_t, y_t,
&ldy_t, &k, reig, imeig, z_t, &ldz_t, res, b_t, &ldb_t,
w_t, &ldw_t, s_t, &lds_t, work, &lwork, iwork, &liwork, &info );
LAPACK_cgedmd( &jobs, &jobz, &jobr, &jobf, &whtsvd, &m, &n, x_t,
&ldx_t, y_t, &ldy_t, &nrnk, tol, &k, eigs, z_t, &ldz_t,
res, b_t, &ldb_t, w_t, &ldw_t, s_t, &lds_t, zwork,
&lzwork, work, &lwork, iwork, &liwork, &info );
if( info < 0 ) {
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_cge_trans( LAPACK_COL_MAJOR, m, n, x_t, ldx_t, x, ldx );
LAPACKE_cge_trans( LAPACK_COL_MAJOR, m, n, y_t, ldy_t, y, ldy );
LAPACKE_cge_trans( LAPACK_COL_MAJOR, m, n, z_t, ldz_t, z, ldz );
LAPACKE_cge_trans( LAPACK_COL_MAJOR, m, n, b_t, ldb_t, b, ldb );
LAPACKE_cge_trans( LAPACK_COL_MAJOR, m, n, w_t, ldw_t, w, ldw );
LAPACKE_cge_trans( LAPACK_COL_MAJOR, m, n, s_t, lds_t, s, lds );
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, m, n, x_t, ldx_t, x, ldx );
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, m, n, y_t, ldy_t, y, ldy );
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, m, n, z_t, ldz_t, z, ldz );
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, m, n, b_t, ldb_t, b, ldb );
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, m, n, w_t, ldw_t, w, ldw );
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, m, n, s_t, lds_t, s, lds );
/* Release memory and exit */
LAPACKE_free( s_t );
exit_level_5:
@@ -170,11 +174,11 @@ exit_level_1:
LAPACKE_free( x_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgedmd_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgedmd_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_cgedmd_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgedmd_work", info );
}
return info;
}
+38 -28
View File
@@ -32,92 +32,102 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgedmdq( int matrix_layout, char jobs, char jobz, char jobr,
lapack_int API_SUFFIX(LAPACKE_cgedmdq)( int matrix_layout, char jobs, char jobz, char jobr,
char jobq, char jobt, char jobf, lapack_int whtsvd,
lapack_int m, lapack_int n, lapack_complex_float* f,
lapack_int ldf, lapack_complex_float* x,
lapack_int ldx, lapack_complex_float* y,
lapack_int ldy, lapack_int nrnk, float tol,
lapack_int k, lapack_complex_float* reig,
lapack_complex_float* imeig,
lapack_int ldy, lapack_int nrnk, float* tol,
lapack_int k, lapack_complex_float* eigs,
lapack_complex_float* z, lapack_int ldz,
lapack_complex_float* res, lapack_complex_float* b,
float* res, lapack_complex_float* b,
lapack_int ldb, lapack_complex_float* v,
lapack_int ldv, lapack_complex_float* s, lapack_int lds)
{
lapack_int info = 0;
lapack_int lwork = -1;
lapack_int liwork = -1;
lapack_complex_float* work = NULL;
lapack_int lzwork = -1;
lapack_complex_float* zwork = NULL;
float* work = NULL;
lapack_int* iwork = NULL;
lapack_complex_float work_query;
lapack_complex_float zwork_query;
float work_query;
lapack_int iwork_query;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_cgedmdq", -1 );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgedmdq", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_cge_nancheck( matrix_layout, m, n, f, ldf ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, m, n, f, ldf ) ) {
return -11;
}
if( LAPACKE_cge_nancheck( matrix_layout, m, n, x, ldx ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, m, n, x, ldx ) ) {
return -13;
}
if( LAPACKE_cge_nancheck( matrix_layout, m, n, y, ldy ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, m, n, y, ldy ) ) {
return -15;
}
if( LAPACKE_cge_nancheck( matrix_layout, m, n, z, ldz ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, m, n, z, ldz ) ) {
return -22;
}
if( LAPACKE_cge_nancheck( matrix_layout, m, n, b, ldb ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, m, n, b, ldb ) ) {
return -25;
}
if( LAPACKE_cge_nancheck( matrix_layout, m, n, v, ldv ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, m, n, v, ldv ) ) {
return -27;
}
if( LAPACKE_cge_nancheck( matrix_layout, m, n, s, lds ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, m, n, s, lds ) ) {
return -29;
}
}
#endif
/* Query optimal working array(s) size */
info = LAPACKE_cgedmdq_work( matrix_layout, jobs, jobz, jobr, jobq, jobt,
info = API_SUFFIX(LAPACKE_cgedmdq_work)( matrix_layout, jobs, jobz, jobr, jobq, jobt,
jobf, whtsvd, m, n, f, ldf, x, ldx, y, ldy,
nrnk, tol, k, reig, imeig, z, ldz, res,
b, ldb, v, ldv, s, lds, &work_query, lwork,
&iwork_query, liwork );
nrnk, tol, k, eigs, z, ldz, res,
b, ldb, v, ldv, s, lds, &zwork_query, lzwork,
&work_query, lwork, &iwork_query, liwork );
if( info != 0 ) {
goto exit_level_0;
}
lzwork = LAPACK_C2INT( zwork_query );
lwork = LAPACK_C2INT( work_query );
liwork = iwork_query;
/* Allocate memory for work arrays */
work = (lapack_complex_float*)LAPACKE_malloc( sizeof(lapack_complex_float) * lwork );
if( work == NULL ) {
zwork = (lapack_complex_float*)LAPACKE_malloc( sizeof(lapack_complex_float) * lzwork );
if( zwork == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
work = (float*)LAPACKE_malloc( sizeof(lapack_complex_float) * lwork );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_1;
}
iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * liwork );
if( iwork == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_1;
goto exit_level_2;
}
/* Call middle-level interface */
info = LAPACKE_cgedmdq_work( matrix_layout, jobs, jobz, jobr, jobq, jobt,
info = API_SUFFIX(LAPACKE_cgedmdq_work)( matrix_layout, jobs, jobz, jobr, jobq, jobt,
jobf, whtsvd, m, n, f, ldf, x, ldx, y, ldy,
nrnk, tol, k, reig, imeig, z, ldz, res,
b, ldb, v, ldv, s, lds, work, lwork, iwork,
liwork );
nrnk, tol, k, eigs, z, ldz, res,
b, ldb, v, ldv, s, lds, zwork, lzwork,
work, lwork, iwork, liwork );
/* Release memory and exit */
LAPACKE_free( iwork );
exit_level_1:
exit_level_2:
LAPACKE_free( work );
exit_level_1:
LAPACKE_free( zwork );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgedmdq", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgedmdq", info );
}
return info;
}
+39 -39
View File
@@ -32,21 +32,21 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgedmdq_work( int matrix_layout, char jobs, char jobz,
lapack_int API_SUFFIX(LAPACKE_cgedmdq_work)( int matrix_layout, char jobs, char jobz,
char jobr, char jobq, char jobt, char jobf,
lapack_int whtsvd, lapack_int m, lapack_int n,
lapack_complex_float* f, lapack_int ldf,
lapack_complex_float* x, lapack_int ldx,
lapack_complex_float* y, lapack_int ldy,
lapack_int nrnk, float tol, lapack_int k,
lapack_complex_float* reig,
lapack_complex_float* imeig,
lapack_int nrnk, float* tol, lapack_int k,
lapack_complex_float* eigs,
lapack_complex_float* z,
lapack_int ldz, lapack_complex_float* res,
lapack_int ldz, float* res,
lapack_complex_float* b,
lapack_int ldb, lapack_complex_float* v,
lapack_int ldv, lapack_complex_float* s,
lapack_int lds, lapack_complex_float* work,
lapack_int lds, lapack_complex_float *zwork,
lapack_int lzwork, float* work,
lapack_int lwork, lapack_int* iwork,
lapack_int liwork )
{
@@ -54,9 +54,9 @@ lapack_int LAPACKE_cgedmdq_work( int matrix_layout, char jobs, char jobz,
if( matrix_layout == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_cgedmdq( &jobs, &jobz, &jobr, &jobq, &jobt, &jobf, &whtsvd, &m,
&n, f, &ldf, x, &ldx, y, &ldy, &nrnk, &tol, &k, reig,
imeig, z, &ldz, res, b, &ldb, v, &ldv, s, &lds,
work, &lwork, iwork, &liwork, &info );
&n, f, &ldf, x, &ldx, y, &ldy, &nrnk, tol, &k, eigs,
z, &ldz, res, b, &ldb, v, &ldv, s, &lds,
zwork, &lzwork, work, &lwork, iwork, &liwork, &info );
if( info < 0 ) {
info = info - 1;
}
@@ -78,45 +78,45 @@ lapack_int LAPACKE_cgedmdq_work( int matrix_layout, char jobs, char jobz,
/* Check leading dimension(s) */
if( ldf < n ) {
info = -12;
LAPACKE_xerbla( "LAPACKE_cgedmdq_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgedmdq_work", info );
return info;
}
if( ldx < n ) {
info = -14;
LAPACKE_xerbla( "LAPACKE_cgedmdq_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgedmdq_work", info );
return info;
}
if( ldy < n ) {
info = -16;
LAPACKE_xerbla( "LAPACKE_cgedmdq_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgedmdq_work", info );
return info;
}
if( ldz < n ) {
info = -23;
LAPACKE_xerbla( "LAPACKE_cgedmdq_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgedmdq_work", info );
return info;
}
if( ldb < n ) {
info = -26;
LAPACKE_xerbla( "LAPACKE_cgedmdq_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgedmdq_work", info );
return info;
}
if( ldv < n ) {
info = -28;
LAPACKE_xerbla( "LAPACKE_cgedmdq_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgedmdq_work", info );
return info;
}
if( lds < n ) {
info = -30;
LAPACKE_xerbla( "LAPACKE_cgedmdq_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgedmdq_work", info );
return info;
}
/* Query optimal working array(s) size if requested */
if( lwork == -1 || liwork == -1 ) {
if( lzwork == -1 || lwork == -1 || liwork == -1 ) {
LAPACK_cgedmdq( &jobs, &jobz, &jobr, &jobq, &jobt, &jobf, &whtsvd, &m,
&n, f, &ldf, x, &ldx, y, &ldy, &nrnk, &tol, &k, reig,
imeig, z, &ldz, res, b, &ldb, v, &ldv, s, &lds,
work, &lwork, iwork, &liwork, &info );
&n, f, &ldf, x, &ldx, y, &ldy, &nrnk, tol, &k, eigs,
z, &ldz, res, b, &ldb, v, &ldv, s, &lds,
zwork, &lzwork, work, &lwork, iwork, &liwork, &info );
return (info < 0) ? (info - 1) : info;
}
/* Allocate memory for temporary array(s) */
@@ -156,29 +156,29 @@ lapack_int LAPACKE_cgedmdq_work( int matrix_layout, char jobs, char jobz,
goto exit_level_6;
}
/* Transpose input matrices */
LAPACKE_cge_trans( matrix_layout, m, n, f, ldf, f_t, ldf_t );
LAPACKE_cge_trans( matrix_layout, m, n, x, ldx, x_t, ldx_t );
LAPACKE_cge_trans( matrix_layout, m, n, y, ldy, y_t, ldy_t );
LAPACKE_cge_trans( matrix_layout, m, n, z, ldz, z_t, ldz_t );
LAPACKE_cge_trans( matrix_layout, m, n, b, ldb, b_t, ldb_t );
LAPACKE_cge_trans( matrix_layout, m, n, v, ldv, v_t, ldv_t );
LAPACKE_cge_trans( matrix_layout, m, n, s, lds, s_t, lds_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, m, n, f, ldf, f_t, ldf_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, m, n, x, ldx, x_t, ldx_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, m, n, y, ldy, y_t, ldy_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, m, n, z, ldz, z_t, ldz_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, m, n, b, ldb, b_t, ldb_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, m, n, v, ldv, v_t, ldv_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, m, n, s, lds, s_t, lds_t );
/* Call LAPACK function and adjust info */
LAPACK_cgedmdq( &jobs, &jobz, &jobr, &jobq, &jobt, &jobf, &whtsvd, &m,
&n, f, &ldf, x, &ldx, y, &ldy, &nrnk, &tol, &k, reig,
imeig, z, &ldz, res, b, &ldb, v, &ldv, s, &lds,
work, &lwork, iwork, &liwork, &info );
&n, f, &ldf, x, &ldx, y, &ldy, &nrnk, tol, &k, eigs,
z, &ldz, res, b, &ldb, v, &ldv, s, &lds,
zwork, &lzwork, work, &lwork, iwork, &liwork, &info );
if( info < 0 ) {
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_cge_trans( LAPACK_COL_MAJOR, m, n, f_t, ldf_t, f, ldf );
LAPACKE_cge_trans( LAPACK_COL_MAJOR, m, n, x_t, ldx_t, x, ldx );
LAPACKE_cge_trans( LAPACK_COL_MAJOR, m, n, y_t, ldy_t, y, ldy );
LAPACKE_cge_trans( LAPACK_COL_MAJOR, m, n, z_t, ldz_t, z, ldz );
LAPACKE_cge_trans( LAPACK_COL_MAJOR, m, n, b_t, ldb_t, b, ldb );
LAPACKE_cge_trans( LAPACK_COL_MAJOR, m, n, v_t, ldv_t, v, ldv );
LAPACKE_cge_trans( LAPACK_COL_MAJOR, m, n, s_t, lds_t, s, lds );
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, m, n, f_t, ldf_t, f, ldf );
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, m, n, x_t, ldx_t, x, ldx );
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, m, n, y_t, ldy_t, y, ldy );
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, m, n, z_t, ldz_t, z, ldz );
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, m, n, b_t, ldb_t, b, ldb );
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, m, n, v_t, ldv_t, v, ldv );
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, m, n, s_t, lds_t, s, lds );
/* Release memory and exit */
LAPACKE_free( s_t );
exit_level_6:
@@ -195,11 +195,11 @@ exit_level_1:
LAPACKE_free( f_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgedmdq_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgedmdq_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_cgedmdq_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgedmdq_work", info );
}
return info;
}
+4 -4
View File
@@ -32,23 +32,23 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgeequ( int matrix_layout, lapack_int m, lapack_int n,
lapack_int API_SUFFIX(LAPACKE_cgeequ)( int matrix_layout, lapack_int m, lapack_int n,
const lapack_complex_float* a, lapack_int lda,
float* r, float* c, float* rowcnd, float* colcnd,
float* amax )
{
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_cgeequ", -1 );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgeequ", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_cge_nancheck( matrix_layout, m, n, a, lda ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, m, n, a, lda ) ) {
return -4;
}
}
#endif
return LAPACKE_cgeequ_work( matrix_layout, m, n, a, lda, r, c, rowcnd,
return API_SUFFIX(LAPACKE_cgeequ_work)( matrix_layout, m, n, a, lda, r, c, rowcnd,
colcnd, amax );
}
+5 -5
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgeequ_work( int matrix_layout, lapack_int m, lapack_int n,
lapack_int API_SUFFIX(LAPACKE_cgeequ_work)( int matrix_layout, lapack_int m, lapack_int n,
const lapack_complex_float* a, lapack_int lda,
float* r, float* c, float* rowcnd,
float* colcnd, float* amax )
@@ -50,7 +50,7 @@ lapack_int LAPACKE_cgeequ_work( int matrix_layout, lapack_int m, lapack_int n,
/* Check leading dimension(s) */
if( lda < n ) {
info = -5;
LAPACKE_xerbla( "LAPACKE_cgeequ_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgeequ_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
@@ -61,7 +61,7 @@ lapack_int LAPACKE_cgeequ_work( int matrix_layout, lapack_int m, lapack_int n,
goto exit_level_0;
}
/* Transpose input matrices */
LAPACKE_cge_trans( matrix_layout, m, n, a, lda, a_t, lda_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, m, n, a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
LAPACK_cgeequ( &m, &n, a_t, &lda_t, r, c, rowcnd, colcnd, amax, &info );
if( info < 0 ) {
@@ -71,11 +71,11 @@ lapack_int LAPACKE_cgeequ_work( int matrix_layout, lapack_int m, lapack_int n,
LAPACKE_free( a_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgeequ_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgeequ_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_cgeequ_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgeequ_work", info );
}
return info;
}
+4 -4
View File
@@ -32,23 +32,23 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgeequb( int matrix_layout, lapack_int m, lapack_int n,
lapack_int API_SUFFIX(LAPACKE_cgeequb)( int matrix_layout, lapack_int m, lapack_int n,
const lapack_complex_float* a, lapack_int lda,
float* r, float* c, float* rowcnd, float* colcnd,
float* amax )
{
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_cgeequb", -1 );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgeequb", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_cge_nancheck( matrix_layout, m, n, a, lda ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, m, n, a, lda ) ) {
return -4;
}
}
#endif
return LAPACKE_cgeequb_work( matrix_layout, m, n, a, lda, r, c, rowcnd,
return API_SUFFIX(LAPACKE_cgeequb_work)( matrix_layout, m, n, a, lda, r, c, rowcnd,
colcnd, amax );
}
+5 -5
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgeequb_work( int matrix_layout, lapack_int m, lapack_int n,
lapack_int API_SUFFIX(LAPACKE_cgeequb_work)( int matrix_layout, lapack_int m, lapack_int n,
const lapack_complex_float* a, lapack_int lda,
float* r, float* c, float* rowcnd,
float* colcnd, float* amax )
@@ -50,7 +50,7 @@ lapack_int LAPACKE_cgeequb_work( int matrix_layout, lapack_int m, lapack_int n,
/* Check leading dimension(s) */
if( lda < n ) {
info = -5;
LAPACKE_xerbla( "LAPACKE_cgeequb_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgeequb_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
@@ -61,7 +61,7 @@ lapack_int LAPACKE_cgeequb_work( int matrix_layout, lapack_int m, lapack_int n,
goto exit_level_0;
}
/* Transpose input matrices */
LAPACKE_cge_trans( matrix_layout, m, n, a, lda, a_t, lda_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, m, n, a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
LAPACK_cgeequb( &m, &n, a_t, &lda_t, r, c, rowcnd, colcnd, amax,
&info );
@@ -72,11 +72,11 @@ lapack_int LAPACKE_cgeequb_work( int matrix_layout, lapack_int m, lapack_int n,
LAPACKE_free( a_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgeequb_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgeequb_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_cgeequb_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgeequb_work", info );
}
return info;
}
+8 -8
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgees( int matrix_layout, char jobvs, char sort,
lapack_int API_SUFFIX(LAPACKE_cgees)( int matrix_layout, char jobvs, char sort,
LAPACK_C_SELECT1 select, lapack_int n,
lapack_complex_float* a, lapack_int lda,
lapack_int* sdim, lapack_complex_float* w,
@@ -45,19 +45,19 @@ lapack_int LAPACKE_cgees( int matrix_layout, char jobvs, char sort,
lapack_complex_float* work = NULL;
lapack_complex_float work_query;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_cgees", -1 );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgees", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_cge_nancheck( matrix_layout, n, n, a, lda ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, n, n, a, lda ) ) {
return -6;
}
}
#endif
/* Allocate memory for working array(s) */
if( LAPACKE_lsame( sort, 's' ) ) {
if( API_SUFFIX(LAPACKE_lsame)( sort, 's' ) ) {
bwork = (lapack_logical*)
LAPACKE_malloc( sizeof(lapack_logical) * MAX(1,n) );
if( bwork == NULL ) {
@@ -71,7 +71,7 @@ lapack_int LAPACKE_cgees( int matrix_layout, char jobvs, char sort,
goto exit_level_1;
}
/* Query optimal working array(s) size */
info = LAPACKE_cgees_work( matrix_layout, jobvs, sort, select, n, a, lda,
info = API_SUFFIX(LAPACKE_cgees_work)( matrix_layout, jobvs, sort, select, n, a, lda,
sdim, w, vs, ldvs, &work_query, lwork, rwork,
bwork );
if( info != 0 ) {
@@ -86,19 +86,19 @@ lapack_int LAPACKE_cgees( int matrix_layout, char jobvs, char sort,
goto exit_level_2;
}
/* Call middle-level interface */
info = LAPACKE_cgees_work( matrix_layout, jobvs, sort, select, n, a, lda,
info = API_SUFFIX(LAPACKE_cgees_work)( matrix_layout, jobvs, sort, select, n, a, lda,
sdim, w, vs, ldvs, work, lwork, rwork, bwork );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_2:
LAPACKE_free( rwork );
exit_level_1:
if( LAPACKE_lsame( sort, 's' ) ) {
if( API_SUFFIX(LAPACKE_lsame)( sort, 's' ) ) {
LAPACKE_free( bwork );
}
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgees", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgees", info );
}
return info;
}
+11 -11
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgees_work( int matrix_layout, char jobvs, char sort,
lapack_int API_SUFFIX(LAPACKE_cgees_work)( int matrix_layout, char jobvs, char sort,
LAPACK_C_SELECT1 select, lapack_int n,
lapack_complex_float* a, lapack_int lda,
lapack_int* sdim, lapack_complex_float* w,
@@ -56,12 +56,12 @@ lapack_int LAPACKE_cgees_work( int matrix_layout, char jobvs, char sort,
/* Check leading dimension(s) */
if( lda < n ) {
info = -7;
LAPACKE_xerbla( "LAPACKE_cgees_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgees_work", info );
return info;
}
if( ldvs < n ) {
info = -11;
LAPACKE_xerbla( "LAPACKE_cgees_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgees_work", info );
return info;
}
/* Query optimal working array(s) size if requested */
@@ -77,7 +77,7 @@ lapack_int LAPACKE_cgees_work( int matrix_layout, char jobvs, char sort,
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
if( LAPACKE_lsame( jobvs, 'v' ) ) {
if( API_SUFFIX(LAPACKE_lsame)( jobvs, 'v' ) ) {
vs_t = (lapack_complex_float*)
LAPACKE_malloc( sizeof(lapack_complex_float) *
ldvs_t * MAX(1,n) );
@@ -87,7 +87,7 @@ lapack_int LAPACKE_cgees_work( int matrix_layout, char jobvs, char sort,
}
}
/* Transpose input matrices */
LAPACKE_cge_trans( matrix_layout, n, n, a, lda, a_t, lda_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, n, n, a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
LAPACK_cgees( &jobvs, &sort, select, &n, a_t, &lda_t, sdim, w, vs_t,
&ldvs_t, work, &lwork, rwork, bwork, &info );
@@ -95,23 +95,23 @@ lapack_int LAPACKE_cgees_work( int matrix_layout, char jobvs, char sort,
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda );
if( LAPACKE_lsame( jobvs, 'v' ) ) {
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, vs_t, ldvs_t, vs, ldvs );
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda );
if( API_SUFFIX(LAPACKE_lsame)( jobvs, 'v' ) ) {
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, n, n, vs_t, ldvs_t, vs, ldvs );
}
/* Release memory and exit */
if( LAPACKE_lsame( jobvs, 'v' ) ) {
if( API_SUFFIX(LAPACKE_lsame)( jobvs, 'v' ) ) {
LAPACKE_free( vs_t );
}
exit_level_1:
LAPACKE_free( a_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgees_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgees_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_cgees_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgees_work", info );
}
return info;
}
+8 -8
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgeesx( int matrix_layout, char jobvs, char sort,
lapack_int API_SUFFIX(LAPACKE_cgeesx)( int matrix_layout, char jobvs, char sort,
LAPACK_C_SELECT1 select, char sense, lapack_int n,
lapack_complex_float* a, lapack_int lda,
lapack_int* sdim, lapack_complex_float* w,
@@ -46,19 +46,19 @@ lapack_int LAPACKE_cgeesx( int matrix_layout, char jobvs, char sort,
lapack_complex_float* work = NULL;
lapack_complex_float work_query;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_cgeesx", -1 );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgeesx", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_cge_nancheck( matrix_layout, n, n, a, lda ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, n, n, a, lda ) ) {
return -7;
}
}
#endif
/* Allocate memory for working array(s) */
if( LAPACKE_lsame( sort, 's' ) ) {
if( API_SUFFIX(LAPACKE_lsame)( sort, 's' ) ) {
bwork = (lapack_logical*)
LAPACKE_malloc( sizeof(lapack_logical) * MAX(1,n) );
if( bwork == NULL ) {
@@ -72,7 +72,7 @@ lapack_int LAPACKE_cgeesx( int matrix_layout, char jobvs, char sort,
goto exit_level_1;
}
/* Query optimal working array(s) size */
info = LAPACKE_cgeesx_work( matrix_layout, jobvs, sort, select, sense, n, a,
info = API_SUFFIX(LAPACKE_cgeesx_work)( matrix_layout, jobvs, sort, select, sense, n, a,
lda, sdim, w, vs, ldvs, rconde, rcondv,
&work_query, lwork, rwork, bwork );
if( info != 0 ) {
@@ -87,7 +87,7 @@ lapack_int LAPACKE_cgeesx( int matrix_layout, char jobvs, char sort,
goto exit_level_2;
}
/* Call middle-level interface */
info = LAPACKE_cgeesx_work( matrix_layout, jobvs, sort, select, sense, n, a,
info = API_SUFFIX(LAPACKE_cgeesx_work)( matrix_layout, jobvs, sort, select, sense, n, a,
lda, sdim, w, vs, ldvs, rconde, rcondv, work,
lwork, rwork, bwork );
/* Release memory and exit */
@@ -95,12 +95,12 @@ lapack_int LAPACKE_cgeesx( int matrix_layout, char jobvs, char sort,
exit_level_2:
LAPACKE_free( rwork );
exit_level_1:
if( LAPACKE_lsame( sort, 's' ) ) {
if( API_SUFFIX(LAPACKE_lsame)( sort, 's' ) ) {
LAPACKE_free( bwork );
}
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgeesx", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgeesx", info );
}
return info;
}
+11 -11
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgeesx_work( int matrix_layout, char jobvs, char sort,
lapack_int API_SUFFIX(LAPACKE_cgeesx_work)( int matrix_layout, char jobvs, char sort,
LAPACK_C_SELECT1 select, char sense,
lapack_int n, lapack_complex_float* a,
lapack_int lda, lapack_int* sdim,
@@ -59,12 +59,12 @@ lapack_int LAPACKE_cgeesx_work( int matrix_layout, char jobvs, char sort,
/* Check leading dimension(s) */
if( lda < n ) {
info = -8;
LAPACKE_xerbla( "LAPACKE_cgeesx_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgeesx_work", info );
return info;
}
if( ldvs < n ) {
info = -12;
LAPACKE_xerbla( "LAPACKE_cgeesx_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgeesx_work", info );
return info;
}
/* Query optimal working array(s) size if requested */
@@ -81,7 +81,7 @@ lapack_int LAPACKE_cgeesx_work( int matrix_layout, char jobvs, char sort,
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
if( LAPACKE_lsame( jobvs, 'v' ) ) {
if( API_SUFFIX(LAPACKE_lsame)( jobvs, 'v' ) ) {
vs_t = (lapack_complex_float*)
LAPACKE_malloc( sizeof(lapack_complex_float) *
ldvs_t * MAX(1,n) );
@@ -91,7 +91,7 @@ lapack_int LAPACKE_cgeesx_work( int matrix_layout, char jobvs, char sort,
}
}
/* Transpose input matrices */
LAPACKE_cge_trans( matrix_layout, n, n, a, lda, a_t, lda_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, n, n, a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
LAPACK_cgeesx( &jobvs, &sort, select, &sense, &n, a_t, &lda_t, sdim, w,
vs_t, &ldvs_t, rconde, rcondv, work, &lwork, rwork,
@@ -100,23 +100,23 @@ lapack_int LAPACKE_cgeesx_work( int matrix_layout, char jobvs, char sort,
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda );
if( LAPACKE_lsame( jobvs, 'v' ) ) {
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, vs_t, ldvs_t, vs, ldvs );
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda );
if( API_SUFFIX(LAPACKE_lsame)( jobvs, 'v' ) ) {
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, n, n, vs_t, ldvs_t, vs, ldvs );
}
/* Release memory and exit */
if( LAPACKE_lsame( jobvs, 'v' ) ) {
if( API_SUFFIX(LAPACKE_lsame)( jobvs, 'v' ) ) {
LAPACKE_free( vs_t );
}
exit_level_1:
LAPACKE_free( a_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgeesx_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgeesx_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_cgeesx_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgeesx_work", info );
}
return info;
}
+6 -6
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgeev( int matrix_layout, char jobvl, char jobvr,
lapack_int API_SUFFIX(LAPACKE_cgeev)( int matrix_layout, char jobvl, char jobvr,
lapack_int n, lapack_complex_float* a, lapack_int lda,
lapack_complex_float* w, lapack_complex_float* vl,
lapack_int ldvl, lapack_complex_float* vr,
@@ -44,13 +44,13 @@ lapack_int LAPACKE_cgeev( int matrix_layout, char jobvl, char jobvr,
lapack_complex_float* work = NULL;
lapack_complex_float work_query;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_cgeev", -1 );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgeev", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_cge_nancheck( matrix_layout, n, n, a, lda ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, n, n, a, lda ) ) {
return -5;
}
}
@@ -62,7 +62,7 @@ lapack_int LAPACKE_cgeev( int matrix_layout, char jobvl, char jobvr,
goto exit_level_0;
}
/* Query optimal working array(s) size */
info = LAPACKE_cgeev_work( matrix_layout, jobvl, jobvr, n, a, lda, w, vl,
info = API_SUFFIX(LAPACKE_cgeev_work)( matrix_layout, jobvl, jobvr, n, a, lda, w, vl,
ldvl, vr, ldvr, &work_query, lwork, rwork );
if( info != 0 ) {
goto exit_level_1;
@@ -76,7 +76,7 @@ lapack_int LAPACKE_cgeev( int matrix_layout, char jobvl, char jobvr,
goto exit_level_1;
}
/* Call middle-level interface */
info = LAPACKE_cgeev_work( matrix_layout, jobvl, jobvr, n, a, lda, w, vl,
info = API_SUFFIX(LAPACKE_cgeev_work)( matrix_layout, jobvl, jobvr, n, a, lda, w, vl,
ldvl, vr, ldvr, work, lwork, rwork );
/* Release memory and exit */
LAPACKE_free( work );
@@ -84,7 +84,7 @@ exit_level_1:
LAPACKE_free( rwork );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgeev", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgeev", info );
}
return info;
}
+18 -18
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgeev_work( int matrix_layout, char jobvl, char jobvr,
lapack_int API_SUFFIX(LAPACKE_cgeev_work)( int matrix_layout, char jobvl, char jobvr,
lapack_int n, lapack_complex_float* a,
lapack_int lda, lapack_complex_float* w,
lapack_complex_float* vl, lapack_int ldvl,
@@ -58,17 +58,17 @@ lapack_int LAPACKE_cgeev_work( int matrix_layout, char jobvl, char jobvr,
/* Check leading dimension(s) */
if( lda < n ) {
info = -6;
LAPACKE_xerbla( "LAPACKE_cgeev_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgeev_work", info );
return info;
}
if( ldvl < 1 || ( LAPACKE_lsame( jobvl, 'v' ) && ldvl < n ) ) {
if( ldvl < 1 || ( API_SUFFIX(LAPACKE_lsame)( jobvl, 'v' ) && ldvl < n ) ) {
info = -9;
LAPACKE_xerbla( "LAPACKE_cgeev_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgeev_work", info );
return info;
}
if( ldvr < 1 || ( LAPACKE_lsame( jobvr, 'v' ) && ldvr < n ) ) {
if( ldvr < 1 || ( API_SUFFIX(LAPACKE_lsame)( jobvr, 'v' ) && ldvr < n ) ) {
info = -11;
LAPACKE_xerbla( "LAPACKE_cgeev_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgeev_work", info );
return info;
}
/* Query optimal working array(s) size if requested */
@@ -84,7 +84,7 @@ lapack_int LAPACKE_cgeev_work( int matrix_layout, char jobvl, char jobvr,
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
if( LAPACKE_lsame( jobvl, 'v' ) ) {
if( API_SUFFIX(LAPACKE_lsame)( jobvl, 'v' ) ) {
vl_t = (lapack_complex_float*)
LAPACKE_malloc( sizeof(lapack_complex_float) *
ldvl_t * MAX(1,n) );
@@ -93,7 +93,7 @@ lapack_int LAPACKE_cgeev_work( int matrix_layout, char jobvl, char jobvr,
goto exit_level_1;
}
}
if( LAPACKE_lsame( jobvr, 'v' ) ) {
if( API_SUFFIX(LAPACKE_lsame)( jobvr, 'v' ) ) {
vr_t = (lapack_complex_float*)
LAPACKE_malloc( sizeof(lapack_complex_float) *
ldvr_t * MAX(1,n) );
@@ -103,7 +103,7 @@ lapack_int LAPACKE_cgeev_work( int matrix_layout, char jobvl, char jobvr,
}
}
/* Transpose input matrices */
LAPACKE_cge_trans( matrix_layout, n, n, a, lda, a_t, lda_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, n, n, a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
LAPACK_cgeev( &jobvl, &jobvr, &n, a_t, &lda_t, w, vl_t, &ldvl_t, vr_t,
&ldvr_t, work, &lwork, rwork, &info );
@@ -111,30 +111,30 @@ lapack_int LAPACKE_cgeev_work( int matrix_layout, char jobvl, char jobvr,
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda );
if( LAPACKE_lsame( jobvl, 'v' ) ) {
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, vl_t, ldvl_t, vl, ldvl );
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda );
if( API_SUFFIX(LAPACKE_lsame)( jobvl, 'v' ) ) {
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, n, n, vl_t, ldvl_t, vl, ldvl );
}
if( LAPACKE_lsame( jobvr, 'v' ) ) {
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, vr_t, ldvr_t, vr, ldvr );
if( API_SUFFIX(LAPACKE_lsame)( jobvr, 'v' ) ) {
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, n, n, vr_t, ldvr_t, vr, ldvr );
}
/* Release memory and exit */
if( LAPACKE_lsame( jobvr, 'v' ) ) {
if( API_SUFFIX(LAPACKE_lsame)( jobvr, 'v' ) ) {
LAPACKE_free( vr_t );
}
exit_level_2:
if( LAPACKE_lsame( jobvl, 'v' ) ) {
if( API_SUFFIX(LAPACKE_lsame)( jobvl, 'v' ) ) {
LAPACKE_free( vl_t );
}
exit_level_1:
LAPACKE_free( a_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgeev_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgeev_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_cgeev_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgeev_work", info );
}
return info;
}
+6 -6
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgeevx( int matrix_layout, char balanc, char jobvl,
lapack_int API_SUFFIX(LAPACKE_cgeevx)( int matrix_layout, char balanc, char jobvl,
char jobvr, char sense, lapack_int n,
lapack_complex_float* a, lapack_int lda,
lapack_complex_float* w, lapack_complex_float* vl,
@@ -47,13 +47,13 @@ lapack_int LAPACKE_cgeevx( int matrix_layout, char balanc, char jobvl,
lapack_complex_float* work = NULL;
lapack_complex_float work_query;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_cgeevx", -1 );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgeevx", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_cge_nancheck( matrix_layout, n, n, a, lda ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, n, n, a, lda ) ) {
return -7;
}
}
@@ -65,7 +65,7 @@ lapack_int LAPACKE_cgeevx( int matrix_layout, char balanc, char jobvl,
goto exit_level_0;
}
/* Query optimal working array(s) size */
info = LAPACKE_cgeevx_work( matrix_layout, balanc, jobvl, jobvr, sense, n, a,
info = API_SUFFIX(LAPACKE_cgeevx_work)( matrix_layout, balanc, jobvl, jobvr, sense, n, a,
lda, w, vl, ldvl, vr, ldvr, ilo, ihi, scale,
abnrm, rconde, rcondv, &work_query, lwork,
rwork );
@@ -81,7 +81,7 @@ lapack_int LAPACKE_cgeevx( int matrix_layout, char balanc, char jobvl,
goto exit_level_1;
}
/* Call middle-level interface */
info = LAPACKE_cgeevx_work( matrix_layout, balanc, jobvl, jobvr, sense, n, a,
info = API_SUFFIX(LAPACKE_cgeevx_work)( matrix_layout, balanc, jobvl, jobvr, sense, n, a,
lda, w, vl, ldvl, vr, ldvr, ilo, ihi, scale,
abnrm, rconde, rcondv, work, lwork, rwork );
/* Release memory and exit */
@@ -90,7 +90,7 @@ exit_level_1:
LAPACKE_free( rwork );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgeevx", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgeevx", info );
}
return info;
}
+18 -18
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgeevx_work( int matrix_layout, char balanc, char jobvl,
lapack_int API_SUFFIX(LAPACKE_cgeevx_work)( int matrix_layout, char balanc, char jobvl,
char jobvr, char sense, lapack_int n,
lapack_complex_float* a, lapack_int lda,
lapack_complex_float* w,
@@ -62,17 +62,17 @@ lapack_int LAPACKE_cgeevx_work( int matrix_layout, char balanc, char jobvl,
/* Check leading dimension(s) */
if( lda < n ) {
info = -8;
LAPACKE_xerbla( "LAPACKE_cgeevx_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgeevx_work", info );
return info;
}
if( ldvl < 1 || ( LAPACKE_lsame( jobvl, 'v' ) && ldvl < n ) ) {
if( ldvl < 1 || ( API_SUFFIX(LAPACKE_lsame)( jobvl, 'v' ) && ldvl < n ) ) {
info = -11;
LAPACKE_xerbla( "LAPACKE_cgeevx_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgeevx_work", info );
return info;
}
if( ldvr < 1 || ( LAPACKE_lsame( jobvr, 'v' ) && ldvr < n ) ) {
if( ldvr < 1 || ( API_SUFFIX(LAPACKE_lsame)( jobvr, 'v' ) && ldvr < n ) ) {
info = -13;
LAPACKE_xerbla( "LAPACKE_cgeevx_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgeevx_work", info );
return info;
}
/* Query optimal working array(s) size if requested */
@@ -89,7 +89,7 @@ lapack_int LAPACKE_cgeevx_work( int matrix_layout, char balanc, char jobvl,
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
if( LAPACKE_lsame( jobvl, 'v' ) ) {
if( API_SUFFIX(LAPACKE_lsame)( jobvl, 'v' ) ) {
vl_t = (lapack_complex_float*)
LAPACKE_malloc( sizeof(lapack_complex_float) *
ldvl_t * MAX(1,n) );
@@ -98,7 +98,7 @@ lapack_int LAPACKE_cgeevx_work( int matrix_layout, char balanc, char jobvl,
goto exit_level_1;
}
}
if( LAPACKE_lsame( jobvr, 'v' ) ) {
if( API_SUFFIX(LAPACKE_lsame)( jobvr, 'v' ) ) {
vr_t = (lapack_complex_float*)
LAPACKE_malloc( sizeof(lapack_complex_float) *
ldvr_t * MAX(1,n) );
@@ -108,7 +108,7 @@ lapack_int LAPACKE_cgeevx_work( int matrix_layout, char balanc, char jobvl,
}
}
/* Transpose input matrices */
LAPACKE_cge_trans( matrix_layout, n, n, a, lda, a_t, lda_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, n, n, a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
LAPACK_cgeevx( &balanc, &jobvl, &jobvr, &sense, &n, a_t, &lda_t, w,
vl_t, &ldvl_t, vr_t, &ldvr_t, ilo, ihi, scale, abnrm,
@@ -117,30 +117,30 @@ lapack_int LAPACKE_cgeevx_work( int matrix_layout, char balanc, char jobvl,
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda );
if( LAPACKE_lsame( jobvl, 'v' ) ) {
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, vl_t, ldvl_t, vl, ldvl );
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda );
if( API_SUFFIX(LAPACKE_lsame)( jobvl, 'v' ) ) {
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, n, n, vl_t, ldvl_t, vl, ldvl );
}
if( LAPACKE_lsame( jobvr, 'v' ) ) {
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, vr_t, ldvr_t, vr, ldvr );
if( API_SUFFIX(LAPACKE_lsame)( jobvr, 'v' ) ) {
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, n, n, vr_t, ldvr_t, vr, ldvr );
}
/* Release memory and exit */
if( LAPACKE_lsame( jobvr, 'v' ) ) {
if( API_SUFFIX(LAPACKE_lsame)( jobvr, 'v' ) ) {
LAPACKE_free( vr_t );
}
exit_level_2:
if( LAPACKE_lsame( jobvl, 'v' ) ) {
if( API_SUFFIX(LAPACKE_lsame)( jobvl, 'v' ) ) {
LAPACKE_free( vl_t );
}
exit_level_1:
LAPACKE_free( a_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgeevx_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgeevx_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_cgeevx_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgeevx_work", info );
}
return info;
}
+6 -6
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgehrd( int matrix_layout, lapack_int n, lapack_int ilo,
lapack_int API_SUFFIX(LAPACKE_cgehrd)( int matrix_layout, lapack_int n, lapack_int ilo,
lapack_int ihi, lapack_complex_float* a,
lapack_int lda, lapack_complex_float* tau )
{
@@ -41,19 +41,19 @@ lapack_int LAPACKE_cgehrd( int matrix_layout, lapack_int n, lapack_int ilo,
lapack_complex_float* work = NULL;
lapack_complex_float work_query;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_cgehrd", -1 );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgehrd", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_cge_nancheck( matrix_layout, n, n, a, lda ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, n, n, a, lda ) ) {
return -5;
}
}
#endif
/* Query optimal working array(s) size */
info = LAPACKE_cgehrd_work( matrix_layout, n, ilo, ihi, a, lda, tau,
info = API_SUFFIX(LAPACKE_cgehrd_work)( matrix_layout, n, ilo, ihi, a, lda, tau,
&work_query, lwork );
if( info != 0 ) {
goto exit_level_0;
@@ -67,13 +67,13 @@ lapack_int LAPACKE_cgehrd( int matrix_layout, lapack_int n, lapack_int ilo,
goto exit_level_0;
}
/* Call middle-level interface */
info = LAPACKE_cgehrd_work( matrix_layout, n, ilo, ihi, a, lda, tau, work,
info = API_SUFFIX(LAPACKE_cgehrd_work)( matrix_layout, n, ilo, ihi, a, lda, tau, work,
lwork );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgehrd", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgehrd", info );
}
return info;
}
+6 -6
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgehrd_work( int matrix_layout, lapack_int n, lapack_int ilo,
lapack_int API_SUFFIX(LAPACKE_cgehrd_work)( int matrix_layout, lapack_int n, lapack_int ilo,
lapack_int ihi, lapack_complex_float* a,
lapack_int lda, lapack_complex_float* tau,
lapack_complex_float* work, lapack_int lwork )
@@ -50,7 +50,7 @@ lapack_int LAPACKE_cgehrd_work( int matrix_layout, lapack_int n, lapack_int ilo,
/* Check leading dimension(s) */
if( lda < n ) {
info = -6;
LAPACKE_xerbla( "LAPACKE_cgehrd_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgehrd_work", info );
return info;
}
/* Query optimal working array(s) size if requested */
@@ -67,23 +67,23 @@ lapack_int LAPACKE_cgehrd_work( int matrix_layout, lapack_int n, lapack_int ilo,
goto exit_level_0;
}
/* Transpose input matrices */
LAPACKE_cge_trans( matrix_layout, n, n, a, lda, a_t, lda_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, n, n, a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
LAPACK_cgehrd( &n, &ilo, &ihi, a_t, &lda_t, tau, work, &lwork, &info );
if( info < 0 ) {
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda );
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda );
/* Release memory and exit */
LAPACKE_free( a_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgehrd_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgehrd_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_cgehrd_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgehrd_work", info );
}
return info;
}
+54 -54
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgejsv( int matrix_layout, char joba, char jobu, char jobv,
lapack_int API_SUFFIX(LAPACKE_cgejsv)( int matrix_layout, char joba, char jobu, char jobv,
char jobr, char jobt, char jobp, lapack_int m,
lapack_int n, lapack_complex_float* a, lapack_int lda, float* sva,
lapack_complex_float* u, lapack_int ldu, lapack_complex_float* v, lapack_int ldv,
@@ -41,96 +41,96 @@ lapack_int LAPACKE_cgejsv( int matrix_layout, char joba, char jobu, char jobv,
lapack_int info = 0;
lapack_int lwork = (
// 1.1
( LAPACKE_lsame( jobu, 'n' ) && LAPACKE_lsame( jobv, 'n' ) &&
( LAPACKE_lsame( jobt, 't' ) || LAPACKE_lsame( joba, 'f' ) || LAPACKE_lsame( joba, 'g' ) )) ? 2*n+1 :
( API_SUFFIX(LAPACKE_lsame)( jobu, 'n' ) && API_SUFFIX(LAPACKE_lsame)( jobv, 'n' ) &&
( API_SUFFIX(LAPACKE_lsame)( jobt, 't' ) || API_SUFFIX(LAPACKE_lsame)( joba, 'f' ) || API_SUFFIX(LAPACKE_lsame)( joba, 'g' ) )) ? 2*n+1 :
//1.2
( ( LAPACKE_lsame( jobu, 'n' ) && LAPACKE_lsame( jobv, 'n' ) &&
!( LAPACKE_lsame( jobt, 't' ) || LAPACKE_lsame( joba, 'f' ) || LAPACKE_lsame( joba, 'g' ) )) ? n*n+3*n :
( ( API_SUFFIX(LAPACKE_lsame)( jobu, 'n' ) && API_SUFFIX(LAPACKE_lsame)( jobv, 'n' ) &&
!( API_SUFFIX(LAPACKE_lsame)( jobt, 't' ) || API_SUFFIX(LAPACKE_lsame)( joba, 'f' ) || API_SUFFIX(LAPACKE_lsame)( joba, 'g' ) )) ? n*n+3*n :
//2.1
( ( ( LAPACKE_lsame( jobv, 'v' ) || LAPACKE_lsame( jobv, 'j' ) ) &&
!( LAPACKE_lsame( jobu, 'u') || LAPACKE_lsame( jobu, 'f' ) )&&
( LAPACKE_lsame( jobt, 't' ) || LAPACKE_lsame( joba, 'f' ) || LAPACKE_lsame( joba, 'g' ) ))? 3*n :
( ( ( API_SUFFIX(LAPACKE_lsame)( jobv, 'v' ) || API_SUFFIX(LAPACKE_lsame)( jobv, 'j' ) ) &&
!( API_SUFFIX(LAPACKE_lsame)( jobu, 'u') || API_SUFFIX(LAPACKE_lsame)( jobu, 'f' ) )&&
( API_SUFFIX(LAPACKE_lsame)( jobt, 't' ) || API_SUFFIX(LAPACKE_lsame)( joba, 'f' ) || API_SUFFIX(LAPACKE_lsame)( joba, 'g' ) ))? 3*n :
//2.2
( ( ( LAPACKE_lsame( jobv, 'v' ) || LAPACKE_lsame( jobv, 'j' ) ) &&
!( LAPACKE_lsame( jobu, 'u' ) || LAPACKE_lsame( jobu, 'f' ) ) &&
!( LAPACKE_lsame( jobt, 't' ) || LAPACKE_lsame( joba, 'f' ) || LAPACKE_lsame( joba, 'g' ) ))? 3*n :
( ( ( API_SUFFIX(LAPACKE_lsame)( jobv, 'v' ) || API_SUFFIX(LAPACKE_lsame)( jobv, 'j' ) ) &&
!( API_SUFFIX(LAPACKE_lsame)( jobu, 'u' ) || API_SUFFIX(LAPACKE_lsame)( jobu, 'f' ) ) &&
!( API_SUFFIX(LAPACKE_lsame)( jobt, 't' ) || API_SUFFIX(LAPACKE_lsame)( joba, 'f' ) || API_SUFFIX(LAPACKE_lsame)( joba, 'g' ) ))? 3*n :
//3.1
( ( ( LAPACKE_lsame( jobu, 'u' ) || LAPACKE_lsame( jobu, 'f' )) &&
!( LAPACKE_lsame( jobv, 'v' ) || LAPACKE_lsame( jobv, 'j' )) &&
( LAPACKE_lsame( jobt, 't' ) || LAPACKE_lsame( joba, 'f' ) || LAPACKE_lsame( joba, 'g' ) ))? 3*n :
( ( ( API_SUFFIX(LAPACKE_lsame)( jobu, 'u' ) || API_SUFFIX(LAPACKE_lsame)( jobu, 'f' )) &&
!( API_SUFFIX(LAPACKE_lsame)( jobv, 'v' ) || API_SUFFIX(LAPACKE_lsame)( jobv, 'j' )) &&
( API_SUFFIX(LAPACKE_lsame)( jobt, 't' ) || API_SUFFIX(LAPACKE_lsame)( joba, 'f' ) || API_SUFFIX(LAPACKE_lsame)( joba, 'g' ) ))? 3*n :
//3.2
( ( ( LAPACKE_lsame( jobu, 'u' ) || LAPACKE_lsame( jobu, 'f' )) &&
!(LAPACKE_lsame( jobv, 'v' ) || LAPACKE_lsame( jobv, 'j' )) &&
!(LAPACKE_lsame( jobt, 't' ) || LAPACKE_lsame( joba, 'f' ) || LAPACKE_lsame( joba, 'g' ) ))? 3*n :
( ( ( API_SUFFIX(LAPACKE_lsame)( jobu, 'u' ) || API_SUFFIX(LAPACKE_lsame)( jobu, 'f' )) &&
!(API_SUFFIX(LAPACKE_lsame)( jobv, 'v' ) || API_SUFFIX(LAPACKE_lsame)( jobv, 'j' )) &&
!(API_SUFFIX(LAPACKE_lsame)( jobt, 't' ) || API_SUFFIX(LAPACKE_lsame)( joba, 'f' ) || API_SUFFIX(LAPACKE_lsame)( joba, 'g' ) ))? 3*n :
//4.1
( ( ( LAPACKE_lsame( jobu, 'u' ) || LAPACKE_lsame( jobu, 'f' ) ) &&
( LAPACKE_lsame( jobv, 'v' ) || LAPACKE_lsame( jobv, 'j' ) ) &&
( LAPACKE_lsame( jobt, 't' ) || LAPACKE_lsame( joba, 'f' ) || LAPACKE_lsame( joba, 'g' ) ))? 5*n+2*n*n :
( ( ( API_SUFFIX(LAPACKE_lsame)( jobu, 'u' ) || API_SUFFIX(LAPACKE_lsame)( jobu, 'f' ) ) &&
( API_SUFFIX(LAPACKE_lsame)( jobv, 'v' ) || API_SUFFIX(LAPACKE_lsame)( jobv, 'j' ) ) &&
( API_SUFFIX(LAPACKE_lsame)( jobt, 't' ) || API_SUFFIX(LAPACKE_lsame)( joba, 'f' ) || API_SUFFIX(LAPACKE_lsame)( joba, 'g' ) ))? 5*n+2*n*n :
//4.2
( ( ( LAPACKE_lsame( jobu, 'u' ) || LAPACKE_lsame( jobu, 'f' ) ) &&
( LAPACKE_lsame( jobv, 'v' ) || LAPACKE_lsame( jobv, 'j' ) ) &&
( LAPACKE_lsame( jobt, 't' ) || LAPACKE_lsame( joba, 'f' ) || LAPACKE_lsame( joba, 'g' ) ))? 4*n*n:
( ( ( API_SUFFIX(LAPACKE_lsame)( jobu, 'u' ) || API_SUFFIX(LAPACKE_lsame)( jobu, 'f' ) ) &&
( API_SUFFIX(LAPACKE_lsame)( jobv, 'v' ) || API_SUFFIX(LAPACKE_lsame)( jobv, 'j' ) ) &&
( API_SUFFIX(LAPACKE_lsame)( jobt, 't' ) || API_SUFFIX(LAPACKE_lsame)( joba, 'f' ) || API_SUFFIX(LAPACKE_lsame)( joba, 'g' ) ))? 4*n*n:
1) ) ) ) ) ) ) );
lapack_int lrwork = (
// 1.1
( LAPACKE_lsame( jobu, 'n' ) && LAPACKE_lsame( jobv, 'n' ) &&
( LAPACKE_lsame( jobt, 't' ) || LAPACKE_lsame( joba, 'f' ) || LAPACKE_lsame( joba, 'g' ) )) ? MAX(7,n+2*m) :
( API_SUFFIX(LAPACKE_lsame)( jobu, 'n' ) && API_SUFFIX(LAPACKE_lsame)( jobv, 'n' ) &&
( API_SUFFIX(LAPACKE_lsame)( jobt, 't' ) || API_SUFFIX(LAPACKE_lsame)( joba, 'f' ) || API_SUFFIX(LAPACKE_lsame)( joba, 'g' ) )) ? MAX(7,n+2*m) :
//1.2
( ( LAPACKE_lsame( jobu, 'n' ) && LAPACKE_lsame( jobv, 'n' ) &&
!( LAPACKE_lsame( jobt, 't' ) || LAPACKE_lsame( joba, 'f' ) || LAPACKE_lsame( joba, 'g' ) )) ? MAX(7,2*n) :
( ( API_SUFFIX(LAPACKE_lsame)( jobu, 'n' ) && API_SUFFIX(LAPACKE_lsame)( jobv, 'n' ) &&
!( API_SUFFIX(LAPACKE_lsame)( jobt, 't' ) || API_SUFFIX(LAPACKE_lsame)( joba, 'f' ) || API_SUFFIX(LAPACKE_lsame)( joba, 'g' ) )) ? MAX(7,2*n) :
//2.1
( ( ( LAPACKE_lsame( jobv, 'v' ) || LAPACKE_lsame( jobv, 'j' ) ) &&
!( LAPACKE_lsame( jobu, 'u') || LAPACKE_lsame( jobu, 'f' ) ) &&
( LAPACKE_lsame( jobt, 't' ) || LAPACKE_lsame( joba, 'f' ) || LAPACKE_lsame( joba, 'g' ) ))? MAX( 7, n+ 2*m ) :
( ( ( API_SUFFIX(LAPACKE_lsame)( jobv, 'v' ) || API_SUFFIX(LAPACKE_lsame)( jobv, 'j' ) ) &&
!( API_SUFFIX(LAPACKE_lsame)( jobu, 'u') || API_SUFFIX(LAPACKE_lsame)( jobu, 'f' ) ) &&
( API_SUFFIX(LAPACKE_lsame)( jobt, 't' ) || API_SUFFIX(LAPACKE_lsame)( joba, 'f' ) || API_SUFFIX(LAPACKE_lsame)( joba, 'g' ) ))? MAX( 7, n+ 2*m ) :
//2.2
( ( ( LAPACKE_lsame( jobv, 'v' ) || LAPACKE_lsame( jobv, 'j' ) ) &&
!( LAPACKE_lsame( jobu, 'u' ) || LAPACKE_lsame( jobu, 'f' ) ) &&
!( LAPACKE_lsame( jobt, 't' ) || LAPACKE_lsame( joba, 'f' ) || LAPACKE_lsame( joba, 'g' ) ))? MAX(7,2*n) :
( ( ( API_SUFFIX(LAPACKE_lsame)( jobv, 'v' ) || API_SUFFIX(LAPACKE_lsame)( jobv, 'j' ) ) &&
!( API_SUFFIX(LAPACKE_lsame)( jobu, 'u' ) || API_SUFFIX(LAPACKE_lsame)( jobu, 'f' ) ) &&
!( API_SUFFIX(LAPACKE_lsame)( jobt, 't' ) || API_SUFFIX(LAPACKE_lsame)( joba, 'f' ) || API_SUFFIX(LAPACKE_lsame)( joba, 'g' ) ))? MAX(7,2*n) :
//3.1
( ( ( LAPACKE_lsame( jobu, 'u' ) || LAPACKE_lsame( jobu, 'f' )) &&
!( LAPACKE_lsame( jobv, 'v' ) || LAPACKE_lsame( jobv, 'j' )) &&
( LAPACKE_lsame( jobt, 't' ) || LAPACKE_lsame( joba, 'f' ) || LAPACKE_lsame( joba, 'g' ) ))? MAX( 7, n+ 2*m ) :
( ( ( API_SUFFIX(LAPACKE_lsame)( jobu, 'u' ) || API_SUFFIX(LAPACKE_lsame)( jobu, 'f' )) &&
!( API_SUFFIX(LAPACKE_lsame)( jobv, 'v' ) || API_SUFFIX(LAPACKE_lsame)( jobv, 'j' )) &&
( API_SUFFIX(LAPACKE_lsame)( jobt, 't' ) || API_SUFFIX(LAPACKE_lsame)( joba, 'f' ) || API_SUFFIX(LAPACKE_lsame)( joba, 'g' ) ))? MAX( 7, n+ 2*m ) :
//3.2
( ( ( LAPACKE_lsame( jobu, 'u' ) || LAPACKE_lsame( jobu, 'f' )) &&
!(LAPACKE_lsame( jobv, 'v' ) || LAPACKE_lsame( jobv, 'j' )) &&
!(LAPACKE_lsame( jobt, 't' ) || LAPACKE_lsame( joba, 'f' ) || LAPACKE_lsame( joba, 'g' ) ))? MAX(7,2*n) :
( ( ( API_SUFFIX(LAPACKE_lsame)( jobu, 'u' ) || API_SUFFIX(LAPACKE_lsame)( jobu, 'f' )) &&
!(API_SUFFIX(LAPACKE_lsame)( jobv, 'v' ) || API_SUFFIX(LAPACKE_lsame)( jobv, 'j' )) &&
!(API_SUFFIX(LAPACKE_lsame)( jobt, 't' ) || API_SUFFIX(LAPACKE_lsame)( joba, 'f' ) || API_SUFFIX(LAPACKE_lsame)( joba, 'g' ) ))? MAX(7,2*n) :
//4.1
( ( ( LAPACKE_lsame( jobu, 'u' ) || LAPACKE_lsame( jobu, 'f' ) ) &&
( LAPACKE_lsame( jobv, 'v' ) || LAPACKE_lsame( jobv, 'j' ) ) &&
( LAPACKE_lsame( jobt, 't' ) || LAPACKE_lsame( joba, 'f' ) || LAPACKE_lsame( joba, 'g' ) ))? MAX( 7, n+ 2*m ) :
( ( ( API_SUFFIX(LAPACKE_lsame)( jobu, 'u' ) || API_SUFFIX(LAPACKE_lsame)( jobu, 'f' ) ) &&
( API_SUFFIX(LAPACKE_lsame)( jobv, 'v' ) || API_SUFFIX(LAPACKE_lsame)( jobv, 'j' ) ) &&
( API_SUFFIX(LAPACKE_lsame)( jobt, 't' ) || API_SUFFIX(LAPACKE_lsame)( joba, 'f' ) || API_SUFFIX(LAPACKE_lsame)( joba, 'g' ) ))? MAX( 7, n+ 2*m ) :
//4.2
( ( ( LAPACKE_lsame( jobu, 'u' ) || LAPACKE_lsame( jobu, 'f' ) ) &&
( LAPACKE_lsame( jobv, 'v' ) || LAPACKE_lsame( jobv, 'j' ) ) &&
( LAPACKE_lsame( jobt, 't' ) || LAPACKE_lsame( joba, 'f' ) || LAPACKE_lsame( joba, 'g' ) ))? MAX(7,2*n) :
( ( ( API_SUFFIX(LAPACKE_lsame)( jobu, 'u' ) || API_SUFFIX(LAPACKE_lsame)( jobu, 'f' ) ) &&
( API_SUFFIX(LAPACKE_lsame)( jobv, 'v' ) || API_SUFFIX(LAPACKE_lsame)( jobv, 'j' ) ) &&
( API_SUFFIX(LAPACKE_lsame)( jobt, 't' ) || API_SUFFIX(LAPACKE_lsame)( joba, 'f' ) || API_SUFFIX(LAPACKE_lsame)( joba, 'g' ) ))? MAX(7,2*n) :
7) ) ) ) ) ) ) );
lapack_int* iwork = NULL;
float* rwork = NULL;
lapack_complex_float* cwork = NULL;
lapack_int i;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_cgejsv", -1 );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgejsv", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_cge_nancheck( matrix_layout, m, n, a, lda ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, m, n, a, lda ) ) {
return -10;
}
}
@@ -143,13 +143,13 @@ lapack_int LAPACKE_cgejsv( int matrix_layout, char joba, char jobu, char jobv,
}
lwork = MAX( lwork, 1 );
{ /* FIXUP LWORK */
int want_u = LAPACKE_lsame( jobu, 'u' ) || LAPACKE_lsame( jobu, 'f' );
int want_v = LAPACKE_lsame( jobv, 'v' ) || LAPACKE_lsame( jobv, 'j' );
int want_sce = LAPACKE_lsame( joba, 'e' ) || LAPACKE_lsame( joba, 'g' );
int want_u = API_SUFFIX(LAPACKE_lsame)( jobu, 'u' ) || API_SUFFIX(LAPACKE_lsame)( jobu, 'f' );
int want_v = API_SUFFIX(LAPACKE_lsame)( jobv, 'v' ) || API_SUFFIX(LAPACKE_lsame)( jobv, 'j' );
int want_sce = API_SUFFIX(LAPACKE_lsame)( joba, 'e' ) || API_SUFFIX(LAPACKE_lsame)( joba, 'g' );
if( !want_u && !want_v && !want_sce ) lwork = MAX( lwork, 2*n+1 ); // 1.1
if( !want_u && !want_v && want_sce ) lwork = MAX( lwork, n*n+3*n ); // 1.2
if( want_u && LAPACKE_lsame( jobv, 'v' ) ) lwork = MAX( lwork, 5*n+2*n*n ); // 4.1
if( want_u && LAPACKE_lsame( jobv, 'j' ) ) lwork = MAX( lwork, 4*n+n*n ); // 4.2
if( want_u && API_SUFFIX(LAPACKE_lsame)( jobv, 'v' ) ) lwork = MAX( lwork, 5*n+2*n*n ); // 4.1
if( want_u && API_SUFFIX(LAPACKE_lsame)( jobv, 'j' ) ) lwork = MAX( lwork, 4*n+n*n ); // 4.2
}
cwork = (lapack_complex_float*)LAPACKE_malloc( sizeof(lapack_complex_float) * lwork );
if( cwork == NULL ) {
@@ -163,7 +163,7 @@ lapack_int LAPACKE_cgejsv( int matrix_layout, char joba, char jobu, char jobv,
goto exit_level_2;
}
/* Call middle-level interface */
info = LAPACKE_cgejsv_work( matrix_layout, joba, jobu, jobv, jobr, jobt,
info = API_SUFFIX(LAPACKE_cgejsv_work)( matrix_layout, joba, jobu, jobv, jobr, jobt,
jobp, m, n, a, lda, sva, u, ldu, v, ldv, cwork,
lwork, rwork, lrwork, iwork );
/* Backup significant data from working array(s) */
@@ -181,7 +181,7 @@ exit_level_1:
LAPACKE_free( iwork );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgejsv", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgejsv", info );
}
return info;
}
+25 -25
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgejsv_work( int matrix_layout, char joba, char jobu,
lapack_int API_SUFFIX(LAPACKE_cgejsv_work)( int matrix_layout, char joba, char jobu,
char jobv, char jobr, char jobt, char jobp,
lapack_int m, lapack_int n, lapack_complex_float* a,
lapack_int lda, float* sva, lapack_complex_float* u,
@@ -51,10 +51,10 @@ lapack_int LAPACKE_cgejsv_work( int matrix_layout, char joba, char jobu,
info = info - 1;
}
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
lapack_int nu = LAPACKE_lsame( jobu, 'n' ) ? 1 : m;
lapack_int nv = LAPACKE_lsame( jobv, 'n' ) ? 1 : n;
lapack_int ncols_u = LAPACKE_lsame( jobu, 'n' ) ? 1 :
LAPACKE_lsame( jobu, 'f' ) ? m : n;
lapack_int nu = API_SUFFIX(LAPACKE_lsame)( jobu, 'n' ) ? 1 : m;
lapack_int nv = API_SUFFIX(LAPACKE_lsame)( jobv, 'n' ) ? 1 : n;
lapack_int ncols_u = API_SUFFIX(LAPACKE_lsame)( jobu, 'n' ) ? 1 :
API_SUFFIX(LAPACKE_lsame)( jobu, 'f' ) ? m : n;
lapack_int lda_t = MAX(1,m);
lapack_int ldu_t = MAX(1,nu);
lapack_int ldv_t = MAX(1,nv);
@@ -64,17 +64,17 @@ lapack_int LAPACKE_cgejsv_work( int matrix_layout, char joba, char jobu,
/* Check leading dimension(s) */
if( lda < n ) {
info = -11;
LAPACKE_xerbla( "LAPACKE_cgejsv_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgejsv_work", info );
return info;
}
if( ldu < ncols_u ) {
info = -14;
LAPACKE_xerbla( "LAPACKE_cgejsv_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgejsv_work", info );
return info;
}
if( ldv < n ) {
info = -16;
LAPACKE_xerbla( "LAPACKE_cgejsv_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgejsv_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
@@ -84,8 +84,8 @@ lapack_int LAPACKE_cgejsv_work( int matrix_layout, char joba, char jobu,
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
if( LAPACKE_lsame( jobu, 'f' ) || LAPACKE_lsame( jobu, 'u' ) ||
LAPACKE_lsame( jobu, 'w' ) ) {
if( API_SUFFIX(LAPACKE_lsame)( jobu, 'f' ) || API_SUFFIX(LAPACKE_lsame)( jobu, 'u' ) ||
API_SUFFIX(LAPACKE_lsame)( jobu, 'w' ) ) {
u_t = (lapack_complex_float*)
LAPACKE_malloc( sizeof(lapack_complex_float) * ldu_t * MAX(1,ncols_u) );
if( u_t == NULL ) {
@@ -93,8 +93,8 @@ lapack_int LAPACKE_cgejsv_work( int matrix_layout, char joba, char jobu,
goto exit_level_1;
}
}
if( LAPACKE_lsame( jobv, 'j' ) || LAPACKE_lsame( jobv, 'v' ) ||
LAPACKE_lsame( jobv, 'w' ) ) {
if( API_SUFFIX(LAPACKE_lsame)( jobv, 'j' ) || API_SUFFIX(LAPACKE_lsame)( jobv, 'v' ) ||
API_SUFFIX(LAPACKE_lsame)( jobv, 'w' ) ) {
v_t = (lapack_complex_float*)
LAPACKE_malloc( sizeof(lapack_complex_float) * ldv_t * MAX(1,n) );
if( v_t == NULL ) {
@@ -103,7 +103,7 @@ lapack_int LAPACKE_cgejsv_work( int matrix_layout, char joba, char jobu,
}
}
/* Transpose input matrices */
LAPACKE_cge_trans( matrix_layout, m, n, a, lda, a_t, lda_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, m, n, a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
LAPACK_cgejsv( &joba, &jobu, &jobv, &jobr, &jobt, &jobp, &m, &n, a_t,
&lda_t, sva, u_t, &ldu_t, v_t, &ldv_t, cwork, &lwork,
@@ -112,33 +112,33 @@ lapack_int LAPACKE_cgejsv_work( int matrix_layout, char joba, char jobu,
info = info - 1;
}
/* Transpose output matrices */
if( LAPACKE_lsame( jobu, 'f' ) || LAPACKE_lsame( jobu, 'u' ) ||
LAPACKE_lsame( jobu, 'w' ) ) {
LAPACKE_cge_trans( LAPACK_COL_MAJOR, nu, ncols_u, u_t, ldu_t, u, ldu );
if( API_SUFFIX(LAPACKE_lsame)( jobu, 'f' ) || API_SUFFIX(LAPACKE_lsame)( jobu, 'u' ) ||
API_SUFFIX(LAPACKE_lsame)( jobu, 'w' ) ) {
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, nu, ncols_u, u_t, ldu_t, u, ldu );
}
if( LAPACKE_lsame( jobv, 'j' ) || LAPACKE_lsame( jobv, 'v' ) ||
LAPACKE_lsame( jobv, 'w' ) ) {
LAPACKE_cge_trans( LAPACK_COL_MAJOR, nv, n, v_t, ldv_t, v, ldv );
if( API_SUFFIX(LAPACKE_lsame)( jobv, 'j' ) || API_SUFFIX(LAPACKE_lsame)( jobv, 'v' ) ||
API_SUFFIX(LAPACKE_lsame)( jobv, 'w' ) ) {
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, nv, n, v_t, ldv_t, v, ldv );
}
/* Release memory and exit */
if( LAPACKE_lsame( jobv, 'j' ) || LAPACKE_lsame( jobv, 'v' ) ||
LAPACKE_lsame( jobv, 'w' ) ) {
if( API_SUFFIX(LAPACKE_lsame)( jobv, 'j' ) || API_SUFFIX(LAPACKE_lsame)( jobv, 'v' ) ||
API_SUFFIX(LAPACKE_lsame)( jobv, 'w' ) ) {
LAPACKE_free( v_t );
}
exit_level_2:
if( LAPACKE_lsame( jobu, 'f' ) || LAPACKE_lsame( jobu, 'u' ) ||
LAPACKE_lsame( jobu, 'w' ) ) {
if( API_SUFFIX(LAPACKE_lsame)( jobu, 'f' ) || API_SUFFIX(LAPACKE_lsame)( jobu, 'u' ) ||
API_SUFFIX(LAPACKE_lsame)( jobu, 'w' ) ) {
LAPACKE_free( u_t );
}
exit_level_1:
LAPACKE_free( a_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgejsv_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgejsv_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_cgejsv_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgejsv_work", info );
}
return info;
}
+6 -6
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgelq( int matrix_layout, lapack_int m, lapack_int n,
lapack_int API_SUFFIX(LAPACKE_cgelq)( int matrix_layout, lapack_int m, lapack_int n,
lapack_complex_float* a, lapack_int lda,
lapack_complex_float* t, lapack_int tsize )
{
@@ -41,19 +41,19 @@ lapack_int LAPACKE_cgelq( int matrix_layout, lapack_int m, lapack_int n,
lapack_complex_float* work = NULL;
lapack_complex_float work_query;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_cgelq", -1 );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgelq", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_cge_nancheck( matrix_layout, m, n, a, lda ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, m, n, a, lda ) ) {
return -4;
}
}
#endif
/* Query optimal working array(s) size */
info = LAPACKE_cgelq_work( matrix_layout, m, n, a, lda, t, tsize, &work_query,
info = API_SUFFIX(LAPACKE_cgelq_work)( matrix_layout, m, n, a, lda, t, tsize, &work_query,
lwork );
if( info != 0 ) {
goto exit_level_0;
@@ -69,12 +69,12 @@ lapack_int LAPACKE_cgelq( int matrix_layout, lapack_int m, lapack_int n,
goto exit_level_0;
}
/* Call middle-level interface */
info = LAPACKE_cgelq_work( matrix_layout, m, n, a, lda, t, tsize, work, lwork );
info = API_SUFFIX(LAPACKE_cgelq_work)( matrix_layout, m, n, a, lda, t, tsize, work, lwork );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgelq", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgelq", info );
}
return info;
}
+5 -5
View File
@@ -32,20 +32,20 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgelq2( int matrix_layout, lapack_int m, lapack_int n,
lapack_int API_SUFFIX(LAPACKE_cgelq2)( int matrix_layout, lapack_int m, lapack_int n,
lapack_complex_float* a, lapack_int lda,
lapack_complex_float* tau )
{
lapack_int info = 0;
lapack_complex_float* work = NULL;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_cgelq2", -1 );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgelq2", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_cge_nancheck( matrix_layout, m, n, a, lda ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, m, n, a, lda ) ) {
return -4;
}
}
@@ -58,12 +58,12 @@ lapack_int LAPACKE_cgelq2( int matrix_layout, lapack_int m, lapack_int n,
goto exit_level_0;
}
/* Call middle-level interface */
info = LAPACKE_cgelq2_work( matrix_layout, m, n, a, lda, tau, work );
info = API_SUFFIX(LAPACKE_cgelq2_work)( matrix_layout, m, n, a, lda, tau, work );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgelq2", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgelq2", info );
}
return info;
}
+6 -6
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgelq2_work( int matrix_layout, lapack_int m, lapack_int n,
lapack_int API_SUFFIX(LAPACKE_cgelq2_work)( int matrix_layout, lapack_int m, lapack_int n,
lapack_complex_float* a, lapack_int lda,
lapack_complex_float* tau,
lapack_complex_float* work )
@@ -50,7 +50,7 @@ lapack_int LAPACKE_cgelq2_work( int matrix_layout, lapack_int m, lapack_int n,
/* Check leading dimension(s) */
if( lda < n ) {
info = -5;
LAPACKE_xerbla( "LAPACKE_cgelq2_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgelq2_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
@@ -61,23 +61,23 @@ lapack_int LAPACKE_cgelq2_work( int matrix_layout, lapack_int m, lapack_int n,
goto exit_level_0;
}
/* Transpose input matrices */
LAPACKE_cge_trans( matrix_layout, m, n, a, lda, a_t, lda_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, m, n, a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
LAPACK_cgelq2( &m, &n, a_t, &lda_t, tau, work, &info );
if( info < 0 ) {
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_cge_trans( LAPACK_COL_MAJOR, m, n, a_t, lda_t, a, lda );
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, m, n, a_t, lda_t, a, lda );
/* Release memory and exit */
LAPACKE_free( a_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgelq2_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgelq2_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_cgelq2_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgelq2_work", info );
}
return info;
}
+6 -6
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgelq_work( int matrix_layout, lapack_int m, lapack_int n,
lapack_int API_SUFFIX(LAPACKE_cgelq_work)( int matrix_layout, lapack_int m, lapack_int n,
lapack_complex_float* a, lapack_int lda,
lapack_complex_float* t, lapack_int tsize,
lapack_complex_float* work, lapack_int lwork )
@@ -50,7 +50,7 @@ lapack_int LAPACKE_cgelq_work( int matrix_layout, lapack_int m, lapack_int n,
/* Check leading dimension(s) */
if( lda < n ) {
info = -5;
LAPACKE_xerbla( "LAPACKE_cgelq_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgelq_work", info );
return info;
}
/* Query optimal working array(s) size if requested */
@@ -65,23 +65,23 @@ lapack_int LAPACKE_cgelq_work( int matrix_layout, lapack_int m, lapack_int n,
goto exit_level_0;
}
/* Transpose input matrices */
LAPACKE_cge_trans( matrix_layout, m, n, a, lda, a_t, lda_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, m, n, a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
LAPACK_cgelq( &m, &n, a_t, &lda_t, t, &tsize, work, &lwork, &info );
if( info < 0 ) {
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_cge_trans( LAPACK_COL_MAJOR, m, n, a_t, lda_t, a, lda );
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, m, n, a_t, lda_t, a, lda );
/* Release memory and exit */
LAPACKE_free( a_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgelq_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgelq_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_cgelq_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgelq_work", info );
}
return info;
}
+6 -6
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgelqf( int matrix_layout, lapack_int m, lapack_int n,
lapack_int API_SUFFIX(LAPACKE_cgelqf)( int matrix_layout, lapack_int m, lapack_int n,
lapack_complex_float* a, lapack_int lda,
lapack_complex_float* tau )
{
@@ -41,19 +41,19 @@ lapack_int LAPACKE_cgelqf( int matrix_layout, lapack_int m, lapack_int n,
lapack_complex_float* work = NULL;
lapack_complex_float work_query;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_cgelqf", -1 );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgelqf", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_cge_nancheck( matrix_layout, m, n, a, lda ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, m, n, a, lda ) ) {
return -4;
}
}
#endif
/* Query optimal working array(s) size */
info = LAPACKE_cgelqf_work( matrix_layout, m, n, a, lda, tau, &work_query,
info = API_SUFFIX(LAPACKE_cgelqf_work)( matrix_layout, m, n, a, lda, tau, &work_query,
lwork );
if( info != 0 ) {
goto exit_level_0;
@@ -67,12 +67,12 @@ lapack_int LAPACKE_cgelqf( int matrix_layout, lapack_int m, lapack_int n,
goto exit_level_0;
}
/* Call middle-level interface */
info = LAPACKE_cgelqf_work( matrix_layout, m, n, a, lda, tau, work, lwork );
info = API_SUFFIX(LAPACKE_cgelqf_work)( matrix_layout, m, n, a, lda, tau, work, lwork );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgelqf", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgelqf", info );
}
return info;
}
+6 -6
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgelqf_work( int matrix_layout, lapack_int m, lapack_int n,
lapack_int API_SUFFIX(LAPACKE_cgelqf_work)( int matrix_layout, lapack_int m, lapack_int n,
lapack_complex_float* a, lapack_int lda,
lapack_complex_float* tau,
lapack_complex_float* work, lapack_int lwork )
@@ -50,7 +50,7 @@ lapack_int LAPACKE_cgelqf_work( int matrix_layout, lapack_int m, lapack_int n,
/* Check leading dimension(s) */
if( lda < n ) {
info = -5;
LAPACKE_xerbla( "LAPACKE_cgelqf_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgelqf_work", info );
return info;
}
/* Query optimal working array(s) size if requested */
@@ -66,23 +66,23 @@ lapack_int LAPACKE_cgelqf_work( int matrix_layout, lapack_int m, lapack_int n,
goto exit_level_0;
}
/* Transpose input matrices */
LAPACKE_cge_trans( matrix_layout, m, n, a, lda, a_t, lda_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, m, n, a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
LAPACK_cgelqf( &m, &n, a_t, &lda_t, tau, work, &lwork, &info );
if( info < 0 ) {
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_cge_trans( LAPACK_COL_MAJOR, m, n, a_t, lda_t, a, lda );
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, m, n, a_t, lda_t, a, lda );
/* Release memory and exit */
LAPACKE_free( a_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgelqf_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgelqf_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_cgelqf_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgelqf_work", info );
}
return info;
}
+7 -7
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgels( int matrix_layout, char trans, lapack_int m,
lapack_int API_SUFFIX(LAPACKE_cgels)( int matrix_layout, char trans, lapack_int m,
lapack_int n, lapack_int nrhs,
lapack_complex_float* a, lapack_int lda,
lapack_complex_float* b, lapack_int ldb )
@@ -42,22 +42,22 @@ lapack_int LAPACKE_cgels( int matrix_layout, char trans, lapack_int m,
lapack_complex_float* work = NULL;
lapack_complex_float work_query;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_cgels", -1 );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgels", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_cge_nancheck( matrix_layout, m, n, a, lda ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, m, n, a, lda ) ) {
return -6;
}
if( LAPACKE_cge_nancheck( matrix_layout, MAX(m,n), nrhs, b, ldb ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, MAX(m,n), nrhs, b, ldb ) ) {
return -8;
}
}
#endif
/* Query optimal working array(s) size */
info = LAPACKE_cgels_work( matrix_layout, trans, m, n, nrhs, a, lda, b, ldb,
info = API_SUFFIX(LAPACKE_cgels_work)( matrix_layout, trans, m, n, nrhs, a, lda, b, ldb,
&work_query, lwork );
if( info != 0 ) {
goto exit_level_0;
@@ -71,13 +71,13 @@ lapack_int LAPACKE_cgels( int matrix_layout, char trans, lapack_int m,
goto exit_level_0;
}
/* Call middle-level interface */
info = LAPACKE_cgels_work( matrix_layout, trans, m, n, nrhs, a, lda, b, ldb,
info = API_SUFFIX(LAPACKE_cgels_work)( matrix_layout, trans, m, n, nrhs, a, lda, b, ldb,
work, lwork );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgels", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgels", info );
}
return info;
}
+9 -9
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgels_work( int matrix_layout, char trans, lapack_int m,
lapack_int API_SUFFIX(LAPACKE_cgels_work)( int matrix_layout, char trans, lapack_int m,
lapack_int n, lapack_int nrhs,
lapack_complex_float* a, lapack_int lda,
lapack_complex_float* b, lapack_int ldb,
@@ -54,12 +54,12 @@ lapack_int LAPACKE_cgels_work( int matrix_layout, char trans, lapack_int m,
/* Check leading dimension(s) */
if( lda < n ) {
info = -7;
LAPACKE_xerbla( "LAPACKE_cgels_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgels_work", info );
return info;
}
if( ldb < nrhs ) {
info = -9;
LAPACKE_xerbla( "LAPACKE_cgels_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgels_work", info );
return info;
}
/* Query optimal working array(s) size if requested */
@@ -83,8 +83,8 @@ lapack_int LAPACKE_cgels_work( int matrix_layout, char trans, lapack_int m,
goto exit_level_1;
}
/* Transpose input matrices */
LAPACKE_cge_trans( matrix_layout, m, n, a, lda, a_t, lda_t );
LAPACKE_cge_trans( matrix_layout, MAX(m,n), nrhs, b, ldb, b_t, ldb_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, m, n, a, lda, a_t, lda_t );
API_SUFFIX(LAPACKE_cge_trans)( matrix_layout, MAX(m,n), nrhs, b, ldb, b_t, ldb_t );
/* Call LAPACK function and adjust info */
LAPACK_cgels( &trans, &m, &n, &nrhs, a_t, &lda_t, b_t, &ldb_t, work,
&lwork, &info );
@@ -92,8 +92,8 @@ lapack_int LAPACKE_cgels_work( int matrix_layout, char trans, lapack_int m,
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_cge_trans( LAPACK_COL_MAJOR, m, n, a_t, lda_t, a, lda );
LAPACKE_cge_trans( LAPACK_COL_MAJOR, MAX(m,n), nrhs, b_t, ldb_t, b,
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, m, n, a_t, lda_t, a, lda );
API_SUFFIX(LAPACKE_cge_trans)( LAPACK_COL_MAJOR, MAX(m,n), nrhs, b_t, ldb_t, b,
ldb );
/* Release memory and exit */
LAPACKE_free( b_t );
@@ -101,11 +101,11 @@ exit_level_1:
LAPACKE_free( a_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgels_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgels_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_cgels_work", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgels_work", info );
}
return info;
}
+8 -8
View File
@@ -32,7 +32,7 @@
#include "lapacke_utils.h"
lapack_int LAPACKE_cgelsd( int matrix_layout, lapack_int m, lapack_int n,
lapack_int API_SUFFIX(LAPACKE_cgelsd)( int matrix_layout, lapack_int m, lapack_int n,
lapack_int nrhs, lapack_complex_float* a,
lapack_int lda, lapack_complex_float* b,
lapack_int ldb, float* s, float rcond,
@@ -50,25 +50,25 @@ lapack_int LAPACKE_cgelsd( int matrix_layout, lapack_int m, lapack_int n,
float rwork_query;
lapack_complex_float work_query;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_cgelsd", -1 );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgelsd", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_cge_nancheck( matrix_layout, m, n, a, lda ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, m, n, a, lda ) ) {
return -5;
}
if( LAPACKE_cge_nancheck( matrix_layout, MAX(m,n), nrhs, b, ldb ) ) {
if( API_SUFFIX(LAPACKE_cge_nancheck)( matrix_layout, MAX(m,n), nrhs, b, ldb ) ) {
return -7;
}
if( LAPACKE_s_nancheck( 1, &rcond, 1 ) ) {
if( API_SUFFIX(LAPACKE_s_nancheck)( 1, &rcond, 1 ) ) {
return -10;
}
}
#endif
/* Query optimal working array(s) size */
info = LAPACKE_cgelsd_work( matrix_layout, m, n, nrhs, a, lda, b, ldb, s,
info = API_SUFFIX(LAPACKE_cgelsd_work)( matrix_layout, m, n, nrhs, a, lda, b, ldb, s,
rcond, rank, &work_query, lwork, &rwork_query,
&iwork_query );
if( info != 0 ) {
@@ -95,7 +95,7 @@ lapack_int LAPACKE_cgelsd( int matrix_layout, lapack_int m, lapack_int n,
goto exit_level_2;
}
/* Call middle-level interface */
info = LAPACKE_cgelsd_work( matrix_layout, m, n, nrhs, a, lda, b, ldb, s,
info = API_SUFFIX(LAPACKE_cgelsd_work)( matrix_layout, m, n, nrhs, a, lda, b, ldb, s,
rcond, rank, work, lwork, rwork, iwork );
/* Release memory and exit */
LAPACKE_free( work );
@@ -105,7 +105,7 @@ exit_level_1:
LAPACKE_free( iwork );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgelsd", info );
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgelsd", info );
}
return info;
}

Some files were not shown because too many files have changed in this diff Show More