proxsuite 0.6.7
The Advanced Proximal Optimization Toolbox
Loading...
Searching...
No Matches
workspace.hpp
Go to the documentation of this file.
1//
2// Copyright (c) 2022 INRIA
3//
6#ifndef PROXSUITE_PROXQP_SPARSE_WORKSPACE_HPP
7#define PROXSUITE_PROXQP_SPARSE_WORKSPACE_HPP
8
22
23#include <memory>
24#include <Eigen/IterativeLinearSolvers>
25#include <unsupported/Eigen/IterativeSolvers>
26
27namespace proxsuite {
28namespace proxqp {
29namespace sparse {
30
31template<typename T, typename I>
32void
34 Results<T> const& results,
35 Settings<T> const& settings,
38 Model<T, I> const& data,
41{
42 isize n_tot = kkt_active.nrows();
43 T mu_eq_neg = -results.info.mu_eq;
44 T mu_in_neg(0);
45 switch (settings.merit_function_type) {
47 mu_in_neg = -settings.alpha_gpdal * results.info.mu_in;
48 break;
50 mu_in_neg = -results.info.mu_in;
51 break;
52 }
53
54 if (work.internal.do_ldlt) {
56 work.internal.ldl.nnz_counts.ptr_mut(),
57 work.internal.ldl.etree.ptr_mut(),
58 work.internal.ldl.perm_inv.ptr_mut(),
59 work.internal.ldl.perm.ptr_mut(),
60 kkt_active.symbolic(),
61 stack);
62
63 isize nnz = 0;
65 for (usize j = 0; j < usize(kkt_active.ncols()); ++j) {
66 nnz += usize(kkt_active.col_end(j) - kkt_active.col_start(j));
67 }
68 VEG_ASSERT(kkt_active.nnz() == nnz);
69 auto _diag = stack.make_new_for_overwrite(xtag, n_tot);
70 T* diag = _diag.ptr_mut();
71
72 for (isize i = 0; i < data.dim; ++i) {
73 diag[i] = results.info.rho;
74 }
75 for (isize i = 0; i < data.n_eq; ++i) {
76 diag[data.dim + i] = mu_eq_neg;
77 }
78 for (isize i = 0; i < data.n_in; ++i) {
79 diag[(data.dim + data.n_eq) + i] =
80 active_constraints[i] ? mu_in_neg : T(1);
81 }
82
84 work.internal.ldl.values.ptr_mut(),
85 work.internal.ldl.row_indices.ptr_mut(),
86 diag,
87 work.internal.ldl.perm.ptr_mut(),
88 work.internal.ldl.col_ptrs.ptr(),
89 work.internal.ldl.etree.ptr_mut(),
90 work.internal.ldl.perm_inv.ptr_mut(),
91 kkt_active.as_const(),
92 stack);
93 } else {
94 *work.internal.matrix_free_kkt = { { kkt_active.as_const(),
95 active_constraints.as_const(),
96 data.dim,
97 data.n_eq,
98 data.n_in,
99 results.info.rho,
100 results.info.mu_eq_inv,
101 results.info.mu_in_inv } };
103 }
104}
105
106template<typename T, typename I>
117
118template<typename T, typename I>
120{
121
122 struct /* NOLINT */
123 {
124 // temporary allocations
126 storage; // memory of the stack with the requirements req which determines
127 // its size.
131 // persistent allocations
132
133 Eigen::Matrix<T, Eigen::Dynamic, 1> g_scaled;
134 Eigen::Matrix<T, Eigen::Dynamic, 1> b_scaled;
135 Eigen::Matrix<T, Eigen::Dynamic, 1> l_scaled;
136 Eigen::Matrix<T, Eigen::Dynamic, 1> u_scaled;
138
139 // stored in unique_ptr because we need a stable address
140 std::unique_ptr<detail::AugmentedKkt<T, I>>
141 matrix_free_kkt; // view on active part of the KKT which includes the
142 // regularizations
143 std::unique_ptr<Eigen::MINRES<detail::AugmentedKkt<T, I>,
144 Eigen::Upper | Eigen::Lower,
145 Eigen::IdentityPreconditioner>>
146 matrix_free_solver; // eigen based method which takes in entry vector, and
147 // performs matrix vector products
148
150 {
151 return {
153 storage.as_mut(),
154 };
155 } // exploits all available memory in storage
156
157 // Whether the workspace is dirty
158 bool dirty;
161
166 isize lnnz;
181 Model<T, I>& data,
185 {
186 auto& ldl = internal.ldl;
187
188 auto& storage = internal.storage;
189 auto& do_ldlt = internal.do_ldlt;
190 // persistent allocations
191
192 data.dim = H.nrows();
193 data.n_eq = AT.ncols();
194 data.n_in = CT.ncols();
195 data.H_nnz = H.nnz();
196 data.A_nnz = AT.nnz();
197 data.C_nnz = CT.nnz();
198
199 using namespace proxsuite::linalg::veg::dynstack;
200 using namespace proxsuite::linalg::sparse::util;
202
203 isize n = H.nrows();
204 isize n_eq = AT.ncols();
205 isize n_in = CT.ncols();
206 isize n_tot = n + n_eq + n_in;
207
208 isize nnz_tot = H.nnz() + AT.nnz() + CT.nnz();
209
210 // form the full kkt matrix
211 // assuming H, AT, CT are sorted
212 // and H is upper triangular
213 {
214 data.kkt_col_ptrs.resize_for_overwrite(n_tot + 1); //
215 data.kkt_row_indices.resize_for_overwrite(nnz_tot);
216 data.kkt_values.resize_for_overwrite(nnz_tot);
217
218 I* kktp = data.kkt_col_ptrs.ptr_mut();
219 I* kkti = data.kkt_row_indices.ptr_mut();
220
221 kktp[0] = 0;
222 usize col = 0;
223 usize pos = 0;
224
225 auto insert_submatrix =
227 bool assert_sym_hi) -> void {
228 I const* mi = m.row_indices();
229 isize ncols = m.ncols();
230
231 for (usize j = 0; j < usize(ncols); ++j) {
232 usize col_start = m.col_start(j);
233 usize col_end = m.col_end(j);
234
235 kktp[col + 1] =
236 checked_non_negative_plus(kktp[col], I(col_end - col_start));
237 ++col;
238
239 for (usize p = col_start; p < col_end; ++p) {
240 usize i = zero_extend(mi[p]);
241 if (assert_sym_hi) {
242 VEG_ASSERT(i <= j);
243 }
244
246
247 ++pos;
248 }
249 }
250 };
251
252 insert_submatrix(H, true);
253 insert_submatrix(AT, false);
254 insert_submatrix(CT, false);
255 }
256
259
260 storage.resize_for_overwrite( //
261 (StackReq::with_len(itag, n_tot) &
263 itag, //
264 n_tot, //
265 nnz_tot, //
267 .alloc_req() //
268 );
269
270 ldl.col_ptrs.resize_for_overwrite(n_tot + 1);
271 ldl.perm_inv.resize_for_overwrite(n_tot);
272
273 DynStackMut stack = stack_mut();
274
275 bool overflow = false;
276 {
277 ldl.etree.resize_for_overwrite(n_tot);
278 auto etree_ptr = ldl.etree.ptr_mut();
279
280 using namespace proxsuite::linalg::veg::literals;
282 proxsuite::linalg::sparse::from_raw_parts,
283 n_tot,
284 n_tot,
285 nnz_tot,
286 data.kkt_col_ptrs.ptr(),
287 nullptr,
288 data.kkt_row_indices.ptr(),
289 };
291 ldl.col_ptrs.ptr_mut() +
292 1, // reimplements col counts to get the matrix free version as well
293 etree_ptr,
294 ldl.perm_inv.ptr_mut(),
295 static_cast<I const*>(nullptr),
296 kkt_sym,
297 stack);
298
299 auto pcol_ptrs = ldl.col_ptrs.ptr_mut();
300 pcol_ptrs[0] = I(0);
301
303 u64 acc = 0;
304
305 for (usize i = 0; i < usize(n_tot); ++i) {
306 acc += u64(zero_extend(pcol_ptrs[i + 1]));
307 if (acc != u64(I(acc))) {
308 overflow = true;
309 }
310 pcol_ptrs[(i + 1)] = I(acc);
311 }
312 }
313
314 lnnz = isize(zero_extend(ldl.col_ptrs[n_tot]));
315
316 // if ldlt is too sparse
317 // do_ldlt = !overflow && lnnz < (10000000);
318 do_ldlt = !overflow && lnnz < 10000000;
319
320 internal.do_symbolic_fact = false;
321 }
332 template<typename P>
334 Model<T, I>& data,
335 const Settings<T>& settings,
336 bool execute_or_not,
337 P& precond,
339 {
340
341 auto& ldl = internal.ldl;
342
343 auto& storage = internal.storage;
344 auto& do_ldlt = internal.do_ldlt;
345 // persistent allocations
346
347 auto& g_scaled = internal.g_scaled;
348 auto& b_scaled = internal.b_scaled;
349 auto& l_scaled = internal.l_scaled;
350 auto& u_scaled = internal.u_scaled;
351 auto& kkt_nnz_counts = internal.kkt_nnz_counts;
352
353 // stored in unique_ptr because we need a stable address
354 auto& matrix_free_solver = internal.matrix_free_solver;
355 auto& matrix_free_kkt = internal.matrix_free_kkt;
356
357 data.dim = qp.H.nrows();
358 data.n_eq = qp.AT.ncols();
359 data.n_in = qp.CT.ncols();
360 data.H_nnz = qp.H.nnz();
361 data.A_nnz = qp.AT.nnz();
362 data.C_nnz = qp.CT.nnz();
363
364 data.g = qp.g.to_eigen();
365 data.b = qp.b.to_eigen();
366 data.l = qp.l.to_eigen();
367 data.u = qp.u.to_eigen();
368
369 using namespace proxsuite::linalg::veg::dynstack;
370 using namespace proxsuite::linalg::sparse::util;
371
372 using SR = StackReq;
375
376 isize n = qp.H.nrows();
377 isize n_eq = qp.AT.ncols();
378 isize n_in = qp.CT.ncols();
379 isize n_tot = n + n_eq + n_in;
380
381 isize nnz_tot = qp.H.nnz() + qp.AT.nnz() + qp.CT.nnz();
382
383 if (internal.do_symbolic_fact) {
384
385 // form the full kkt matrix
386 // assuming H, AT, CT are sorted
387 // and H is upper triangular
388 {
389 data.kkt_col_ptrs.resize_for_overwrite(n_tot + 1);
390 data.kkt_row_indices.resize_for_overwrite(nnz_tot);
391 data.kkt_values.resize_for_overwrite(nnz_tot);
392
393 I* kktp = data.kkt_col_ptrs.ptr_mut();
394 I* kkti = data.kkt_row_indices.ptr_mut();
395 T* kktx = data.kkt_values.ptr_mut();
396
397 kktp[0] = 0;
398 usize col = 0;
399 usize pos = 0;
400
402 bool assert_sym_hi) -> void {
403 I const* mi = m.row_indices();
404 T const* mx = m.values();
405 isize ncols = m.ncols();
406
407 for (usize j = 0; j < usize(ncols); ++j) {
408 usize col_start = m.col_start(j);
409 usize col_end = m.col_end(j);
410
411 kktp[col + 1] =
412 checked_non_negative_plus(kktp[col], I(col_end - col_start));
413 ++col;
414
415 for (usize p = col_start; p < col_end; ++p) {
416 usize i = zero_extend(mi[p]);
417 if (assert_sym_hi) {
418 VEG_ASSERT(i <= j);
419 }
420
422 kktx[pos] = mx[p];
423
424 ++pos;
425 }
426 }
427 };
428
429 insert_submatrix(qp.H, true);
430 insert_submatrix(qp.AT, false);
431 insert_submatrix(qp.CT, false);
432 }
433
437
438 storage.resize_for_overwrite( //
439 (StackReq::with_len(itag, n_tot) &
441 itag, //
442 n_tot, //
443 nnz_tot, //
445 .alloc_req() //
446 );
447
448 ldl.col_ptrs.resize_for_overwrite(n_tot + 1);
449 ldl.perm_inv.resize_for_overwrite(n_tot);
450
451 DynStackMut stack = stack_mut();
452
453 bool overflow = false;
454 {
455 ldl.etree.resize_for_overwrite(n_tot);
456 auto etree_ptr = ldl.etree.ptr_mut();
457
458 using namespace proxsuite::linalg::veg::literals;
460 proxsuite::linalg::sparse::from_raw_parts,
461 n_tot,
462 n_tot,
463 nnz_tot,
464 data.kkt_col_ptrs.ptr(),
465 nullptr,
466 data.kkt_row_indices.ptr(),
467 };
469 ldl.col_ptrs.ptr_mut() + 1,
470 etree_ptr,
471 ldl.perm_inv.ptr_mut(),
472 static_cast<I const*>(nullptr),
473 kkt_sym,
474 stack);
475
476 auto pcol_ptrs = ldl.col_ptrs.ptr_mut();
477 pcol_ptrs[0] = I(0); // pcol_ptrs +1: pointor towards the nbr of non
478 // zero elts per column of the ldlt
479 // we need to compute its cumulative sum below to determine if there
480 // could be an overflow
481
483 u64 acc = 0;
484
485 for (usize i = 0; i < usize(n_tot); ++i) {
486 acc += u64(zero_extend(pcol_ptrs[i + 1]));
487 if (acc != u64(I(acc))) {
488 overflow = true;
489 }
490 pcol_ptrs[(i + 1)] = I(acc);
491 }
492 }
493
494 auto lnnz = isize(zero_extend(ldl.col_ptrs[n_tot]));
495
496 // if ldlt is too sparse
497 // do_ldlt = !overflow && lnnz < (10000000);
499 do_ldlt = !overflow && lnnz < 10000000;
500 } else if (settings.sparse_backend == SparseBackend::SparseCholesky) {
501 do_ldlt = true;
502 } else {
503 do_ldlt = false;
504 }
505
506 } else {
507 T* kktx = data.kkt_values.ptr_mut();
508 usize pos = 0;
509 auto insert_submatrix =
511 T const* mx = m.values();
512 isize ncols = m.ncols();
513
514 for (usize j = 0; j < usize(ncols); ++j) {
515 usize col_start = m.col_start(j);
516 usize col_end = m.col_end(j);
517 for (usize p = col_start; p < col_end; ++p) {
518
519 kktx[pos] = mx[p];
520
521 ++pos;
522 }
523 }
524 };
525
530 }
531#define PROX_QP_ALL_OF(...) \
532 ::proxsuite::linalg::veg::dynstack::StackReq::and_( \
533 ::proxsuite::linalg::veg::init_list(__VA_ARGS__))
534#define PROX_QP_ANY_OF(...) \
535 ::proxsuite::linalg::veg::dynstack::StackReq::or_( \
536 ::proxsuite::linalg::veg::init_list(__VA_ARGS__))
537 // ? --> if
538 auto refactorize_req =
539 do_ldlt
542 itag,
543 n_tot,
544 nnz_tot,
547 SR::with_len(xtag, n_tot), // diag
549 xtag,
550 itag,
551 n_tot,
552 nnz_tot,
554 }),
555 })
557 SR::with_len(itag, 0), // compute necessary space for storing n elts
558 // of type I (n = 0 here)
559 SR::with_len(xtag, 0), // compute necessary space for storing n elts
560 // of type T (n = 0 here)
561 });
562
563 auto x_vec = [&](isize n) noexcept -> StackReq {
565 };
566
568 x_vec(n_tot), // tmp
569 x_vec(n_tot), // err
570 x_vec(n_tot), // work
571 });
572
575 x_vec(2 * n_in), // alphas
576 x_vec(n), // Cdx_active
577 x_vec(n_in), // active_part_z
578 x_vec(n_in), // tmp_lo
579 x_vec(n_in), // tmp_up
580 });
581 // define memory needed for primal_dual_newton_semi_smooth
582 // PROX_QP_ALL_OF --> need to store all argument inside
583 // PROX_QP_ANY_OF --> au moins un de ceux en entrée
585 x_vec(n_tot), // dw
590 n_in), // active_set_lo
592 n_in), // active_set_up
594 n_in), // new_active_constraints
595 (do_ldlt && n_in > 0) ? PROX_QP_ANY_OF({
597 xtag, itag, n_tot, false, n, n_tot),
599 xtag, itag, n_tot, n_tot),
600 })
602 }),
604 x_vec(n), // Hdx
605 x_vec(n_eq), // Adx
606 x_vec(n_in), // Cdx
607 x_vec(n), // ATdy
608 x_vec(n), // CTdz
609 }),
610 }),
612 });
613
614 auto iter_req = PROX_QP_ANY_OF({
615 PROX_QP_ALL_OF({ x_vec(n_eq), // primal_residual_eq_scaled
616 x_vec(n_in), // primal_residual_in_scaled_lo
617 x_vec(n_in), // primal_residual_in_scaled_up
618 x_vec(n_in), // primal_residual_in_scaled_up
619 x_vec(n), // dual_residual_scaled
623 x_vec(n), // x_prev
624 x_vec(n_eq), // y_prev
625 x_vec(n_in), // z_prev
627 }),
628 }) }),
629 refactorize_req, // mu_update
630 });
631
632 auto req = //
634 x_vec(n), // g_scaled
635 x_vec(n_eq), // b_scaled
636 x_vec(n_in), // l_scaled
637 x_vec(n_in), // u_scaled
639 n_in), // active constr
640 SR::with_len(itag, n_tot), // kkt nnz counts
646 SR::with_len(itag, n_tot), // perm
647 SR::with_len(itag, n_tot), // etree
648 SR::with_len(itag, n_tot), // ldl nnz counts
649 SR::with_len(itag, lnnz), // ldl row indices
650 SR::with_len(xtag, lnnz), // ldl values
651 })
653 SR::with_len(itag, 0),
654 SR::with_len(xtag, 0),
655 }),
656 iter_req,
657 }),
658 }),
659 });
660
661 storage.resize_for_overwrite(
662 req.alloc_req()); // defines the maximal storage size
663 // storage.resize(n): if it is done twice in a row, the second times it does
664 // nothing, as the same resize has been asked
665
666 // preconditioner
667 auto kkt = data.kkt_mut();
669 proxsuite::linalg::veg::unsafe,
670 kkt,
671 n); // top_rows_mut_unchecked: take a view of sparse matrix for n first
672 // lines ; the function assumes all others lines are zeros;
673 /*
674 H AT CT
675 A
676 C
677
678 here we store the upper triangular part below
679
680 tirSup(H) AT CT
681 0 0 0
682 0 0 0
683
684 proxsuite::linalg::veg::unsafe: precises that the function has
685 undefined behavior if upper condition is not respected.
686 */
687
690
693
695 detail::middle_cols_mut(kkt_top_n_rows, n + n_eq, n_in, data.C_nnz);
696
697 g_scaled = data.g;
698 b_scaled = data.b;
699 u_scaled =
700 (data.u.array() <= T(1.E20))
701 .select(data.u,
702 Eigen::Matrix<T, Eigen::Dynamic, 1>::Zero(data.n_in).array() +
703 T(1.E20));
704 l_scaled =
705 (data.l.array() >= T(-1.E20))
706 .select(data.l,
707 Eigen::Matrix<T, Eigen::Dynamic, 1>::Zero(data.n_in).array() -
708 T(1.E20));
709
711 H_scaled,
713 AT_scaled,
715 CT_scaled,
718 };
719
720 DynStackMut stack = stack_mut();
721 precond.scale_qp_in_place(qp_scaled,
726 stack);
727 kkt_nnz_counts.resize_for_overwrite(n_tot);
728
730 proxsuite::linalg::sparse::from_raw_parts,
731 n_tot,
732 n_tot,
733 data.H_nnz +
734 data.A_nnz, // these variables are not used for the matrix vector
735 // product in augmented KKT with Min res algorithm (to be
736 // exact, it should depend of the initial guess)
737 kkt.col_ptrs_mut(),
739 kkt.row_indices_mut(),
740 kkt.values_mut(),
741 };
742
743 using MatrixFreeSolver = Eigen::MINRES<detail::AugmentedKkt<T, I>,
744 Eigen::Upper | Eigen::Lower,
745 Eigen::IdentityPreconditioner>;
746 matrix_free_solver = std::unique_ptr<MatrixFreeSolver>{
748 };
749 matrix_free_kkt = std::unique_ptr<detail::AugmentedKkt<T, I>>{
751 {
752 kkt_active.as_const(),
753 {},
754 n,
755 n_eq,
756 n_in,
757 {},
758 {},
759 {},
760 },
761 }
762 };
763
764 auto zx = proxsuite::linalg::sparse::util::zero_extend; // ?
765 auto max_lnnz = isize(zx(ldl.col_ptrs[n_tot]));
766 isize ldlt_ntot = do_ldlt ? n_tot : 0;
767 isize ldlt_lnnz = do_ldlt ? max_lnnz : 0;
768
769 ldl.nnz_counts.resize_for_overwrite(ldlt_ntot);
770 ldl.row_indices.resize_for_overwrite(ldlt_lnnz);
771 ldl.values.resize_for_overwrite(ldlt_lnnz);
772
773 ldl.perm.resize_for_overwrite(ldlt_ntot);
774 if (do_ldlt) {
775 // compute perm from perm_inv
776 for (isize i = 0; i < n_tot; ++i) {
777 ldl.perm[isize(zx(ldl.perm_inv[i]))] = I(i);
778 }
779 }
780
781 internal.dirty = false;
782 }
784 Workspace() = default;
785
786 auto ldl_col_ptrs() const -> I const* { return internal.ldl.col_ptrs.ptr(); }
787 auto ldl_col_ptrs_mut() -> I* { return internal.ldl.col_ptrs.ptr_mut(); }
789 {
790 return internal.stack_mut();
791 }
792
793 void set_dirty() { internal.dirty = true; }
794};
795
796} // namespace sparse
797} // namespace proxqp
798} // namespace proxsuite
799
800#endif /* end of include guard PROXSUITE_PROXQP_SPARSE_WORKSPACE_HPP */
#define VEG_ASSERT(...)
#define VEG_ONLY_USED_FOR_DEBUG(var)
Definition macros.hpp:85
auto temp_vec_req(proxsuite::linalg::veg::Tag< T >, isize rows) noexcept -> proxsuite::linalg::veg::dynstack::StackReq
Definition core.hpp:862
void factorize_symbolic_non_zeros(I *nnz_per_col, I *etree, I *perm_inv, I const *perm, SymbolicMatRef< I > a, DynStackMut stack) noexcept
auto delete_row_req(proxsuite::linalg::veg::Tag< T >, proxsuite::linalg::veg::Tag< I >, isize n, isize max_nnz) noexcept -> proxsuite::linalg::veg::dynstack::StackReq
Definition rowmod.hpp:25
void factorize_numeric(T *values, I *row_indices, proxsuite::linalg::veg::DoNotDeduce< T const * > diag_to_add, proxsuite::linalg::veg::DoNotDeduce< I const * > perm, I const *col_ptrs, I const *etree, I const *perm_inv, MatRef< T, I > a, DynStackMut stack) noexcept(false)
auto factorize_symbolic_req(proxsuite::linalg::veg::Tag< I > tag, isize n, isize nnz, Ordering o) noexcept -> proxsuite::linalg::veg::dynstack::StackReq
auto factorize_numeric_req(proxsuite::linalg::veg::Tag< T >, proxsuite::linalg::veg::Tag< I >, isize n, isize a_nnz, Ordering o) noexcept -> proxsuite::linalg::veg::dynstack::StackReq
auto add_row_req(proxsuite::linalg::veg::Tag< T >, proxsuite::linalg::veg::Tag< I >, isize n, bool id_perm, isize nnz, isize max_nnz) noexcept -> proxsuite::linalg::veg::dynstack::StackReq
Definition rowmod.hpp:143
std::uint64_t u64
Definition typedefs.hpp:46
auto middle_cols_mut(proxsuite::linalg::sparse::MatMut< T, I > mat, isize start, isize ncols, isize nnz) -> proxsuite::linalg::sparse::MatMut< T, I >
Definition utils.hpp:400
auto top_rows_mut_unchecked(proxsuite::linalg::veg::Unsafe, proxsuite::linalg::sparse::MatMut< T, I > mat, isize nrows) -> proxsuite::linalg::sparse::MatMut< T, I >
Definition utils.hpp:440
void refactorize(Workspace< T, I > &work, Results< T > const &results, Settings< T > const &settings, proxsuite::linalg::sparse::MatMut< T, I > kkt_active, proxsuite::linalg::veg::SliceMut< bool > active_constraints, Model< T, I > const &data, proxsuite::linalg::veg::dynstack::DynStackMut stack, proxsuite::linalg::veg::Tag< T > &xtag)
Definition workspace.hpp:33
Eigen::Matrix< bool, DYN, 1 > VecBool
Definition fwd.hpp:43
decltype(sizeof(0)) usize
Definition views.hpp:24
#define PROX_QP_ALL_OF(...)
#define PROX_QP_ANY_OF(...)
VEG_NODISCARD VEG_INLINE auto ptr_mut() VEG_NOEXCEPT -> T *
Definition vec.hpp:966
VEG_NODISCARD VEG_INLINE auto as_mut() VEG_NOEXCEPT -> SliceMut< T >
Definition vec.hpp:957
VEG_NODISCARD VEG_INLINE auto ptr() const VEG_NOEXCEPT -> T const *
Definition vec.hpp:962
VEG_NODISCARD auto ptr_mut() const VEG_NOEXCEPT -> void *
This class stores all the results of PROXQP solvers with sparse and dense backends.
Definition results.hpp:68
This class defines the settings of PROXQP solvers with sparse and dense backends.
Definition settings.hpp:89
MeritFunctionType merit_function_type
Definition settings.hpp:137
This class mimics the way "boost/timer/timer.hpp" operates while using the modern std::chrono library...
Definition timings.hpp:36
proxsuite::linalg::veg::Vec< I > nnz_counts
proxsuite::linalg::veg::Vec< I > row_indices
proxsuite::linalg::veg::Vec< T > values
proxsuite::linalg::veg::Vec< I > etree
proxsuite::linalg::veg::Vec< I > perm_inv
proxsuite::linalg::veg::Vec< I > col_ptrs
proxsuite::linalg::veg::Vec< I > perm
This class stores the model of the QP problem.
Definition model.hpp:23
proxsuite::linalg::veg::Vec< I > kkt_col_ptrs
Definition model.hpp:35
proxsuite::linalg::veg::Vec< T > kkt_values
Definition model.hpp:37
proxsuite::linalg::veg::Vec< I > kkt_row_indices_unscaled
Definition model.hpp:40
proxsuite::linalg::veg::Vec< T > kkt_values_unscaled
Definition model.hpp:41
auto kkt_mut() -> proxsuite::linalg::sparse::MatMut< T, I >
Definition model.hpp:96
proxsuite::linalg::veg::Vec< I > kkt_row_indices
Definition model.hpp:36
proxsuite::linalg::veg::Vec< I > kkt_col_ptrs_unscaled
Definition model.hpp:39
This class defines the workspace of the sparse solver.
Eigen::Matrix< T, Eigen::Dynamic, 1 > u_scaled
std::unique_ptr< detail::AugmentedKkt< T, I > > matrix_free_kkt
proxsuite::linalg::veg::Vec< bool > active_inequalities
Eigen::Matrix< T, Eigen::Dynamic, 1 > b_scaled
void setup_impl(const QpView< T, I > qp, Model< T, I > &data, const Settings< T > &settings, bool execute_or_not, P &precond, proxsuite::linalg::veg::dynstack::StackReq precond_req)
std::unique_ptr< Eigen::MINRES< detail::AugmentedKkt< T, I >, Eigen::Upper|Eigen::Lower, Eigen::IdentityPreconditioner > > matrix_free_solver
Eigen::Matrix< T, Eigen::Dynamic, 1 > l_scaled
Eigen::Matrix< T, Eigen::Dynamic, 1 > g_scaled
struct proxsuite::proxqp::sparse::Workspace::@16 internal
proxsuite::linalg::veg::Vec< I > kkt_nnz_counts
auto stack_mut() -> proxsuite::linalg::veg::dynstack::DynStackMut
void setup_symbolic_factorizaton(Model< T, I > &data, proxsuite::linalg::sparse::SymbolicMatRef< I > H, proxsuite::linalg::sparse::SymbolicMatRef< I > AT, proxsuite::linalg::sparse::SymbolicMatRef< I > CT)
auto ldl_col_ptrs() const -> I const *
proxsuite::linalg::veg::Vec< proxsuite::linalg::veg::mem::byte > storage