mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[wpimath] Generalize Eigen formatter (#5360)
This commit is contained in:
@@ -16,14 +16,14 @@ TEST(FormatterTest, Eigen) {
|
||||
" 0.000000 1.000000\n"
|
||||
" 2.000000 3.000000\n"
|
||||
" 4.000000 5.000000",
|
||||
fmt::format("{}", A));
|
||||
fmt::format("{:f}", A));
|
||||
|
||||
Eigen::MatrixXd B{{0.0, 1.0}, {2.0, 3.0}, {4.0, 5.0}};
|
||||
EXPECT_EQ(
|
||||
" 0.000000 1.000000\n"
|
||||
" 2.000000 3.000000\n"
|
||||
" 4.000000 5.000000",
|
||||
fmt::format("{}", B));
|
||||
fmt::format("{:f}", B));
|
||||
|
||||
Eigen::SparseMatrix<double> C{3, 2};
|
||||
std::vector<Eigen::Triplet<double>> triplets;
|
||||
@@ -37,7 +37,7 @@ TEST(FormatterTest, Eigen) {
|
||||
" 0.000000 1.000000\n"
|
||||
" 2.000000 3.000000\n"
|
||||
" 4.000000 5.000000",
|
||||
fmt::format("{}", C));
|
||||
fmt::format("{:f}", C));
|
||||
}
|
||||
|
||||
TEST(FormatterTest, Units) {
|
||||
|
||||
Reference in New Issue
Block a user