- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
gparam.c
资源名称:leda.tar.gz [点击查看]
上传用户:gzelex
上传日期:2007-01-07
资源大小:707k
文件大小:1k
源码类别:
数值算法/人工智能
开发平台:
MultiPlatform
- #include <LEDA/graph.h>
- #include <LEDA/integer.h>
- #include <LEDA/real.h>
- #include <LEDA/vector.h>
- struct Simple1 {
- string str;
- };
- void Print(const Simple1& x, ostream& out) { out << x.str; }
- struct Simple2 {
- integer i;
- };
- void Print(const Simple2& x, ostream& out) { out << x.i; }
- struct Simple3 {
- real r;
- Simple3(int i) { r = i; }
- Simple3() { r = 0; }
- };
- void Print(const Simple3& x, ostream& out) { out << x.r; }
- int main()
- {
- GRAPH<Simple1,Simple2> G;
- test_graph(G);
- G.del_node(G.first_node());
- G.print();
- GRAPH<Simple1,Simple2> G1 = G;
- vector vec(1.1,2.2,3.3);
- node_array<Simple3> A(G1);
- edge_array<vector> B(G1,vec);
- G1.print();
- int i = 0;
- node v;
- forall_nodes(v,G1) A[v] = i++;
- forall_nodes(v,G1) { Print(A[v],cout); cout << endl; }
- edge e;
- forall_edges(e,G1) cout << B[e] << endl;
- return 0;
- }