From 57cf286f4b660e99cd9c2e8cb73eea08b19d30f4 Mon Sep 17 00:00:00 2001 From: lilkeet Date: Mon, 10 Nov 2025 04:27:07 -0600 Subject: [PATCH] use correct base log --- src/arraymancer/linear_algebra/helpers/least_squares_lapack.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arraymancer/linear_algebra/helpers/least_squares_lapack.nim b/src/arraymancer/linear_algebra/helpers/least_squares_lapack.nim index bfee45ae1..bc597982f 100644 --- a/src/arraymancer/linear_algebra/helpers/least_squares_lapack.nim +++ b/src/arraymancer/linear_algebra/helpers/least_squares_lapack.nim @@ -70,7 +70,7 @@ proc gelsd*[T: SomeFloat]( const smlsiz = 25'i32 # equal to the maximum size of the subproblems at the bottom of the computation tree let minmn = min(m,n).int - nlvl = max(0, (minmn.T / (smlsiz+1).T).ln.int32 + 1) + nlvl = max(0, (minmn.T / (smlsiz+1).T).log2.int32 + 1) # Bug in some Lapack, liwork must be determined manually: http://icl.cs.utk.edu/lapack-forum/archives/lapack/msg00899.html liwork = max(1, 3 * minmn * nlvl + 11 * minmn)