Skip to content

Commit

Permalink
Use original space for chebychev center
Browse files Browse the repository at this point in the history
  • Loading branch information
schmoelder committed Jan 16, 2024
1 parent ce4206e commit 089c6d4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions CADETProcess/optimization/optimizationProblem.py
Original file line number Diff line number Diff line change
Expand Up @@ -2722,15 +2722,19 @@ def get_chebyshev_center(self, include_dependent_variables=True):
# !!! Additional checks in place to handle PolyRound.round()
# removing "small" dimensions.
# Bug reported, Check for future release!
chebyshev_orig = hopsy.compute_chebyshev_center(problem)[:, 0]
chebyshev_orig = hopsy.compute_chebyshev_center(
problem, original_space=True
)[:, 0]

try:
problem_rounded = hopsy.round(problem)
except ValueError:
problem_rounded = problem

if problem_rounded.A.shape[1] == problem.A.shape[1]:
chebyshev_rounded = hopsy.compute_chebyshev_center(problem_rounded)[:, 0]
chebyshev_rounded = hopsy.compute_chebyshev_center(
problem_rounded, original_space=True
)[:, 0]

if np.all(np.greater(chebyshev_rounded, self.lower_bounds)):
problem = problem_rounded
Expand Down

0 comments on commit 089c6d4

Please sign in to comment.