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 /test | |
parent | 05837be8fb373d69840c5a1b0a0be14a1c52639b (diff) |
Silenced type conversion warnings.
Diffstat (limited to 'test')
-rw-r--r-- | test/nullary.cpp | 4 | ||||
-rw-r--r-- | test/redux.cpp | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/test/nullary.cpp b/test/nullary.cpp index 240365529..3adfc33fe 100644 --- a/test/nullary.cpp +++ b/test/nullary.cpp @@ -50,8 +50,8 @@ template<typename VectorType> void testVectorType(const VectorType& base) { typedef typename ei_traits<VectorType>::Scalar Scalar; - Scalar low = ei_random(-500,500); - Scalar high = ei_random(-500,500); + Scalar low = ei_random<Scalar>(-500,500); + Scalar high = ei_random<Scalar>(-500,500); if (low>high) std::swap(low,high); const int size = base.size(); const Scalar step = (high-low)/(size-1); diff --git a/test/redux.cpp b/test/redux.cpp index 511df1d22..2dc4dcc45 100644 --- a/test/redux.cpp +++ b/test/redux.cpp @@ -27,6 +27,7 @@ template<typename MatrixType> void matrixRedux(const MatrixType& m) { typedef typename MatrixType::Scalar Scalar; + typedef typename MatrixType::RealScalar RealScalar; int rows = m.rows(); int cols = m.cols(); @@ -44,7 +45,7 @@ template<typename MatrixType> void matrixRedux(const MatrixType& m) minc = std::min(ei_real(minc), ei_real(m1(i,j))); maxc = std::max(ei_real(maxc), ei_real(m1(i,j))); } - const Scalar mean = s/Scalar(rows*cols); + const Scalar mean = s/Scalar(RealScalar(rows*cols)); VERIFY_IS_APPROX(m1.sum(), s); VERIFY_IS_APPROX(m1.mean(), mean); |