Commit Graph
3428 Commits
Author SHA1 Message Date
langou 2f098d0fbe Merge pull request #1195 from jberg5/fix-f32-issue
Fix truncating large workspace values
2026-03-24 19:16:02 -06:00
langou dd3608ade7 Merge pull request #1208 from Reference-LAPACK/zrot_and_srot__NaN_checks_on_input_scalar
add NaN check for input scalars `s` and `c` to lapacke_crot and lapacke_srot
2026-03-24 19:15:36 -06:00
langou 7a5f0f890f Merge pull request #1209 from Reference-LAPACK/minor___zunbdb3
remove unused parameter ONE
2026-03-24 19:15:19 -06:00
Mark Gates 0dddb40aaf fix indentation 2026-03-24 20:43:58 -04:00
langou 93f72dd1f7 Merge branch 'master' into fix-f32-issue 2026-03-24 15:08:51 -06:00
langou c806564313 Merge pull request #1136 from langou/try__fix_1128__adding_part_of_angsch_suggestion
add NaN checks for input matrix A in GEEV, return error if NaN are in matrix A, NaNs in input are detected with LANGE (needed for scaling)
2026-03-24 14:40:09 -06:00
Julien Langou 7f4dff6336 oops 2026-03-24 14:35:02 -06:00
Julien Langou 8b52b5e82f remove unused parameter ONE 2026-03-24 14:27:06 -06:00
Julien Langou 8fa1db366b add NaN check for input scalars s and c to lapacke_crot and lapacke_srot 2026-03-24 14:18:29 -06:00
langou 10d120966e Merge pull request #1192 from kevinsung/zrot
add crot and zrot to LAPACKE
2026-03-24 14:13:46 -06:00
langou b760323bc5 Merge pull request #1196 from ilayn/fix_zunbdb3
FIX: Revert the conjugation removal in zunbdb3
2026-03-24 13:54:04 -06:00
langou eb5f719947 Merge pull request #1206 from nakatamaho/fix/trsyl3-ldswork-overwrite
Fix LDSWORK being overwritten during workspace query in xTRSYL3
2026-03-24 06:59:14 -06:00
langou a52f5fa69d Merge pull request #1207 from nakatamaho/fix/xpgvx-info-to-iinfo
fix(TESTING/EIG): pass IINFO instead of INFO to xSPGVX/xHPGVX in *drvsg2stg
2026-03-24 06:42:12 -06:00
langou c6e6948e8f Merge pull request #1205 from nakatamaho/remove_redundant_DBLE_REAL_in_testing
Remove redundant DBLE()/REAL() type conversions in TESTING
2026-03-24 06:37:12 -06:00
NAKATA Maho 4e013d710c fix(eig): pass IINFO instead of INFO to xSPGVX/xHPGVX in *drvsg2stg
In cdrvsg2stg.f, ddrvsg2stg.f, sdrvsg2stg.f, and zdrvsg2stg.f, the
three RANGE='A'/'V'/'I' calls to CHPGVX, DSPGVX, SSPGVX, and ZHPGVX
were passing INFO as the output error argument instead of IINFO.

The error-check block immediately following each call tests IINFO.NE.0,
but IINFO was never updated by the routine, so errors were silently
ignored. Additionally, the block sets INFO = ABS(IINFO), which would
overwrite the value ZHPGVX/xSPGVX had written into INFO with the
stale value of IINFO.

All other driver calls in these files (ZHEGV, ZHEGVD, ZHEGVX, ZHPGV,
ZHPGVD, ZHBGV, ZHBGVD, ZHBGVX and their s/d/c equivalents) correctly
use IINFO. This commit brings the xSPGVX/xHPGVX calls into line with
the established pattern.

Affected routines (3 call sites each):
  CHPGVX in cdrvsg2stg.f
  DSPGVX in ddrvsg2stg.f
  SSPGVX in sdrvsg2stg.f
  ZHPGVX in zdrvsg2stg.f
