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 | |
parent | 05837be8fb373d69840c5a1b0a0be14a1c52639b (diff) |
Silenced type conversion warnings.
Diffstat (limited to 'unsupported/test')
-rw-r--r-- | unsupported/test/FFT.cpp | 4 | ||||
-rw-r--r-- | unsupported/test/matrix_function.cpp | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/unsupported/test/FFT.cpp b/unsupported/test/FFT.cpp index 056be2ef3..9c2682724 100644 --- a/unsupported/test/FFT.cpp +++ b/unsupported/test/FFT.cpp @@ -46,10 +46,10 @@ complex<long double> promote(long double x) { return complex<long double>( x); long double difpower=0; cerr <<"idx\ttruth\t\tvalue\t|dif|=\n"; long double pi = acos((long double)-1); - for (int k0=0;k0<fftbuf.size();++k0) { + for (int k0=0;k0<static_cast<int>(fftbuf.size());++k0) { complex<long double> acc = 0; long double phinc = -2.*k0* pi / timebuf.size(); - for (int k1=0;k1<timebuf.size();++k1) { + for (int k1=0;k1<static_cast<int>(timebuf.size());++k1) { acc += promote( timebuf[k1] ) * exp( complex<long double>(0,k1*phinc) ); } totalpower += norm(acc); 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; |