From 84b68a5d15defbba87f9c7646da3c4408bec40ef Mon Sep 17 00:00:00 2001 From: Esteban82 Date: Fri, 9 Oct 2026 15:16:18 -0300 Subject: [PATCH] Clear all n_rowsA entries in gmt_matrix_vector_mult 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 --- src/gmt_vector.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gmt_vector.c b/src/gmt_vector.c index bfa8b0d45e8..da7ff7c4289 100644 --- a/src/gmt_vector.c +++ b/src/gmt_vector.c @@ -1341,7 +1341,7 @@ extern int dgemm_ (char* tra, char* trb, int* na, int* nb, int* nc, double* alph void gmt_matrix_vector_mult (struct GMT_CTRL *GMT, double *A, double *b, uint64_t n_rowsA, uint64_t n_colsA, double *c) { uint64_t row, col, ij; gmt_M_unused(GMT); - gmt_M_memset (c, n_colsA, double); + gmt_M_memset (c, n_rowsA, double); for (row = ij = 0; row < n_rowsA; row++) { for (col = 0; col < n_colsA; col++, ij++) c[row] += A[ij] * b[col];