diff options
author | Michael Schneeberger <michael.schneeberger@fhnw.ch> | 2023-05-09 09:49:44 +0200 |
---|---|---|
committer | Michael Schneeberger <michael.schneeberger@fhnw.ch> | 2023-05-09 09:49:44 +0200 |
commit | 403e292f2dd44ac41535b463b719525d9374fb77 (patch) | |
tree | 03fa3e4bae82d5f28d552b1d8075a7f86f3a79e2 | |
parent | key of x0 are the names instead of the parameter objects (diff) | |
download | sumofsquares-403e292f2dd44ac41535b463b719525d9374fb77.tar.gz sumofsquares-403e292f2dd44ac41535b463b719525d9374fb77.zip |
create single parameter if n_rows > 1 or n_col > 1
-rw-r--r-- | sumofsquares/sosexprbase/init/initsosexprbase.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sumofsquares/sosexprbase/init/initsosexprbase.py b/sumofsquares/sosexprbase/init/initsosexprbase.py index 9dade7e..f8f97fd 100644 --- a/sumofsquares/sosexprbase/init/initsosexprbase.py +++ b/sumofsquares/sosexprbase/init/initsosexprbase.py @@ -47,9 +47,12 @@ def init_param_sos_expr_base( param_matrix = param.T else: - params = tuple(monom.parametrize(f'{name}_{row+1}_{col+1}') for col in range(n_col) for row in range(n_row)) - param = polymatrix.v_stack(params) - param_matrix = polymatrix.v_stack(tuple(param.T for param in params)) + param = monom.rep_mat(n_col * n_row, 1).parametrize(f'{name}') + param_matrix = param.reshape(monom, -1).T + + # params = tuple(monom.parametrize(f'{name}_{row+1}_{col+1}') for col in range(n_col) for row in range(n_row)) + # param = polymatrix.v_stack(params) + # param_matrix = polymatrix.v_stack(tuple(param.T for param in params)) return ParamSOSExprBaseImpl( name=name, |