Describe the bug
A double free happens within the C++ solver, when a factor is given that contains a variable that is marked as optimized but never appears in the actual problem statement.
To Reproduce
Use any optimization problem formulation in python using the Factor class.
Remove an arbitrary symbolic variable from your problem entirely, but leave its definition.
Add this symbolic variable to the optimized_keys in factor.generate()
Use the generate code in the LM solver.
Watch it crash.
Expected behavior
Optimized variable should simply be kept at its initial value,
Environment (please complete the following information):
Describe the bug A double free happens within the C++ solver, when a factor is given that contains a variable that is marked as optimized but never appears in the actual problem statement.
To Reproduce
Factor
class.optimized_keys
infactor.generate()
Expected behavior Optimized variable should simply be kept at its initial value,
Environment (please complete the following information):