Skip to content

Commit

Permalink
Merge pull request #82 from chrhansk/hotfix-cutest-nonlinear-equations
Browse files Browse the repository at this point in the history
Fix error in detection of nonlinear equations
  • Loading branch information
chrhansk authored May 13, 2024
2 parents ad3c54c + 3669ba7 commit 31f7533
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
project = "pygradflow"
copyright = "2023, Christoph Hansknecht"
author = "Christoph Hansknecht"
release = "0.4.12"
release = "0.4.13"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
11 changes: 8 additions & 3 deletions pygradflow/runners/cutest_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ def y0(self):
return self.instance.v0


class LSQCUTEstProblem(Problem):
# Nonlinear equations: Goal is to minimize the violation
# 1/2 ||c(x)||^2 subject to problem bounds. Constraint
# functions are used to access the residuals and their derivatives
class NECUTEstProblem(Problem):
def __init__(self, instance):
self.instance = instance
var_lb = cutest_map_inf(instance.bl)
Expand Down Expand Up @@ -151,8 +154,10 @@ def solve(self, params):

props = pycutest.problem_properties(self.instance)

if props["objective"] == "none":
problem = LSQCUTEstProblem(problem)
is_ne = self.name.endswith("NE")

if is_ne:
problem = NECUTEstProblem(problem)
elif problem.m == 0:
problem = UnconstrainedCUTEstProblem(problem)
else:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pygradflow"
version = "0.4.12"
version = "0.4.13"
description = "PyGradFlow is a simple implementation of the sequential homotopy method to be used to solve general nonlinear programs."
authors = ["Christoph Hansknecht <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit 31f7533

Please sign in to comment.