Changeset 1012


Ignore:
Timestamp:
Feb 1, 2008, 3:18:15 PM (14 years ago)
Author:
Markus Ringnér
Message:

Fixed bug in weighted euclidean distance calculation

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/vector_distance_test.cc

    r999 r1012  
    8888                                   statistics::euclidean_vector_distance_tag());
    8989 
    90   if(fabs(dist-2)>tolerance) {
     90  if(fabs(dist-sqrt(6))>tolerance) {
    9191    *error << "Error in weighted Euclidean vector_distance " << std::endl;
    9292    ok=false;
     
    130130  if (error!=&std::cerr)
    131131    delete error;
    132   if (ok=true
     132  if (ok
    133133    return 0;
    134134  return -1;
  • trunk/yat/statistics/euclidean_vector_distance.h

    r999 r1012  
    7777    AveragerPairWeighted ap;
    7878    add(ap,beg1,end1,beg2);
    79     return sqrt((beg2-beg1)*ap.msd());
     79    return sqrt(std::distance(beg1,end1)*ap.msd());
    8080  }
    8181
Note: See TracChangeset for help on using the changeset viewer.