Linear equality constraints remove dimension when problem is rounded.
When adding linear equality constraints, and then rounding the problem, hopsy removes one of the dimensions. I understand that this is useful and more efficient since equality constraints can always be transformed in a problem with lower dimensions. However, as a user, it makes it difficult to process the results.
Here's a MRE:
import hopsy
import numpy as np
A = np.array([]).reshape((0, 3))
b = np.array([])
problem = hopsy.Problem(
A,
b,
)
lb = [-5, -5, -5]
ub = [5, 5, 5]
problem = hopsy.add_box_constraints(
problem,
lb,
ub,
simplify=False,
)
A_eq = np.array([[1., 2., 0.]])
b_eq = np.array([8])
problem = hopsy.add_equality_constraints(
problem,
A_eq,
b_eq
)
# This works:
chebychev = hopsy.compute_chebyshev_center(
problem, original_space=True
)[:, 0]
print(chebychev)
# This does not work:
problem_rounded = hopsy.round(problem)
chebychev_rounded = hopsy.compute_chebyshev_center(
problem_rounded, original_space=True
)[:, 0]
print(chebychev_rounded)