mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
29 lines
1.3 KiB
Diff
29 lines
1.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Tyler Veness <calcmogul@gmail.com>
|
|
Date: Sat, 8 Feb 2025 13:42:36 -0800
|
|
Subject: [PATCH 05/10] Replace std::views::zip()
|
|
|
|
---
|
|
include/sleipnir/optimization/problem.hpp | 8 +++++---
|
|
1 file changed, 5 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/include/sleipnir/optimization/problem.hpp b/include/sleipnir/optimization/problem.hpp
|
|
index 49921b98de3452b6ca9f2e33a86daa254c0d3a01..d3feadd577bd53147a8b07da76910e046ccbf95d 100644
|
|
--- a/include/sleipnir/optimization/problem.hpp
|
|
+++ b/include/sleipnir/optimization/problem.hpp
|
|
@@ -792,9 +792,11 @@ class Problem {
|
|
for (const auto& constraint : constraints) {
|
|
++counts[slp::to_underlying(constraint.type())];
|
|
}
|
|
- for (const auto& [count, name] :
|
|
- std::views::zip(counts, std::array{"empty", "constant", "linear",
|
|
- "quadratic", "nonlinear"})) {
|
|
+ for (size_t i = 0; i < counts.size(); ++i) {
|
|
+ constexpr std::array names{"empty", "constant", "linear",
|
|
+ "quadratic", "nonlinear"};
|
|
+ const auto& count = counts[i];
|
|
+ const auto& name = names[i];
|
|
if (count > 0) {
|
|
slp::println(" ↳ {} {}", count, name);
|
|
}
|