Changeset 612:0c8e5c688440 in lemon-main
- Timestamp:
- 04/23/09 11:44:35 (16 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
demo/graph_to_eps_demo.cc
r440 r612 183 183 ListDigraph::NodeMap<Point> hcoords(h); 184 184 185 int cols=int(s qrt(double(palette.size())));185 int cols=int(std::sqrt(double(palette.size()))); 186 186 for(int i=0;i<int(paletteW.size());i++) { 187 187 Node n=h.addNode(); -
lemon/network_simplex.h
r609 r612 382 382 const int MIN_BLOCK_SIZE = 10; 383 383 384 _block_size = std::max( int(BLOCK_SIZE_FACTOR * sqrt(_arc_num)), 384 _block_size = std::max( int(BLOCK_SIZE_FACTOR * 385 std::sqrt(double(_arc_num))), 385 386 MIN_BLOCK_SIZE ); 386 387 } … … 458 459 const int MIN_MINOR_LIMIT = 3; 459 460 460 _list_length = std::max( int(LIST_LENGTH_FACTOR * sqrt(_arc_num)), 461 _list_length = std::max( int(LIST_LENGTH_FACTOR * 462 std::sqrt(double(_arc_num))), 461 463 MIN_LIST_LENGTH ); 462 464 _minor_limit = std::max( int(MINOR_LIMIT_FACTOR * _list_length), … … 578 580 const int MIN_HEAD_LENGTH = 3; 579 581 580 _block_size = std::max( int(BLOCK_SIZE_FACTOR * sqrt(_arc_num)), 582 _block_size = std::max( int(BLOCK_SIZE_FACTOR * 583 std::sqrt(double(_arc_num))), 581 584 MIN_BLOCK_SIZE ); 582 585 _head_length = std::max( int(HEAD_LENGTH_FACTOR * _block_size), … … 1226 1229 1227 1230 // Store the arcs in a mixed order 1228 int k = std::max(int(s qrt(_arc_num)), 10);1231 int k = std::max(int(std::sqrt(double(_arc_num))), 10); 1229 1232 int i = 0; 1230 1233 for (ArcIt e(_graph); e != INVALID; ++e) { -
tools/lgf-gen.cc
r584 r612 66 66 double tlen=0; 67 67 for(EdgeIt e(g);e!=INVALID;++e) 68 tlen+=s qrt((coords[g.v(e)]-coords[g.u(e)]).normSquare());68 tlen+=std::sqrt((coords[g.v(e)]-coords[g.u(e)]).normSquare()); 69 69 return tlen; 70 70 } … … 189 189 (r.x * r.x + r.y * r.y) * (p.x * q.y - q.x * p.y); 190 190 191 return d / (2 * a) + s qrt((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); 192 192 } 193 193 … … 207 207 double b = (q.x - sx) * p.y - (p.x - sx) * q.y; 208 208 double d = (q.x - sx) * (p.x - sx) * (p - q).normSquare(); 209 return (b - s qrt(d)) / a;209 return (b - std::sqrt(d)) / a; 210 210 } 211 211 … … 814 814 double tlen=0; 815 815 for(EdgeIt e(g);e!=INVALID;++e) 816 tlen+=s qrt((coords[g.v(e)]-coords[g.u(e)]).normSquare());816 tlen+=std::sqrt((coords[g.v(e)]-coords[g.u(e)]).normSquare()); 817 817 std::cout << "Total arc length : " << tlen << std::endl; 818 818
Note: See TracChangeset
for help on using the changeset viewer.