Changeset 513:60afd11e6cb3 in lemon-0.x for src/work/athos
- Timestamp:
- 05/03/04 16:42:40 (21 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@673
- Location:
- src/work/athos
- Files:
-
- 2 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
src/work/athos/minlengthpaths.h
r511 r513 23 23 /// 24 24 /// The class \ref hugo::MinLengthPaths "MinLengthPaths" implements 25 /// an algorithm which findsk edge-disjoint paths25 /// an algorithm for finding k edge-disjoint paths 26 26 /// from a given source node to a given target node in an 27 27 /// edge-weighted directed graph having minimal total weigth (length). -
src/work/athos/xy/xy.cc
r240 r513 1 1 #include <xy.h> 2 2 #include <iostream> 3 #include <vector> 3 4 using namespace std; 4 5 using namespace hugo; 6 7 5 8 int main() 6 9 { -
src/work/athos/xy/xy_test.cc
r240 r513 3 3 using namespace std; 4 4 using namespace hugo; 5 6 bool passed = true; 7 8 void check(bool rc) { 9 passed = passed && rc; 10 if(!rc) { 11 cout << "Test failed!" << endl; 12 } 13 } 14 15 16 5 17 int main() 6 18 { 7 19 8 cout << "Kérek szépen egy egész számot!" << endl;9 int s;10 cin >> s;11 20 12 cout << "Kerek sok sikvektort." << endl;13 21 14 xy<int> osszeg; 15 xy<int> kul; 16 xy<int> z; 22 typedef xy<int> XY; 23 24 XY seged; 25 XY a(1,2); 26 XY b(3,4); 17 27 18 vector< xy<int> > v; 19 20 while(cin >> z) { 21 v.push_back(z); 22 osszeg += z; 23 kul -= z; 24 cout << "Az összeg aktualisan: " << osszeg << endl; 25 cout << "A különbség aktualisan: " << kul << endl; 26 } 28 seged = a+b; 29 check(seged.x==4 && seged.y==6); 27 30 28 cout << "A kovetkezo szamokat szoroztam ossze:" << endl; 29 for(unsigned int i=0; i<v.size(); ++i) { 30 cout << v[i] << ", A normanégyzete: " << v[i].normSquare() <<endl; 31 cout << v[i] << " " << s << " szorosa " << v[i]*s <<endl; 32 cout << v[i] << " " << s << " edrésze " << v[i]/s <<endl; 33 } 34 if (v.size()>1){ 35 cout << "Az elsö kettö szorzata: " << v[0]*v[1] << endl; 36 } 37 38 cout << "Eleg nehez volt." << endl; 31 seged = a-b; 32 check(seged.x==-1 && seged.y==-1); 33 34 check(a.normSquare()==5); 35 check(a*b==11); 36 37 int l=2; 38 seged = a*l; 39 check(seged.x==2 && seged.y==4); 40 41 seged = b/l; 42 check(seged.x==1 && seged.y==2); 43 44 typedef BoundingBox<int> BB; 45 BB doboz1; 46 doboz1 += a; 47 doboz1 += b; 48 49 cout << (passed ? "All tests passed." : "Some of the tests failed!!!") 50 << endl; 51 52 return passed ? 0 : 1; 53 39 54 }
Note: See TracChangeset
for help on using the changeset viewer.