fix warnings for doc-eigen-prerequisites

This commit is contained in:
Christoph Hertzberg 2018-07-24 21:59:15 +02:00
parent 5f79b7f9a9
commit 5e79402b4a
3 changed files with 5 additions and 5 deletions

View File

@ -3,5 +3,5 @@ m << 1, 0,
1, 1; 1, 1;
cout << "Comparing m with identity matrix:" << endl; cout << "Comparing m with identity matrix:" << endl;
cout << m.cwiseEqual(MatrixXi::Identity(2,2)) << endl; cout << m.cwiseEqual(MatrixXi::Identity(2,2)) << endl;
int count = m.cwiseEqual(MatrixXi::Identity(2,2)).count(); Index count = m.cwiseEqual(MatrixXi::Identity(2,2)).count();
cout << "Number of coefficients that are equal: " << count << endl; cout << "Number of coefficients that are equal: " << count << endl;

View File

@ -3,5 +3,5 @@ m << 1, 0,
1, 1; 1, 1;
cout << "Comparing m with identity matrix:" << endl; cout << "Comparing m with identity matrix:" << endl;
cout << m.cwiseNotEqual(MatrixXi::Identity(2,2)) << endl; cout << m.cwiseNotEqual(MatrixXi::Identity(2,2)) << endl;
int count = m.cwiseNotEqual(MatrixXi::Identity(2,2)).count(); Index count = m.cwiseNotEqual(MatrixXi::Identity(2,2)).count();
cout << "Number of coefficients that are not equal: " << count << endl; cout << "Number of coefficients that are not equal: " << count << endl;

View File

@ -61,14 +61,14 @@ template <typename T>
void RandomFill(std::vector<T> & vec) void RandomFill(std::vector<T> & vec)
{ {
for (size_t k=0;k<vec.size();++k) for (size_t k=0;k<vec.size();++k)
vec[k] = T( rand() )/T(RAND_MAX) - .5; vec[k] = T( rand() )/T(RAND_MAX) - T(.5);
} }
template <typename T> template <typename T>
void RandomFill(std::vector<std::complex<T> > & vec) void RandomFill(std::vector<std::complex<T> > & vec)
{ {
for (size_t k=0;k<vec.size();++k) for (size_t k=0;k<vec.size();++k)
vec[k] = std::complex<T> ( T( rand() )/T(RAND_MAX) - .5, T( rand() )/T(RAND_MAX) - .5); vec[k] = std::complex<T> ( T( rand() )/T(RAND_MAX) - T(.5), T( rand() )/T(RAND_MAX) - T(.5));
} }
template <typename T_time,typename T_freq> template <typename T_time,typename T_freq>
@ -85,7 +85,7 @@ void fwd_inv(size_t nfft)
vector<T_time> timebuf2; vector<T_time> timebuf2;
fft.inv(timebuf2,freqbuf); fft.inv(timebuf2,freqbuf);
long double rmse = mag2(timebuf - timebuf2) / mag2(timebuf); T_time rmse = mag2(timebuf - timebuf2) / mag2(timebuf);
cout << "roundtrip rmse: " << rmse << endl; cout << "roundtrip rmse: " << rmse << endl;
} }