What happened?
If the bounds for a row of a constraint are vacuous (-∞,∞), then NLopt terminates with kSolverSpecificError. Simple replication below:
import numpy as np
from pydrake.solvers import IpoptSolver, MathematicalProgram, NloptSolver
def f(x):
return np.array([x[0] + x[1], x[0] - x[1]])
prog = MathematicalProgram()
x = prog.NewContinuousVariables(2)
prog.AddCost(x.dot(x))
prog.AddConstraint(f, lb=[1.0, -np.inf], ub=[1.0, np.inf], vars=x)
prog.SetInitialGuess(x, [0.0, 0.0])
print(NloptSolver().Solve(prog).get_solution_result())
print(IpoptSolver().Solve(prog).get_solution_result())
Version
e45193f
What operating system are you using?
Other, Ubuntu 24.04 (Noble)
What installation option are you using?
compiled from source code using Bazel
Relevant log output
What happened?
If the bounds for a row of a constraint are vacuous (-∞,∞), then NLopt terminates with
kSolverSpecificError. Simple replication below:Version
e45193f
What operating system are you using?
Other, Ubuntu 24.04 (Noble)
What installation option are you using?
compiled from source code using Bazel
Relevant log output