Commit db12302f authored by Jorn Baayen's avatar Jorn Baayen Committed by Tjerk Vreeken

Return ca.MX(0) by default in objectives/residuals

Because `ca.MX() + 1 = ca.MX()`, returning an empty symbol could be
confusing if people override e.g. self.objective().
parent 3bb2217b
......@@ -461,7 +461,7 @@ class OptimizationProblem(metaclass=ABCMeta):
:returns: An :class:`MX` object representing F in the initial equation F = 0.
"""
return ca.MX()
return ca.MX(0)
def seed(self, ensemble_member: int) -> AliasDict:
"""
......@@ -491,7 +491,7 @@ class OptimizationProblem(metaclass=ABCMeta):
return self.state_at('x', times[-1], ensemble_member)
"""
return ca.MX()
return ca.MX(0)
def path_objective(self, ensemble_member: int) -> ca.MX:
"""
......@@ -513,7 +513,7 @@ class OptimizationProblem(metaclass=ABCMeta):
return self.state('x')
"""
return ca.MX()
return ca.MX(0)
def constraints(self, ensemble_member: int) -> List[
Tuple[ca.MX, Union[float, np.ndarray], Union[float, np.ndarray]]]:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment