mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-01 02:41:48 +00:00
[upstream_utils] Upgrade to Sleipnir 0.6.0 (#8923)
This commit is contained in:
@@ -11,10 +11,10 @@ Subject: [PATCH 04/10] Replace std::to_underlying()
|
||||
create mode 100644 include/sleipnir/util/to_underlying.hpp
|
||||
|
||||
diff --git a/include/sleipnir/optimization/problem.hpp b/include/sleipnir/optimization/problem.hpp
|
||||
index 3de6d5bf89a65fe07784350c3b1a4691dfc0c822..273363db2cf75c84d81f2fef36dcb2094303ee2e 100644
|
||||
index 41b44578b1e2783dbceb300b7c72ee0c8d1202df..49921b98de3452b6ca9f2e33a86daa254c0d3a01 100644
|
||||
--- a/include/sleipnir/optimization/problem.hpp
|
||||
+++ b/include/sleipnir/optimization/problem.hpp
|
||||
@@ -37,6 +37,7 @@
|
||||
@@ -38,6 +38,7 @@
|
||||
#include "sleipnir/util/profiler.hpp"
|
||||
#include "sleipnir/util/spy.hpp"
|
||||
#include "sleipnir/util/symbol_exports.hpp"
|
||||
@@ -22,7 +22,7 @@ index 3de6d5bf89a65fe07784350c3b1a4691dfc0c822..273363db2cf75c84d81f2fef36dcb209
|
||||
|
||||
namespace slp {
|
||||
|
||||
@@ -752,11 +753,11 @@ class Problem {
|
||||
@@ -773,11 +774,11 @@ class Problem {
|
||||
// Print problem structure
|
||||
slp::println("\nProblem structure:");
|
||||
slp::println(" ↳ {} cost function",
|
||||
@@ -37,7 +37,7 @@ index 3de6d5bf89a65fe07784350c3b1a4691dfc0c822..273363db2cf75c84d81f2fef36dcb209
|
||||
|
||||
if (m_decision_variables.size() == 1) {
|
||||
slp::print("\n1 decision variable\n");
|
||||
@@ -768,7 +769,7 @@ class Problem {
|
||||
@@ -789,7 +790,7 @@ class Problem {
|
||||
[](const gch::small_vector<Variable<Scalar>>& constraints) {
|
||||
std::array<size_t, 5> counts{};
|
||||
for (const auto& constraint : constraints) {
|
||||
@@ -47,7 +47,7 @@ index 3de6d5bf89a65fe07784350c3b1a4691dfc0c822..273363db2cf75c84d81f2fef36dcb209
|
||||
for (const auto& [count, name] :
|
||||
std::views::zip(counts, std::array{"empty", "constant", "linear",
|
||||
diff --git a/include/sleipnir/util/print_diagnostics.hpp b/include/sleipnir/util/print_diagnostics.hpp
|
||||
index e16ef1b03e675b7ccb8db6781568eec7a44aace7..69cb99957cc7da5abc4162c53a229f7f642bbe4b 100644
|
||||
index 87ccad9ef4b05ee5aeaaf0e5ff9cfbc7e995d5ed..831ae3e5d1002005a8aa00fc80accd705d5cca7d 100644
|
||||
--- a/include/sleipnir/util/print_diagnostics.hpp
|
||||
+++ b/include/sleipnir/util/print_diagnostics.hpp
|
||||
@@ -17,6 +17,7 @@
|
||||
@@ -58,15 +58,15 @@ index e16ef1b03e675b7ccb8db6781568eec7a44aace7..69cb99957cc7da5abc4162c53a229f7f
|
||||
|
||||
namespace slp {
|
||||
|
||||
@@ -239,7 +240,7 @@ void print_iteration_diagnostics(int iterations, IterationType type,
|
||||
@@ -230,7 +231,7 @@ void print_iteration_diagnostics(int iterations, IterationType type,
|
||||
slp::println(
|
||||
"│{:4} {:4} {:9.3f} {:12e} {:13e} {:12e} {:12e} {:.2e} {:<5} {:.2e} "
|
||||
"{:.2e} {:2d}│",
|
||||
"│{:4} {:1} {:9.3f} {:10.4e} {:11.4e} {:10.4e} {:8.2e} {:8.2e} {:<5} "
|
||||
"{:<5} {:8.2e} {:8.2e} {:8.2e} {:8.2e} {:2d}│",
|
||||
- iterations, ITERATION_TYPES[std::to_underlying(type)], to_ms(time), error,
|
||||
+ iterations, ITERATION_TYPES[slp::to_underlying(type)], to_ms(time), error,
|
||||
cost, infeasibility, complementarity, μ, power_of_10(δ), primal_α, dual_α,
|
||||
cost, infeasibility, complementarity, μ, power_of_10(δ), power_of_10(γ),
|
||||
full_primal_step_inf_norm, full_dual_step_inf_norm, primal_α, dual_α,
|
||||
backtracks);
|
||||
}
|
||||
diff --git a/include/sleipnir/util/to_underlying.hpp b/include/sleipnir/util/to_underlying.hpp
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..3f9b4835b912c5a0d998c43828f255c61d0f573e
|
||||
|
||||
Reference in New Issue
Block a user