Compare commits
254
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7094cb0f7c | ||
|
|
7a2ecc24e5 | ||
|
|
b44c64faef | ||
|
|
a4c4a4eb52 | ||
|
|
0d9803a29c | ||
|
|
81be118bcb | ||
|
|
f57a792304 | ||
|
|
2bdd724ecf | ||
|
|
1a95ff9b67 | ||
|
|
5b521e6ccc | ||
|
|
fe843f99d6 | ||
|
|
230b8c4862 | ||
|
|
acbac1092c | ||
|
|
c6bc40164a | ||
|
|
bc5d836a31 | ||
|
|
15d05b4fbc | ||
|
|
41909fd0c5 | ||
|
|
21299d28eb | ||
|
|
40ca7a2713 | ||
|
|
ee213a3ed3 | ||
|
|
fe3e793c16 | ||
|
|
81823e958c | ||
|
|
ac2c5681bc | ||
|
|
56aa979416 | ||
|
|
dae4c5a3a4 | ||
|
|
ba11da8301 | ||
|
|
19d3a4e638 | ||
|
|
3ccdccea9b | ||
|
|
a1e8cb4845 | ||
|
|
b891145899 | ||
|
|
907725572a | ||
|
|
741a2c2ee0 | ||
|
|
50d689057a | ||
|
|
cc90d869b0 | ||
|
|
add94979e9 | ||
|
|
827cb8e8eb | ||
|
|
0a3aa4db40 | ||
|
|
dead4e4dfd | ||
|
|
6597d4803b | ||
|
|
aa41ed6b5e | ||
|
|
79a0785334 | ||
|
|
5d705a1a20 | ||
|
|
55d73a2ef2 | ||
|
|
7952995ba0 | ||
|
|
cf9b217c50 | ||
|
|
bd6fece37b | ||
|
|
62c9cd885a | ||
|
|
f81db935ca | ||
|
|
8254fbdd80 | ||
|
|
ec2805b5e9 | ||
|
|
d7ea9c52b9 | ||
|
|
464f532552 | ||
|
|
db501d91ba | ||
|
|
4787915207 | ||
|
|
101800018d | ||
|
|
c2255a8d4d | ||
|
|
280e16145d | ||
|
|
cd7523d5b2 | ||
|
|
9dc24803a2 | ||
|
|
7d15f830c2 | ||
|
|
e0d8afbed6 | ||
|
|
0c1e0c3e75 | ||
|
|
6032a6bca0 | ||
|
|
a4298d5ff6 | ||
|
|
5b0687f429 | ||
|
|
3200980553 | ||
|
|
3d2b9cbdcd | ||
|
|
af77ebfa6c | ||
|
|
9560fe2fe3 | ||
|
|
2a0aea9c4c | ||
|
|
c69a96ea9e | ||
|
|
8c54a57d66 | ||
|
|
26db2da3eb | ||
|
|
10432bb5e8 | ||
|
|
e78a2ad18c | ||
|
|
cbb553627e | ||
|
|
04b044e020 | ||
|
|
d7be813203 | ||
|
|
b231dd57cd | ||
|
|
bd4455fb82 | ||
|
|
dcbd80331e | ||
|
|
aec6cb3281 | ||
|
|
d811d855d8 | ||
|
|
d2c2de1d54 | ||
|
|
4b8a925006 | ||
|
|
b29d75131e | ||
|
|
d58d59a99d | ||
|
|
8d44861982 | ||
|
|
a1322ff40e | ||
|
|
21e33bd707 | ||
|
|
d64a6ca96d | ||
|
|
7603b62709 | ||
|
|
ea4787ca59 | ||
|
|
6a15917836 | ||
|
|
ee81706f4f | ||
|
|
036fef485f | ||
|
|
0a6744177a | ||
|
|
c2228e10e1 | ||
|
|
7019c6345c | ||
|
|
540e4eb0a9 | ||
|
|
0c440488d9 | ||
|
|
10e12a4001 | ||
|
|
bd42f8ebaf | ||
|
|
5bcd5859e5 | ||
|
|
c64027aa5e | ||
|
|
349a295b93 | ||
|
|
d086a3d5b8 | ||
|
|
bfbd799e1a | ||
|
|
7656583a53 | ||
|
|
e3b58c4cda | ||
|
|
c037c322b7 | ||
|
|
c3eaab30c6 | ||
|
|
667f08c385 | ||
|
|
1309b6c5cc | ||
|
|
231dd99d0c | ||
|
|
6abbd2b64d | ||
|
|
35634f322c | ||
|
|
8e888aaa61 | ||
|
|
59fc007bc2 | ||
|
|
93b5bc325e | ||
|
|
f1bbf6c1c3 | ||
|
|
86cf705308 | ||
|
|
2c939526a5 | ||
|
|
8ecf1119ab | ||
|
|
a39a28f68c | ||
|
|
37b19bffed | ||
|
|
b20545c6d4 | ||
|
|
a020ed05b8 | ||
|
|
f1a95eebeb | ||
|
|
8e5b70565c | ||
|
|
8482937cfa | ||
|
|
4161851dd6 | ||
|
|
12e939727a | ||
|
|
18c19a461c | ||
|
|
46ef59fcee | ||
|
|
36fa12432d | ||
|
|
8d7f615330 | ||
|
|
2eac2f6332 | ||
|
|
ea810c995c | ||
|
|
a111c9bb61 | ||
|
|
14e5f471f3 | ||
|
|
e209e73925 | ||
|
|
7c1c8b0271 | ||
|
|
79f4d030e3 | ||
|
|
a0341b292d | ||
|
|
395d04e7f6 | ||
|
|
1798bdba70 | ||
|
|
bfbcec20f6 | ||
|
|
3fc6c23e44 | ||
|
|
f84ee6c9cc | ||
|
|
1b7bf32c20 | ||
|
|
4603e69a5f | ||
|
|
46e75194d1 | ||
|
|
e9e939400f | ||
|
|
8ebb7c88fd | ||
|
|
33c8a2a392 | ||
|
|
785b734760 | ||
|
|
352ffe958f | ||
|
|
6aac08032d | ||
|
|
ecaf99b88c | ||
|
|
214842c9bd | ||
|
|
8391371122 | ||
|
|
9ea14cddad | ||
|
|
115d5a4c46 | ||
|
|
39828c7f67 | ||
|
|
43eb003a74 | ||
|
|
9c0a21ebd3 | ||
|
|
7bc3615d79 | ||
|
|
762496f6fc | ||
|
|
9de1ee7775 | ||
|
|
d152705578 | ||
|
|
b943dee7c7 | ||
|
|
46f90f6f87 | ||
|
|
3fc469a5dd | ||
|
|
73bfa95e71 | ||
|
|
8da81bc473 | ||
|
|
4c09d8efbf | ||
|
|
e965983eb9 | ||
|
|
f0b12a2193 | ||
|
|
8d5c716a64 | ||
|
|
f8edd87189 | ||
|
|
1287f67c9e | ||
|
|
614452f28e | ||
|
|
f5a907d796 | ||
|
|
e8517680f9 | ||
|
|
6e9d74860c | ||
|
|
dd4c896894 | ||
|
|
ba5afcdadb | ||
|
|
f238faeafb | ||
|
|
706fd1a7f5 | ||
|
|
af1bb9e4b4 | ||
|
|
ae9c818530 | ||
|
|
26df4b3599 | ||
|
|
f568a60945 | ||
|
|
466401c52b | ||
|
|
3ac3bf9fa4 | ||
|
|
5d35af84fd | ||
|
|
2382be4f23 | ||
|
|
6261d629e1 | ||
|
|
a383745e50 | ||
|
|
64897c4474 | ||
|
|
d469b91278 | ||
|
|
43a55bc960 | ||
|
|
44e942df6d | ||
|
|
5b0bc5e555 | ||
|
|
7eb4057d6d | ||
|
|
80d7c69a52 | ||
|
|
ad3d9b8fc4 | ||
|
|
bc2b374725 | ||
|
|
68eafc69a8 | ||
|
|
eaa105b0e0 | ||
|
|
8ecaaf9869 | ||
|
|
e0370cabce | ||
|
|
ada20a01db | ||
|
|
da7f21005e | ||
|
|
09abbd017b | ||
|
|
3a6f4629e3 | ||
|
|
e18529f945 | ||
|
|
cfe1114651 | ||
|
|
88277c5b8e | ||
|
|
7a29cfe543 | ||
|
|
d8f668cf50 | ||
|
|
833ae881d3 | ||
|
|
1cae5392c0 | ||
|
|
7216a7cd1b | ||
|
|
bfc7838cd9 | ||
|
|
dfb84d0c3b | ||
|
|
33b3a45a90 | ||
|
|
bf50aff0de | ||
|
|
163820243e | ||
|
|
981af1160b | ||
|
|
6a74005272 | ||
|
|
f70c3febac | ||
|
|
02ea2d3c77 | ||
|
|
461cc2cc8b | ||
|
|
aca7ad1ec6 | ||
|
|
fa75a821b6 | ||
|
|
62e6bdfc71 | ||
|
|
88810e4079 | ||
|
|
f01a4d7c5f | ||
|
|
c4f8085e66 | ||
|
|
78b3aab273 | ||
|
|
ddca8374dc | ||
|
|
710c8bb61d | ||
|
|
f43a41db80 | ||
|
|
d5c4999fcb | ||
|
|
30b43ed625 | ||
|
|
b8475a728d | ||
|
|
fffd38fedc | ||
|
|
914f719422 | ||
|
|
b85e2bd578 | ||
|
|
6eecdf6c0c | ||
|
|
cc4798ea38 | ||
|
|
1575bb8e19 |
+1
-1
@@ -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%"
|
||||
|
||||
@@ -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
|
||||
@@ -43,3 +43,6 @@ build*
|
||||
DOCS/man
|
||||
DOCS/explore-html
|
||||
output_err
|
||||
|
||||
# Editor config files
|
||||
.vscode/
|
||||
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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})
|
||||
|
||||
@@ -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
@@ -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()
|
||||
|
||||
@@ -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
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
@@ -58,7 +58,7 @@
|
||||
INTEGER VERS_MAJOR, VERS_MINOR, VERS_PATCH
|
||||
* =====================================================================
|
||||
VERS_MAJOR = 3
|
||||
VERS_MINOR = 11
|
||||
VERS_MINOR = 12
|
||||
VERS_PATCH = 0
|
||||
* =====================================================================
|
||||
*
|
||||
|
||||
@@ -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
@@ -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)
|
||||
|
||||
@@ -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 */
|
||||
@@ -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 */
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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 */
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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" );
|
||||
}
|
||||
|
||||
@@ -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_*/
|
||||
|
||||
@@ -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
File diff suppressed because it is too large
Load Diff
+69
-52
@@ -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
@@ -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 );
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
Reference in New Issue
Block a user