Added snark14m distribution examples
[snark14.git] / examples / b2 / src / art_tset.cpp
diff --git a/examples/b2/src/art_tset.cpp b/examples/b2/src/art_tset.cpp
new file mode 100644 (file)
index 0000000..4f85e9e
--- /dev/null
@@ -0,0 +1,32 @@
+/* 
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *                                                                           *
+ *                              S N A R K   1 4                              *
+ *                                                                           *
+ *                     A PICTURE RECONSTRUCTION PROGRAM                      *
+ *                                                                           *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+
+ art_tset.cpp,v 1.2 2008/09/06 15:18:05 rdavidi Exp
+
+*/
+
+//    Example 2  user-written tolerance function
+//    This function returns RAYSUM/(10*ITER) as tolerance.
+
+#include <stdio.h>
+
+#include "blkdta.h"
+#include "uiod.h"
+
+#include "art.h"
+
+REAL art_class::tset(REAL* recon, INTEGER iter, INTEGER np, INTEGER nr,INTEGER i, REAL raysum, INTEGER* list, REAL* weight, BOOLEAN* flag)
+{  
+  REAL tmp = raysum / ((REAL)(10 * iter));
+  *flag = FALSE;
+  if(trace >= 1) {
+    fprintf(output, "\n          TOLERANCE IS %19.10f \n", tmp);
+  }
+  return tmp;
+}