Repository navigation
Clear all n_rowsA entries in gmt_matrix_vector_mult - #9254
Conversation
The output vector c has n_rowsA entries but the function cleared only n_colsA of them. In gmtlib_smooth_spline the call Q = K*c has n_rowsA = n and n_colsA = n-2, so the last two entries of Q were left holding the previous matrix values and s[n-2] and s[n-1] came out wrong. Builds with LAPACK clear the output in gmt_matrix_matrix_mult first and hide the problem, so it only showed up in builds without LAPACK (the Windows CI), as failures of GMT_splines, smooth and smooth_deriv. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Again, not sure it's acceptable. I never had that problem in my local build but it's also true that I am using LAPACK |
|
I think this is correct. The An It can also be verified by codes near line 1347: in which row is 0 - n_rowsA. |
Indeed, with LAPACK the bug is hidden: As a check, the Windows CI (which builds without LAPACK) now passes the 3 tests that were failing because of this: |
gmt_matrix_vector_multclearedn_colsAentries of the output vector instead ofn_rowsA.In builds without LAPACK this left the last two values of the smoothing spline (
sample1d -Fs) wrong, which is whyGMT_splines,smoothandsmooth_derivfail only in the Windows CI.Written with Claude Sonnet 5.5, reviewed with Claude Opus 5.5.