!
!
!
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
///\ingroup demos |
| 20 | 20 |
///\file |
| 21 | 21 |
///\brief Argument parser demo |
| 22 | 22 |
/// |
| 23 | 23 |
/// This example shows how the argument parser can be used. |
| 24 | 24 |
/// |
| 25 | 25 |
/// \include arg_parser_demo.cc |
| 26 | 26 |
|
| 27 | 27 |
#include <lemon/arg_parser.h> |
| 28 | 28 |
|
| 29 | 29 |
using namespace lemon; |
| 30 | 30 |
int main(int argc, const char **argv) |
| 31 | 31 |
{
|
| 32 | 32 |
// Initialize the argument parser |
| 33 | 33 |
ArgParser ap(argc, argv); |
| 34 | 34 |
int i; |
| 35 | 35 |
std::string s; |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
/// \ingroup demos |
| 20 | 20 |
/// \file |
| 21 | 21 |
/// \brief Demo of the graph drawing function \ref graphToEps() |
| 22 | 22 |
/// |
| 23 | 23 |
/// This demo program shows examples how to use the function \ref |
| 24 | 24 |
/// graphToEps(). It takes no input but simply creates six |
| 25 | 25 |
/// <tt>.eps</tt> files demonstrating the capability of \ref |
| 26 | 26 |
/// graphToEps(), and showing how to draw directed graphs, |
| 27 | 27 |
/// how to handle parallel egdes, how to change the properties (like |
| 28 | 28 |
/// color, shape, size, title etc.) of nodes and arcs individually |
| 29 | 29 |
/// using appropriate \ref maps-page "graph maps". |
| 30 | 30 |
/// |
| 31 | 31 |
/// \include graph_to_eps_demo.cc |
| 32 | 32 |
|
| 33 | 33 |
#include<lemon/list_graph.h> |
| 34 | 34 |
#include<lemon/graph_utils.h> |
| 35 | 35 |
#include<lemon/graph_to_eps.h> |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
///\ingroup demos |
| 20 | 20 |
///\file |
| 21 | 21 |
///\brief Demonstrating graph input and output |
| 22 | 22 |
/// |
| 23 | 23 |
/// This program gives an example of how to read and write a digraph |
| 24 | 24 |
/// and additional maps from/to a stream or a file using the |
| 25 | 25 |
/// \ref lgf-format "LGF" format. |
| 26 | 26 |
/// |
| 27 | 27 |
/// The \c "digraph.lgf" file: |
| 28 | 28 |
/// \include digraph.lgf |
| 29 | 29 |
/// |
| 30 | 30 |
/// And the program which reads it and prints the digraph to the |
| 31 | 31 |
/// standard output: |
| 32 | 32 |
/// \include lgf_demo.cc |
| 33 | 33 |
|
| 34 | 34 |
#include <iostream> |
| 35 | 35 |
#include <lemon/smart_graph.h> |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
/*! |
| 20 | 20 |
|
| 21 | 21 |
\page coding_style LEMON Coding Style |
| 22 | 22 |
|
| 23 | 23 |
\section naming_conv Naming Conventions |
| 24 | 24 |
|
| 25 | 25 |
In order to make development easier we have made some conventions |
| 26 | 26 |
according to coding style. These include names of types, classes, |
| 27 | 27 |
functions, variables, constants and exceptions. If these conventions |
| 28 | 28 |
are met in one's code then it is easier to read and maintain |
| 29 | 29 |
it. Please comply with these conventions if you want to contribute |
| 30 | 30 |
developing LEMON library. |
| 31 | 31 |
|
| 32 | 32 |
\note When the coding style requires the capitalization of an abbreviation, |
| 33 | 33 |
only the first letter should be upper case. |
| 34 | 34 |
|
| 35 | 35 |
\code |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
/** |
| 20 | 20 |
\dir demo |
| 21 | 21 |
\brief A collection of demo application. |
| 22 | 22 |
|
| 23 | 23 |
This directory contains several simple demo application, mainly |
| 24 | 24 |
for educational purposes. |
| 25 | 25 |
*/ |
| 26 | 26 |
|
| 27 | 27 |
/** |
| 28 | 28 |
\dir doc |
| 29 | 29 |
\brief Auxiliary (and the whole generated) documentation. |
| 30 | 30 |
|
| 31 | 31 |
Auxiliary (and the whole generated) documentation. |
| 32 | 32 |
*/ |
| 33 | 33 |
|
| 34 | 34 |
/** |
| 35 | 35 |
\dir test |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
/** |
| 20 | 20 |
@defgroup datas Data Structures |
| 21 | 21 |
This group describes the several data structures implemented in LEMON. |
| 22 | 22 |
*/ |
| 23 | 23 |
|
| 24 | 24 |
/** |
| 25 | 25 |
@defgroup graphs Graph Structures |
| 26 | 26 |
@ingroup datas |
| 27 | 27 |
\brief Graph structures implemented in LEMON. |
| 28 | 28 |
|
| 29 | 29 |
The implementation of combinatorial algorithms heavily relies on |
| 30 | 30 |
efficient graph implementations. LEMON offers data structures which are |
| 31 | 31 |
planned to be easily used in an experimental phase of implementation studies, |
| 32 | 32 |
and thereafter the program code can be made efficient by small modifications. |
| 33 | 33 |
|
| 34 | 34 |
The most efficient implementation of diverse applications require the |
| 35 | 35 |
usage of different physical graph implementations. These differences |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
namespace lemon {
|
| 20 | 20 |
/*! |
| 21 | 21 |
|
| 22 | 22 |
|
| 23 | 23 |
|
| 24 | 24 |
\page lgf-format Lemon Graph Format (LGF) |
| 25 | 25 |
|
| 26 | 26 |
The \e LGF is a <em>column oriented</em> |
| 27 | 27 |
file format for storing graphs and associated data like |
| 28 | 28 |
node and edge maps. |
| 29 | 29 |
|
| 30 | 30 |
Each line with \c '#' first non-whitespace |
| 31 | 31 |
character is considered as a comment line. |
| 32 | 32 |
|
| 33 | 33 |
Otherwise the file consists of sections starting with |
| 34 | 34 |
a header line. The header lines starts with an \c '@' character followed by the |
| 35 | 35 |
type of section. The standard section types are \c \@nodes, \c |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
/** |
| 20 | 20 |
|
| 21 | 21 |
\page license License Terms |
| 22 | 22 |
|
| 23 | 23 |
\verbinclude LICENSE |
| 24 | 24 |
|
| 25 | 25 |
*/ |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
/** |
| 20 | 20 |
\mainpage LEMON Documentation |
| 21 | 21 |
|
| 22 | 22 |
\section intro Introduction |
| 23 | 23 |
|
| 24 | 24 |
\subsection whatis What is LEMON |
| 25 | 25 |
|
| 26 | 26 |
LEMON stands for |
| 27 | 27 |
<b>L</b>ibrary of <b>E</b>fficient <b>M</b>odels |
| 28 | 28 |
and <b>O</b>ptimization in <b>N</b>etworks. |
| 29 | 29 |
It is a C++ template |
| 30 | 30 |
library aimed at combinatorial optimization tasks which |
| 31 | 31 |
often involve in working |
| 32 | 32 |
with graphs. |
| 33 | 33 |
|
| 34 | 34 |
<b> |
| 35 | 35 |
LEMON is an <a class="el" href="http://opensource.org/">open source</a> |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
/// The namespace of LEMON |
| 20 | 20 |
|
| 21 | 21 |
/// The namespace of LEMON |
| 22 | 22 |
/// |
| 23 | 23 |
namespace lemon {
|
| 24 | 24 |
|
| 25 | 25 |
/// The namespace of LEMON concepts and concept checking classes |
| 26 | 26 |
|
| 27 | 27 |
/// The namespace of LEMON concepts and concept checking classes |
| 28 | 28 |
/// |
| 29 | 29 |
namespace concepts {}
|
| 30 | 30 |
} |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_TEMPLATE_H |
| 20 | 20 |
#define LEMON_TEMPLATE_H |
| 21 | 21 |
|
| 22 | 22 |
#endif // LEMON_TEMPLATE_H |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#include <lemon/arg_parser.h> |
| 20 | 20 |
|
| 21 | 21 |
namespace lemon {
|
| 22 | 22 |
|
| 23 | 23 |
void ArgParser::_showHelp(void *p) |
| 24 | 24 |
{
|
| 25 | 25 |
(static_cast<ArgParser*>(p))->showHelp(); |
| 26 | 26 |
exit(1); |
| 27 | 27 |
} |
| 28 | 28 |
|
| 29 | 29 |
ArgParser::ArgParser(int argc, const char **argv) :_argc(argc), _argv(argv), |
| 30 | 30 |
_command_name(argv[0]) {
|
| 31 | 31 |
funcOption("-help","Print a short help message",_showHelp,this);
|
| 32 | 32 |
synonym("help","-help");
|
| 33 | 33 |
synonym("h","-help");
|
| 34 | 34 |
|
| 35 | 35 |
} |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_ARG_PARSER |
| 20 | 20 |
#define LEMON_ARG_PARSER |
| 21 | 21 |
|
| 22 | 22 |
#include <vector> |
| 23 | 23 |
#include <map> |
| 24 | 24 |
#include <list> |
| 25 | 25 |
#include <string> |
| 26 | 26 |
#include <iostream> |
| 27 | 27 |
#include <sstream> |
| 28 | 28 |
#include <algorithm> |
| 29 | 29 |
#include <lemon/assert.h> |
| 30 | 30 |
|
| 31 | 31 |
///\ingroup misc |
| 32 | 32 |
///\file |
| 33 | 33 |
///\brief A tool to parse command line arguments. |
| 34 | 34 |
|
| 35 | 35 |
namespace lemon {
|
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_ASSERT_H |
| 20 | 20 |
#define LEMON_ASSERT_H |
| 21 | 21 |
|
| 22 | 22 |
/// \ingroup exceptions |
| 23 | 23 |
/// \file |
| 24 | 24 |
/// \brief Extended assertion handling |
| 25 | 25 |
|
| 26 | 26 |
#include <lemon/error.h> |
| 27 | 27 |
|
| 28 | 28 |
namespace lemon {
|
| 29 | 29 |
|
| 30 | 30 |
inline void assert_fail_log(const char *file, int line, const char *function, |
| 31 | 31 |
const char *message, const char *assertion) |
| 32 | 32 |
{
|
| 33 | 33 |
std::cerr << file << ":" << line << ": "; |
| 34 | 34 |
if (function) |
| 35 | 35 |
std::cerr << function << ": "; |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
///\file |
| 20 | 20 |
///\brief Some basic non-inline functions and static global data. |
| 21 | 21 |
|
| 22 | 22 |
#include<lemon/tolerance.h> |
| 23 | 23 |
#include<lemon/bits/invalid.h> |
| 24 | 24 |
namespace lemon {
|
| 25 | 25 |
|
| 26 | 26 |
float Tolerance<float>::def_epsilon = 1e-4; |
| 27 | 27 |
double Tolerance<double>::def_epsilon = 1e-10; |
| 28 | 28 |
long double Tolerance<long double>::def_epsilon = 1e-14; |
| 29 | 29 |
|
| 30 | 30 |
#ifndef LEMON_ONLY_TEMPLATES |
| 31 | 31 |
const Invalid INVALID = Invalid(); |
| 32 | 32 |
#endif |
| 33 | 33 |
|
| 34 | 34 |
} //namespace lemon |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_BFS_H |
| 20 | 20 |
#define LEMON_BFS_H |
| 21 | 21 |
|
| 22 | 22 |
///\ingroup search |
| 23 | 23 |
///\file |
| 24 | 24 |
///\brief Bfs algorithm. |
| 25 | 25 |
|
| 26 | 26 |
#include <lemon/list_graph.h> |
| 27 | 27 |
#include <lemon/graph_utils.h> |
| 28 | 28 |
#include <lemon/bits/path_dump.h> |
| 29 | 29 |
#include <lemon/bits/invalid.h> |
| 30 | 30 |
#include <lemon/error.h> |
| 31 | 31 |
#include <lemon/maps.h> |
| 32 | 32 |
|
| 33 | 33 |
namespace lemon {
|
| 34 | 34 |
|
| 35 | 35 |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_BIN_HEAP_H |
| 20 | 20 |
#define LEMON_BIN_HEAP_H |
| 21 | 21 |
|
| 22 | 22 |
///\ingroup auxdat |
| 23 | 23 |
///\file |
| 24 | 24 |
///\brief Binary Heap implementation. |
| 25 | 25 |
|
| 26 | 26 |
#include <vector> |
| 27 | 27 |
#include <utility> |
| 28 | 28 |
#include <functional> |
| 29 | 29 |
|
| 30 | 30 |
namespace lemon {
|
| 31 | 31 |
|
| 32 | 32 |
///\ingroup auxdat |
| 33 | 33 |
/// |
| 34 | 34 |
///\brief A Binary Heap implementation. |
| 35 | 35 |
/// |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_BITS_ALTERATION_NOTIFIER_H |
| 20 | 20 |
#define LEMON_BITS_ALTERATION_NOTIFIER_H |
| 21 | 21 |
|
| 22 | 22 |
#include <vector> |
| 23 | 23 |
#include <list> |
| 24 | 24 |
|
| 25 | 25 |
#include <lemon/bits/utility.h> |
| 26 | 26 |
|
| 27 | 27 |
///\ingroup graphbits |
| 28 | 28 |
///\file |
| 29 | 29 |
///\brief Observer notifier for graph alteration observers. |
| 30 | 30 |
|
| 31 | 31 |
namespace lemon {
|
| 32 | 32 |
|
| 33 | 33 |
/// \ingroup graphbits |
| 34 | 34 |
/// |
| 35 | 35 |
/// \brief Notifier class to notify observes about alterations in |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_BITS_ARRAY_MAP_H |
| 20 | 20 |
#define LEMON_BITS_ARRAY_MAP_H |
| 21 | 21 |
|
| 22 | 22 |
#include <memory> |
| 23 | 23 |
|
| 24 | 24 |
#include <lemon/bits/traits.h> |
| 25 | 25 |
#include <lemon/bits/alteration_notifier.h> |
| 26 | 26 |
#include <lemon/concept_check.h> |
| 27 | 27 |
#include <lemon/concepts/maps.h> |
| 28 | 28 |
|
| 29 | 29 |
/// \ingroup graphbits |
| 30 | 30 |
/// \file |
| 31 | 31 |
/// \brief Graph map based on the array storage. |
| 32 | 32 |
|
| 33 | 33 |
namespace lemon {
|
| 34 | 34 |
|
| 35 | 35 |
/// \ingroup graphbits |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_BITS_BASE_EXTENDER_H |
| 20 | 20 |
#define LEMON_BITS_BASE_EXTENDER_H |
| 21 | 21 |
|
| 22 | 22 |
#include <lemon/bits/invalid.h> |
| 23 | 23 |
#include <lemon/error.h> |
| 24 | 24 |
|
| 25 | 25 |
#include <lemon/bits/map_extender.h> |
| 26 | 26 |
#include <lemon/bits/default_map.h> |
| 27 | 27 |
|
| 28 | 28 |
#include <lemon/concept_check.h> |
| 29 | 29 |
#include <lemon/concepts/maps.h> |
| 30 | 30 |
|
| 31 | 31 |
///\ingroup digraphbits |
| 32 | 32 |
///\file |
| 33 | 33 |
///\brief Extenders for the digraph types |
| 34 | 34 |
namespace lemon {
|
| 35 | 35 |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_BEZIER_H |
| 20 | 20 |
#define LEMON_BEZIER_H |
| 21 | 21 |
|
| 22 | 22 |
///\ingroup misc |
| 23 | 23 |
///\file |
| 24 | 24 |
///\brief Classes to compute with Bezier curves. |
| 25 | 25 |
/// |
| 26 | 26 |
///Up to now this file is used internally by \ref graph_to_eps.h |
| 27 | 27 |
|
| 28 | 28 |
#include<lemon/dim2.h> |
| 29 | 29 |
|
| 30 | 30 |
namespace lemon {
|
| 31 | 31 |
namespace dim2 {
|
| 32 | 32 |
|
| 33 | 33 |
class BezierBase {
|
| 34 | 34 |
public: |
| 35 | 35 |
typedef lemon::dim2::Point<double> Point; |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_BITS_DEFAULT_MAP_H |
| 20 | 20 |
#define LEMON_BITS_DEFAULT_MAP_H |
| 21 | 21 |
|
| 22 | 22 |
|
| 23 | 23 |
#include <lemon/bits/array_map.h> |
| 24 | 24 |
#include <lemon/bits/vector_map.h> |
| 25 | 25 |
//#include <lemon/bits/debug_map.h> |
| 26 | 26 |
|
| 27 | 27 |
///\ingroup graphbits |
| 28 | 28 |
///\file |
| 29 | 29 |
///\brief Graph maps that construct and destruct their elements dynamically. |
| 30 | 30 |
|
| 31 | 31 |
namespace lemon {
|
| 32 | 32 |
|
| 33 | 33 |
|
| 34 | 34 |
//#ifndef LEMON_USE_DEBUG_MAP |
| 35 | 35 |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_BITS_GRAPH_EXTENDER_H |
| 20 | 20 |
#define LEMON_BITS_GRAPH_EXTENDER_H |
| 21 | 21 |
|
| 22 | 22 |
#include <lemon/bits/invalid.h> |
| 23 | 23 |
#include <lemon/bits/utility.h> |
| 24 | 24 |
|
| 25 | 25 |
#include <lemon/bits/map_extender.h> |
| 26 | 26 |
#include <lemon/bits/default_map.h> |
| 27 | 27 |
|
| 28 | 28 |
#include <lemon/concept_check.h> |
| 29 | 29 |
#include <lemon/concepts/maps.h> |
| 30 | 30 |
|
| 31 | 31 |
///\ingroup graphbits |
| 32 | 32 |
///\file |
| 33 | 33 |
///\brief Extenders for the digraph types |
| 34 | 34 |
namespace lemon {
|
| 35 | 35 |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_BITS_INVALID_H |
| 20 | 20 |
#define LEMON_BITS_INVALID_H |
| 21 | 21 |
|
| 22 | 22 |
///\file |
| 23 | 23 |
///\brief Definition of INVALID. |
| 24 | 24 |
|
| 25 | 25 |
namespace lemon {
|
| 26 | 26 |
|
| 27 | 27 |
/// \brief Dummy type to make it easier to create invalid iterators. |
| 28 | 28 |
/// |
| 29 | 29 |
/// Dummy type to make it easier to create invalid iterators. |
| 30 | 30 |
/// See \ref INVALID for the usage. |
| 31 | 31 |
struct Invalid {
|
| 32 | 32 |
public: |
| 33 | 33 |
bool operator==(Invalid) { return true; }
|
| 34 | 34 |
bool operator!=(Invalid) { return false; }
|
| 35 | 35 |
bool operator< (Invalid) { return false; }
|
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_BITS_MAP_EXTENDER_H |
| 20 | 20 |
#define LEMON_BITS_MAP_EXTENDER_H |
| 21 | 21 |
|
| 22 | 22 |
#include <iterator> |
| 23 | 23 |
|
| 24 | 24 |
#include <lemon/bits/traits.h> |
| 25 | 25 |
|
| 26 | 26 |
#include <lemon/concept_check.h> |
| 27 | 27 |
#include <lemon/concepts/maps.h> |
| 28 | 28 |
|
| 29 | 29 |
///\file |
| 30 | 30 |
///\brief Extenders for iterable maps. |
| 31 | 31 |
|
| 32 | 32 |
namespace lemon {
|
| 33 | 33 |
|
| 34 | 34 |
/// \ingroup graphbits |
| 35 | 35 |
/// |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_BITS_PRED_MAP_PATH_H |
| 20 | 20 |
#define LEMON_BITS_PRED_MAP_PATH_H |
| 21 | 21 |
|
| 22 | 22 |
namespace lemon {
|
| 23 | 23 |
|
| 24 | 24 |
template <typename _Digraph, typename _PredMap> |
| 25 | 25 |
class PredMapPath {
|
| 26 | 26 |
public: |
| 27 | 27 |
typedef True RevPathTag; |
| 28 | 28 |
|
| 29 | 29 |
typedef _Digraph Digraph; |
| 30 | 30 |
typedef typename Digraph::Arc Arc; |
| 31 | 31 |
typedef _PredMap PredMap; |
| 32 | 32 |
|
| 33 | 33 |
PredMapPath(const Digraph& _digraph, const PredMap& _predMap, |
| 34 | 34 |
typename Digraph::Node _target) |
| 35 | 35 |
: digraph(_digraph), predMap(_predMap), target(_target) {}
|
| 1 |
|
|
| 2 |
/* -*- C++ -*- |
|
| 1 |
/* -*- mode: C++; indent-tabs-mode: nil; -*- |
|
| 3 | 2 |
* |
| 4 |
* 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. |
|
| 5 | 4 |
* |
| 6 | 5 |
* Copyright (C) 2003-2008 |
| 7 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 8 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 9 | 8 |
* |
| 10 | 9 |
* Permission to use, modify and distribute this software is granted |
| 11 | 10 |
* provided that this copyright notice appears in all copies. For |
| 12 | 11 |
* precise terms see the accompanying LICENSE file. |
| 13 | 12 |
* |
| 14 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 15 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 16 | 15 |
* purpose. |
| 17 | 16 |
* |
| 18 | 17 |
*/ |
| 19 | 18 |
|
| 20 | 19 |
#ifndef LEMON_BITS_TRAITS_H |
| 21 | 20 |
#define LEMON_BITS_TRAITS_H |
| 22 | 21 |
|
| 23 | 22 |
#include <lemon/bits/utility.h> |
| 24 | 23 |
|
| 25 | 24 |
///\file |
| 26 | 25 |
///\brief Traits for graphs and maps |
| 27 | 26 |
/// |
| 28 | 27 |
|
| 29 | 28 |
namespace lemon {
|
| 30 | 29 |
template <typename _Graph, typename _Item> |
| 31 | 30 |
class ItemSetTraits {};
|
| 32 | 31 |
|
| 33 | 32 |
|
| 34 | 33 |
template <typename Graph, typename Enable = void> |
| 35 | 34 |
struct NodeNotifierIndicator {
|
| 36 | 35 |
typedef InvalidType Type; |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
// This file contains a modified version of the enable_if library from BOOST. |
| 20 | 20 |
// See the appropriate copyright notice below. |
| 21 | 21 |
|
| 22 | 22 |
// Boost enable_if library |
| 23 | 23 |
|
| 24 | 24 |
// Copyright 2003 (c) The Trustees of Indiana University. |
| 25 | 25 |
|
| 26 | 26 |
// Use, modification, and distribution is subject to the Boost Software |
| 27 | 27 |
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
| 28 | 28 |
// http://www.boost.org/LICENSE_1_0.txt) |
| 29 | 29 |
|
| 30 | 30 |
// Authors: Jaakko Jarvi (jajarvi at osl.iu.edu) |
| 31 | 31 |
// Jeremiah Willcock (jewillco at osl.iu.edu) |
| 32 | 32 |
// Andrew Lumsdaine (lums at osl.iu.edu) |
| 33 | 33 |
|
| 34 | 34 |
|
| 35 | 35 |
#ifndef LEMON_BITS_UTILITY_H |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_BITS_VECTOR_MAP_H |
| 20 | 20 |
#define LEMON_BITS_VECTOR_MAP_H |
| 21 | 21 |
|
| 22 | 22 |
#include <vector> |
| 23 | 23 |
#include <algorithm> |
| 24 | 24 |
|
| 25 | 25 |
#include <lemon/bits/traits.h> |
| 26 | 26 |
#include <lemon/bits/utility.h> |
| 27 | 27 |
|
| 28 | 28 |
#include <lemon/bits/alteration_notifier.h> |
| 29 | 29 |
|
| 30 | 30 |
#include <lemon/concept_check.h> |
| 31 | 31 |
#include <lemon/concepts/maps.h> |
| 32 | 32 |
|
| 33 | 33 |
///\ingroup graphbits |
| 34 | 34 |
/// |
| 35 | 35 |
///\file |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
///\file |
| 20 | 20 |
///\brief Color constants |
| 21 | 21 |
|
| 22 | 22 |
#include<lemon/color.h> |
| 23 | 23 |
|
| 24 | 24 |
namespace lemon {
|
| 25 | 25 |
|
| 26 | 26 |
const Color WHITE(1,1,1); |
| 27 | 27 |
|
| 28 | 28 |
const Color BLACK(0,0,0); |
| 29 | 29 |
const Color RED(1,0,0); |
| 30 | 30 |
const Color GREEN(0,1,0); |
| 31 | 31 |
const Color BLUE(0,0,1); |
| 32 | 32 |
const Color YELLOW(1,1,0); |
| 33 | 33 |
const Color MAGENTA(1,0,1); |
| 34 | 34 |
const Color CYAN(0,1,1); |
| 35 | 35 |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_COLOR_H |
| 20 | 20 |
#define LEMON_COLOR_H |
| 21 | 21 |
|
| 22 | 22 |
#include<vector> |
| 23 | 23 |
#include<lemon/math.h> |
| 24 | 24 |
#include<lemon/maps.h> |
| 25 | 25 |
|
| 26 | 26 |
|
| 27 | 27 |
///\ingroup misc |
| 28 | 28 |
///\file |
| 29 | 29 |
///\brief Tools to manage RGB colors. |
| 30 | 30 |
|
| 31 | 31 |
namespace lemon {
|
| 32 | 32 |
|
| 33 | 33 |
|
| 34 | 34 |
/// \addtogroup misc |
| 35 | 35 |
/// @{
|
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
// This file contains a modified version of the concept checking |
| 20 | 20 |
// utility from BOOST. |
| 21 | 21 |
// See the appropriate copyright notice below. |
| 22 | 22 |
|
| 23 | 23 |
// (C) Copyright Jeremy Siek 2000. |
| 24 | 24 |
// Distributed under the Boost Software License, Version 1.0. (See |
| 25 | 25 |
// accompanying file LICENSE_1_0.txt or copy at |
| 26 | 26 |
// http://www.boost.org/LICENSE_1_0.txt) |
| 27 | 27 |
// |
| 28 | 28 |
// Revision History: |
| 29 | 29 |
// 05 May 2001: Workarounds for HP aCC from Thomas Matelich. (Jeremy Siek) |
| 30 | 30 |
// 02 April 2001: Removed limits header altogether. (Jeremy Siek) |
| 31 | 31 |
// 01 April 2001: Modified to use new <boost/limits.hpp> header. (JMaddock) |
| 32 | 32 |
// |
| 33 | 33 |
|
| 34 | 34 |
// See http://www.boost.org/libs/concept_check for documentation. |
| 35 | 35 |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_CONCEPT_DIGRAPH_H |
| 20 | 20 |
#define LEMON_CONCEPT_DIGRAPH_H |
| 21 | 21 |
|
| 22 | 22 |
///\ingroup graph_concepts |
| 23 | 23 |
///\file |
| 24 | 24 |
///\brief The concept of directed graphs. |
| 25 | 25 |
|
| 26 | 26 |
#include <lemon/bits/invalid.h> |
| 27 | 27 |
#include <lemon/bits/utility.h> |
| 28 | 28 |
#include <lemon/concepts/maps.h> |
| 29 | 29 |
#include <lemon/concept_check.h> |
| 30 | 30 |
#include <lemon/concepts/graph_components.h> |
| 31 | 31 |
|
| 32 | 32 |
namespace lemon {
|
| 33 | 33 |
namespace concepts {
|
| 34 | 34 |
|
| 35 | 35 |
/// \ingroup graph_concepts |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
///\ingroup graph_concepts |
| 20 | 20 |
///\file |
| 21 | 21 |
///\brief The concept of Undirected Graphs. |
| 22 | 22 |
|
| 23 | 23 |
#ifndef LEMON_CONCEPT_GRAPH_H |
| 24 | 24 |
#define LEMON_CONCEPT_GRAPH_H |
| 25 | 25 |
|
| 26 | 26 |
#include <lemon/concepts/graph_components.h> |
| 27 | 27 |
#include <lemon/concepts/graph.h> |
| 28 | 28 |
#include <lemon/bits/utility.h> |
| 29 | 29 |
|
| 30 | 30 |
namespace lemon {
|
| 31 | 31 |
namespace concepts {
|
| 32 | 32 |
|
| 33 | 33 |
/// \ingroup graph_concepts |
| 34 | 34 |
/// |
| 35 | 35 |
/// \brief Class describing the concept of Undirected Graphs. |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
///\ingroup graph_concepts |
| 20 | 20 |
///\file |
| 21 | 21 |
///\brief The concept of graph components. |
| 22 | 22 |
|
| 23 | 23 |
|
| 24 | 24 |
#ifndef LEMON_CONCEPT_GRAPH_COMPONENTS_H |
| 25 | 25 |
#define LEMON_CONCEPT_GRAPH_COMPONENTS_H |
| 26 | 26 |
|
| 27 | 27 |
#include <lemon/bits/invalid.h> |
| 28 | 28 |
#include <lemon/concepts/maps.h> |
| 29 | 29 |
|
| 30 | 30 |
#include <lemon/bits/alteration_notifier.h> |
| 31 | 31 |
|
| 32 | 32 |
namespace lemon {
|
| 33 | 33 |
namespace concepts {
|
| 34 | 34 |
|
| 35 | 35 |
/// \brief Skeleton class for graph Node and Arc types |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
///\ingroup concept |
| 20 | 20 |
///\file |
| 21 | 21 |
///\brief The concept of heaps. |
| 22 | 22 |
|
| 23 | 23 |
#ifndef LEMON_CONCEPT_HEAP_H |
| 24 | 24 |
#define LEMON_CONCEPT_HEAP_H |
| 25 | 25 |
|
| 26 | 26 |
#include <lemon/bits/invalid.h> |
| 27 | 27 |
|
| 28 | 28 |
namespace lemon {
|
| 29 | 29 |
|
| 30 | 30 |
namespace concepts {
|
| 31 | 31 |
|
| 32 | 32 |
/// \addtogroup concept |
| 33 | 33 |
/// @{
|
| 34 | 34 |
|
| 35 | 35 |
/// \brief The heap concept. |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_CONCEPT_MAPS_H |
| 20 | 20 |
#define LEMON_CONCEPT_MAPS_H |
| 21 | 21 |
|
| 22 | 22 |
#include <lemon/bits/utility.h> |
| 23 | 23 |
#include <lemon/concept_check.h> |
| 24 | 24 |
|
| 25 | 25 |
///\ingroup concept |
| 26 | 26 |
///\file |
| 27 | 27 |
///\brief The concept of maps. |
| 28 | 28 |
|
| 29 | 29 |
namespace lemon {
|
| 30 | 30 |
|
| 31 | 31 |
namespace concepts {
|
| 32 | 32 |
|
| 33 | 33 |
/// \addtogroup concept |
| 34 | 34 |
/// @{
|
| 35 | 35 |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
///\ingroup concept |
| 20 | 20 |
///\file |
| 21 | 21 |
///\brief Classes for representing paths in digraphs. |
| 22 | 22 |
/// |
| 23 | 23 |
///\todo Iterators have obsolete style |
| 24 | 24 |
|
| 25 | 25 |
#ifndef LEMON_CONCEPT_PATH_H |
| 26 | 26 |
#define LEMON_CONCEPT_PATH_H |
| 27 | 27 |
|
| 28 | 28 |
#include <lemon/bits/invalid.h> |
| 29 | 29 |
#include <lemon/bits/utility.h> |
| 30 | 30 |
#include <lemon/concept_check.h> |
| 31 | 31 |
|
| 32 | 32 |
namespace lemon {
|
| 33 | 33 |
namespace concepts {
|
| 34 | 34 |
|
| 35 | 35 |
/// \addtogroup concept |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_COUNTER_H |
| 20 | 20 |
#define LEMON_COUNTER_H |
| 21 | 21 |
|
| 22 | 22 |
#include <string> |
| 23 | 23 |
#include <iostream> |
| 24 | 24 |
|
| 25 | 25 |
///\ingroup timecount |
| 26 | 26 |
///\file |
| 27 | 27 |
///\brief Tools for counting steps and events |
| 28 | 28 |
|
| 29 | 29 |
namespace lemon |
| 30 | 30 |
{
|
| 31 | 31 |
|
| 32 | 32 |
template<class P> class _NoSubCounter; |
| 33 | 33 |
|
| 34 | 34 |
template<class P> |
| 35 | 35 |
class _SubCounter |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_DFS_H |
| 20 | 20 |
#define LEMON_DFS_H |
| 21 | 21 |
|
| 22 | 22 |
///\ingroup search |
| 23 | 23 |
///\file |
| 24 | 24 |
///\brief Dfs algorithm. |
| 25 | 25 |
|
| 26 | 26 |
#include <lemon/list_graph.h> |
| 27 | 27 |
#include <lemon/graph_utils.h> |
| 28 | 28 |
#include <lemon/bits/path_dump.h> |
| 29 | 29 |
#include <lemon/bits/invalid.h> |
| 30 | 30 |
#include <lemon/error.h> |
| 31 | 31 |
#include <lemon/maps.h> |
| 32 | 32 |
|
| 33 | 33 |
#include <lemon/concept_check.h> |
| 34 | 34 |
|
| 35 | 35 |
namespace lemon {
|
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_DIJKSTRA_H |
| 20 | 20 |
#define LEMON_DIJKSTRA_H |
| 21 | 21 |
|
| 22 | 22 |
///\ingroup shortest_path |
| 23 | 23 |
///\file |
| 24 | 24 |
///\brief Dijkstra algorithm. |
| 25 | 25 |
|
| 26 | 26 |
#include <limits> |
| 27 | 27 |
#include <lemon/list_graph.h> |
| 28 | 28 |
#include <lemon/bin_heap.h> |
| 29 | 29 |
#include <lemon/bits/path_dump.h> |
| 30 | 30 |
#include <lemon/bits/invalid.h> |
| 31 | 31 |
#include <lemon/error.h> |
| 32 | 32 |
#include <lemon/maps.h> |
| 33 | 33 |
|
| 34 | 34 |
namespace lemon {
|
| 35 | 35 |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_DIM2_H |
| 20 | 20 |
#define LEMON_DIM2_H |
| 21 | 21 |
|
| 22 | 22 |
#include <iostream> |
| 23 | 23 |
#include <lemon/bits/utility.h> |
| 24 | 24 |
|
| 25 | 25 |
///\ingroup misc |
| 26 | 26 |
///\file |
| 27 | 27 |
///\brief A simple two dimensional vector and a bounding box implementation |
| 28 | 28 |
/// |
| 29 | 29 |
/// The class \ref lemon::dim2::Point "dim2::Point" implements |
| 30 | 30 |
/// a two dimensional vector with the usual operations. |
| 31 | 31 |
/// |
| 32 | 32 |
/// The class \ref lemon::dim2::BoundingBox "dim2::BoundingBox" |
| 33 | 33 |
/// can be used to determine |
| 34 | 34 |
/// the rectangular bounding box of a set of |
| 35 | 35 |
/// \ref lemon::dim2::Point "dim2::Point"'s. |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_ERROR_H |
| 20 | 20 |
#define LEMON_ERROR_H |
| 21 | 21 |
|
| 22 | 22 |
/// \ingroup exceptions |
| 23 | 23 |
/// \file |
| 24 | 24 |
/// \brief Basic exception classes and error handling. |
| 25 | 25 |
|
| 26 | 26 |
#include <exception> |
| 27 | 27 |
#include <string> |
| 28 | 28 |
#include <sstream> |
| 29 | 29 |
#include <iostream> |
| 30 | 30 |
#include <cstdlib> |
| 31 | 31 |
#include <memory> |
| 32 | 32 |
|
| 33 | 33 |
namespace lemon {
|
| 34 | 34 |
|
| 35 | 35 |
/// \addtogroup exceptions |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_GRAPH_TO_EPS_H |
| 20 | 20 |
#define LEMON_GRAPH_TO_EPS_H |
| 21 | 21 |
|
| 22 | 22 |
#include<iostream> |
| 23 | 23 |
#include<fstream> |
| 24 | 24 |
#include<sstream> |
| 25 | 25 |
#include<algorithm> |
| 26 | 26 |
#include<vector> |
| 27 | 27 |
|
| 28 | 28 |
#ifndef WIN32 |
| 29 | 29 |
#include<sys/time.h> |
| 30 | 30 |
#include<ctime> |
| 31 | 31 |
#else |
| 32 | 32 |
#define WIN32_LEAN_AND_MEAN |
| 33 | 33 |
#define NOMINMAX |
| 34 | 34 |
#include<windows.h> |
| 35 | 35 |
#endif |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_GRAPH_UTILS_H |
| 20 | 20 |
#define LEMON_GRAPH_UTILS_H |
| 21 | 21 |
|
| 22 | 22 |
#include <iterator> |
| 23 | 23 |
#include <vector> |
| 24 | 24 |
#include <map> |
| 25 | 25 |
#include <cmath> |
| 26 | 26 |
#include <algorithm> |
| 27 | 27 |
|
| 28 | 28 |
#include <lemon/bits/invalid.h> |
| 29 | 29 |
#include <lemon/bits/utility.h> |
| 30 | 30 |
#include <lemon/maps.h> |
| 31 | 31 |
#include <lemon/bits/traits.h> |
| 32 | 32 |
|
| 33 | 33 |
#include <lemon/bits/alteration_notifier.h> |
| 34 | 34 |
#include <lemon/bits/default_map.h> |
| 35 | 35 |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_KRUSKAL_H |
| 20 | 20 |
#define LEMON_KRUSKAL_H |
| 21 | 21 |
|
| 22 | 22 |
#include <algorithm> |
| 23 | 23 |
#include <vector> |
| 24 | 24 |
#include <lemon/unionfind.h> |
| 25 | 25 |
// #include <lemon/graph_utils.h> |
| 26 | 26 |
#include <lemon/maps.h> |
| 27 | 27 |
|
| 28 | 28 |
// #include <lemon/radix_sort.h> |
| 29 | 29 |
|
| 30 | 30 |
#include <lemon/bits/utility.h> |
| 31 | 31 |
#include <lemon/bits/traits.h> |
| 32 | 32 |
|
| 33 | 33 |
///\ingroup spantree |
| 34 | 34 |
///\file |
| 35 | 35 |
///\brief Kruskal's algorithm to compute a minimum cost spanning tree |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
///\ingroup lemon_io |
| 20 | 20 |
///\file |
| 21 | 21 |
///\brief \ref lgf-format "Lemon Graph Format" reader. |
| 22 | 22 |
|
| 23 | 23 |
|
| 24 | 24 |
#ifndef LEMON_LGF_READER_H |
| 25 | 25 |
#define LEMON_LGF_READER_H |
| 26 | 26 |
|
| 27 | 27 |
#include <iostream> |
| 28 | 28 |
#include <fstream> |
| 29 | 29 |
#include <sstream> |
| 30 | 30 |
|
| 31 | 31 |
#include <set> |
| 32 | 32 |
#include <map> |
| 33 | 33 |
|
| 34 | 34 |
#include <lemon/assert.h> |
| 35 | 35 |
#include <lemon/graph_utils.h> |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
///\ingroup lemon_io |
| 20 | 20 |
///\file |
| 21 | 21 |
///\brief \ref lgf-format "Lemon Graph Format" writer. |
| 22 | 22 |
|
| 23 | 23 |
|
| 24 | 24 |
#ifndef LEMON_LGF_WRITER_H |
| 25 | 25 |
#define LEMON_LGF_WRITER_H |
| 26 | 26 |
|
| 27 | 27 |
#include <iostream> |
| 28 | 28 |
#include <fstream> |
| 29 | 29 |
#include <sstream> |
| 30 | 30 |
|
| 31 | 31 |
#include <algorithm> |
| 32 | 32 |
|
| 33 | 33 |
#include <vector> |
| 34 | 34 |
#include <functional> |
| 35 | 35 |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_LIST_GRAPH_H |
| 20 | 20 |
#define LEMON_LIST_GRAPH_H |
| 21 | 21 |
|
| 22 | 22 |
///\ingroup graphs |
| 23 | 23 |
///\file |
| 24 | 24 |
///\brief ListDigraph, ListGraph classes. |
| 25 | 25 |
|
| 26 | 26 |
#include <lemon/bits/graph_extender.h> |
| 27 | 27 |
|
| 28 | 28 |
#include <vector> |
| 29 | 29 |
#include <list> |
| 30 | 30 |
|
| 31 | 31 |
namespace lemon {
|
| 32 | 32 |
|
| 33 | 33 |
class ListDigraphBase {
|
| 34 | 34 |
|
| 35 | 35 |
protected: |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_MAPS_H |
| 20 | 20 |
#define LEMON_MAPS_H |
| 21 | 21 |
|
| 22 | 22 |
#include <iterator> |
| 23 | 23 |
#include <functional> |
| 24 | 24 |
#include <vector> |
| 25 | 25 |
|
| 26 | 26 |
#include <lemon/bits/utility.h> |
| 27 | 27 |
#include <lemon/bits/traits.h> |
| 28 | 28 |
|
| 29 | 29 |
///\file |
| 30 | 30 |
///\ingroup maps |
| 31 | 31 |
///\brief Miscellaneous property maps |
| 32 | 32 |
|
| 33 | 33 |
#include <map> |
| 34 | 34 |
|
| 35 | 35 |
namespace lemon {
|
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_MATH_H |
| 20 | 20 |
#define LEMON_MATH_H |
| 21 | 21 |
|
| 22 | 22 |
///\ingroup misc |
| 23 | 23 |
///\file |
| 24 | 24 |
///\brief Some extensions to the standard \c cmath library. |
| 25 | 25 |
/// |
| 26 | 26 |
///Some extensions to the standard \c cmath library. |
| 27 | 27 |
/// |
| 28 | 28 |
///This file includes the standard math library (cmath). |
| 29 | 29 |
|
| 30 | 30 |
#include<cmath> |
| 31 | 31 |
|
| 32 | 32 |
namespace lemon {
|
| 33 | 33 |
|
| 34 | 34 |
/// \addtogroup misc |
| 35 | 35 |
/// @{
|
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
///\ingroup paths |
| 20 | 20 |
///\file |
| 21 | 21 |
///\brief Classes for representing paths in digraphs. |
| 22 | 22 |
/// |
| 23 | 23 |
|
| 24 | 24 |
#ifndef LEMON_PATH_H |
| 25 | 25 |
#define LEMON_PATH_H |
| 26 | 26 |
|
| 27 | 27 |
#include <vector> |
| 28 | 28 |
#include <algorithm> |
| 29 | 29 |
|
| 30 | 30 |
#include <lemon/error.h> |
| 31 | 31 |
#include <lemon/bits/invalid.h> |
| 32 | 32 |
#include <lemon/concepts/path.h> |
| 33 | 33 |
|
| 34 | 34 |
namespace lemon {
|
| 35 | 35 |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
///\file |
| 20 | 20 |
///\brief Instantiation of the Random class. |
| 21 | 21 |
|
| 22 | 22 |
#include <lemon/random.h> |
| 23 | 23 |
|
| 24 | 24 |
namespace lemon {
|
| 25 | 25 |
/// \brief Global random number generator instance |
| 26 | 26 |
/// |
| 27 | 27 |
/// A global Mersenne Twister random number generator instance. |
| 28 | 28 |
Random rnd; |
| 29 | 29 |
} |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
/* |
| 20 | 20 |
* This file contains the reimplemented version of the Mersenne Twister |
| 21 | 21 |
* Generator of Matsumoto and Nishimura. |
| 22 | 22 |
* |
| 23 | 23 |
* See the appropriate copyright notice below. |
| 24 | 24 |
* |
| 25 | 25 |
* Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, |
| 26 | 26 |
* All rights reserved. |
| 27 | 27 |
* |
| 28 | 28 |
* Redistribution and use in source and binary forms, with or without |
| 29 | 29 |
* modification, are permitted provided that the following conditions |
| 30 | 30 |
* are met: |
| 31 | 31 |
* |
| 32 | 32 |
* 1. Redistributions of source code must retain the above copyright |
| 33 | 33 |
* notice, this list of conditions and the following disclaimer. |
| 34 | 34 |
* |
| 35 | 35 |
* 2. Redistributions in binary form must reproduce the above copyright |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_SMART_GRAPH_H |
| 20 | 20 |
#define LEMON_SMART_GRAPH_H |
| 21 | 21 |
|
| 22 | 22 |
///\ingroup graphs |
| 23 | 23 |
///\file |
| 24 | 24 |
///\brief SmartDigraph and SmartGraph classes. |
| 25 | 25 |
|
| 26 | 26 |
#include <vector> |
| 27 | 27 |
|
| 28 | 28 |
#include <lemon/bits/invalid.h> |
| 29 | 29 |
|
| 30 | 30 |
#include <lemon/bits/base_extender.h> |
| 31 | 31 |
#include <lemon/bits/graph_extender.h> |
| 32 | 32 |
|
| 33 | 33 |
#include <lemon/bits/utility.h> |
| 34 | 34 |
#include <lemon/error.h> |
| 35 | 35 |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_TIME_MEASURE_H |
| 20 | 20 |
#define LEMON_TIME_MEASURE_H |
| 21 | 21 |
|
| 22 | 22 |
///\ingroup timecount |
| 23 | 23 |
///\file |
| 24 | 24 |
///\brief Tools for measuring cpu usage |
| 25 | 25 |
|
| 26 | 26 |
#ifdef WIN32 |
| 27 | 27 |
#define WIN32_LEAN_AND_MEAN |
| 28 | 28 |
#define NOMINMAX |
| 29 | 29 |
#include <windows.h> |
| 30 | 30 |
#include <cmath> |
| 31 | 31 |
#else |
| 32 | 32 |
#include <sys/times.h> |
| 33 | 33 |
#include <sys/time.h> |
| 34 | 34 |
#endif |
| 35 | 35 |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_TOLERANCE_H |
| 20 | 20 |
#define LEMON_TOLERANCE_H |
| 21 | 21 |
|
| 22 | 22 |
///\ingroup misc |
| 23 | 23 |
///\file |
| 24 | 24 |
///\brief A basic tool to handle the anomalies of calculation with |
| 25 | 25 |
///floating point numbers. |
| 26 | 26 |
/// |
| 27 | 27 |
///\todo It should be in a module like "Basic tools" |
| 28 | 28 |
|
| 29 | 29 |
|
| 30 | 30 |
namespace lemon {
|
| 31 | 31 |
|
| 32 | 32 |
/// \addtogroup misc |
| 33 | 33 |
/// @{
|
| 34 | 34 |
|
| 35 | 35 |
///\brief A class to provide a basic way to |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_UNION_FIND_H |
| 20 | 20 |
#define LEMON_UNION_FIND_H |
| 21 | 21 |
|
| 22 | 22 |
//!\ingroup auxdat |
| 23 | 23 |
//!\file |
| 24 | 24 |
//!\brief Union-Find data structures. |
| 25 | 25 |
//! |
| 26 | 26 |
|
| 27 | 27 |
#include <vector> |
| 28 | 28 |
#include <list> |
| 29 | 29 |
#include <utility> |
| 30 | 30 |
#include <algorithm> |
| 31 | 31 |
#include <functional> |
| 32 | 32 |
|
| 33 | 33 |
#include <lemon/bits/invalid.h> |
| 34 | 34 |
|
| 35 | 35 |
namespace lemon {
|
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#include <lemon/concepts/digraph.h> |
| 20 | 20 |
#include <lemon/smart_graph.h> |
| 21 | 21 |
#include <lemon/list_graph.h> |
| 22 | 22 |
#include <lemon/bfs.h> |
| 23 | 23 |
#include <lemon/path.h> |
| 24 | 24 |
|
| 25 | 25 |
#include "graph_test.h" |
| 26 | 26 |
#include "test_tools.h" |
| 27 | 27 |
|
| 28 | 28 |
using namespace lemon; |
| 29 | 29 |
|
| 30 | 30 |
void checkBfsCompile() |
| 31 | 31 |
{
|
| 32 | 32 |
typedef concepts::Digraph Digraph; |
| 33 | 33 |
typedef Bfs<Digraph> BType; |
| 34 | 34 |
|
| 35 | 35 |
Digraph G; |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#include <lemon/counter.h> |
| 20 | 20 |
#include <vector> |
| 21 | 21 |
|
| 22 | 22 |
using namespace lemon; |
| 23 | 23 |
|
| 24 | 24 |
template <typename T> |
| 25 | 25 |
void bubbleSort(std::vector<T>& v) {
|
| 26 | 26 |
Counter op("Bubble Sort - Operations: ");
|
| 27 | 27 |
Counter::NoSubCounter as(op, "Assignments: "); |
| 28 | 28 |
Counter::NoSubCounter co(op, "Comparisons: "); |
| 29 | 29 |
for (int i = v.size()-1; i > 0; --i) {
|
| 30 | 30 |
for (int j = 0; j < i; ++j) {
|
| 31 | 31 |
if (v[j] > v[j+1]) {
|
| 32 | 32 |
T tmp = v[j]; |
| 33 | 33 |
v[j] = v[j+1]; |
| 34 | 34 |
v[j+1] = tmp; |
| 35 | 35 |
as += 3; |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#include <lemon/concepts/digraph.h> |
| 20 | 20 |
#include <lemon/smart_graph.h> |
| 21 | 21 |
#include <lemon/list_graph.h> |
| 22 | 22 |
#include <lemon/dfs.h> |
| 23 | 23 |
#include <lemon/path.h> |
| 24 | 24 |
|
| 25 | 25 |
#include "graph_test.h" |
| 26 | 26 |
#include "test_tools.h" |
| 27 | 27 |
|
| 28 | 28 |
using namespace lemon; |
| 29 | 29 |
|
| 30 | 30 |
void checkDfsCompile() |
| 31 | 31 |
{
|
| 32 | 32 |
typedef concepts::Digraph Digraph; |
| 33 | 33 |
typedef Dfs<Digraph> DType; |
| 34 | 34 |
|
| 35 | 35 |
Digraph G; |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#include <lemon/concepts/digraph.h> |
| 20 | 20 |
#include <lemon/list_graph.h> |
| 21 | 21 |
#include <lemon/smart_graph.h> |
| 22 | 22 |
//#include <lemon/full_graph.h> |
| 23 | 23 |
//#include <lemon/hypercube_graph.h> |
| 24 | 24 |
|
| 25 | 25 |
#include "test_tools.h" |
| 26 | 26 |
#include "graph_test.h" |
| 27 | 27 |
#include "graph_maps_test.h" |
| 28 | 28 |
|
| 29 | 29 |
using namespace lemon; |
| 30 | 30 |
using namespace lemon::concepts; |
| 31 | 31 |
|
| 32 | 32 |
void check_concepts() {
|
| 33 | 33 |
{ // Checking digraph components
|
| 34 | 34 |
checkConcept<BaseDigraphComponent, BaseDigraphComponent >(); |
| 35 | 35 |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#include <lemon/concepts/digraph.h> |
| 20 | 20 |
#include <lemon/smart_graph.h> |
| 21 | 21 |
#include <lemon/list_graph.h> |
| 22 | 22 |
#include <lemon/graph_utils.h> |
| 23 | 23 |
#include <lemon/dijkstra.h> |
| 24 | 24 |
#include <lemon/path.h> |
| 25 | 25 |
|
| 26 | 26 |
#include "graph_test.h" |
| 27 | 27 |
#include "test_tools.h" |
| 28 | 28 |
|
| 29 | 29 |
using namespace lemon; |
| 30 | 30 |
|
| 31 | 31 |
void checkDijkstraCompile() |
| 32 | 32 |
{
|
| 33 | 33 |
typedef int VType; |
| 34 | 34 |
typedef concepts::Digraph Digraph; |
| 35 | 35 |
typedef concepts::ReadMap<Digraph::Arc,VType> LengthMap; |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#include <lemon/dim2.h> |
| 20 | 20 |
#include <iostream> |
| 21 | 21 |
#include "test_tools.h" |
| 22 | 22 |
|
| 23 | 23 |
using namespace std; |
| 24 | 24 |
using namespace lemon; |
| 25 | 25 |
|
| 26 | 26 |
int main() |
| 27 | 27 |
{
|
| 28 | 28 |
typedef dim2::Point<int> Point; |
| 29 | 29 |
|
| 30 | 30 |
Point p; |
| 31 | 31 |
check(p.size()==2, "Wrong dim2::Point initialization."); |
| 32 | 32 |
|
| 33 | 33 |
Point a(1,2); |
| 34 | 34 |
Point b(3,4); |
| 35 | 35 |
check(a[0]==1 && a[1]==2, "Wrong dim2::Point initialization."); |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#include <iostream> |
| 20 | 20 |
|
| 21 | 21 |
#include <lemon/error.h> |
| 22 | 22 |
#include "test_tools.h" |
| 23 | 23 |
|
| 24 | 24 |
using namespace lemon; |
| 25 | 25 |
|
| 26 | 26 |
#ifdef LEMON_ENABLE_ASSERTS |
| 27 | 27 |
#undef LEMON_ENABLE_ASSERTS |
| 28 | 28 |
#endif |
| 29 | 29 |
|
| 30 | 30 |
#ifdef LEMON_DISABLE_ASSERTS |
| 31 | 31 |
#undef LEMON_DISABLE_ASSERTS |
| 32 | 32 |
#endif |
| 33 | 33 |
|
| 34 | 34 |
//checking disabled asserts |
| 35 | 35 |
#define LEMON_DISABLE_ASSERTS |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#include <lemon/smart_graph.h> |
| 20 | 20 |
#include <lemon/list_graph.h> |
| 21 | 21 |
#include <lemon/lgf_reader.h> |
| 22 | 22 |
#include <lemon/graph_utils.h> |
| 23 | 23 |
#include <lemon/error.h> |
| 24 | 24 |
|
| 25 | 25 |
#include "test_tools.h" |
| 26 | 26 |
|
| 27 | 27 |
using namespace std; |
| 28 | 28 |
using namespace lemon; |
| 29 | 29 |
|
| 30 | 30 |
void digraph_copy_test() {
|
| 31 | 31 |
const int nn = 10; |
| 32 | 32 |
|
| 33 | 33 |
SmartDigraph from; |
| 34 | 34 |
SmartDigraph::NodeMap<int> fnm(from); |
| 35 | 35 |
SmartDigraph::ArcMap<int> fam(from); |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_TEST_MAP_TEST_H |
| 20 | 20 |
#define LEMON_TEST_MAP_TEST_H |
| 21 | 21 |
|
| 22 | 22 |
#include <vector> |
| 23 | 23 |
#include <lemon/maps.h> |
| 24 | 24 |
|
| 25 | 25 |
#include "test_tools.h" |
| 26 | 26 |
|
| 27 | 27 |
namespace lemon {
|
| 28 | 28 |
|
| 29 | 29 |
template <typename Graph> |
| 30 | 30 |
void checkGraphNodeMap() {
|
| 31 | 31 |
Graph graph; |
| 32 | 32 |
const int num = 16; |
| 33 | 33 |
|
| 34 | 34 |
typedef typename Graph::Node Node; |
| 35 | 35 |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#include <lemon/concepts/graph.h> |
| 20 | 20 |
#include <lemon/list_graph.h> |
| 21 | 21 |
#include <lemon/smart_graph.h> |
| 22 | 22 |
// #include <lemon/full_graph.h> |
| 23 | 23 |
// #include <lemon/grid_graph.h> |
| 24 | 24 |
|
| 25 | 25 |
#include "test_tools.h" |
| 26 | 26 |
#include "graph_test.h" |
| 27 | 27 |
#include "graph_maps_test.h" |
| 28 | 28 |
|
| 29 | 29 |
using namespace lemon; |
| 30 | 30 |
using namespace lemon::concepts; |
| 31 | 31 |
|
| 32 | 32 |
void check_concepts() {
|
| 33 | 33 |
{ // Checking graph components
|
| 34 | 34 |
checkConcept<BaseGraphComponent, BaseGraphComponent >(); |
| 35 | 35 |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_TEST_GRAPH_TEST_H |
| 20 | 20 |
#define LEMON_TEST_GRAPH_TEST_H |
| 21 | 21 |
|
| 22 | 22 |
#include <lemon/graph_utils.h> |
| 23 | 23 |
#include "test_tools.h" |
| 24 | 24 |
|
| 25 | 25 |
namespace lemon {
|
| 26 | 26 |
|
| 27 | 27 |
template<class Graph> |
| 28 | 28 |
void checkGraphNodeList(const Graph &G, int cnt) |
| 29 | 29 |
{
|
| 30 | 30 |
typename Graph::NodeIt n(G); |
| 31 | 31 |
for(int i=0;i<cnt;i++) {
|
| 32 | 32 |
check(n!=INVALID,"Wrong Node list linking."); |
| 33 | 33 |
++n; |
| 34 | 34 |
} |
| 35 | 35 |
check(n==INVALID,"Wrong Node list linking."); |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#include <cstdlib> |
| 20 | 20 |
#include <ctime> |
| 21 | 21 |
|
| 22 | 22 |
#include <lemon/random.h> |
| 23 | 23 |
#include <lemon/graph_utils.h> |
| 24 | 24 |
#include <lemon/list_graph.h> |
| 25 | 25 |
#include <lemon/smart_graph.h> |
| 26 | 26 |
|
| 27 | 27 |
#include "graph_test.h" |
| 28 | 28 |
#include "test_tools.h" |
| 29 | 29 |
|
| 30 | 30 |
using namespace lemon; |
| 31 | 31 |
|
| 32 | 32 |
template <typename Digraph> |
| 33 | 33 |
void checkFindArcs() {
|
| 34 | 34 |
TEMPLATE_DIGRAPH_TYPEDEFS(Digraph); |
| 35 | 35 |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#include <iostream> |
| 20 | 20 |
#include <fstream> |
| 21 | 21 |
#include <string> |
| 22 | 22 |
#include <vector> |
| 23 | 23 |
|
| 24 | 24 |
#include <lemon/concept_check.h> |
| 25 | 25 |
#include <lemon/concepts/heap.h> |
| 26 | 26 |
|
| 27 | 27 |
#include <lemon/smart_graph.h> |
| 28 | 28 |
|
| 29 | 29 |
#include <lemon/lgf_reader.h> |
| 30 | 30 |
#include <lemon/dijkstra.h> |
| 31 | 31 |
#include <lemon/maps.h> |
| 32 | 32 |
|
| 33 | 33 |
#include <lemon/bin_heap.h> |
| 34 | 34 |
|
| 35 | 35 |
#include "test_tools.h" |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#include <iostream> |
| 20 | 20 |
#include <vector> |
| 21 | 21 |
|
| 22 | 22 |
#include "test_tools.h" |
| 23 | 23 |
#include <lemon/maps.h> |
| 24 | 24 |
#include <lemon/kruskal.h> |
| 25 | 25 |
#include <lemon/list_graph.h> |
| 26 | 26 |
|
| 27 | 27 |
#include <lemon/concepts/maps.h> |
| 28 | 28 |
#include <lemon/concepts/digraph.h> |
| 29 | 29 |
#include <lemon/concepts/graph.h> |
| 30 | 30 |
|
| 31 | 31 |
using namespace std; |
| 32 | 32 |
using namespace lemon; |
| 33 | 33 |
|
| 34 | 34 |
void checkCompileKruskal() |
| 35 | 35 |
{
|
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#include <deque> |
| 20 | 20 |
#include <set> |
| 21 | 21 |
|
| 22 | 22 |
#include <lemon/concept_check.h> |
| 23 | 23 |
#include <lemon/concepts/maps.h> |
| 24 | 24 |
#include <lemon/maps.h> |
| 25 | 25 |
|
| 26 | 26 |
#include "test_tools.h" |
| 27 | 27 |
|
| 28 | 28 |
using namespace lemon; |
| 29 | 29 |
using namespace lemon::concepts; |
| 30 | 30 |
|
| 31 | 31 |
struct A {};
|
| 32 | 32 |
inline bool operator<(A, A) { return true; }
|
| 33 | 33 |
struct B {};
|
| 34 | 34 |
|
| 35 | 35 |
class C {
|
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#include <string> |
| 20 | 20 |
#include <iostream> |
| 21 | 21 |
|
| 22 | 22 |
#include <lemon/concepts/path.h> |
| 23 | 23 |
#include <lemon/concepts/digraph.h> |
| 24 | 24 |
|
| 25 | 25 |
#include <lemon/path.h> |
| 26 | 26 |
#include <lemon/list_graph.h> |
| 27 | 27 |
|
| 28 | 28 |
#include "test_tools.h" |
| 29 | 29 |
|
| 30 | 30 |
using namespace std; |
| 31 | 31 |
using namespace lemon; |
| 32 | 32 |
|
| 33 | 33 |
void check_concepts() {
|
| 34 | 34 |
checkConcept<concepts::Path<ListDigraph>, concepts::Path<ListDigraph> >(); |
| 35 | 35 |
checkConcept<concepts::Path<ListDigraph>, Path<ListDigraph> >(); |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#include <lemon/random.h> |
| 20 | 20 |
#include "test_tools.h" |
| 21 | 21 |
|
| 22 | 22 |
int seed_array[] = {1, 2};
|
| 23 | 23 |
|
| 24 | 24 |
int main() |
| 25 | 25 |
{
|
| 26 | 26 |
double a=lemon::rnd(); |
| 27 | 27 |
check(a<1.0&&a>0.0,"This should be in [0,1)"); |
| 28 | 28 |
a=lemon::rnd.gauss(); |
| 29 | 29 |
a=lemon::rnd.gamma(3.45,0); |
| 30 | 30 |
a=lemon::rnd.gamma(4); |
| 31 | 31 |
//Does gamma work with integer k? |
| 32 | 32 |
a=lemon::rnd.gamma(4.0,0); |
| 33 | 33 |
a=lemon::rnd.poisson(.5); |
| 34 | 34 |
|
| 35 | 35 |
lemon::rnd.seed(100); |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_TEST_TEST_TOOLS_H |
| 20 | 20 |
#define LEMON_TEST_TEST_TOOLS_H |
| 21 | 21 |
|
| 22 | 22 |
///\ingroup misc |
| 23 | 23 |
///\file |
| 24 | 24 |
///\brief Some utilities to write test programs. |
| 25 | 25 |
|
| 26 | 26 |
#include <iostream> |
| 27 | 27 |
#include <stdlib.h> |
| 28 | 28 |
|
| 29 | 29 |
///If \c rc is fail, writes an error message and exits. |
| 30 | 30 |
|
| 31 | 31 |
///If \c rc is fail, writes an error message and exits. |
| 32 | 32 |
///The error message contains the file name and the line number of the |
| 33 | 33 |
///source code in a standard from, which makes it possible to go there |
| 34 | 34 |
///using good source browsers like e.g. \c emacs. |
| 35 | 35 |
/// |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#include "test_tools.h" |
| 20 | 20 |
|
| 21 | 21 |
int main() |
| 22 | 22 |
{
|
| 23 | 23 |
check(false, "Don't panic. Failing is the right behaviour here."); |
| 24 | 24 |
return 0; |
| 25 | 25 |
} |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#include "test_tools.h" |
| 20 | 20 |
|
| 21 | 21 |
int main() |
| 22 | 22 |
{
|
| 23 | 23 |
check(true, "It should pass."); |
| 24 | 24 |
return 0; |
| 25 | 25 |
} |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#include <lemon/time_measure.h> |
| 20 | 20 |
|
| 21 | 21 |
using namespace lemon; |
| 22 | 22 |
|
| 23 | 23 |
void f() |
| 24 | 24 |
{
|
| 25 | 25 |
double d=0; |
| 26 | 26 |
for(int i=0;i<1000;i++) |
| 27 | 27 |
d+=0.1; |
| 28 | 28 |
} |
| 29 | 29 |
|
| 30 | 30 |
void g() |
| 31 | 31 |
{
|
| 32 | 32 |
static Timer T; |
| 33 | 33 |
|
| 34 | 34 |
for(int i=0;i<1000;i++) |
| 35 | 35 |
TimeStamp x(T); |
| 1 |
/* -*- C++ -*- |
|
| 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 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#include <lemon/list_graph.h> |
| 20 | 20 |
#include <lemon/maps.h> |
| 21 | 21 |
#include <lemon/unionfind.h> |
| 22 | 22 |
#include "test_tools.h" |
| 23 | 23 |
|
| 24 | 24 |
using namespace lemon; |
| 25 | 25 |
using namespace std; |
| 26 | 26 |
|
| 27 | 27 |
typedef UnionFindEnum<ListGraph::NodeMap<int> > UFE; |
| 28 | 28 |
|
| 29 | 29 |
int main() {
|
| 30 | 30 |
ListGraph g; |
| 31 | 31 |
ListGraph::NodeMap<int> base(g); |
| 32 | 32 |
UFE U(base); |
| 33 | 33 |
vector<ListGraph::Node> n; |
| 34 | 34 |
|
| 35 | 35 |
for(int i=0;i<20;i++) n.push_back(g.addNode()); |
0 comments (0 inline)