Initial snark14m import
[snark14.git] / src / snark / TerminationCriterion.h
1 /* 
2  ***********************************************************
3  $SNARK_Header$
4  $HeadURL: svn://dig.cs.gc.cuny.edu/snark/trunk/src/snark/trm6.h $
5  $LastChangedRevision: 122 $
6  $Date: 2014-07-09 18:18:59 -0400 (Wed, 09 Jul 2014) $
7  $Author: agulati $
8  ***********************************************************
9
10  Residual based stopping criterion
11
12  */
13
14 #ifndef Termination_Criterion
15 #define Termination_Criterion
16
17 #include "termtest.h"
18 #include "blkdta.h"
19 #include "DistanceMeasure.h"
20
21 class TerminationCriterion: public termtest_class {
22
23 // attributes
24 private:
25         REAL terminationValue; // the value at which the algorithm should get aborted
26         DistanceMeasure* distanceMeasure; // the distance measure to use
27
28         BOOLEAN reportingEnabled; // if reporting is enabled
29         INTEGER reportingSkipFactor; // the skip factor
30         CHAR* reportingFilename; // the filename to report
31
32 // methods
33 private:
34         void reportCurrentValue(REAL currentDistance, INTEGER iteration);
35
36 protected:
37         TerminationCriterion(DistanceMeasure* distanceMeasureIn,
38                         char* reportingFilenameIn);
39
40 public:
41         virtual ~TerminationCriterion();
42
43         void Init();
44
45         BOOLEAN Run(REAL* recon, INTEGER* list, REAL* weight,
46         INTEGER iter);
47 };
48
49 #endif