Skip to content

Commit

Permalink
fixed convertJacobian (#371)
Browse files Browse the repository at this point in the history
* fixed the convertJacobian call when jacType == "csr" so that it returns CSR data instead of passing through

* added inform values to the ParOpt wrapper

---------

Co-authored-by: Ella Wu <[email protected]>
Co-authored-by: Marco Mangano <[email protected]>
  • Loading branch information
3 people authored Dec 22, 2023
1 parent 5fef213 commit 8d43112
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyoptsparse/pyOpt_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ def _convertJacobian(self, gcon_csr_in):
self._jac_map_csr_to_csc = mapToCSC(gcon_csr)
gcon = gcon_csr["csr"][IDATA][self._jac_map_csr_to_csc[IDATA]]
elif self.jacType == "csr":
pass
gcon = gcon_csr["csr"][IDATA]
elif self.jacType == "coo":
gcon = convertToCOO(gcon_csr)
gcon = gcon["coo"][IDATA]
Expand Down
2 changes: 2 additions & 0 deletions pyoptsparse/pyParOpt/ParOpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ def evalObjConGradient(self, x, g, A):
# are switch since ParOpt uses a formulation with c(x) >= 0, while pyOpt
# uses g(x) = -c(x) <= 0. Therefore the multipliers are reversed.
sol_inform = {}
sol_inform["value"] = None
sol_inform["text"] = None

# If number of constraints is zero, ParOpt returns z as None.
# Thus if there is no constraints, should pass an empty list
Expand Down

0 comments on commit 8d43112

Please sign in to comment.