From: David Wells Date: Sat, 21 Nov 2015 23:33:45 +0000 (-0500) Subject: Prefer boost::math::iround to static_cast. X-Git-Tag: v8.4.0-rc2~198^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f3af3059e0b70413e109442ef82c61d15addd1fb;p=dealii.git Prefer boost::math::iround to static_cast. --- diff --git a/source/lac/lapack_full_matrix.cc b/source/lac/lapack_full_matrix.cc index 5abe298209..52faaca150 100644 --- a/source/lac/lapack_full_matrix.cc +++ b/source/lac/lapack_full_matrix.cc @@ -22,6 +22,8 @@ #include #include +#include + #include #include @@ -503,7 +505,7 @@ LAPACKFullMatrix::compute_svd() &work[0], &lwork, &ipiv[0], &info); AssertThrow (info==0, LAPACKSupport::ExcErrorCode("gesdd", info)); // Now resize work array and - lwork = static_cast(work[0] + .5); + lwork = boost::math::iround(work[0]); work.resize(lwork); // Do the actual SVD. @@ -655,7 +657,7 @@ LAPACKFullMatrix::compute_eigenvalues(const bool right, // for work, everything else would not be acceptable. Assert (info == 0, ExcInternalError()); // Allocate working array according to suggestion. - lwork = (int) (work[0]+.1); + lwork = boost::math::iround(work[0]); // resize workspace array work.resize((size_type ) lwork); @@ -727,7 +729,7 @@ LAPACKFullMatrix::compute_eigenvalues_symmetric(const number lowe // for work, everything else would not be acceptable. Assert (info == 0, ExcInternalError()); // Allocate working array according to suggestion. - lwork = (int) (work[0]+.1); + lwork = boost::math::iround(work[0]); work.resize(static_cast (lwork)); // Finally compute the eigenvalues. @@ -817,7 +819,7 @@ LAPACKFullMatrix::compute_generalized_eigenvalues_symmetric( // for work, everything else would not be acceptable. Assert (info == 0, ExcInternalError()); // Allocate working array according to suggestion. - lwork = (int) (work[0]+.1); + lwork = boost::math::iround(work[0]); // resize workspace arrays work.resize(static_cast (lwork)); @@ -898,7 +900,7 @@ LAPACKFullMatrix::compute_generalized_eigenvalues_symmetric ( // for work, everything else would not be acceptable. Assert (info == 0, ExcInternalError()); // Allocate working array according to suggestion. - lwork = (int) (work[0]+.1); + lwork = boost::math::iround(work[0]); // resize workspace array work.resize((size_type) lwork);