aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported
diff options
context:
space:
mode:
authorGravatar Hauke Heibel <hauke.heibel@gmail.com>2009-11-30 16:54:04 +0100
committerGravatar Hauke Heibel <hauke.heibel@gmail.com>2009-11-30 16:54:04 +0100
commit66534b782c243f8a9a6c392674fa6e1706e7e822 (patch)
tree2eac1cee7c3c05fd9a41afb341be4c9b9d1ac4c4 /unsupported
parent4b1aca2288ebf549791def6287b2886759dec2f4 (diff)
Some of our unit tests require mathematical constants and thus we rely on non-ansi code.
It seems as if the new standard removed pow(T,int). M_PIL is only defined when _GNU_SOURCE is defined.
Diffstat (limited to 'unsupported')
-rw-r--r--unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h4
-rw-r--r--unsupported/test/FFT.cpp4
2 files changed, 6 insertions, 2 deletions
diff --git a/unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h b/unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h
index 636f37655..6510b6814 100644
--- a/unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h
+++ b/unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h
@@ -272,7 +272,7 @@ void MatrixExponential<MatrixType>::computeUV(float)
} else {
const float maxnorm = 3.925724783138660f;
m_squarings = std::max(0, (int)ceil(log2(m_l1norm / maxnorm)));
- MatrixType A = *m_M / std::pow(Scalar(2), m_squarings);
+ MatrixType A = *m_M / std::pow(Scalar(2), Scalar(m_squarings));
pade7(A);
}
}
@@ -291,7 +291,7 @@ void MatrixExponential<MatrixType>::computeUV(double)
} else {
const double maxnorm = 5.371920351148152;
m_squarings = std::max(0, (int)ceil(log2(m_l1norm / maxnorm)));
- MatrixType A = *m_M / std::pow(Scalar(2), m_squarings);
+ MatrixType A = *m_M / std::pow(Scalar(2), Scalar(m_squarings));
pade13(A);
}
}
diff --git a/unsupported/test/FFT.cpp b/unsupported/test/FFT.cpp
index ad0d426e4..861677174 100644
--- a/unsupported/test/FFT.cpp
+++ b/unsupported/test/FFT.cpp
@@ -47,7 +47,11 @@ complex<long double> promote(long double x) { return complex<long double>( x);
cerr <<"idx\ttruth\t\tvalue\t|dif|=\n";
for (size_t k0=0;k0<size_t(fftbuf.size());++k0) {
complex<long double> acc = 0;
+#ifdef _GNU_SOURCE
long double phinc = -2.*k0* M_PIl / timebuf.size();
+#else
+ long double phinc = -2.*k0* M_PI / timebuf.size();
+#endif
for (size_t k1=0;k1<size_t(timebuf.size());++k1) {
acc += promote( timebuf[k1] ) * exp( complex<long double>(0,k1*phinc) );
}