-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Eigen for linear algebra #116
Comments
I would second this, and could support in implementation. Using both Eigen::SparseMatrix and qpOASES::SparseMatrix in client code becomes a hassle, when no easy convert function exists. It would be great to have an overload of all init and hotstart methods that accepts at least the Hessian H and constraint matrix A as Eigen::Matrix or Eigen::SparseMatrix. |
It would be great to have an easier interface for users of Eigen. However, a compile-time dependency of qpOASES on Eigen would probably create a lot of headache for those that need to run qpOASES on embedded devices. My feeling is that conversion shouldn't be too hard, as the data structures for matrices in qpOASES are completely standard. If one would like a more native support without deep copies, I think deriving Eigen-based classes from the abstract matrix classes in qpOASES should be doable (but I don't have the time to figure out the details). Would it be a viable solution to start a separate small project that delivers the conversion routines and the derived matrix classes? In this case, current users wouldn't be bothered with the new dependencies on Eigen. |
yeah perhaps, it's really the more advanced feature sets where I have run into issues that have taken me great amounts of time/effort to support. For the simple
and say I then have |
Yes, I also referred to Eigen::SparseMatrix. I understand that the dependency on Eigen would be not desired. Currently, I'm using a naive mapping, such as let's say I have an Eigen::SparseMatrix Eigen_sparse
And then I construct the qpOASES::SparseMatrix from the three vectors values, row_indices and col_pointer. It's not very pretty though. Perhaps someone here has a better solution? |
I just accidentally found that it is a lot easier than that, perhaps it is useful to someone else: Example:
Just make sure that eigen_sparse is still valid when qpoases_sparse is being used, e.g. by creating it as a class member via a unique pointer. |
NIce, I will need to give that a try |
It allocates an index array |
I'm not sure if this is a desire for anybody other than myself or if the maintainers are interested in this or not so feel free to "close won't do" if i'm alone in this, but it would really make life easier if Eigen was used for linear algebra. Especially for the more advanced features like the sparse utilizing sparse matrices.
The text was updated successfully, but these errors were encountered: