COIN-OR::LEMON - Graph Library

Changeset 659:0c8e5c688440 in lemon for tools


Ignore:
Timestamp:
04/23/09 11:44:35 (11 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Phase:
public
Message:

Fix usage of sqrt() (#268)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/lgf-gen.cc

    r631 r659  
    6666  double tlen=0;
    6767  for(EdgeIt e(g);e!=INVALID;++e)
    68     tlen+=sqrt((coords[g.v(e)]-coords[g.u(e)]).normSquare());
     68    tlen+=std::sqrt((coords[g.v(e)]-coords[g.u(e)]).normSquare());
    6969  return tlen;
    7070}
     
    189189      (r.x * r.x + r.y * r.y) * (p.x * q.y - q.x * p.y);
    190190
    191     return d / (2 * a) + sqrt((d * d + e * e) / (4 * a * a) + f / a);
     191    return d / (2 * a) + std::sqrt((d * d + e * e) / (4 * a * a) + f / a);
    192192  }
    193193
     
    207207    double b = (q.x - sx) * p.y - (p.x - sx) * q.y;
    208208    double d = (q.x - sx) * (p.x - sx) * (p - q).normSquare();
    209     return (b - sqrt(d)) / a;
     209    return (b - std::sqrt(d)) / a;
    210210  }
    211211
     
    814814  double tlen=0;
    815815  for(EdgeIt e(g);e!=INVALID;++e)
    816     tlen+=sqrt((coords[g.v(e)]-coords[g.u(e)]).normSquare());
     816    tlen+=std::sqrt((coords[g.v(e)]-coords[g.u(e)]).normSquare());
    817817  std::cout << "Total arc length  : " << tlen << std::endl;
    818818
Note: See TracChangeset for help on using the changeset viewer.