demo/hello_lemon.cc
author Peter Kovacs <kpeter@inf.elte.hu>
Mon, 22 Feb 2010 00:41:19 +0100
changeset 43 7b789434b1af
parent 20 3ffc47b666b1
child 54 e99a7fb6bff5
permissions -rw-r--r--
Add images for gLemon and graphToEps
     1 /* -*- mode: C++; indent-tabs-mode: nil; -*-
     2  *
     3  * This file is a part of LEMON, a generic C++ optimization library.
     4  *
     5  * Copyright (C) 2003-2010
     6  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     7  * (Egervary Research Group on Combinatorial Optimization, EGRES).
     8  *
     9  * Permission to use, modify and distribute this software is granted
    10  * provided that this copyright notice appears in all copies. For
    11  * precise terms see the accompanying LICENSE file.
    12  *
    13  * This software is provided "AS IS" with no warranty of any kind,
    14  * express or implied, and with no claim as to its suitability for any
    15  * purpose.
    16  *
    17  */
    18 
    19 ///\file
    20 ///\brief Simple "Hello World!" program for LEMON.
    21 ///
    22 /// Simple "Hello World!" program for LEMON.
    23 /// \include hello_lemon.cc
    24 
    25 #include <iostream>
    26 #include <lemon/list_graph.h>
    27 
    28 using namespace lemon;
    29 using namespace std;
    30 
    31 int main()
    32 {
    33   ListDigraph g;
    34 
    35   ListDigraph::Node u = g.addNode();
    36   ListDigraph::Node v = g.addNode();
    37   ListDigraph::Arc  a = g.addArc(u, v);
    38 
    39   cout << "Hello World! This is LEMON library here." << endl;
    40   cout << "We have a directed graph with " << countNodes(g) << " nodes "
    41        << "and " << countArcs(g) << " arc." << endl;
    42 
    43   return 0;
    44 }