Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
delau_tree.c
Package: leda.tar.gz [view]
Upload User: gzelex
Upload Date: 2007-01-07
Package Size: 707k
Code Size: 1k
Category:
Mathimatics-Numerical algorithms
Development Platform:
MultiPlatform
- #include <LEDA/impl/delaunay_tree.h>
- #include <LEDA/plane.h>
- const double R = 1000; // "length of inifinite rays"
- void infi_pt(double x1, double y1, double x2, double y2, double *x, double* y)
- /* retourne le point a l'infini dans la direction x2 y2 depuis x1 y1*/
- { vector v(x2,y2);
- v = v.norm();
- *x = x1 + R * v[0];
- *y = y1 + R * v[1];
- }
- list<segment> seg_list;
- void draw_triang_seg(double x1, double y1, double x2, double y2)
- { seg_list.append(segment(x1,y1,x2,y2)); }
- random_source& operator>>(random_source& R, point& p)
- { double x,y;
- R >> x >>y;
- p = point(x,y);
- return R;
- }
- main()
- {
- int N = read_int("N = ");
- list<point> L;
- random_source ran(0,1000);
- ran.set_seed(12345*N);
- for(int i=0; i<N; i++)
- { point p;
- ran >> p;
- L.append(p);
- }
- DELAUNAY_TREE<int> DT;
- float T = used_time();
- point p;
- forall(p,L) DT.insert(p,0);
- cout << string("insert time = %.2f",used_time(T)) << endl;
- DT.trace_triang_edges( draw_triang_seg);
- cout << string("trace time = %.2f",used_time(T)) << endl;
- }