Commit 3bb2217b authored by Jorn Baayen's avatar Jorn Baayen Committed by Tjerk Vreeken

CollInt: Handle MX objective with 0x0 shape

If self.objective() returns a 0x0 MX, do not use it as a base to add
path objectives to, as the result would still be 0x0.

This is due to the fact that `ca.MX() + 1 = ca.MX()`.
parent bb84fbfd
......@@ -1211,6 +1211,8 @@ class CollocatedIntegratedOptimizationProblem(OptimizationProblem, metaclass=ABC
# Objective
f_member = self.objective(ensemble_member)
if f_member.size1() == 0:
f_member = 0
if path_objective.size1() > 0:
initial_path_objective = path_objective_function.call(
[parameters,
......
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