Skip to content
Snippets Groups Projects
Commit 3b9dfbe0 authored by Julien Malik's avatar Julien Malik
Browse files

COMP: fix windows compilation

parent ddf5cb10
No related branches found
No related tags found
No related merge requests found
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
int ossimpluginsHermiteInterpolationTest(int argc, char * argv[]) int ossimpluginsHermiteInterpolationTest(int argc, char * argv[])
{ {
itk::TimeProbe chrono;
double epsilon = 0.0000001; double epsilon = 0.0000001;
double xref[11]; double xref[11];
...@@ -87,8 +86,8 @@ int ossimpluginsHermiteInterpolationTest(int argc, char * argv[]) ...@@ -87,8 +86,8 @@ int ossimpluginsHermiteInterpolationTest(int argc, char * argv[])
std::cout << std::setprecision(15) << "Value at " << x << " : " << y << " (derivative " << dy << ")\n"; std::cout << std::setprecision(15) << "Value at " << x << " : " << y << " (derivative " << dy << ")\n";
std::cout << "- Should be : " << yExpected << " (derivative " << dyExpected << ")" << std::endl; std::cout << "- Should be : " << yExpected << " (derivative " << dyExpected << ")" << std::endl;
if ( std::isnan(y) || ( (y - yExpected)/yExpected > epsilon)) return EXIT_FAILURE; if ( ossim::isnan(y) || ( (y - yExpected)/yExpected > epsilon)) return EXIT_FAILURE;
if ( std::isnan(dy) || ( (dy - dyExpected)/dyExpected > epsilon)) return EXIT_FAILURE; if ( ossim::isnan(dy) || ( (dy - dyExpected)/dyExpected > epsilon)) return EXIT_FAILURE;
//Test limit situation //Test limit situation
x = 56640.0; x = 56640.0;
...@@ -98,8 +97,8 @@ int ossimpluginsHermiteInterpolationTest(int argc, char * argv[]) ...@@ -98,8 +97,8 @@ int ossimpluginsHermiteInterpolationTest(int argc, char * argv[])
std::cout << std::setprecision(15) << "Value at " << x << " : " << y << " (derivative " << dy << ")\n"; std::cout << std::setprecision(15) << "Value at " << x << " : " << y << " (derivative " << dy << ")\n";
std::cout << "- Should be : " << yExpected << " (derivative " << dyExpected << ")" << std::endl; std::cout << "- Should be : " << yExpected << " (derivative " << dyExpected << ")" << std::endl;
if ( std::isnan(y) || ( (y - yExpected)/yExpected > epsilon)) return EXIT_FAILURE; if ( ossim::isnan(y) || ( (y - yExpected)/yExpected > epsilon)) return EXIT_FAILURE;
if ( std::isnan(dy) || ( (dy - dyExpected)/dyExpected > epsilon)) return EXIT_FAILURE; if ( ossim::isnan(dy) || ( (dy - dyExpected)/dyExpected > epsilon)) return EXIT_FAILURE;
x = 56700.0; x = 56700.0;
yExpected = -1489827.1436; yExpected = -1489827.1436;
...@@ -108,13 +107,14 @@ int ossimpluginsHermiteInterpolationTest(int argc, char * argv[]) ...@@ -108,13 +107,14 @@ int ossimpluginsHermiteInterpolationTest(int argc, char * argv[])
std::cout << std::setprecision(15) << "Value at " << x << " : " << y << " (derivative " << dy << ")\n"; std::cout << std::setprecision(15) << "Value at " << x << " : " << y << " (derivative " << dy << ")\n";
std::cout << "- Should be : " << yExpected << " (derivative " << dyExpected << ")" << std::endl; std::cout << "- Should be : " << yExpected << " (derivative " << dyExpected << ")" << std::endl;
if ( std::isnan(y) || ( (y - yExpected)/yExpected > epsilon)) return EXIT_FAILURE; if ( ossim::isnan(y) || ( (y - yExpected)/yExpected > epsilon)) return EXIT_FAILURE;
if ( std::isnan(dy) || ( (dy - dyExpected)/dyExpected > epsilon)) return EXIT_FAILURE; if ( ossim::isnan(dy) || ( (dy - dyExpected)/dyExpected > epsilon)) return EXIT_FAILURE;
x = 56942.862208; x = 56942.862208;
//Performance test //Performance test
int nTest = 1000000; int nTest = 1000000;
itk::TimeProbe chrono;
chrono.Start(); chrono.Start();
for (int i = 0; i < nTest; ++i) for (int i = 0; i < nTest; ++i)
{ {
...@@ -123,7 +123,7 @@ int ossimpluginsHermiteInterpolationTest(int argc, char * argv[]) ...@@ -123,7 +123,7 @@ int ossimpluginsHermiteInterpolationTest(int argc, char * argv[])
} }
chrono.Stop(); chrono.Stop();
std::cout << "Computation time: " << chrono.GetMeanTime() << " s" << std::endl; std::cout << "Computation time: " << chrono.GetMean() << " s" << std::endl;
std::cout << " *** Test y only ***" << std::endl; std::cout << " *** Test y only ***" << std::endl;
...@@ -136,7 +136,8 @@ int ossimpluginsHermiteInterpolationTest(int argc, char * argv[]) ...@@ -136,7 +136,8 @@ int ossimpluginsHermiteInterpolationTest(int argc, char * argv[])
std::cout << "- Should be : -1154600.87561283" << std::endl; std::cout << "- Should be : -1154600.87561283" << std::endl;
//Performance test //Performance test
chrono.Start(); itk::TimeProbe chrono2;
chrono2.Start();
for (int i = 0; i < nTest; ++i) for (int i = 0; i < nTest; ++i)
{ {
...@@ -144,8 +145,8 @@ int ossimpluginsHermiteInterpolationTest(int argc, char * argv[]) ...@@ -144,8 +145,8 @@ int ossimpluginsHermiteInterpolationTest(int argc, char * argv[])
interp2->Interpolate(x2, y2); interp2->Interpolate(x2, y2);
} }
chrono.Stop(); chrono2.Stop();
std::cout << chrono.GetMeanTime() << " s" << std::endl; std::cout << "Computation time: " << chrono2.GetMean() << " s" << std::endl;
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment