[BUG FIX] fix check precision which may fail with some ATLAS versions. (#198)

This commit is contained in:
Franck HOUSSEN
2019-04-01 10:44:02 +02:00
committed by Sylvestre Ledru
parent c34f762fcd
commit f5aead95fd
3 changed files with 13 additions and 12 deletions
+1
View File
@@ -5,6 +5,7 @@
* arpackmm: add --simplePrec option (to enable use of s*upd).
* arpackmm: add --dense option.
* autotools: provide *.cmake files (in addition to *.pc file).
* [BUG FIX] fix check precision which may fail with some ATLAS versions.
[ Kyle Guinn ]
* [BUG FIX]: fix 'eval: Syntax error: "(" unexpected' error at build time.
+3 -3
View File
@@ -88,7 +88,7 @@ void real_symmetric_runner() {
for (int i = 0; i < nev; ++i) {
std::cout << "rank " << rank << " - " << d[i] << std::endl;
if (std::abs(d[i] - static_cast<float>(1000 - (nev - 1) + i)) > 1e-1) {
if (std::abs(d[i] - static_cast<float>(1000 - (nev - 1) + i)) > 1.) {
throw std::domain_error("Correct eigenvalues not computed");
}
}
@@ -169,8 +169,8 @@ void complex_symmetric_runner() {
for (int i = 0; i < nev; ++i) {
std::cout << "rank " << rank << " - " << std::real(d[i]) << " "
<< std::imag(d[i]) << '\n';
if (std::abs(std::real(d[i]) - static_cast<float>(1000 - i)) > 1e-1 ||
std::abs(std::imag(d[i]) - static_cast<float>(1000 - i)) > 1e-1) {
if (std::abs(std::real(d[i]) - static_cast<float>(1000 - i)) > 1. ||
std::abs(std::imag(d[i]) - static_cast<float>(1000 - i)) > 1.) {
throw std::domain_error("Correct eigenvalues not computed");
}
}
+9 -9
View File
@@ -27,7 +27,7 @@ void diagonal_matrix_vector_product(Real const* const x, Real* const y) {
}
template<typename Real>
void real_symmetric_runner() {
void real_symmetric_runner(double const & tol_check) {
a_int const N = 1000;
a_int const nev = 9;
@@ -89,7 +89,7 @@ void real_symmetric_runner() {
for (int i = 0; i < nev; ++i) {
std::cout << d[i] << "\n";
if (std::abs(d[i] - static_cast<Real>(1000 - (nev - 1) + i)) > 1e-1) {
if (std::abs(d[i] - static_cast<Real>(1000 - (nev - 1) + i)) > tol_check) {
throw std::domain_error("Correct eigenvalues not computed");
}
}
@@ -105,7 +105,7 @@ void diagonal_matrix_vector_product(std::complex<Real> const* const x,
}
template<typename Real>
void complex_symmetric_runner() {
void complex_symmetric_runner(double const & tol_check) {
a_int const N = 1000;
a_int const nev = 9;
@@ -168,8 +168,8 @@ void complex_symmetric_runner() {
for (int i = 0; i < nev; ++i) {
std::cout << d[i] << "\n";
if (std::abs(std::real(d[i]) - static_cast<Real>(1000 - i)) > 1e-1 ||
std::abs(std::imag(d[i]) - static_cast<Real>(1000 - i)) > 1e-1) {
if (std::abs(std::real(d[i]) - static_cast<Real>(1000 - i)) > tol_check ||
std::abs(std::imag(d[i]) - static_cast<Real>(1000 - i)) > tol_check) {
throw std::domain_error("Correct eigenvalues not computed");
}
}
@@ -179,8 +179,8 @@ int main() {
sstats_c();
// arpack without debug
real_symmetric_runner<float>();
real_symmetric_runner<double>();
real_symmetric_runner<float>(1);
real_symmetric_runner<double>(1.e-05);
int nopx_c, nbx_c, nrorth_c, nitref_c, nrstrt_c;
float tsaupd_c, tsaup2_c, tsaitr_c, tseigt_c, tsgets_c, tsapps_c, tsconv_c;
@@ -202,8 +202,8 @@ int main() {
1);
// arpack with debug
complex_symmetric_runner<float>();
complex_symmetric_runner<double>();
complex_symmetric_runner<float>(1);
complex_symmetric_runner<double>(1.e-05);
return 0;
}