X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=src%2Fif-2.cpp;h=951b4314087747e03ace04230e6ef9d435f8133b;hb=08f34bf3ba14d4f436f4d2ef0ee5af1d6eb266ac;hp=89e6cc811d0528f11485c0b8a652abf93305c156;hpb=2c61ff85796550481227f2fbec53506a6b5bd365;p=ctsim.git diff --git a/src/if-2.cpp b/src/if-2.cpp index 89e6cc8..951b431 100644 --- a/src/if-2.cpp +++ b/src/if-2.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: if-2.cpp,v 1.5 2000/06/18 10:27:11 kevin Exp $ +** $Id: if-2.cpp,v 1.7 2000/06/25 17:32:24 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -195,11 +195,11 @@ if2_main (int argc, char *const argv[]) for (int iy = 0; iy < im_in1.ny(); iy++) { double diff = *in1++ - *in2++; *out++ = diff; - abs_error += fabs(diff); } } - abs_error /= (im_in1.nx() * im_in1.ny()); - cout << "Average Error: " << abs_error << endl; + double d, r, e; + im_in1.comparativeStatistics (im_in2, d, r, e); + cout << "d=" << d << ", r=" << r << ", e=" << e << endl; } im_out.arrayDataWrite(); @@ -216,7 +216,17 @@ if2_main (int argc, char *const argv[]) int main (int argc, char *const argv[]) { - return (if2_main(argc, argv)); + int retval = 1; + + try { + retval = if2_main(argc, argv); + } catch (exception e) { + cerr << "Exception: " << e.what() << endl; + } catch (...) { + cerr << "Unknown exception" << endl; + } + + return (retval); } #endif