Commit 40875b0a authored by Tjerk Vreeken's avatar Tjerk Vreeken Committed by Jesse VanderWees

Optimize reading from results array

Looping over a CasADi DM array is much slower than a NumPy array. This
is especially noticeable when the array consists of 100,000+ elements,
where extract_results() goes from taking minutes to seconds.
parent bc4ebe74
......@@ -134,7 +134,7 @@ class OptimizationProblem(metaclass = ABCMeta):
# Extract relevant stats
self.__objective_value = float(results['f'])
self.__solver_output = results['x']
self.__solver_output = np.array(results['x'])
self.__solver_stats = solver.stats()
# Get the return status
......
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