diff options
author | Hauke Heibel <hauke.heibel@gmail.com> | 2010-02-03 19:20:25 +0100 |
---|---|---|
committer | Hauke Heibel <hauke.heibel@gmail.com> | 2010-02-03 19:20:25 +0100 |
commit | 1a77334d5435f8edd6d7d756222207a8e3f268a6 (patch) | |
tree | dd1bee59b86fb434bc6b7194d1c05d60067da56d /unsupported/test/matrix_function.cpp | |
parent | 05837be8fb373d69840c5a1b0a0be14a1c52639b (diff) |
Silenced type conversion warnings.
Diffstat (limited to 'unsupported/test/matrix_function.cpp')
-rw-r--r-- | unsupported/test/matrix_function.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/unsupported/test/matrix_function.cpp b/unsupported/test/matrix_function.cpp index 3e25c6a6f..446fa7ec3 100644 --- a/unsupported/test/matrix_function.cpp +++ b/unsupported/test/matrix_function.cpp @@ -33,14 +33,15 @@ template<typename MatrixType> MatrixType createRandomMatrix(const int size) { typedef typename MatrixType::Scalar Scalar; + typedef typename MatrixType::RealScalar RealScalar; MatrixType result; if (ei_random<int>(0,1) == 0) { result = MatrixType::Random(size, size); } else { MatrixType diag = MatrixType::Zero(size, size); for (int i = 0; i < size; ++i) { - diag(i, i) = static_cast<Scalar>(ei_random<int>(0,2)) - + ei_random<Scalar>() * static_cast<Scalar>(0.01); + diag(i, i) = Scalar(RealScalar(ei_random<int>(0,2))) + + ei_random<Scalar>() * Scalar(RealScalar(0.01)); } MatrixType A = MatrixType::Random(size, size); result = A.inverse() * diag * A; |