2026-03-24 18:21:30 +09:00
NAKATA Maho 989ffdd779 Fix LDSWORK being overwritten during workspace query in xTRSYL3
Remove the erroneous "LDSWORK = 2" assignment inside the LQUERY branch
of STRSYL3, DTRSYL3, CTRSYL3, and ZTRSYL3. The assignment overwrites
the caller's input argument, which is declared as intent(in) in the
documentation. The assignment was unnecessary because SWORK(1,1) and
SWORK(2,1) access column 1 only, making the leading dimension
irrelevant for these stores (offset = (i-1) + (j-1)*LDSWORK, j=1).
2026-03-24 13:22:39 +09:00
NAKATA Maho 8b1494be8c Remove redundant DBLE()/REAL() type conversions in TESTING
In ddrvst.f, ddrvst2stg.f, and dlatm4.f, DBLE() was applied to
DOUBLE PRECISION array elements assigned to DOUBLE PRECISION
variables ― a no-op conversion. Similarly, in sdrvst.f,
sdrvst2stg.f, and slatm4.f, REAL() was applied to REAL array
elements assigned to REAL variables.

Remove these 168 redundant calls. Integer-to-real conversions
(e.g., DBLE(N), DBLE(KLEN-1), REAL(MAX(1,N))) are retained as
they are semantically necessary.
2026-03-24 11:37:16 +09:00
langou 7f18edae13 Merge pull request #1203 from nakatamaho/fix-gvd-workspace-query-roundup
Use ROUNDUP_LWORK and remove redundant type conversions in *gvd routines
2026-03-23 08:35:50 -06:00
langou 5dfd515e90 Merge pull request #1202 from nakatamaho/xLAQP2RK
fix(xlaqp2rk): do not modify [in] argument KMAX; introduce KBOUND
2026-03-23 08:30:31 -06:00
langou 6fe88c7ac8 Merge pull request #1204 from nakatamaho/fix/stebz-error-propagation
Fix incorrect INFO return codes from xSTEBZ in driver routines
2026-03-23 08:12:35 -06:00
NAKATA Maho 94f05be6c3 Fix incorrect INFO return codes from xSTEBZ in driver routines
In 26 driver routines across all four precisions (S, D, C, Z),
xSTEBZ was called writing directly to INFO, which was then
silently overwritten by xSTEIN.  Two bugs are fixed:

1. xSTEBZ errors were not propagated to the caller at all.

2. When xSTEBZ returned INFO > 0, eigenvectors were computed
   with an incomplete or empty eigenvalue set (INFO=2,3,4) or
   with reduced accuracy (INFO=1), producing silently wrong
   results.

Fix: route xSTEBZ return value through IINFO.  For INFO != 1,
skip xSTEIN entirely via GO TO.  For INFO == 1 (bisection
convergence warning), xSTEIN is still called since M eigenvalues
are available; the warning is preserved in INFO.

The xSTEBZ error is encoded as INFO = N + IINFO to distinguish
it from xSTEIN failures (1..N), matching the convention already
used for xPBSTF errors in the xBGVX routines.  For the four
xBGVX routines, which already use INFO = N+i for xPBSTF, the
xSTEBZ error is encoded as INFO = 2*N + IINFO.

Update INFO documentation in all 26 files accordingly.
Also add IINFO to the INTEGER declaration in dstevx.f and
sstevx.f where it was missing.

Files modified (26):
  SRC/chbevx.f, SRC/chbevx_2stage.f, SRC/chbgvx.f,
  SRC/cheevx.f, SRC/cheevx_2stage.f, SRC/chpevx.f,
  SRC/dsbevx.f, SRC/dsbevx_2stage.f, SRC/dsbgvx.f,
  SRC/dspevx.f, SRC/dstevx.f, SRC/dsyevx.f, SRC/dsyevx_2stage.f,
  SRC/ssbevx.f, SRC/ssbevx_2stage.f, SRC/ssbgvx.f,
  SRC/sspevx.f, SRC/sstevx.f, SRC/ssyevx.f, SRC/ssyevx_2stage.f,
  SRC/zhbevx.f, SRC/zhbevx_2stage.f, SRC/zhbgvx.f,
  SRC/zheevx.f, SRC/zheevx_2stage.f, SRC/zhpevx.f
