Skip to content

Commit

Permalink
Hello, Dan. I made it function
Browse files Browse the repository at this point in the history
  • Loading branch information
U-angry_cat\Mike authored and U-angry_cat\Mike committed Sep 30, 2008
1 parent 6075548 commit 8cc5b67
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/DataSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ FloatKeyVec DataSet::getTopKSimilar(ObjectValueMap *a, int k, DistanceFunction d

for(ActorObjectMap::iterator i = myMap.begin(); i != myMap.end(); i++) {
float val = df(a, i->second);

std::cout << "returned " << val << std::endl;
if(!used_min)
min = val;
#if 0
Expand Down
6 changes: 2 additions & 4 deletions src/DistanceFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,17 @@ float pearsonDistanceOrdered(ObjectValueMap *p1, ObjectValueMap *p2) {
// return 1.0;
while(true) {

int n1=0, n2=0;
int n2=0;

while(i != p1->end() && i2 != p2->end() && i->first != i2->first) {
if(i->first < i2->first) {
++i;
n1++;
} else {
++i2;
n2++;
}
}
if(i->first == i2->first) {
n1++;
n2++;
}

Expand All @@ -49,7 +47,7 @@ float pearsonDistanceOrdered(ObjectValueMap *p1, ObjectValueMap *p2) {
break;
}

std::cout << n1 << " - " << n2 << std::endl;
std::cout << i->second << "," <<i2->second << " - " << n2 << std::endl;

n++;

Expand Down

0 comments on commit 8cc5b67

Please sign in to comment.