31.01.2014 Views

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

double CLOSEST PAIR(list& L, point& r1 , point& r2 )<br />

CLOSEST PAIR takes as input a list of points L. It computes a pair<br />

of points r1, r2 ∈ L with minimal Euclidean distance and returns the<br />

squared distance between r1 and r2. <strong>The</strong> algorithm ([76]) has running<br />

time O(n log n) where n is the number of input points.<br />

• Miscellaneous Functions<br />

void<br />

Bounding Box(const list& L, point& pl, point& pb, point& pr, point& pt)<br />

computes four points pl, pb, pr, pt from L such that<br />

(xleft, ybot, xright, ytop) with xleft = pl.xcoord( ), ybot = pb.ycoord( ),<br />

xright = pr.xcoord( ) and ytop = pt.ycoord( ) is the smallest isooriented<br />

rectangle containing all points of L. Precondition: L is not<br />

empty.<br />

bool Is Simple Polygon(const list& L)<br />

takes as input a list of points L and returns true if L is the vertex sequence<br />

of a simple polygon and false otherwise. <strong>The</strong> algorithms has running time<br />

O(n log n), where n is the number of points in L.<br />

• Properties of Geometric Graphs<br />

We give procedures to check properties of geometric graph. We give procedures to verify<br />

properties of geometric graph. A geometric graph is a straight-line embedded map. Every<br />

node is mapped to a point in the plane and every dart is mapped to the line segment<br />

connecting its endpoints.<br />

We use geo graph as a template parameter for geometric graph.<br />

geo graph must provide a function<br />

Any instantiation of<br />

VECTOR edge vector(const geo graph& G, const edge& e)<br />

that returns a vector from the source to the target of e. In order to use any of these<br />

template functions the file /<strong>LEDA</strong>/geo/generic/geo check.h must be included.<br />

template <br />

bool Is CCW Ordered(const geo graph& G)<br />

returns true if for all nodes v the neighbors of v are in increasing<br />

counter-clockwise order around v.<br />

template <br />

bool Is CCW Weakly Ordered(const geo graph& G)<br />

returns true if for all nodes v the neighbors of v are in non-decreasing<br />

counter-clockwise order around v.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!