proxsuite 0.6.7
The Advanced Proximal Optimization Toolbox
Loading...
Searching...
No Matches
results.hpp
Go to the documentation of this file.
1//
2// Copyright (c) 2022 INRIA
3//
8#ifndef PROXSUITE_SERIALIZATION_RESULTS_HPP
9#define PROXSUITE_SERIALIZATION_RESULTS_HPP
10
11#include <cereal/cereal.hpp>
13
14namespace cereal {
15
16template<class Archive, typename T>
17void
18serialize(Archive& archive, proxsuite::proxqp::Info<T>& info)
19{
20 archive(CEREAL_NVP(info.mu_eq),
21 CEREAL_NVP(info.mu_eq_inv),
22 CEREAL_NVP(info.mu_in),
23 CEREAL_NVP(info.mu_in_inv),
24 CEREAL_NVP(info.rho),
25 CEREAL_NVP(info.nu),
26 CEREAL_NVP(info.iter),
27 CEREAL_NVP(info.iter_ext),
28 CEREAL_NVP(info.mu_updates),
29 CEREAL_NVP(info.rho_updates),
30 CEREAL_NVP(info.status),
31 CEREAL_NVP(info.setup_time),
32 CEREAL_NVP(info.solve_time),
33 CEREAL_NVP(info.run_time),
34 CEREAL_NVP(info.objValue),
35 CEREAL_NVP(info.pri_res),
36 CEREAL_NVP(info.dua_res),
37 CEREAL_NVP(info.duality_gap),
38 CEREAL_NVP(info.iterative_residual),
39 CEREAL_NVP(info.sparse_backend));
40}
41
42template<class Archive, typename T>
43void
44serialize(Archive& archive, proxsuite::proxqp::Results<T>& results)
45{
46 archive(CEREAL_NVP(results.x),
47 CEREAL_NVP(results.y),
48 CEREAL_NVP(results.z),
49 CEREAL_NVP(results.se),
50 CEREAL_NVP(results.si),
51 CEREAL_NVP(results.active_constraints),
52 CEREAL_NVP(results.info));
53}
54
55template<class Archive>
56void
57save(Archive& ar, proxsuite::linalg::veg::Vec<bool> const& vec_bool)
58{
59 proxsuite::linalg::veg::isize len = vec_bool.len();
60 ar(CEREAL_NVP(len));
61 for (proxsuite::linalg::veg::isize i = 0; i < len; i++)
62 ar(vec_bool[i]);
63}
64
65template<class Archive>
66void
68{
70 ar(len);
71 vec_bool.reserve(len);
72 for (proxsuite::linalg::veg::isize i = 0; i < len; i++)
73 ar(vec_bool[i]);
74}
75
76} // namespace cereal
77
78#endif /* end of include guard PROXSUITE_SERIALIZATION_RESULTS_HPP */
void save(Archive &ar, Eigen::PlainObjectBase< Derived > const &m)
Definition eigen.hpp:21
void serialize(Archive &archive, proxsuite::proxqp::dense::Model< T > &model)
Definition model.hpp:18
void load(Archive &ar, Eigen::PlainObjectBase< Derived > &m)
Definition eigen.hpp:38
_detail::_meta::make_signed< usize >::Type isize
Definition typedefs.hpp:43
This class stores the results statistics of PROXQP solvers with sparse and dense backends.
Definition results.hpp:29
sparse::isize mu_updates
Definition results.hpp:41
sparse::isize iter
Definition results.hpp:39
QPSolverOutput status
Definition results.hpp:43
SparseBackend sparse_backend
Definition results.hpp:55
sparse::isize iter_ext
Definition results.hpp:40
sparse::isize rho_updates
Definition results.hpp:42
This class stores all the results of PROXQP solvers with sparse and dense backends.
Definition results.hpp:68
sparse::Vec< T > z
Definition results.hpp:74
sparse::Vec< T > si
Definition results.hpp:77
proxsuite::linalg::veg::Vec< bool > active_constraints
Definition results.hpp:79
sparse::Vec< T > y
Definition results.hpp:73
sparse::Vec< T > se
Definition results.hpp:75
sparse::Vec< T > x
Definition results.hpp:72