demo/hello_lemon.cc
author Peter Kovacs <kpeter@inf.elte.hu>
Mon, 01 Mar 2010 02:27:36 +0100
changeset 55 edb7d5759e0d
parent 36 199a65b64d90
permissions -rw-r--r--
Greatly extend LP section
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@54
    23
///
kpeter@5
    24
/// \include hello_lemon.cc
kpeter@5
    25
kpeter@5
    26
#include <iostream>
kpeter@5
    27
#include <lemon/list_graph.h>
kpeter@5
    28
kpeter@36
    29
using namespace lemon;
kpeter@36
    30
using namespace std;
kpeter@36
    31
kpeter@5
    32
int main()
kpeter@5
    33
{
kpeter@36
    34
  ListDigraph g;
kpeter@5
    35
kpeter@36
    36
  ListDigraph::Node u = g.addNode();
kpeter@36
    37
  ListDigraph::Node v = g.addNode();
kpeter@36
    38
  ListDigraph::Arc  a = g.addArc(u, v);
kpeter@5
    39
kpeter@36
    40
  cout << "Hello World! This is LEMON library here." << endl;
kpeter@36
    41
  cout << "We have a directed graph with " << countNodes(g) << " nodes "
kpeter@36
    42
       << "and " << countArcs(g) << " arc." << endl;
kpeter@5
    43
kpeter@5
    44
  return 0;
kpeter@5
    45
}