Use setprecision for std::cout
[ctsim.git] / tools / if2.cpp
index a9900b9d3fe21cba5dfdb72b84e957cf2eb5b336..b264046360d4437c333d0e5750da553fcc0d1efe 100644 (file)
@@ -7,9 +7,7 @@
 **   Date Started:  May 2000
 **
 **  This is part of the CTSim program
-**  Copyright (C) 1983-2000 Kevin Rosenberg
-**
-**  $Id$
+**  Copyright (C) 1983-2009 Kevin Rosenberg
 **
 **  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
@@ -88,7 +86,8 @@ if2_main (int argc, char *const argv[])
   int opt_rowPlot = -1;
   int opt_columnPlot = -1;
   Timer timerProgram;
-
+  UNUSED(opt_verbose);
+  
   while (1) {
     char* endptr;
     int c = getopt_long (argc, argv, "", my_options, NULL);
@@ -184,19 +183,20 @@ if2_main (int argc, char *const argv[])
     return(1);
   }
 
-  ImageFileArray v1 = im_in1.getArray();
-  ImageFileArray v2 = im_in2.getArray();
-  ImageFileArray vout = NULL;
-
   if (opt_bImageOutputFile && opt_bPlotOutputFile) {
     sys_error (ERR_SEVERE, "Both Image and Plot output files can not be selected simultaneously");
     return (1);
   }
+
+  ImageFileArray v1 = im_in1.getArray();
+  ImageFileArray v2 = im_in2.getArray();
+  ImageFileArray vout = NULL;
   if (opt_bImageOutputFile) {
     pim_out = new ImageFile (im_in1.nx(), im_in1.ny());
     vout = pim_out->getArray();
   }
-
+  UNUSED(vout);
+  
   std::string strOperation;
   int nx = im_in1.nx();
   int ny = im_in1.ny();
@@ -219,7 +219,8 @@ if2_main (int argc, char *const argv[])
   if (opt_comp) {
     double d, r, e;
     im_in1.comparativeStatistics (im_in2, d, r, e);
-    std::cout << "d=" << d << ", r=" << r << ", e=" << e << std::endl;
+    std::cout << std::setprecision(7) <<
+      "d=" << d << ", r=" << r << ", e=" << e << std::endl;
   }
 
   int i;