Ignore:
Timestamp:
Mar 6, 2008, 5:00:44 PM (14 years ago)
Author:
Peter
Message:

refs #223 change fabs to std::abs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/distance_test.cc

    r1121 r1210  
    6060  statistics::EuclideanDistance eucl_dist;
    6161  double dist=eucl_dist(a.begin(),a.end(),b.begin());
    62   if(fabs(dist-2.23607)>tolerance) {
     62  if(std::abs(dist-2.23607)>tolerance) {
    6363    *error << "Error in unweighted Euclidean distance " << std::endl;
    6464    ok=false;
     
    6767  statistics::PearsonDistance pear_dist;
    6868  dist=pear_dist(a.begin(),a.end(),b.begin());
    69   if(fabs(dist-1.5)>tolerance) {
     69  if(std::abs(dist-1.5)>tolerance) {
    7070    *error << "Error in unweighted Pearson distance " << std::endl;
    7171    ok=false;
     
    8686  dist=eucl_dist(aw.begin(),aw.end(),bw.begin());
    8787 
    88   if(fabs(dist-sqrt(6))>tolerance) {
     88  if(std::abs(dist-sqrt(6))>tolerance) {
    8989    *error << "Error in weighted Euclidean distance " << std::endl;
    9090    ok=false;
     
    9393  dist=pear_dist(aw.begin(),aw.end(),bw.begin());
    9494 
    95   if(fabs(dist-2)>tolerance) {
     95  if(std::abs(dist-2)>tolerance) {
    9696    *error << "Error in weighted Pearson distance " << std::endl;
    9797    ok=false;
     
    106106 
    107107  dist=eucl_dist(sa.begin(),sa.end(),sb.begin());
    108   if(fabs(dist-2.23607)>tolerance) {
     108  if(std::abs(dist-2.23607)>tolerance) {
    109109    *error << "Error in distance for std::vector " << std::endl;
    110110    ok=false;
     
    115115  std::copy(sa.begin(),sa.end(),std::back_inserter<std::list<double> >(la));
    116116  dist=eucl_dist(la.begin(),la.end(),sb.begin());
    117   if(fabs(dist-2.23607)>tolerance) {
     117  if(std::abs(dist-2.23607)>tolerance) {
    118118    *error << "Error in distance for std::list " << std::endl;
    119119    ok=false;
Note: See TracChangeset for help on using the changeset viewer.