Closed voldien closed 2 years ago
Hi @voldien thank you for your contribution! We really appreciate it. I will try review the PR before the end of this week
This change will break compilation with double. Templating might be a solution, however I believe that casting in user-applications is the correct approach. @voldien, can you try ....getSolution().cast<c_float>()
in your application without changing the osqp-eigen? Would this resolve your issues?
The compilation error is caused by changing the c_float inside osqp to float instead of double. Since i trying to increase performance for my application.
So the compilation error is not on my not on my side, since then I would just cast it as you mention. rather the compilation error is inside both OsqpEigen::Solver::getDualSolution() and OsqpEigen::Solver::getSolution(). Since it tries to pass a float pointer to VectorXd.
I thought the reason for it being a double for these two methods was just a miss, since the rest of variables and methods in the class are using the c_float.
Right, I missed this - you're correct
Thank you very much @voldien! Merging!
Resolves compilation error when c_float is set to float.