diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,16 +1,7 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-#EXECUTE_PROCESS(
-# COMMAND hg id -i
-# OUTPUT_VARIABLE HG_REVISION
-# OUTPUT_STRIP_TRAILING_WHITESPACE)
-
SET(PROJECT_NAME "LEMON")
-SET(PROJECT_VERSION_MAJOR "0")
-SET(PROJECT_VERSION_MINOR "99")
-SET(PROJECT_VERSION_PATCH "0")
-SET(PROJECT_VERSION
- "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
+SET(PROJECT_VERSION "hg-tip" CACHE STRING "The version string.")
PROJECT(${PROJECT_NAME})
@@ -39,15 +30,12 @@
"LEMON - Library of Efficient Models and Optimization in Networks")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
- SET(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
- SET(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
- SET(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
SET(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
SET(CPACK_PACKAGE_INSTALL_DIRECTORY
- "${PROJECT_NAME} ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")
+ "${PROJECT_NAME} ${PROJECT_VERSION}")
SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY
- "${PROJECT_NAME} ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
+ "${PROJECT_NAME} ${PROJECT_VERSION}")
# Variables to generate a component-based installer.
#SET(CPACK_COMPONENTS_ALL headers library html_documentation)
diff --git a/NEWS b/NEWS
--- a/NEWS
+++ b/NEWS
@@ -0,0 +1,49 @@
+20XX-XX-XX Version 1.0 released
+
+ This is the first stable release of LEMON. Compared to the 0.x
+ release series, it features a considerably smaller but more
+ matured set of tools. The API has also completely revised and
+ changed in several places.
+
+ * The major name changes compared to the 0.x series
+ * Graph -> Digraph, UGraph -> Graph
+ * Edge -> Arc, UEdge -> Edge
+ * source(UEdge)/target(UEdge) -> u(Edge)/v(Edge)
+ * Other improvements
+ * Better documentation
+ * Reviewed and cleaned up codebase
+ * CMake based build system (along with the autotools based one)
+ * Contents of the library (ported from 0.x)
+ * Algorithms
+ * breadth-first search (bfs.h)
+ * depth-first search (dfs.h)
+ * Dijkstra's algorithm (dijkstra.h)
+ * Kruskal's algorithm (kruskal.h)
+ * Data structures
+ * graph data structures (list_graph.h, smart_graph.h)
+ * path data structures (path.h)
+ * binary heap data structure (bin_heap.h)
+ * union-find data structures (unionfind.h)
+ * miscellaneous property maps (maps.h)
+ * two dimensional vector and bounding box (dim2.h)
+ * Concepts
+ * graph structure concepts (concepts/digraph.h, concepts/graph.h,
+ concepts/graph_components.h)
+ * concepts for other structures (concepts/heap.h, concepts/maps.h,
+ concepts/path.h)
+ * Tools
+ * Mersenne twister random number generator (random.h)
+ * tools for measuring cpu and wall clock time (time_measure.h)
+ * tools for counting steps and events (counter.h)
+ * tool for parsing command line arguments (arg_parser.h)
+ * tool for visualizing graphs (graph_to_eps.h)
+ * tools for reading and writing data in LEMON Graph Format
+ (lgf_reader.h, lgf_writer.h)
+ * tools to handle the anomalies of calculations with
+ floating point numbers (tolerance.h)
+ * tools to manage RGB colors (color.h)
+ * Infrastructure
+ * extended assertion handling (assert.h)
+ * exception classes and error handling (error.h)
+ * concept checking (concept_check.h)
+ * commonly used mathematical constants (math.h)
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -1,9 +1,15 @@
dnl Process this file with autoconf to produce a configure script.
dnl Version information.
-m4_define([lemon_version_number], [])
+m4_define([lemon_version_number],
+ [m4_normalize(esyscmd([echo ${LEMON_VERSION}]))])
+dnl m4_define([lemon_version_number], [])
+m4_define([lemon_hg_path], [m4_normalize(esyscmd([./scripts/chg-len.py]))])
m4_define([lemon_hg_revision], [m4_normalize(esyscmd([hg id -i]))])
-m4_define([lemon_version], [ifelse(lemon_version_number(), [], [lemon_hg_revision()], [lemon_version_number()])])
+m4_define([lemon_version], [ifelse(lemon_version_number(),
+ [],
+ [lemon_hg_path().lemon_hg_revision()],
+ [lemon_version_number()])])
AC_PREREQ([2.59])
AC_INIT([LEMON], [lemon_version()], [lemon-user@lemon.cs.elte.hu], [lemon])
diff --git a/doc/Makefile.am b/doc/Makefile.am
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -6,6 +6,7 @@
doc/lgf.dox \
doc/license.dox \
doc/mainpage.dox \
+ doc/named-param.dox \
doc/namespaces.dox \
doc/html \
doc/CMakeLists.txt
diff --git a/doc/named-param.dox b/doc/named-param.dox
new file mode 100644
--- /dev/null
+++ b/doc/named-param.dox
@@ -0,0 +1,119 @@
+/* -*- mode: C++; indent-tabs-mode: nil; -*-
+ *
+ * This file is a part of LEMON, a generic C++ optimization library.
+ *
+ * Copyright (C) 2003-2008
+ * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
+ * (Egervary Research Group on Combinatorial Optimization, EGRES).
+ *
+ * Permission to use, modify and distribute this software is granted
+ * provided that this copyright notice appears in all copies. For
+ * precise terms see the accompanying LICENSE file.
+ *
+ * This software is provided "AS IS" with no warranty of any kind,
+ * express or implied, and with no claim as to its suitability for any
+ * purpose.
+ *
+ */
+
+/*!
+
+\page named-param Named Parameters
+
+\section named-func-param Named Function Parameters
+
+Several modern languages provide a convenient way to refer the
+function parameters by name also when you call the function. It is
+especially comfortable in case of a function having tons of parameters
+with natural default values. Sadly, C++ lack this amenity.
+
+However, with a crafty trick and with some little
+inconvenience, it is possible to emulate is.
+The example below shows how to do it.
+
+\code
+class namedFn
+{
+ int _id;
+ double _val;
+ int _dim;
+
+ public:
+ namedFn() : _id(0), _val(1), _dim(2) {}
+ namedFn& id(int p) { _id = p ; return *this; }
+ namedFn& val(double p) { _val = p ; return *this; }
+ namedFn& dim(int p) { _dim = p ; return *this; }
+
+ run() {
+ std::cout << "Here comes the function itself\n" <<
+ << "With parameters "
+ << _id << ", " << _val << ", " << _dim << std::endl;
+ }
+};
+\endcode
+
+Then you can use it like this.
+
+\code
+namedFn().id(3).val(2).run();
+\endcode
+
+The trick is obvious, each "named parameter" changes one component of
+the underlying class, then gives back a reference to it. Finally,
+run() executes the algorithm itself.
+
+\note Although it is a class, namedFn is used pretty much like as it were
+a function. That it why we called it namedFn instead of \c NamedFn.
+
+\note In fact, the final .run() could be made unnecessary,
+because the algorithm could also be implemented in the destructor of
+\c namedFn instead. This however would make it impossible to implement
+functions with return values, and would also cause serious problems when
+implementing \ref named-templ-func-param "named template parameters".
+Therefore, by convention, .run() must be used
+explicitly to execute a function having named parameters
+everywhere in LEMON.
+
+\section named-templ-func-param Named Function Template Parameters
+
+A named parameter can also be a template function. The usage is
+exactly the same, but the implementation behind is a kind of black
+magic and they are the dirtiest part of the LEMON code.
+
+You will probably never need to know how it works, but if you really
+committed, have a look at \ref lemon/graph_to_eps.h for an example.
+
+\section traits-classes Traits Classes
+
+A similar game can also be played when defining classes. In this case
+the type of the class attributes can be changed. Initially we have to
+define a special class called Traits Class defining the
+default type of the attributes. Then the types of these attributes can
+be changed in the same way as described in the next section.
+
+See \ref lemon::DijkstraDefaultTraits for an
+example how a traits class implementation looks like.
+
+\section named-templ-param Named Class Template Parameters
+
+If we would like to change the type of an attribute in a class that
+was instantiated by using a traits class as a template parameter, and
+the class contains named parameters, we do not have to instantiate again
+the class with new traits class, but instead adaptor classes can
+be used as shown in the following example.
+
+\code
+Dijkstra<>::SetPredMap >::Create
+\endcode
+
+It can also be used in conjunction with other named template
+parameters in arbitrary order.
+
+\code
+Dijkstra<>::SetDistMap::SetPredMap >::Create
+\endcode
+
+The result will be an instantiated Dijkstra class, in which the
+DistMap and the PredMap is modified.
+
+*/
diff --git a/lemon/arg_parser.h b/lemon/arg_parser.h
--- a/lemon/arg_parser.h
+++ b/lemon/arg_parser.h
@@ -16,8 +16,8 @@
*
*/
-#ifndef LEMON_ARG_PARSER
-#define LEMON_ARG_PARSER
+#ifndef LEMON_ARG_PARSER_H
+#define LEMON_ARG_PARSER_H
#include
#include