2026-03-23 13:58:37 +09:00
NAKATA Maho c2023d8f93 Use ROUNDUP_LWORK and remove redundant type conversions in *gvd routines
Fix workspace size handling in {s,d,c,z}{sy,sp,he,hp}gvd:

1. Workspace readback: remove redundant REAL()/DBLE() casts on INTEGER
   and same-type operands in the post-CHEEVD/ZHEEVD/etc. MAX expressions.
   The old pattern INT(MAX(REAL(int_var), REAL(fp_var))) needlessly
   round-tripped integers through floating-point; for IWORK (already
   INTEGER) the conversion was entirely spurious and risks precision
   loss when 5*N+3 exceeds the 23-bit (single) or 52-bit (double)
   significand.

2. WORK(1) writes: use SROUNDUP_LWORK/DROUNDUP_LWORK in dspgvd, dsygvd,
   zhegvd, zhpgvd where the optimal workspace size was previously stored
   via bare assignment (WORK(1) = LOPT), losing the ceiling guarantee
   that ROUNDUP_LWORK provides.

3. RWORK(1) writes: replace REAL(LROPT) with SROUNDUP_LWORK (chegvd,
   chpgvd) or DROUNDUP_LWORK (zhegvd, zhpgvd).  The zhegvd/zhpgvd case
   was a latent bug: RWORK is DOUBLE PRECISION but REAL() truncated to
   single precision before storing.

4. Add DROUNDUP_LWORK declarations (type + EXTERNAL) to the four
   double-precision / complex-16 routines that lacked them.  Remove
   now-unused REAL/DBLE from INTRINSIC lists where applicable.
2026-03-23 10:12:30 +09:00
NAKATA Maho 4f13bb0d6c Fix 72-column violation in {c,d,s,z}laqp2rk.f
The INTEGER declaration line added by PR #1202 exceeds column 72,
causing 'MINMNFACT' to extend into the sequence number field
(columns 73-80). In fixed-form Fortran, compilers silently truncate
at column 72, so 'MINMNFACT' is parsed as 'MINMNF', leaving the
actual variable undeclared.

Move KBOUND, MINMNFACT to the continuation line to keep all code
within columns 1-72.
2026-03-23 09:47:29 +09:00
NAKATA Maho bdbce3ebd3 fix(xlaqp2rk): introduce KBOUND to avoid modifying [in] argument KMAX
In all four variants (SLAQP2RK, DLAQP2RK, CLAQP2RK, ZLAQP2RK),
KMAX was declared as [in] in the documentation but was overwritten
internally via:

    KMAX = MIN( KMAX, MINMNFACT )

This is a bug in the reference LAPACK implementation: the Fortran
calling convention silently tolerates this when the caller passes
a temporary expression, but the intent annotation is violated and
C/C++ translations fail to compile (cannot bind rvalue to non-const
reference).

Introduce local variable KBOUND to hold the clamped value:

    KBOUND = MIN( KMAX, MINMNFACT )

and replace all subsequent uses of KMAX in the executable section
(loop bound and final assignment K = KBOUND) with KBOUND.
KMAX itself is no longer modified.
2026-03-21 09:12:26 +09:00
langou 4f1773e766 Merge pull request #1199 from nakatamaho/master
fix: correct trailing routine comment in dgemmtr
2026-03-06 22:46:07 -07:00
Nakata Maho 507c1dd7c9 fix: correct trailing routine comment in dgemmtr 2026-03-07 14:41:49 +09:00
langou 58ba032b06 Merge pull request #1197 from nakatamaho/master
TESTING/LIN: align ISEED declarations with documented dimension in four test routines
2026-03-06 19:47:21 -07:00
Nakata Maho fa23a2dc2d TESTING/LIN: declare ISEED as dimension(4) in clatsp/clatsy/zlatsp/zlatsy
The four TESTING/LIN routines currently document ISEED as an
INTEGER array of dimension (4), but their dummy argument
declarations use ISEED(*).

All four routines pass ISEED to CLARND or ZLARND, whose interfaces
require ISEED(4) and document that the fourth element must be odd.

