Add debugging method for printing matrices to stderr to fixture.h
PiperOrigin-RevId: 702301299 Change-Id: I01738b6634a91cde6b146475d06731471dcf3764
This commit is contained in:
committed by
Copybara-Service
parent
a793a3417a
commit
13d3bdedad
@@ -14,8 +14,6 @@
|
||||
|
||||
// Tests for engine/engine_derivative.c.
|
||||
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <random>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@@ -74,19 +72,6 @@ static mjtNum CompareMatrices(mjtNum* Actual, mjtNum* Expected,
|
||||
return max_error;
|
||||
}
|
||||
|
||||
// utility function for matrix printing (debug)
|
||||
// NOLINTNEXTLINE(clang-diagnostic-unused-function)
|
||||
static void PrintMatrix(mjtNum* mat, int nrow, int ncol) {
|
||||
std::cerr.precision(5);
|
||||
std::cerr << "\n";
|
||||
for (int r=0; r < nrow; r++) {
|
||||
for (int c=0; c < ncol; c++) {
|
||||
std::cerr << std::fixed << std::setw(9) << mat[c + r*ncol] << " ";
|
||||
}
|
||||
std::cerr << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
static const char* const kEnergyConservingPendulumPath =
|
||||
"engine/testdata/derivative/energy_conserving_pendulum.xml";
|
||||
static const char* const kTumblingThinObjectPath =
|
||||
|
||||
Reference in New Issue
Block a user