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