You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix column-major parameter ordering in parameterized matmul (#72)
* Fix column-major parameter ordering in parameterized matmul
CVXPY sends parameter values in Fortran (column-major) order, but the
matmul refresh functions assumed row-major/CSR order via raw memcpy.
This produced incorrect matrix values for non-symmetric matrices.
For sparse matrices, iterate the CSR pattern and index into the
column-major source array. For dense matrices, exploit the fact that
column-major A is row-major A^T to memcpy directly into AT, then
transpose to get A.
Also fixes a latent bug where sparse update_values would blindly copy
the first nnz values from the full d1*d2 parameter array, which is
wrong for matrices with structural zeros.
Adds tests for rectangular (3x2) and sparse (3x3 with zeros) cases.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Run clang-format on changed files
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* introduce explicit transpose function for dense matrix
* clean up refresh dense right
* clean up tests...
* one more test
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: dance858 <danielcederberg1@gmail.com>
0 commit comments