demo/hello_lemon.cc
changeset 40 e1725bb7e821
parent 20 3ffc47b666b1
child 54 e99a7fb6bff5
equal deleted inserted replaced
2:a7957f7154be 3:18c80e1bd59c
     1 /* -*- mode: C++; indent-tabs-mode: nil; -*-
     1 /* -*- mode: C++; indent-tabs-mode: nil; -*-
     2  *
     2  *
     3  * This file is a part of LEMON, a generic C++ optimization library.
     3  * This file is a part of LEMON, a generic C++ optimization library.
     4  *
     4  *
     5  * Copyright (C) 2003-2009
     5  * Copyright (C) 2003-2010
     6  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     6  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     7  * (Egervary Research Group on Combinatorial Optimization, EGRES).
     7  * (Egervary Research Group on Combinatorial Optimization, EGRES).
     8  *
     8  *
     9  * Permission to use, modify and distribute this software is granted
     9  * Permission to use, modify and distribute this software is granted
    10  * provided that this copyright notice appears in all copies. For
    10  * provided that this copyright notice appears in all copies. For
    23 /// \include hello_lemon.cc
    23 /// \include hello_lemon.cc
    24 
    24 
    25 #include <iostream>
    25 #include <iostream>
    26 #include <lemon/list_graph.h>
    26 #include <lemon/list_graph.h>
    27 
    27 
       
    28 using namespace lemon;
       
    29 using namespace std;
       
    30 
    28 int main()
    31 int main()
    29 {
    32 {
    30   typedef lemon::ListDigraph Graph;
    33   ListDigraph g;
    31   Graph g;
       
    32 
    34 
    33   Graph::Node u = g.addNode();
    35   ListDigraph::Node u = g.addNode();
    34   Graph::Node v = g.addNode();
    36   ListDigraph::Node v = g.addNode();
    35   Graph::Arc  e = g.addArc(u, v);
    37   ListDigraph::Arc  a = g.addArc(u, v);
    36 
    38 
    37   std::cout << "Hello World! This is LEMON library here." << std::endl;
    39   cout << "Hello World! This is LEMON library here." << endl;
    38   std::cout << "We have a directed graph with "
    40   cout << "We have a directed graph with " << countNodes(g) << " nodes "
    39             << countNodes(g) << " nodes and "
    41        << "and " << countArcs(g) << " arc." << endl;
    40             << countArcs(g) << " arc." << std::endl;
       
    41 
    42 
    42   return 0;
    43   return 0;
    43 }
    44 }