You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The most significant memory cost of the dense QP solver come form storing the KKT matrix and its decomposition.
Eigen allows for in-place LDLT decomposition that reuses the coefficient matrix and to save memory.
The in-place decomposition requires a reference to the coefficient matrix at construction, which is not available at that point.
However, construction can be delayed using a placement new, which is illustrated below.
usinglinear_solver_t = Eigen::LDLT<Eigen::Ref<kkt_mat_t>>;
char linear_solver_buf[sizeof(linear_solver_t)]; // enforce some alignment somehow?linear_solver_t* linear_solver;
//...
p = (void*) linear_solver_buf;
linear_solver = new(p) linear_solver_t(kkt_mat);
Note: Another option would be to construct the linear solver as a local object on the stack.
The text was updated successfully, but these errors were encountered:
The most significant memory cost of the dense QP solver come form storing the KKT matrix and its decomposition.
Eigen allows for in-place LDLT decomposition that reuses the coefficient matrix and to save memory.
The in-place decomposition requires a reference to the coefficient matrix at construction, which is not available at that point.
However, construction can be delayed using a placement new, which is illustrated below.
Note: Another option would be to construct the linear solver as a local object on the stack.
The text was updated successfully, but these errors were encountered: