Skip to content
Snippets Groups Projects
Commit 5c39e768 authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[MaL] Avoid implicit conversion IndexType to int.

Conversion happened in the constant vectorXi construction.
parent b4e2396a
No related branches found
No related tags found
No related merge requests found
...@@ -39,10 +39,14 @@ public: ...@@ -39,10 +39,14 @@ public:
* @param n the number of rows (that is equal to the number of columns) * @param n the number of rows (that is equal to the number of columns)
* @param n_nonzero_columns the number of non-zero columns used for preallocation * @param n_nonzero_columns the number of non-zero columns used for preallocation
*/ */
explicit EigenMatrix(IndexType n, IndexType n_nonzero_columns = 0) :_mat(n, n) explicit EigenMatrix(IndexType n, IndexType n_nonzero_columns = 0)
: _mat(n, n)
{ {
if (n_nonzero_columns > 0) if (n_nonzero_columns > 0)
_mat.reserve(Eigen::VectorXi::Constant(n, n_nonzero_columns)); {
_mat.reserve(Eigen::Matrix<IndexType, Eigen::Dynamic, 1>::Constant(
n, n_nonzero_columns));
}
} }
/// return the number of rows /// return the number of rows
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment