Initial snark14m import
[snark14.git] / src / snark / DistanceMeasure.cpp
1 /*
2  ***********************************************************
3  $SNARK_Header$
4  $HeadURL: svn://dig.cs.gc.cuny.edu/snark/trunk/src/snark/trm6.cpp $
5  $LastChangedRevision: 122 $
6  $Date: 2014-07-09 18:18:59 -0400 (Wed, 09 Jul 2014) $
7  $Author: agulati $
8  ***********************************************************
9  */
10
11 #include "DistanceMeasure.h"
12 #include "blob.h"
13
14 using namespace std;
15
16 DistanceMeasure::DistanceMeasure(char* distanceNameIn) {
17         this->distanceName = distanceNameIn;
18 }
19
20 DistanceMeasure::~DistanceMeasure() {
21 }
22
23 REAL DistanceMeasure::calculateDistance(REAL* recon, INTEGER* list,
24 REAL* weight) {
25         if (Blob.pix_basis) {
26                 return this->calculateDistanceForPixel(recon, list, weight);
27         } else {
28                 return this->calculateDistanceForBlob(recon, list, weight);
29         }
30 }
31
32 char* DistanceMeasure::getName() {
33         return this->distanceName;
34 }