diff --git a/Eigen/src/OrderingMethods/Amd.h b/Eigen/src/OrderingMethods/Amd.h index df4e01d6c..ec13077fe 100644 --- a/Eigen/src/OrderingMethods/Amd.h +++ b/Eigen/src/OrderingMethods/Amd.h @@ -106,6 +106,7 @@ Index cs_tdfs(Index j, Index k, Index *head, const Index *next, Index *post, Ind template void minimum_degree_ordering(SparseMatrix& C, PermutationMatrix& perm) { + using std::sqrt; typedef SparseMatrix CCS; int d, dk, dext, lemax = 0, e, elenk, eln, i, j, k, k1, @@ -114,7 +115,7 @@ void minimum_degree_ordering(SparseMatrix& C, Permutation unsigned int h; Index n = C.cols(); - dense = std::max (16, 10 * sqrt ((double) n)); /* find dense threshold */ + dense = std::max (16, Index(10 * sqrt(double(n)))); /* find dense threshold */ dense = std::min (n-2, dense); Index cnz = C.nonZeros(); diff --git a/test/sparse.h b/test/sparse.h index 84cd695f2..860d9ad9c 100644 --- a/test/sparse.h +++ b/test/sparse.h @@ -79,7 +79,7 @@ initSparse(double density, enum { IsRowMajor = SparseMatrix::IsRowMajor }; sparseMat.setZero(); //sparseMat.reserve(int(refMat.rows()*refMat.cols()*density)); - sparseMat.reserve(VectorXi::Constant(IsRowMajor ? refMat.rows() : refMat.cols(), (1.5*density)*(IsRowMajor?refMat.cols():refMat.rows()))); + sparseMat.reserve(VectorXi::Constant(IsRowMajor ? refMat.rows() : refMat.cols(), int((1.5*density)*(IsRowMajor?refMat.cols():refMat.rows())))); for(int j=0; j