Removed some unnecessary files.
authorladanyi
Wed, 26 Jan 2005 00:09:06 +0000
changeset 1095f1eb997f0418
parent 1094 da32bccc7c4d
child 1096 1cfb25ef14d2
Removed some unnecessary files.
src/work/akos/demo.in
src/work/akos/k_cover.cc
src/work/akos/loader.h
src/work/akos/loader_demo.cc
     1.1 --- a/src/work/akos/demo.in	Tue Jan 25 18:37:31 2005 +0000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,17 +0,0 @@
     1.4 -c
     1.5 -c        This is a simple example file to demonstrate the
     1.6 -c     DIMACS input file format for minimum-cost flow problems.
     1.7 -c 
     1.8 -c problem line :
     1.9 -p min 4 5
    1.10 -c
    1.11 -c node descriptor lines :
    1.12 -n 1 4
    1.13 -n 4 -4
    1.14 -c
    1.15 -c arc descriptor lines :
    1.16 -a 1 2 0 4 2
    1.17 -a 1 3 0 2 2
    1.18 -a 2 3 0 2 1
    1.19 -a 2 4 0 3 3
    1.20 -a 3 4 0 5 1
     2.1 --- a/src/work/akos/k_cover.cc	Tue Jan 25 18:37:31 2005 +0000
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,58 +0,0 @@
     2.4 -#include <lemon/list_graph.h>
     2.5 -
     2.6 -using namespace lemon;
     2.7 -
     2.8 -typedef ListGraph Graph;
     2.9 -typedef Graph::NodeIt NodeIt;
    2.10 -typedef Graph::EdgeIt EdgeIt;
    2.11 -
    2.12 -class MyEntity {
    2.13 -public:
    2.14 -  Graph &g;
    2.15 -  Graph::NodeMap<bool> selected;
    2.16 -  int edges;
    2.17 -  int covered_edges;
    2.18 -
    2.19 -  MyEntity(Graph &_g) : g(_g), selected(_g) {}
    2.20 -  MyEntity(MyEntity& e) : g(e.g), selected(e.g) {
    2.21 -    for (NodeIt n(g); n != INVALID; ++n) {
    2.22 -      selected[n] = e.selected[n];
    2.23 -    }
    2.24 -    edges = e.edges;
    2.25 -    covered_edges = e.covered_edges;
    2.26 -  }
    2.27 -  double getCost() {
    2.28 -    return (double) (edges - covered_edges);
    2.29 -  }
    2.30 -  void mutate() {
    2.31 -  
    2.32 -  }
    2.33 -  void revert() {
    2.34 -  
    2.35 -  }
    2.36 -};
    2.37 -
    2.38 -int main() {
    2.39 -  Graph g;
    2.40 -  // beolvasas
    2.41 -  MyEntity ent(g);
    2.42 -
    2.43 -  // kezdeti lefedes generalasa
    2.44 -  int nn = 0;
    2.45 -  for (NodeIt n(g); n != INVALID; ++n) {
    2.46 -    ent.selected[n] = false;
    2.47 -    nn++;
    2.48 -  }
    2.49 -  // k db random node kivalasztasa
    2.50 -
    2.51 -  int i = 0, j = 0;
    2.52 -  for (EdgeIt e(g); e != INVALID; ++e) {
    2.53 -    i++;
    2.54 -    if ((ent.selected[g.source(e)]) || (ent.selected[g.target(e)])) {
    2.55 -      j++;
    2.56 -    }
    2.57 -  }
    2.58 -  ent.edges = i;
    2.59 -  ent.covered_edges = j;
    2.60 -
    2.61 -}
     3.1 --- a/src/work/akos/loader.h	Tue Jan 25 18:37:31 2005 +0000
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,41 +0,0 @@
     3.4 -#ifndef LOADER_H
     3.5 -#define LOADER_H
     3.6 -
     3.7 -#include <map>
     3.8 -
     3.9 -#define LINE_LEN 1024
    3.10 -
    3.11 -template<typename Graph>
    3.12 -void LoadGraph(Graph &G, char *filename) {
    3.13 -  FILE *file;
    3.14 -  if ((file = fopen(filename, "r")) == NULL) {
    3.15 -    printf("Could not open %s\n", filename);
    3.16 -    return;
    3.17 -  }
    3.18 -  int i, n1, n2;
    3.19 -  std::map<int, typename Graph::NodeIt> nmap;
    3.20 -  char line[LINE_LEN];
    3.21 -  while (fgets(line, LINE_LEN, file)) {
    3.22 -    switch (line[0]) {
    3.23 -      case 'n':
    3.24 -        nmap[atoi(line + 1)] = G.addNode();
    3.25 -        break;
    3.26 -      case 'a':
    3.27 -        n1 = atoi(line + 1);
    3.28 -        i = 1;
    3.29 -        while (isspace(line[i])) i++;
    3.30 -        while (isdigit(line[i])) i++;
    3.31 -        n2 = atoi(line + i);
    3.32 -        if (nmap.find(n1) == nmap.end()) {
    3.33 -          nmap[n1] = G.addNode();
    3.34 -        }
    3.35 -        if (nmap.find(n2) == nmap.end()) {
    3.36 -          nmap[n2] = G.addNode();
    3.37 -        }
    3.38 -        G.addEdge(nmap[n1], nmap[n2]);
    3.39 -        break;
    3.40 -    }
    3.41 -  }
    3.42 -}
    3.43 -
    3.44 -#endif
     4.1 --- a/src/work/akos/loader_demo.cc	Tue Jan 25 18:37:31 2005 +0000
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,34 +0,0 @@
     4.4 -#include <vector>
     4.5 -#include <iostream>
     4.6 -#include <list_graph.hh>
     4.7 -#include <bfs_iterator.hh>
     4.8 -#include <loader.h>
     4.9 -
    4.10 -using namespace lemon;
    4.11 -
    4.12 -int main(int, char **) {
    4.13 -  typedef ListGraph::NodeIt NodeIt;
    4.14 -  typedef ListGraph::EdgeIt EdgeIt;
    4.15 -  typedef ListGraph::EachNodeIt EachNodeIt;
    4.16 -  typedef ListGraph::EachEdgeIt EachEdgeIt;
    4.17 -  typedef ListGraph::OutEdgeIt OutEdgeIt;
    4.18 -  typedef ListGraph::InEdgeIt InEdgeIt;
    4.19 -  typedef ListGraph::SymEdgeIt SymEdgeIt;
    4.20 -
    4.21 -  ListGraph G;
    4.22 -  LoadGraph(G, "demo.in");
    4.23 -
    4.24 -  std::cout << "bfs from the first node" << std::endl;
    4.25 -  bfs<ListGraph> bfs_test(G, G.first<EachNodeIt>());
    4.26 -  bfs_test.run();
    4.27 -  std::cout << "reached: ";
    4.28 -  for(EachNodeIt i=G.first<EachNodeIt>(); i.valid(); ++i) {
    4.29 -    std::cout << bfs_test.reached.get(i) << " ";
    4.30 -  }
    4.31 -  std::cout<<std::endl;
    4.32 -  std::cout << "dist: ";
    4.33 -  for(EachNodeIt i=G.first<EachNodeIt>(); i.valid(); ++i) {
    4.34 -    std::cout << bfs_test.dist.get(i) << " ";
    4.35 -  }
    4.36 -  std::cout<<std::endl;
    4.37 -}