40 using scalar_type =
typename Matrix::value_type;
41 using storage_index_type =
typename Matrix::StorageIndex;
46 std::vector<Eigen::Triplet<scalar_type, storage_index_type>> triplets;
48 triplets.emplace_back(i, i,
static_cast<scalar_type
>(1));
49 triplets.emplace_back(i, i + 1,
static_cast<scalar_type
>(-1));
52 Matrix matrix(rows, cols);
53 matrix.setFromTriplets(triplets.begin(), triplets.end());