fix singed integer overflow UB in integer_types and other trivial compiler warnings

libeigen/eigen!2380
This commit is contained in:
Charles Schlosser
2026-04-03 03:36:28 +00:00
parent 60df12437e
commit 5977635d64
6 changed files with 32 additions and 64 deletions

View File

@@ -902,6 +902,17 @@ void setRandomDataInRange(DataContainer& data_container, typename DataContainer:
using namespace Eigen;
template <typename MatrixType, typename Scalar = typename MatrixType::Scalar>
MatrixType RandomMatrix(Index rows, Index cols, Scalar min, Scalar max) {
MatrixType M = MatrixType(rows, cols);
for (Index i = 0; i < rows; ++i) {
for (Index j = 0; j < cols; ++j) {
M(i, j) = Eigen::internal::random<Scalar>(min, max);
}
}
return M;
}
/**
* Set number of repetitions for unit test from input string.
*