…53)
* Unify constants and parameters into single parameter_expr type
Constants and updatable parameters are now represented by a single
parameter_expr node. Constants use param_id == PARAM_FIXED (-1),
while updatable parameters use param_id >= 0. Bivariate ops
(left_matmul, right_matmul, scalar_mult, vector_mult) accept an
optional param_source node and refresh their internal data on
forward/jacobian/hessian evaluation. Adds problem_register_params
and problem_update_params for problem-level parameter management.
Also adds update_values to the Matrix interface for parameter refresh.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
* Address review comments on parameter-support-v2
- Remove redundant refresh_param_values calls from eval_jacobian and
eval_wsum_hess in left_matmul (forward always runs first)
- Use memcpy in problem_register_params for pointer array copy
- Add PARAM_FIXED guard in problem_update_params to skip fixed constants
- Remove unused right_matmul_expr struct from subexpr.h
- Add test_param_fixed_skip_in_update covering mixed fixed/updatable params
- Add CLAUDE.md for Claude Code guidance
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
* Run clang-format and remove CLAUDE.md
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
* Set has_been_refreshed to false in parameter constructor
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
* Remove CLAUDE.md from PR
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
* remove unused constructors
* run formatter and push it up
* Update includes in test_param_prob.h to use atoms/ prefix
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
* 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) <[email protected]>
* Run clang-format on changed files
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
* 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) <[email protected]>
Co-authored-by: dance858 <[email protected]>
* add test that fails with current appraoch
* new parameter abstraction that fixess the fialing test
* remove dead code
* reset csc
* add raise error to catch bugs
* add initial attempt for fixing parameters and broadcasting (#73)
* add initial attempt for fixing parameters and broadcasting
* add test for params with broadcast
* cleanup test to fit more with other tests style
* some progress on supporting backwards compatible constants
* add some parameter broadcast tests as well
* cleanup left matmul as well
* some very minor cleanups
* some error checks and numerical diff to tests
* we don't always have to run forward of parameter in left matmul
* we don't always have to call forward for parameter node in vector mult
* comment out forward parameter pass in scalar mult because it is not needed, I think
* add test for scalar case to be consistent with vector mult
---------
Co-authored-by: dance858 <[email protected]>
* error message and format
---------
Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
Co-authored-by: dance858 <[email protected]>