Replace the assumed-size declaration with an explicit size of 4 in
both the commented argument declarations and the actual dummy
argument declarations, so that the source matches the documented
contract and the callee interfaces.

No functional change is intended.
2026-03-07 11:10:10 +09:00
langou 00cf62bc1b Merge pull request #1191 from angsch/issue-1166
Update step length selection in LAED4 overshoot fallback
2026-03-05 22:36:31 -07:00
ilayn 97567d934d FIX:Revert the conjugation step in zunbdb3 2026-03-05 13:44:09 +01:00
J Berg 15f395c678 Fix truncating large workspace values 2026-02-27 13:31:21 -08:00
Kevin J. Sung caab666dd4 add crot and zrot to LAPACKE 2026-02-21 08:29:46 -05:00
Angelika Schwarz b6b6288080 Update step length selection in LAED4 overshoot fallback 2026-02-16 10:27:00 +01:00
Christopher Albert aca0bc17e7 Fix DGS test seed to avoid FMA-sensitive ill-conditioned matrix
The default seed generates a matrix for N=6, JTYPE=21 that causes
DGGES to fail (INFO=9) when compiled without FMA instructions.

Use a custom seed that avoids this specific ill-conditioned case
while maintaining full test coverage.
2026-01-21 23:26:10 +01:00
langou c0c64400da Merge pull request #1185 from adam-sim-dev/fix_issue_1184
For building shared libs with flang, use C linker instead of Fortran linker to avoid macOS-specific flags that CMake adds (tested CMake 4.2).
2026-01-20 09:14:32 -07:00
adam-sim-dev 7d2118331c For building shared libs with flang, use C linker instead of Fortran linker to avoid macOS-specific flags that CMake adds (tested CMake 4.2). 2026-01-19 20:26:38 +08:00
Simon Maertens 76a3a41e70 Fix typo 2026-01-13 10:58:50 -06:00
langou 4327756d94 Merge pull request #1181 from ACSimon33/fortran_strlen_type
Change FORTRAN_STRLEN type in installed headers.
2026-01-13 07:32:08 -07:00
Simon Maertens eeed198193 Only enable Fortran for CBLAS if Fortran compiler is found 2026-01-13 14:34:05 +01:00
Simon Maertens 583e0e289f Enable Fortran for CBLAS since it also contains Fortran files 2026-01-13 13:11:47 +01:00
Simon Maertens daed92441d Replace FORTRAN_STRLEN type in the cblas_f77.h and handle the header like the lapack.h header. 2026-01-13 12:11:05 +01:00
Simon Maertens 54817e9385 Replace FORTRAN_STRLEN type in the lapack.h header if it's different from size_t 2026-01-13 12:07:05 +01:00
langou 8856fad0cf Merge pull request #1179 from ACSimon33/fix-asan-errors
Fix ASAN errors and FORMAT specifiers
2026-01-07 05:22:09 -07:00
Simon Maertens 3bd8b3124b Increase the size of TAU in tall-skinny QR error tests to 5 to fix reads from outside the array bounds. 2026-01-07 12:13:04 +01:00
Simon Maertens 794b0ba0ab Fix format specifiers with lines longer than 72 characters. 2026-01-07 12:09:56 +01:00
langou 1ff794a959 Merge pull request #1158 from michael-chuvelev/zdrscl_csrscl_infinite_loop
Prevent csrscl/zdrscl from going to infinite loop on Infinity input
2025-12-19 07:04:00 -07:00
langou 67f9279da4 Merge pull request #1174 from Reference-LAPACK/langou-patch-1
Add output-on-failure to ctest command
2025-12-03 00:38:32 -07:00
langou 75248ffe0d Merge pull request #1175 from Reference-LAPACK/langou-patch-2
Enhance test output with failure details
2025-12-03 00:38:20 -07:00
langou 97c0e32f36 Enhance test output with failure details 2025-12-01 06:57:12 -07:00
langou 2b2879eef7 Add output-on-failure to ctest command 2025-12-01 02:04:58 -07:00