File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -411,13 +411,17 @@ def create_qp_from_gurobi(
411
411
constraint_matrix .data = jnp .where (
412
412
leq_nzval_mask , - constraint_matrix .data , constraint_matrix .data
413
413
)
414
- objective_matrix = 2 * BCOO .from_scipy_sparse (model .getQ ())
414
+ objective_matrix = 2 * BCOO .from_scipy_sparse (
415
+ (model .getQ () + model .getQ ().T ) / 2
416
+ )
415
417
else :
416
418
constraint_matrix = jnp .array (model .getA ().toarray ())
417
419
constraint_matrix = constraint_matrix .at [leq_mask ].set (
418
420
- constraint_matrix [leq_mask ]
419
421
)
420
- objective_matrix = 2 * jnp .array (model .getQ ().toarray ())
422
+ objective_matrix = 2 * jnp .array (
423
+ ((model .getQ () + model .getQ ().T ) / 2 ).toarray ()
424
+ )
421
425
is_lp = model .getQ ().nnz == 0
422
426
if sharding is not None :
423
427
constraint_matrix = jax .device_put (constraint_matrix , sharding )
Original file line number Diff line number Diff line change 1
1
[tool .poetry ]
2
2
name = " mpax"
3
- version = " 0.1.2 "
3
+ version = " 0.2.0 "
4
4
description = " MPAX: Mathematical Programming in JAX"
5
5
authors = [
" Zedong Peng <[email protected] >" ]
6
6
license = " MIT"
You can’t perform that action at this time.
0 commit comments