Commit Graph
708 Commits
Author SHA1 Message Date
Martin Kroeker 9cc2702c0f Add the LARFT_LVL2 functions from Reference-LAPACK PR 1163 2026-06-27 20:10:05 +02:00
Martin Kroeker fd89e78ff3 Add non-trivial terminating case for LARFT (Reference-LAPACK PR 1163) 2026-06-27 20:07:45 +02:00
Martin Kroeker b997290389 Merge pull request #5862 from martin-frbg/lapack1293
Scale convergence thresholds in ?BBCSD to fix accuracy (Reference-LAPACK PR 1293)
2026-06-27 11:49:15 +02:00
Martin Kroeker 3f6241b8db Merge pull request #5865 from martin-frbg/lapack1315
Fix handling of negative increments in ?LARF/?LARF1F/?LARF1L (Reference-LAPACK PR 1315)
2026-06-26 22:50:38 +02:00
Martin Kroeker cd395c801a Merge pull request #5864 from martin-frbg/lapack1309
Fix bad scaling in ?LARFF causing slow DSYEVR/ZHEEVR (Reference-LAPACK PR 1309)
2026-06-26 22:50:15 +02:00
Martin Kroeker 7370b520d2 Merge pull request #5857 from martin-frbg/lapack1285
Fix premature return before fallback in ?BDSQR (Reference-LAPACK PR 1285)
2026-06-26 20:45:56 +02:00
Martin Kroeker 132f2a3ebd Merge pull request #5855 from martin-frbg/lapack1283
Avoid intermediate overflows in GEJSV,GESVJ,GESVDX,GEDMD (Reference-LAPACK PR 1283)
2026-06-26 20:45:23 +02:00
Martin Kroeker 3cdf5dcf0b Merge pull request #5860 from martin-frbg/lapack1291
Handle degenerate cases in OR/UNCSD2BY1 (Reference-LAPACK PR 1291)
2026-06-25 15:40:27 +02:00
Martin Kroeker 56b08939f5 Merge pull request #5861 from martin-frbg/lapack1292
Fix workspace for tiny inputs in (ORM/UNM)(L/R)Q and Q(L/R) (Reference-LAPACK PR 1292)
2026-06-25 14:06:48 +02:00
Martin Kroeker e202bcb942 Merge pull request #5859 from martin-frbg/lapack1287
Fix row-major A dimension for SIDE=R in LAPACKE_?TPRFB_WORK (Reference-LAPACK PR 1287)
2026-06-25 14:05:24 +02:00
Martin Kroeker 72ebe7b777 Merge pull request #5856 from martin-frbg/lapack1284-2
Don't check LDU in LAPACKE_?GESVD_WORK when U is not used (from Reference-LAPACK PR 1284)
2026-06-25 12:27:19 +02:00
Martin Kroeker 68b4f228c0 Merge pull request #5854 from martin-frbg/lapack1275
Reject NB=0 in input of DLASWLQ (Reference-LAPACK PR 1275)
2026-06-25 10:20:11 +02:00
Martin Kroeker 1dd3ec9f1f Merge pull request #5853 from martin-frbg/lapack1274
Fix too small workspace queried in SGGEV3 (Reference-LAPACK PR 1274)
2026-06-25 10:19:47 +02:00
Martin Kroeker 854479839b Merge pull request #5852 from martin-frbg/lapack1273
Fix sign of error number returned by LWORK check in ?LAQZ0 (Reference-LAPACK PR 1273)
2026-06-25 10:19:14 +02:00
Martin Kroeker 562aeed4a2 Fix handling of negative increments (Reference-LAPACK PR 1315) 2026-06-24 21:41:17 +02:00
Martin Kroeker faa10e60e4 Fix scaling of relative error to avoid spurious failures (Reference-LAPACK PR 1309) 2026-06-24 21:34:29 +02:00
Martin Kroeker caa18db35f Scale thresholds to improve accuracy of singular vectors (Reference-LAPACK PR 1293) 2026-06-24 20:55:02 +02:00
Martin Kroeker c5cd266fff Reduce workspace demand for tiny M,N,K sizes (Reference-LAPACK PR 1292) 2026-06-24 20:44:27 +02:00
Martin Kroeker 9e9c5a541f Handle degenerate cases having R=0 (Reference-LAPACK PR 1291) 2026-06-24 20:35:34 +02:00
Martin Kroeker 2a859d5fc4 Fix row-major A dimension for SIDE=R (Reference-LAPACK PR 1287) 2026-06-24 18:33:45 +02:00
Martin Kroeker 788a2dfec4 Fix premature return before trying QR fallback (Reference-LAPACK PR 1285) 2026-06-24 16:16:15 +02:00
Martin Kroeker 9971940f04 Also don't check LDU when U is not used (from Reference-LAPACK PR 1284) 2026-06-24 16:06:24 +02:00
Martin Kroeker 6dd2948a2b Guard against intermediate overflows 2026-06-24 14:14:31 +02:00
Martin Kroeker 358d3676d0 Reject NB=0 in input (Reference-LAPACK PR 1275) 2026-06-24 13:31:40 +02:00
Martin Kroeker fb4e77d379 Query correct (larger) workspace for VL=N,VR=V (Reference-LAPACK PR 1274) 2026-06-24 13:27:17 +02:00
Martin Kroeker 6409343512 Fix sign of error number from LWORK check (Reference-LAPACK PR 1273) 2026-06-24 12:33:17 +02:00
Martin Kroeker aae8526e3a Fix bad operand indicator in error messages (Reference-LAPACK PR 1272) 2026-06-24 12:27:21 +02:00
Martin Kroeker a36e22cbb2 Merge pull request #5850 from martin-frbg/lapack1271
Update EXTERNAL declarations in various files (Reference-LAPACK PR 1271)
2026-06-24 10:36:37 +02:00
Martin Kroeker 1afb4c9ba1 Merge pull request #5849 from martin-frbg/lapack1270
Fix wrong workspace in DGEJSV potentially corrupting memory in DGESVJ (Reference-LAPACK PR 1270)
2026-06-24 10:36:15 +02:00
Martin Kroeker 6d648c6b4d Merge pull request #5848 from martin-frbg/lapack1269
Fix wrong JOBA type in SGESVJ call of SGEJSV (Reference-LAPACK PR 1269)
2026-06-24 10:35:54 +02:00
Martin Kroeker 648a53b5cb Merge pull request #5847 from martin-frbg/lapack1268
Fix wrong name in XERBLA call of ZLA_SYRFSX_EXTENDED (Reference-LAPACK PR 1268)
2026-06-24 10:35:34 +02:00
Martin Kroeker cfeb270288 Update EXTERNAL declarations in various files (Reference-LAPACK PR 1271) 2026-06-23 22:20:46 +02:00
Martin Kroeker 9f6c07c5a8 Fix workspace argument if DGESVJ call (Reference-LAPACK PR 1270) 2026-06-23 21:55:15 +02:00
Martin Kroeker 8f2b1e8c7c Fix wrong JOBA type in SGESVJ call (Reference-LAPACK PR 1269) 2026-06-23 21:51:22 +02:00
Martin Kroeker a08b1aa853 Fix wrong function name in XERBLA call (Reference-LAPACK PR 1268) 2026-06-23 21:44:14 +02:00
Martin Kroeker 5da71f5c5b Fix typo in passing leading dimension of Y to ?ROT (Reference-LAPACK PR 1265) 2026-06-23 21:25:17 +02:00
Yue ChangandClaude Fable 5 ede136ee4e Fix 32-bit integer overflow in LAPACKE nancheck index arithmetic
The optional NaN checks performed by LAPACKE front-ends computed array
offsets and lengths in 32-bit lapack_int arithmetic, which overflows for
large matrices (e.g. LAPACKE_dpotrf with n = lda >= 46341 overflows
j*lda in LAPACKE_dtr_nancheck, leading to out-of-bounds reads and
crashes). Several nancheck helpers (ge, gb, tp, tf) already cast to
size_t; this applies the same treatment to the ones that were missed:

- ?tr_nancheck: cast a[i+j*lda] index to size_t (also covers po/sy/he
  checks, i.e. the POTRF/Cholesky path)
- ?_nancheck (vector): iterate by element count instead of n*inc, with
  size_t indexing
- ?sp/?pp/?pf/?hp/?tp/?tf_nancheck: compute n*(n+1)/2 length in size_t
- ?tz_nancheck: widen the part offsets to int64_t (keeping the -1
  sentinel) and compute them with a widening cast

Verified with UBSan: LAPACKE_str_nancheck at n = lda = 47000 previously
reported signed integer overflow and crashed with SEGV at -O0; it now
passes and still detects the NaN. Old and new code produce identical
results across 1907 enumerated small-size cases (all layouts, uplo,
diag, shapes and NaN positions for tr/tz/vector/packed variants).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 23:42:28 -04:00
Martin Kroeker 029a05fa84 Replace dangerous usage of s_copy macro with strncpy and fix various warnings 2026-05-17 22:18:58 +02:00
Martin Kroeker 0b3b486606 Calculate LWORK in K=0 case consistently with ZUNMLQ (Reference-LAPACK PR 1225) 2026-04-25 19:11:43 +02:00
Martin Kroeker 70d1c2f7b2 Fix EXTERNAL declarations (Reference-LAPACK PR 1257) 2026-04-23 09:44:16 +02:00
Martin Kroeker 775f467be6 Optimize looping over the lower triangular in fat matrix cases 2026-04-21 21:30:36 +02:00
Martin Kroeker 1d15733ff5 Fix typos and initialize cutoff value (Reference-LAPACK PRs 1212&1228) 2026-04-15 12:16:03 +02:00
Martin Kroeker 0ea23484c6 Use ROUNDUP_LWORK and remove redundant conversions (Reference-LAPACK PR1203) 2026-04-09 14:54:55 +02:00
Igor S. Gerasimov f9f8e94a14 Fix DROUNDUP_LWORK: patch was not fully copied 2026-04-09 02:23:58 +02:00
Martin Kroeker 7dde52d5d2 Follow-up on ?GESVDQ updates from PR 1146 (Reference-LAPACK PR 1221) 2026-04-01 16:27:56 +02:00
Martin Kroeker c6e4d17819 Follow-up on ?GESVDQ updates from PR 1146 (Reference-LAPACK PR 1221) 2026-04-01 15:34:02 +02:00
Martin Kroeker b9ba9be508 Follow-up on ?GESVDQ updates from PR1146 (Reference-LAPACK PR 1221) 2026-04-01 15:19:41 +02:00
Martin Kroeker d27e98c97a Merge pull request #5734 from martin-frbg/lapack774
Fix workspace size in ?TGSEN (Reference-LAPACK PR 774)
2026-04-01 08:52:37 +02:00
Martin Kroeker 429d23f420 Merge pull request #5730 from martin-frbg/lapack1206
Fix overwriting of LDSWORK in ?TRSYL3 (Reference-LAPACK PR 1206)
2026-03-31 23:58:04 +02:00
Martin Kroeker 3f2338ba85 Merge pull request #5732 from martin-frbg/lapack1209
Remove unused parameter in  DORBDB3/ZUNBDB3 (Reference-LAPACK PR 1209)
2026-03-31 23:57:36 +02:00