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:
@@ -7,9 +7,10 @@ Subject: [PATCH 01/10] Use fmtlib
|
||||
include/sleipnir/autodiff/expression_type.hpp | 16 +++++++----
|
||||
include/sleipnir/optimization/problem.hpp | 1 +
|
||||
.../optimization/solver/exit_status.hpp | 16 +++++++----
|
||||
.../optimization/solver/util/inertia.hpp | 22 ++++++++-------
|
||||
include/sleipnir/util/assert.hpp | 5 ++--
|
||||
include/sleipnir/util/print.hpp | 27 ++++++++++---------
|
||||
5 files changed, 40 insertions(+), 25 deletions(-)
|
||||
6 files changed, 53 insertions(+), 34 deletions(-)
|
||||
|
||||
diff --git a/include/sleipnir/autodiff/expression_type.hpp b/include/sleipnir/autodiff/expression_type.hpp
|
||||
index 12d0568f628d5b97c0c2f5291851d4b20921f9d3..d06d32dac6c7b6faeedefeaa107cedac8446a3ab 100644
|
||||
@@ -66,7 +67,7 @@ index 12d0568f628d5b97c0c2f5291851d4b20921f9d3..d06d32dac6c7b6faeedefeaa107cedac
|
||||
+
|
||||
+// @endcond
|
||||
diff --git a/include/sleipnir/optimization/problem.hpp b/include/sleipnir/optimization/problem.hpp
|
||||
index a9553ffbcfed568c48f7d789d8b127790dfddb91..3de6d5bf89a65fe07784350c3b1a4691dfc0c822 100644
|
||||
index ccff8b9425b45fd1c790bc4da87b81f501a70d9c..41b44578b1e2783dbceb300b7c72ee0c8d1202df 100644
|
||||
--- a/include/sleipnir/optimization/problem.hpp
|
||||
+++ b/include/sleipnir/optimization/problem.hpp
|
||||
@@ -15,6 +15,7 @@
|
||||
@@ -131,6 +132,68 @@ index 0a48df7423b5a3dccd8e611e91befd32487fafdc..8786d6d64ac44ac88133df65a79636ec
|
||||
};
|
||||
+
|
||||
+// @endcond
|
||||
diff --git a/include/sleipnir/optimization/solver/util/inertia.hpp b/include/sleipnir/optimization/solver/util/inertia.hpp
|
||||
index 49ee606f7e3f02f2f5c24079eb27a412dad3055f..2d2ce114be9c40e645d685b63465b977e0b70439 100644
|
||||
--- a/include/sleipnir/optimization/solver/util/inertia.hpp
|
||||
+++ b/include/sleipnir/optimization/solver/util/inertia.hpp
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
-#include <format>
|
||||
#include <limits>
|
||||
|
||||
#include <Eigen/Core>
|
||||
+#include <fmt/format.h>
|
||||
|
||||
namespace slp {
|
||||
|
||||
@@ -77,14 +77,16 @@ class Inertia {
|
||||
|
||||
} // namespace slp
|
||||
|
||||
+// @cond Suppress Doxygen
|
||||
+
|
||||
/// Formatter for Inertia.
|
||||
template <>
|
||||
-struct std::formatter<slp::Inertia> {
|
||||
+struct fmt::formatter<slp::Inertia> {
|
||||
/// Parses format string.
|
||||
///
|
||||
/// @param ctx Format parse context.
|
||||
/// @return Format parse context iterator.
|
||||
- constexpr auto parse(std::format_parse_context& ctx) {
|
||||
+ constexpr auto parse(fmt::format_parse_context& ctx) {
|
||||
return m_underlying.parse(ctx);
|
||||
}
|
||||
|
||||
@@ -95,18 +97,20 @@ struct std::formatter<slp::Inertia> {
|
||||
/// @param ctx Format context.
|
||||
/// @return Format context iterator.
|
||||
template <typename FmtContext>
|
||||
- auto format(const slp::Inertia& inertia, FmtContext& ctx) const {
|
||||
+ constexpr auto format(const slp::Inertia& inertia, FmtContext& ctx) const {
|
||||
auto out = ctx.out();
|
||||
|
||||
- out = std::format_to(out, "(");
|
||||
+ out = fmt::format_to(out, "(");
|
||||
out = m_underlying.format(inertia.positive, ctx);
|
||||
- out = std::format_to(out, ", ");
|
||||
+ out = fmt::format_to(out, ", ");
|
||||
out = m_underlying.format(inertia.negative, ctx);
|
||||
- out = std::format_to(out, ", ");
|
||||
+ out = fmt::format_to(out, ", ");
|
||||
out = m_underlying.format(inertia.zero, ctx);
|
||||
- return std::format_to(out, ")");
|
||||
+ return fmt::format_to(out, ")");
|
||||
}
|
||||
|
||||
private:
|
||||
- std::formatter<int> m_underlying;
|
||||
+ fmt::formatter<int> m_underlying;
|
||||
};
|
||||
+
|
||||
+// @endcond
|
||||
diff --git a/include/sleipnir/util/assert.hpp b/include/sleipnir/util/assert.hpp
|
||||
index 29dfe5416530a476417de3a4b6434d3b28d73120..783a0e71a1cb54bd1d6d17fa9d2bedd2038a8ef5 100644
|
||||
--- a/include/sleipnir/util/assert.hpp
|
||||
|
||||
Reference in New Issue
Block a user