Commit Graph
1497 Commits
Author SHA1 Message Date
langou ed4d486f65 Merge branch 'Reference-LAPACK:master' into follow_up_on_PR1146 2026-03-28 13:40:15 -06:00
langou a884b29254 Merge pull request #1213 from langou/MINMN_EQ_0 2026-03-28 10:19:46 -06:00
langou d3388ade69 Merge pull request #1220 from nakatamaho/topic/xLARGV-fix-helper-naming
clargv,zlargv: rename local ABS1 helper to CABSMAX
2026-03-28 08:09:49 -06:00
NAKATA Maho 1ed1f080da clargv,zlargv: rename local ABS1 helper to CABSMAX
The local ABS1 statement function in CLARGV and ZLARGV does not compute
the usual complex ABS1/CABS1 quantity. It returns

    max(abs(real(z)), abs(aimag(z)))

and is used only as a scaling helper in the same algorithmic path as
CLARTG/ZLARTG.

Rename the helper to CABSMAX so that the name matches its actual
behavior and does not suggest CABS1 semantics.

No numerical behavior is changed.
2026-03-28 16:55:08 +09:00
NAKATA Maho ac82605ea9 refactor: rename ABS1 statement function to CABS1 for consistency
Several LAPACK, BLAS, and CBLAS source files defined a local statement
function named ABS1 for the complex 1-norm approximation:

    ABS1( X ) = ABS( REAL( X ) ) + ABS( AIMAG( X ) )
    ABS1( X ) = ABS( DBLE( X ) ) + ABS( DIMAG( X ) )

The majority of the codebase already uses CABS1 for this identical
purpose. This commit renames ABS1 to CABS1 in all remaining files
(definition line, declaration line, and all call sites within the
same file) to make the naming consistent across the repository.

A small number of fixed-form lines required continuation-line splits
to stay within the 72-column limit after the rename.

No numerical change. Statement functions are file-local in Fortran,
so there is no ABI or interface impact.

This is a preparatory cleanup before inlining these statement
functions (see issue #1200).
2026-03-28 14:46:42 +09:00
Julien Langou e67e3b47d2 minor typos in ZGESVDQ 2026-03-26 08:36:49 -06:00
langou d6bf599fd7 (typo) Fix variable name 2026-03-26 08:30:15 -06:00
Julien Langou ea65bb77ba As suggested by Angelika,see PR#1035, use MINMN.EQ.0 instead of M.EQ.0 2026-03-26 08:05:24 -06:00
langou 034ada14fa Merge pull request #1035 from frjohnst/geqp3_Jul2024
xGEQP3 changes July 2024
2026-03-26 07:55:41 -06:00
langou 89791177a7 Merge branch 'master' into 943-xBBCSD-read-of-unitialised-value 2026-03-25 13:21:59 -06:00
langou 1d7b5c10a5 Merge pull request #1052 from angsch/master
Converge >= and > usage in docs and implementation of GESVJ
2026-03-25 13:15:16 -06:00
langou 4f84ecc5ca Merge pull request #774 from mgates3/tgsen
fix workspace size in tgsen
2026-03-25 12:58:51 -06:00
langou 95640a9031 Merge pull request #1140 from MaartenBaert/fix-dlasd7
Fix documentation error and ordering bug in DLASD7
2026-03-25 12:52:49 -06:00
langou 8104c32fe8 Merge pull request #1168 from foxtran/refactor/ieeeck
Refactor IEEECK to avoid generating IEEE exceptions by using IEEE_ARITHMETIC
2026-03-25 12:32:58 -06:00
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 7a5f0f890f Merge pull request #1209 from Reference-LAPACK/minor___zunbdb3
remove unused parameter ONE
2026-03-24 19:15:19 -06: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 8b52b5e82f remove unused parameter ONE 2026-03-24 14:27:06 -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
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
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
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
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
Angelika Schwarz b6b6288080 Update step length selection in LAED4 overshoot fallback 2026-02-16 10:27:00 +01: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
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
Igor S. Gerasimov bf486fecc0 Refactor IEEECK to avoid generating IEEE exceptions by using IEEE_ARITHMETIC support queries 2025-11-26 14:43:35 +01:00
Johnathan Rhyne dd076164da Merge branch 'dlarftTermCase' of github.com:jprhyne/lapack into dlarftTermCase 2025-10-23 08:47:56 -06:00
Johnathan Rhyne 746f7afb2b attempt at fixing build errors for CI tests 2025-10-22 19:47:38 -06:00
Johnathan Rhyne 6529fc14bc Merge branch 'master' into dlarftTermCase 2025-10-22 14:01:45 -06:00
Johnathan Rhyne 87d679164c changing names 2025-10-22 14:00:14 -06:00
Johnathan Rhyne 9ea006008e Adding larft VARIANTS folder back to test CI failures 2025-10-22 13:59:17 -06:00
Johnathan Rhyne 81c48a0a3a removed larft build instructions from VARIANTS Makefile 2025-10-22 13:53:19 -06:00
Johnathan Rhyne 68a1389c4b Added NX variable declaration to clarft that was initially missed 2025-10-22 13:32:08 -06:00
Johnathan Rhyne b9d53f4c5c adding nx behavior to *larft 2025-10-22 13:24:50 -06:00
Chuvelev, Michael 3c9f92b391 Prevent csrscl/zdrscl from going to infinite loop on Infinity input 2025-09-19 09:24:38 -07:00
GYT 44d9a1636b FIx errors in the documentation of ?gelqt 2025-09-16 22:54:01 +02:00
Mark Gates 971f19940e implicit none in SRC 2025-08-26 23:27:57 -04:00
Mark Gates 04bb0de13a implicit none in SRC/s 2025-08-26 23:27:57 -04:00
Mark Gates f111b2dc42 implicit none in SRC/d 2025-08-26 23:27:57 -04:00
Mark Gates 8caa3ff67b implicit none in SRC/c 2025-08-26 23:27:57 -04:00
Mark Gates 4c76e9deb6 implicit none in SRC/z 2025-08-26 23:00:36 -04:00
Mark Gates b23d944046 implicit none in SRC/VARIANTS 2025-08-26 22:36:12 -04:00
Nick Dingle 146da1d409 Capture module file dependencies in CMake
The modulefile la_xisnan.F90 depends on the modulefile
la_constants.f90 but this dependency is not expressed in the CMake
rules. In some parallel builds we have observed failures where
compilation of objects that depend on la_constants.mod starts before
compilation of la_constants.f90 has finished.

This patch modifies CMakeLists.txt to ensure that la_constants.mod is
built before any other object or modulefile that depends on it.
2025-07-23 11:05:22 +01:00