Initial snark14m import
[snark14.git] / src / snark / pointwse.c
1 /*
2  ***********************************************************
3  $SNARK_Header: S N A R K  1 4 - A PICTURE RECONSTRUCTION PROGRAM $
4  $HeadURL: svn://dig.cs.gc.cuny.edu/snark/trunk/src/snark/pointwse.c $
5  $LastChangedRevision: 80 $
6  $Date: 2014-07-01 21:01:54 -0400 (Tue, 01 Jul 2014) $
7  $Author: agulati $
8  ***********************************************************
9
10  Previously part of SuperSNARK
11  */
12
13 #include "experimenter.h"
14 #include "read_eval_recon2.h"
15 #include "pointwse.h"
16
17 /* ----------------------------- pointwse.c -------------------------------
18
19  This function computes the pointwise accuracy.
20
21  INPUTS:
22  mode - number of MODE commands read in so far.
23  itr1 - array of length niters containing the iteration numbers for the
24  first algorithm.
25  itr2 - array of length niters containing the iteration numbers for the
26  second algorithm.
27  niters - number of iterations to be compared
28  keywrd1 - string containing the keyword which defines the first algorithm.
29  keywrd2 - string containing the keyword which defines the second algorithm.
30
31  OUTPUTS:
32  str_acc1 - array of length niters containing the structural accuracy for
33  the first algorithm.
34  str_acc1 - array of length niters containing the structural accuracy for
35  the second algorithm.
36
37  */
38
39 void pointwse(int mode, int* itr1, int* itr2, int niters, char* keywrd1, char* keywrd2, double* poin_acc1, double* poin_acc2)
40
41 {
42         double recon;
43         int i;
44
45
46         for (i = 0; i < niters; i++)
47         { /* read in normalized root mean square distance for
48          the reconstructions. */
49
50                 read_eval_recon2(mode, itr1[i], keywrd1, &recon);
51                 poin_acc1[i] = -recon;
52                 read_eval_recon2(mode, itr2[i], keywrd2, &recon);
53                 poin_acc2[i] = -recon;
54
55         }
56
57 }