15 #ifndef BELUGA_TEST_UTILS_EIGEN_INITIALIZERS_HPP
16 #define BELUGA_TEST_UTILS_EIGEN_INITIALIZERS_HPP
18 #include <initializer_list>
20 #include <range/v3/view/enumerate.hpp>
24 template <
typename Matrix,
typename Scalar =
typename Matrix::Scalar>
25 Matrix as(std::initializer_list<std::initializer_list<Scalar>> rows) {
27 for (
auto&& [i, row] : ranges::views::enumerate(rows)) {
28 for (
auto&& [j, coeff] : ranges::views::enumerate(row)) {
29 matrix(
static_cast<typename Matrix::StorageIndex
>(i),
static_cast<typename Matrix::StorageIndex
>(j)) = coeff;