[med-svn] [libbpp-core] 01/04: New upstream version 2.3.2

Julien Dutheil jdutheil-guest at moszumanska.debian.org
Mon Feb 5 12:32:05 UTC 2018


This is an automated email from the git hooks/post-receive script.

jdutheil-guest pushed a commit to branch master
in repository libbpp-core.

commit 30596ab287895f3a9a34bade3a3380c690e5a589
Author: Julien Y. Dutheil <dutheil at evolbio.mpg.de>
Date:   Mon Feb 5 13:13:06 2018 +0100

    New upstream version 2.3.2
---
 .clang-format                                      |    8 +
 .gitignore                                         |    1 +
 Doxyfile                                           |  479 +--
 bpp_format.py                                      |  546 +++
 src/Bpp/App/ApplicationTools.cpp                   |   59 +-
 src/Bpp/App/ApplicationTools.h                     |   24 +-
 src/Bpp/App/BppApplication.h                       |    2 +-
 src/Bpp/App/NumCalcApplicationTools.cpp            |    4 +-
 src/Bpp/App/NumCalcApplicationTools.h              |    4 +-
 src/Bpp/BppBoolean.h                               |  121 +-
 src/Bpp/BppString.cpp                              |  104 +-
 src/Bpp/BppString.h                                |  138 +-
 src/Bpp/BppVector.h                                |  147 +-
 src/Bpp/Clonable.h                                 |  118 +-
 src/Bpp/Exceptions.cpp                             |  216 +-
 src/Bpp/Exceptions.h                               |  492 +--
 src/Bpp/Graph/AssociationDAGraphImplObserver.h     |   14 +-
 src/Bpp/Graph/AssociationDAGraphObserver.h         |    4 +
 src/Bpp/Graph/AssociationGraphImplObserver.h       |  128 +-
 src/Bpp/Graph/AssociationGraphObserver.h           |    2 +
 src/Bpp/Graph/AssociationTreeGraphImplObserver.h   |   14 +-
 src/Bpp/Graph/AssociationTreeGraphObserver.h       |    6 +-
 src/Bpp/Graph/GlobalGraph.cpp                      |   83 +-
 src/Bpp/Graph/TreeGraph.h                          |    4 +
 src/Bpp/Graph/TreeGraphImpl.h                      |  894 ++---
 src/Bpp/Graphics/AbstractGraphicDevice.h           |    2 +-
 src/Bpp/Graphics/ColorManager.h                    |    4 +-
 src/Bpp/Graphics/ColorSet.h                        |    8 +-
 src/Bpp/Graphics/Fig/XFigGraphicDevice.cpp         |    2 +-
 src/Bpp/Graphics/Fig/XFigGraphicDevice.h           |    4 +-
 src/Bpp/Graphics/Font/FontManager.h                |    8 +-
 src/Bpp/Graphics/GraphicDevice.h                   |    2 +-
 src/Bpp/Graphics/Latex/PgfGraphicDevice.cpp        |    4 +-
 src/Bpp/Graphics/Latex/PgfGraphicDevice.h          |    4 +-
 src/Bpp/Graphics/Svg/SvgGraphicDevice.cpp          |    2 +-
 src/Bpp/Graphics/Svg/SvgGraphicDevice.h            |    2 +-
 src/Bpp/Io/BppODiscreteDistributionFormat.cpp      |    2 +-
 src/Bpp/Io/BppODiscreteDistributionFormat.h        |    2 +-
 src/Bpp/Io/FileTools.cpp                           |    4 +-
 src/Bpp/Io/IoDiscreteDistributionFactory.cpp       |    4 +-
 src/Bpp/Io/IoDiscreteDistributionFactory.h         |    4 +-
 src/Bpp/Numeric/AbstractParameterAliasable.cpp     |    2 -
 src/Bpp/Numeric/AbstractParameterAliasable.h       |   12 +-
 src/Bpp/Numeric/AbstractParametrizable.h           |   25 +-
 src/Bpp/Numeric/AutoParameter.cpp                  |    4 +-
 src/Bpp/Numeric/AutoParameter.h                    |    4 +-
 src/Bpp/Numeric/DataTable.cpp                      |   37 +-
 src/Bpp/Numeric/DataTable.h                        |   67 +-
 .../Numeric/Function/AbstractNumericalDerivative.h |   10 +-
 src/Bpp/Numeric/Function/AbstractOptimizer.cpp     |    6 +-
 src/Bpp/Numeric/Function/AbstractOptimizer.h       |   12 +-
 src/Bpp/Numeric/Function/BfgsMultiDimensions.cpp   |    4 +-
 src/Bpp/Numeric/Function/BfgsMultiDimensions.h     |    4 +-
 src/Bpp/Numeric/Function/BrentOneDimension.cpp     |    6 +-
 src/Bpp/Numeric/Function/BrentOneDimension.h       |    6 +-
 .../Function/ConjugateGradientMultiDimensions.cpp  |    4 +-
 .../Function/ConjugateGradientMultiDimensions.h    |    4 +-
 src/Bpp/Numeric/Function/DirectionFunction.cpp     |    5 +-
 src/Bpp/Numeric/Function/DirectionFunction.h       |    7 +-
 src/Bpp/Numeric/Function/DownhillSimplexMethod.cpp |    6 +-
 src/Bpp/Numeric/Function/DownhillSimplexMethod.h   |    6 +-
 .../Function/FivePointsNumericalDerivative.cpp     |    1 -
 .../Function/FivePointsNumericalDerivative.h       |    6 +-
 src/Bpp/Numeric/Function/FunctionTools.cpp         |    8 +-
 src/Bpp/Numeric/Function/FunctionTools.h           |   10 +-
 src/Bpp/Numeric/Function/Functions.h               |   64 +-
 src/Bpp/Numeric/Function/GoldenSectionSearch.cpp   |    6 +-
 src/Bpp/Numeric/Function/GoldenSectionSearch.h     |    6 +-
 src/Bpp/Numeric/Function/MetaOptimizer.cpp         |    3 +-
 src/Bpp/Numeric/Function/MetaOptimizer.h           |    4 +-
 .../Function/NewtonBacktrackOneDimension.cpp       |    4 +-
 .../Numeric/Function/NewtonBacktrackOneDimension.h |    4 +-
 src/Bpp/Numeric/Function/NewtonOneDimension.cpp    |    4 +-
 src/Bpp/Numeric/Function/NewtonOneDimension.h      |    4 +-
 src/Bpp/Numeric/Function/Optimizer.h               |    8 +-
 src/Bpp/Numeric/Function/PowellMultiDimensions.cpp |    6 +-
 src/Bpp/Numeric/Function/PowellMultiDimensions.h   |    6 +-
 .../Function/ReparametrizationFunctionWrapper.h    |    9 +-
 src/Bpp/Numeric/Function/SimpleMultiDimensions.cpp |    4 +-
 src/Bpp/Numeric/Function/SimpleMultiDimensions.h   |    4 +-
 .../Function/SimpleNewtonMultiDimensions.cpp       |    4 +-
 .../Numeric/Function/SimpleNewtonMultiDimensions.h |    4 +-
 .../Function/ThreePointsNumericalDerivative.cpp    |    1 -
 .../Function/ThreePointsNumericalDerivative.h      |    5 +-
 .../Function/TwoPointsNumericalDerivative.cpp      |    1 -
 .../Function/TwoPointsNumericalDerivative.h        |    7 +-
 .../Numeric/Hmm/AbstractHmmTransitionMatrix.cpp    |    2 +-
 src/Bpp/Numeric/Hmm/AbstractHmmTransitionMatrix.h  |    2 +-
 src/Bpp/Numeric/Hmm/HmmEmissionProbabilities.h     |    2 +-
 src/Bpp/Numeric/Hmm/HmmLikelihood.cpp              |    4 +-
 src/Bpp/Numeric/Hmm/HmmLikelihood.h                |    8 +-
 src/Bpp/Numeric/Hmm/HmmStateAlphabet.h             |    2 +-
 src/Bpp/Numeric/Hmm/HmmTransitionMatrix.h          |    2 +-
 src/Bpp/Numeric/Hmm/LogsumHmmLikelihood.cpp        |    4 +-
 src/Bpp/Numeric/Hmm/LogsumHmmLikelihood.h          |    8 +-
 .../Numeric/Hmm/LowMemoryRescaledHmmLikelihood.cpp |    2 +-
 .../Numeric/Hmm/LowMemoryRescaledHmmLikelihood.h   |    8 +-
 src/Bpp/Numeric/Hmm/RescaledHmmLikelihood.cpp      |    4 +-
 src/Bpp/Numeric/Hmm/RescaledHmmLikelihood.h        |    8 +-
 src/Bpp/Numeric/IntegerTools.h                     |   86 +
 src/Bpp/Numeric/Matrix/LUDecomposition.h           |    4 +-
 src/Bpp/Numeric/Matrix/Matrix.h                    |    9 +-
 src/Bpp/Numeric/Matrix/MatrixTools.h               |  194 +-
 src/Bpp/Numeric/NumTools.cpp                       |    2 +-
 src/Bpp/Numeric/NumTools.h                         |    2 +-
 src/Bpp/Numeric/Parameter.cpp                      |    8 +-
 src/Bpp/Numeric/Parameter.h                        |    8 +-
 src/Bpp/Numeric/ParameterAliasable.h               |    8 +-
 src/Bpp/Numeric/ParameterExceptions.h              |    6 +-
 src/Bpp/Numeric/ParameterList.cpp                  |   39 +-
 src/Bpp/Numeric/ParameterList.h                    |   53 +-
 src/Bpp/Numeric/Parametrizable.h                   |   35 +-
 .../Numeric/Prob/AbstractDiscreteDistribution.h    |    4 +-
 src/Bpp/Numeric/Prob/BetaDiscreteDistribution.h    |    2 +-
 src/Bpp/Numeric/Prob/ConstantDistribution.h        |    2 +-
 src/Bpp/Numeric/Prob/DiscreteDistribution.h        |    2 +-
 .../Numeric/Prob/ExponentialDiscreteDistribution.h |    2 +-
 src/Bpp/Numeric/Prob/GammaDiscreteDistribution.h   |    2 +-
 .../Numeric/Prob/GaussianDiscreteDistribution.h    |    2 +-
 src/Bpp/Numeric/Prob/Simplex.cpp                   |   11 +-
 .../TruncatedExponentialDiscreteDistribution.h     |    2 +-
 src/Bpp/Numeric/Prob/UniformDiscreteDistribution.h |    2 +-
 src/Bpp/Numeric/Random/RandomTools.h               |   12 +-
 .../Numeric/Stat/Mva/CorrespondenceAnalysis.cpp    |    2 +-
 src/Bpp/Numeric/Stat/Mva/CorrespondenceAnalysis.h  |    5 +-
 src/Bpp/Numeric/Stat/Mva/DualityDiagram.cpp        |    6 +-
 src/Bpp/Numeric/Stat/Mva/DualityDiagram.h          |   24 +-
 .../Stat/Mva/PrincipalComponentAnalysis.cpp        |    8 +-
 .../Numeric/Stat/Mva/PrincipalComponentAnalysis.h  |   14 +-
 src/Bpp/Numeric/Table.h                            |   76 +-
 src/Bpp/Numeric/TableExceptions.h                  |   18 +-
 src/Bpp/Numeric/TransformedParameter.h             |   24 +-
 src/Bpp/Numeric/VectorExceptions.h                 |  238 +-
 src/Bpp/Numeric/VectorTools.h                      | 3526 ++++++++++----------
 src/Bpp/Text/KeyvalTools.cpp                       |    8 +-
 src/Bpp/Text/KeyvalTools.h                         |    8 +-
 src/Bpp/Text/NestedStringTokenizer.cpp             |    5 +-
 src/Bpp/Text/NestedStringTokenizer.h               |    4 +-
 src/Bpp/Text/StringTokenizer.h                     |    2 +-
 src/Bpp/Text/TextTools.cpp                         |  828 +++--
 src/Bpp/Text/TextTools.h                           |  287 +-
 src/Bpp/Utils/AttributesTools.cpp                  |    3 +-
 src/Bpp/Utils/AttributesTools.h                    |    4 +-
 test/PolynomialFunction.h                          |   10 +-
 test/doctest.h                                     | 3488 +++++++++++++++++++
 test/test_distributions.cpp                        |    4 +-
 test/test_graphObs.cpp                             |   33 +-
 test/test_reparametrization.cpp                    |    5 +-
 test/test_text_tools.cpp                           |  295 +-
 149 files changed, 8740 insertions(+), 4822 deletions(-)

diff --git a/.clang-format b/.clang-format
new file mode 100644
index 0000000..e6b8f1c
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,8 @@
+BasedOnStyle: Mozilla
+Cpp11BracedListStyle: true
+BreakBeforeBraces: Allman
+NamespaceIndentation: All
+AlwaysBreakAfterReturnType: None
+AlwaysBreakAfterDefinitionReturnType: None
+CommentPragmas: ^\*
+ColumnLimit: 120
diff --git a/.gitignore b/.gitignore
index 13d3d06..f1e8e92 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,6 +8,7 @@ Makefile
 html
 install_manifest.txt
 libbpp-core.*
+.clang_complete
 
 # file to be specifically not ignored by previous rules
 
diff --git a/Doxyfile b/Doxyfile
index df39478..636c6aa 100644
--- a/Doxyfile
+++ b/Doxyfile
@@ -1,4 +1,4 @@
-# Doxyfile 1.8.11
+# Doxyfile 1.8.7
 
 # This file describes the settings to be used by the documentation system
 # doxygen (www.doxygen.org) for a project.
@@ -44,23 +44,23 @@ PROJECT_NUMBER         = 2.3.0
 # for a project that appears at the top of each page and should give viewer a
 # quick idea about the purpose of the project. Keep the description short.
 
-PROJECT_BRIEF          = 
+PROJECT_BRIEF          =
 
-# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
-# in the documentation. The maximum height of the logo should not exceed 55
-# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
-# the logo to the output directory.
+# With the PROJECT_LOGO tag one can specify an logo or icon that is included in
+# the documentation. The maximum height of the logo should not exceed 55 pixels
+# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo
+# to the output directory.
 
-PROJECT_LOGO           = 
+PROJECT_LOGO           =
 
 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
 # into which the generated documentation will be written. If a relative path is
 # entered, it will be relative to the location where doxygen was started. If
 # left blank the current directory will be used.
 
-OUTPUT_DIRECTORY       = 
+OUTPUT_DIRECTORY       =
 
-# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub-
 # directories (in 2 levels) under the output directory of each output format and
 # will distribute the generated files over these directories. Enabling this
 # option can be useful when feeding doxygen a huge amount of source files, where
@@ -93,14 +93,14 @@ ALLOW_UNICODE_NAMES    = NO
 
 OUTPUT_LANGUAGE        = English
 
-# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member
+# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member
 # descriptions after the members that are listed in the file and class
 # documentation (similar to Javadoc). Set to NO to disable this.
 # The default value is: YES.
 
 BRIEF_MEMBER_DESC      = YES
 
-# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief
+# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief
 # description of a member or function before the detailed description
 #
 # Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
@@ -118,7 +118,7 @@ REPEAT_BRIEF           = YES
 # the entity):The $name class, The $name widget, The $name file, is, provides,
 # specifies, contains, represents, a, an and the.
 
-ABBREVIATE_BRIEF       = 
+ABBREVIATE_BRIEF       =
 
 # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
 # doxygen will generate a detailed section even if there is only a brief
@@ -135,7 +135,7 @@ ALWAYS_DETAILED_SEC    = NO
 
 INLINE_INHERITED_MEMB  = YES
 
-# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path
+# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path
 # before files name in the file list and in the header files. If set to NO the
 # shortest path that makes the file name unique will be used
 # The default value is: YES.
@@ -205,9 +205,9 @@ MULTILINE_CPP_IS_BRIEF = NO
 
 INHERIT_DOCS           = YES
 
-# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new
-# page for each member. If set to NO, the documentation of a member will be part
-# of the file/class/namespace that contains it.
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a
+# new page for each member. If set to NO, the documentation of a member will be
+# part of the file/class/namespace that contains it.
 # The default value is: NO.
 
 SEPARATE_MEMBER_PAGES  = NO
@@ -228,13 +228,13 @@ TAB_SIZE               = 2
 # "Side Effects:". You can put \n's in the value part of an alias to insert
 # newlines.
 
-ALIASES                = 
+ALIASES                =
 
 # This tag can be used to specify a number of word-keyword mappings (TCL only).
 # A mapping has the form "name=value". For example adding "class=itcl::class"
 # will allow you to use the command class in the itcl::class meaning.
 
-TCL_SUBST              = 
+TCL_SUBST              =
 
 # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
 # only. Doxygen will then generate output that is more tailored for C. For
@@ -276,12 +276,12 @@ OPTIMIZE_OUTPUT_VHDL   = NO
 # instance to make doxygen treat .inc files as Fortran files (default is PHP),
 # and .f files as C (default is Fortran), use: inc=Fortran f=C.
 #
-# Note: For files without extension you can use no_extension as a placeholder.
+# Note For files without extension you can use no_extension as a placeholder.
 #
 # Note that for custom extensions you also need to set FILE_PATTERNS otherwise
 # the files are not read by doxygen.
 
-EXTENSION_MAPPING      = 
+EXTENSION_MAPPING      =
 
 # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
 # according to the Markdown format, which allows for more readable
@@ -295,8 +295,8 @@ MARKDOWN_SUPPORT       = YES
 
 # When enabled doxygen tries to link words that correspond to documented
 # classes, or namespaces to their corresponding documentation. Such a link can
-# be prevented in individual cases by putting a % sign in front of the word or
-# globally by setting AUTOLINK_SUPPORT to NO.
+# be prevented in individual cases by by putting a % sign in front of the word
+# or globally by setting AUTOLINK_SUPPORT to NO.
 # The default value is: YES.
 
 AUTOLINK_SUPPORT       = YES
@@ -336,20 +336,13 @@ SIP_SUPPORT            = NO
 IDL_PROPERTY_SUPPORT   = YES
 
 # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
-# tag is set to YES then doxygen will reuse the documentation of the first
+# tag is set to YES, then doxygen will reuse the documentation of the first
 # member in the group (if any) for the other members of the group. By default
 # all members of a group must be documented explicitly.
 # The default value is: NO.
 
 DISTRIBUTE_GROUP_DOC   = NO
 
-# If one adds a struct or class to a group and this option is enabled, then also
-# any nested class or struct is added to the same group. By default this option
-# is disabled and one has to add nested compounds explicitly via \ingroup.
-# The default value is: NO.
-
-GROUP_NESTED_COMPOUNDS = NO
-
 # Set the SUBGROUPING tag to YES to allow class member groups of the same type
 # (for instance a group of public functions) to be put as a subgroup of that
 # type (e.g. under the Public Functions section). Set it to NO to prevent
@@ -408,7 +401,7 @@ LOOKUP_CACHE_SIZE      = 0
 # Build related configuration options
 #---------------------------------------------------------------------------
 
-# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
 # documentation are documented, even if no documentation was available. Private
 # class members and static file members will be hidden unless the
 # EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
@@ -418,35 +411,35 @@ LOOKUP_CACHE_SIZE      = 0
 
 EXTRACT_ALL            = YES
 
-# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will
 # be included in the documentation.
 # The default value is: NO.
 
 EXTRACT_PRIVATE        = YES
 
-# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal
+# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal
 # scope will be included in the documentation.
 # The default value is: NO.
 
 EXTRACT_PACKAGE        = NO
 
-# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be
+# If the EXTRACT_STATIC tag is set to YES all static members of a file will be
 # included in the documentation.
 # The default value is: NO.
 
 EXTRACT_STATIC         = YES
 
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined
-# locally in source files will be included in the documentation. If set to NO,
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined
+# locally in source files will be included in the documentation. If set to NO
 # only classes defined in header files are included. Does not have any effect
 # for Java sources.
 # The default value is: YES.
 
 EXTRACT_LOCAL_CLASSES  = YES
 
-# This flag is only useful for Objective-C code. If set to YES, local methods,
+# This flag is only useful for Objective-C code. When set to YES local methods,
 # which are defined in the implementation section but not in the interface are
-# included in the documentation. If set to NO, only methods in the interface are
+# included in the documentation. If set to NO only methods in the interface are
 # included.
 # The default value is: NO.
 
@@ -471,21 +464,21 @@ HIDE_UNDOC_MEMBERS     = NO
 
 # If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
 # undocumented classes that are normally visible in the class hierarchy. If set
-# to NO, these classes will be included in the various overviews. This option
-# has no effect if EXTRACT_ALL is enabled.
+# to NO these classes will be included in the various overviews. This option has
+# no effect if EXTRACT_ALL is enabled.
 # The default value is: NO.
 
 HIDE_UNDOC_CLASSES     = NO
 
 # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
-# (class|struct|union) declarations. If set to NO, these declarations will be
+# (class|struct|union) declarations. If set to NO these declarations will be
 # included in the documentation.
 # The default value is: NO.
 
 HIDE_FRIEND_COMPOUNDS  = NO
 
 # If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
-# documentation blocks found inside the body of a function. If set to NO, these
+# documentation blocks found inside the body of a function. If set to NO these
 # blocks will be appended to the function's detailed documentation block.
 # The default value is: NO.
 
@@ -499,7 +492,7 @@ HIDE_IN_BODY_DOCS      = NO
 INTERNAL_DOCS          = NO
 
 # If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
-# names in lower-case letters. If set to YES, upper-case letters are also
+# names in lower-case letters. If set to YES upper-case letters are also
 # allowed. This is useful if you have classes or files whose names only differ
 # in case and if your file system supports case sensitive file names. Windows
 # and Mac users are advised to set this option to NO.
@@ -508,19 +501,12 @@ INTERNAL_DOCS          = NO
 CASE_SENSE_NAMES       = YES
 
 # If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
-# their full class and namespace scopes in the documentation. If set to YES, the
+# their full class and namespace scopes in the documentation. If set to YES the
 # scope will be hidden.
 # The default value is: NO.
 
 HIDE_SCOPE_NAMES       = NO
 
-# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will
-# append additional text to a page's title, such as Class Reference. If set to
-# YES the compound reference will be hidden.
-# The default value is: NO.
-
-HIDE_COMPOUND_REFERENCE= NO
-
 # If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
 # the files that are included by a file in the documentation of that file.
 # The default value is: YES.
@@ -548,14 +534,14 @@ INLINE_INFO            = YES
 
 # If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
 # (detailed) documentation of file and class members alphabetically by member
-# name. If set to NO, the members will appear in declaration order.
+# name. If set to NO the members will appear in declaration order.
 # The default value is: YES.
 
 SORT_MEMBER_DOCS       = YES
 
 # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
 # descriptions of file, namespace and class members alphabetically by member
-# name. If set to NO, the members will appear in declaration order. Note that
+# name. If set to NO the members will appear in declaration order. Note that
 # this will also influence the order of the classes in the class list.
 # The default value is: NO.
 
@@ -600,25 +586,27 @@ SORT_BY_SCOPE_NAME     = NO
 
 STRICT_PROTO_MATCHING  = NO
 
-# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo
-# list. This list is created by putting \todo commands in the documentation.
+# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the
+# todo list. This list is created by putting \todo commands in the
+# documentation.
 # The default value is: YES.
 
 GENERATE_TODOLIST      = YES
 
-# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test
-# list. This list is created by putting \test commands in the documentation.
+# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the
+# test list. This list is created by putting \test commands in the
+# documentation.
 # The default value is: YES.
 
 GENERATE_TESTLIST      = NO
 
-# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug
+# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug
 # list. This list is created by putting \bug commands in the documentation.
 # The default value is: YES.
 
 GENERATE_BUGLIST       = NO
 
-# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO)
+# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO)
 # the deprecated list. This list is created by putting \deprecated commands in
 # the documentation.
 # The default value is: YES.
@@ -629,7 +617,7 @@ GENERATE_DEPRECATEDLIST= YES
 # sections, marked by \if <section_label> ... \endif and \cond <section_label>
 # ... \endcond blocks.
 
-ENABLED_SECTIONS       = 
+ENABLED_SECTIONS       =
 
 # The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
 # initial value of a variable or macro / define can have for it to appear in the
@@ -643,8 +631,8 @@ ENABLED_SECTIONS       =
 MAX_INITIALIZER_LINES  = 30
 
 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
-# the bottom of the documentation of classes and structs. If set to YES, the
-# list will mention the files that were used to generate the documentation.
+# the bottom of the documentation of classes and structs. If set to YES the list
+# will mention the files that were used to generate the documentation.
 # The default value is: YES.
 
 SHOW_USED_FILES        = YES
@@ -671,7 +659,7 @@ SHOW_NAMESPACES        = YES
 # by doxygen. Whatever the program writes to standard output is used as the file
 # version. For an example see the documentation.
 
-FILE_VERSION_FILTER    = 
+FILE_VERSION_FILTER    =
 
 # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
 # by doxygen. The layout file controls the global structure of the generated
@@ -684,7 +672,7 @@ FILE_VERSION_FILTER    =
 # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
 # tag is left empty.
 
-LAYOUT_FILE            = 
+LAYOUT_FILE            =
 
 # The CITE_BIB_FILES tag can be used to specify one or more bib files containing
 # the reference definitions. This must be a list of .bib files. The .bib
@@ -692,9 +680,10 @@ LAYOUT_FILE            =
 # to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.
 # For LaTeX the style of the bibliography can be controlled using
 # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
-# search path. See also \cite for info how to create references.
+# search path. Do not use file names with spaces, bibtex cannot handle them. See
+# also \cite for info how to create references.
 
-CITE_BIB_FILES         = 
+CITE_BIB_FILES         =
 
 #---------------------------------------------------------------------------
 # Configuration options related to warning and progress messages
@@ -708,7 +697,7 @@ CITE_BIB_FILES         =
 QUIET                  = NO
 
 # The WARNINGS tag can be used to turn on/off the warning messages that are
-# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES
+# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES
 # this implies that the warnings are on.
 #
 # Tip: Turn warnings on while writing the documentation.
@@ -716,7 +705,7 @@ QUIET                  = NO
 
 WARNINGS               = YES
 
-# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate
+# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate
 # warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
 # will automatically be disabled.
 # The default value is: YES.
@@ -733,18 +722,12 @@ WARN_IF_DOC_ERROR      = YES
 
 # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
 # are documented, but have no documentation for their parameters or return
-# value. If set to NO, doxygen will only warn about wrong or incomplete
-# parameter documentation, but not about the absence of documentation.
+# value. If set to NO doxygen will only warn about wrong or incomplete parameter
+# documentation, but not about the absence of documentation.
 # The default value is: NO.
 
 WARN_NO_PARAMDOC       = NO
 
-# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when
-# a warning is encountered.
-# The default value is: NO.
-
-WARN_AS_ERROR          = NO
-
 # The WARN_FORMAT tag determines the format of the warning messages that doxygen
 # can produce. The string should contain the $file, $line, and $text tags, which
 # will be replaced by the file and line number from which the warning originated
@@ -759,7 +742,7 @@ WARN_FORMAT            = "$file:$line: $text"
 # messages should be written. If left blank the output is written to standard
 # error (stderr).
 
-WARN_LOGFILE           = 
+WARN_LOGFILE           =
 
 #---------------------------------------------------------------------------
 # Configuration options related to the input files
@@ -768,7 +751,7 @@ WARN_LOGFILE           =
 # The INPUT tag is used to specify the files and/or directories that contain
 # documented source files. You may enter file names like myfile.cpp or
 # directories like /usr/src/myproject. Separate the files or directories with
-# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
+# spaces.
 # Note: If this tag is empty the current directory is searched.
 
 INPUT                  = src
@@ -784,17 +767,12 @@ INPUT_ENCODING         = UTF-8
 
 # If the value of the INPUT tag contains directories, you can use the
 # FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
-# *.h) to filter out the source-files in the directories.
-#
-# Note that for custom extensions or not directly supported extensions you also
-# need to set EXTENSION_MAPPING for the extension otherwise the files are not
-# read by doxygen.
-#
-# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
-# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
-# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc,
-# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f, *.for, *.tcl,
-# *.vhd, *.vhdl, *.ucf, *.qsf, *.as and *.js.
+# *.h) to filter out the source-files in the directories. If left blank the
+# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii,
+# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp,
+# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown,
+# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf,
+# *.qsf, *.as and *.js.
 
 FILE_PATTERNS          = *.h \
                          *.cpp
@@ -812,7 +790,7 @@ RECURSIVE              = YES
 # Note that relative paths are relative to the directory from which doxygen is
 # run.
 
-EXCLUDE                = 
+EXCLUDE                =
 
 # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
 # directories that are symbolic links (a Unix file system feature) are excluded
@@ -828,7 +806,7 @@ EXCLUDE_SYMLINKS       = NO
 # Note that the wildcards are matched against the file with absolute path, so to
 # exclude all test directories for example use the pattern */test/*
 
-EXCLUDE_PATTERNS       = 
+EXCLUDE_PATTERNS       =
 
 # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
 # (namespaces, classes, functions, etc.) that should be excluded from the
@@ -839,20 +817,20 @@ EXCLUDE_PATTERNS       =
 # Note that the wildcards are matched against the file with absolute path, so to
 # exclude all test directories use the pattern */test/*
 
-EXCLUDE_SYMBOLS        = 
+EXCLUDE_SYMBOLS        =
 
 # The EXAMPLE_PATH tag can be used to specify one or more files or directories
 # that contain example code fragments that are included (see the \include
 # command).
 
-EXAMPLE_PATH           = 
+EXAMPLE_PATH           =
 
 # If the value of the EXAMPLE_PATH tag contains directories, you can use the
 # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
 # *.h) to filter out the source-files in the directories. If left blank all
 # files are included.
 
-EXAMPLE_PATTERNS       = 
+EXAMPLE_PATTERNS       =
 
 # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
 # searched for input files to be used with the \include or \dontinclude commands
@@ -865,7 +843,7 @@ EXAMPLE_RECURSIVE      = NO
 # that contain images that are to be included in the documentation (see the
 # \image command).
 
-IMAGE_PATH             = 
+IMAGE_PATH             =
 
 # The INPUT_FILTER tag can be used to specify a program that doxygen should
 # invoke to filter for each input file. Doxygen will invoke the filter program
@@ -881,12 +859,8 @@ IMAGE_PATH             =
 # Note that the filter must not add or remove lines; it is applied before the
 # code is scanned, but not when the output code is generated. If lines are added
 # or removed, the anchors will not be placed correctly.
-#
-# Note that for custom extensions or not directly supported extensions you also
-# need to set EXTENSION_MAPPING for the extension otherwise the files are not
-# properly processed by doxygen.
 
-INPUT_FILTER           = 
+INPUT_FILTER           =
 
 # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
 # basis. Doxygen will compare the file name with each pattern and apply the
@@ -894,15 +868,11 @@ INPUT_FILTER           =
 # (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
 # filters are used. If the FILTER_PATTERNS tag is empty or if none of the
 # patterns match the file name, INPUT_FILTER is applied.
-#
-# Note that for custom extensions or not directly supported extensions you also
-# need to set EXTENSION_MAPPING for the extension otherwise the files are not
-# properly processed by doxygen.
 
-FILTER_PATTERNS        = 
+FILTER_PATTERNS        =
 
 # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
-# INPUT_FILTER) will also be used to filter the input files that are used for
+# INPUT_FILTER ) will also be used to filter the input files that are used for
 # producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
 # The default value is: NO.
 
@@ -914,14 +884,14 @@ FILTER_SOURCE_FILES    = NO
 # *.ext= (so without naming a filter).
 # This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
 
-FILTER_SOURCE_PATTERNS = 
+FILTER_SOURCE_PATTERNS =
 
 # If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
 # is part of the input, its contents will be placed on the main page
 # (index.html). This can be useful if you have a project on for instance GitHub
 # and want to reuse the introduction page also for the doxygen output.
 
-USE_MDFILE_AS_MAINPAGE = 
+USE_MDFILE_AS_MAINPAGE =
 
 #---------------------------------------------------------------------------
 # Configuration options related to source browsing
@@ -962,7 +932,7 @@ REFERENCED_BY_RELATION = YES
 REFERENCES_RELATION    = YES
 
 # If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
-# to YES then the hyperlinks from functions in REFERENCES_RELATION and
+# to YES, then the hyperlinks from functions in REFERENCES_RELATION and
 # REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
 # link to the documentation.
 # The default value is: YES.
@@ -1009,25 +979,6 @@ USE_HTAGS              = NO
 
 VERBATIM_HEADERS       = YES
 
-# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the
-# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the
-# cost of reduced performance. This can be particularly helpful with template
-# rich C++ code for which doxygen's built-in parser lacks the necessary type
-# information.
-# Note: The availability of this option depends on whether or not doxygen was
-# generated with the -Duse-libclang=ON option for CMake.
-# The default value is: NO.
-
-CLANG_ASSISTED_PARSING = NO
-
-# If clang assisted parsing is enabled you can provide the compiler with command
-# line options that you would normally use when invoking the compiler. Note that
-# the include paths will already be set by doxygen for the files and directories
-# specified with INPUT and INCLUDE_PATH.
-# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES.
-
-CLANG_OPTIONS          = 
-
 #---------------------------------------------------------------------------
 # Configuration options related to the alphabetical class index
 #---------------------------------------------------------------------------
@@ -1052,13 +1003,13 @@ COLS_IN_ALPHA_INDEX    = 5
 # while generating the index headers.
 # This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
 
-IGNORE_PREFIX          = 
+IGNORE_PREFIX          =
 
 #---------------------------------------------------------------------------
 # Configuration options related to the HTML output
 #---------------------------------------------------------------------------
 
-# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output
+# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output
 # The default value is: YES.
 
 GENERATE_HTML          = YES
@@ -1096,7 +1047,7 @@ HTML_FILE_EXTENSION    = .html
 # of the possible markers and block names see the documentation.
 # This tag requires that the tag GENERATE_HTML is set to YES.
 
-HTML_HEADER            = 
+HTML_HEADER            =
 
 # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
 # generated HTML page. If the tag is left blank doxygen will generate a standard
@@ -1106,7 +1057,7 @@ HTML_HEADER            =
 # that doxygen normally uses.
 # This tag requires that the tag GENERATE_HTML is set to YES.
 
-HTML_FOOTER            = 
+HTML_FOOTER            =
 
 # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
 # sheet that is used by each HTML page. It can be used to fine-tune the look of
@@ -1118,20 +1069,18 @@ HTML_FOOTER            =
 # obsolete.
 # This tag requires that the tag GENERATE_HTML is set to YES.
 
-HTML_STYLESHEET        = 
+HTML_STYLESHEET        =
 
-# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined
-# cascading style sheets that are included after the standard style sheets
+# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user-
+# defined cascading style sheet that is included after the standard style sheets
 # created by doxygen. Using this option one can overrule certain style aspects.
 # This is preferred over using HTML_STYLESHEET since it does not replace the
-# standard style sheet and is therefore more robust against future updates.
-# Doxygen will copy the style sheet files to the output directory.
-# Note: The order of the extra style sheet files is of importance (e.g. the last
-# style sheet in the list overrules the setting of the previous ones in the
-# list). For an example see the documentation.
+# standard style sheet and is therefor more robust against future updates.
+# Doxygen will copy the style sheet file to the output directory. For an example
+# see the documentation.
 # This tag requires that the tag GENERATE_HTML is set to YES.
 
-HTML_EXTRA_STYLESHEET  = 
+HTML_EXTRA_STYLESHEET  =
 
 # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
 # other source files which should be copied to the HTML output directory. Note
@@ -1141,10 +1090,10 @@ HTML_EXTRA_STYLESHEET  =
 # files will be copied as-is; there are no commands or markers available.
 # This tag requires that the tag GENERATE_HTML is set to YES.
 
-HTML_EXTRA_FILES       = 
+HTML_EXTRA_FILES       =
 
 # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
-# will adjust the colors in the style sheet and background images according to
+# will adjust the colors in the stylesheet and background images according to
 # this color. Hue is specified as an angle on a colorwheel, see
 # http://en.wikipedia.org/wiki/Hue for more information. For instance the value
 # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
@@ -1175,9 +1124,8 @@ HTML_COLORSTYLE_GAMMA  = 80
 
 # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
 # page will contain the date and time when the page was generated. Setting this
-# to YES can help to show when doxygen was last run and thus if the
-# documentation is up to date.
-# The default value is: NO.
+# to NO can help when comparing the output of multiple runs.
+# The default value is: YES.
 # This tag requires that the tag GENERATE_HTML is set to YES.
 
 HTML_TIMESTAMP         = YES
@@ -1270,31 +1218,31 @@ GENERATE_HTMLHELP      = NO
 # written to the html output directory.
 # This tag requires that the tag GENERATE_HTMLHELP is set to YES.
 
-CHM_FILE               = 
+CHM_FILE               =
 
 # The HHC_LOCATION tag can be used to specify the location (absolute path
-# including file name) of the HTML help compiler (hhc.exe). If non-empty,
+# including file name) of the HTML help compiler ( hhc.exe). If non-empty
 # doxygen will try to run the HTML help compiler on the generated index.hhp.
 # The file has to be specified with full path.
 # This tag requires that the tag GENERATE_HTMLHELP is set to YES.
 
-HHC_LOCATION           = 
+HHC_LOCATION           =
 
-# The GENERATE_CHI flag controls if a separate .chi index file is generated
-# (YES) or that it should be included in the master .chm file (NO).
+# The GENERATE_CHI flag controls if a separate .chi index file is generated (
+# YES) or that it should be included in the master .chm file ( NO).
 # The default value is: NO.
 # This tag requires that the tag GENERATE_HTMLHELP is set to YES.
 
 GENERATE_CHI           = NO
 
-# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc)
+# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc)
 # and project file content.
 # This tag requires that the tag GENERATE_HTMLHELP is set to YES.
 
-CHM_INDEX_ENCODING     = 
+CHM_INDEX_ENCODING     =
 
-# The BINARY_TOC flag controls whether a binary table of contents is generated
-# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it
+# The BINARY_TOC flag controls whether a binary table of contents is generated (
+# YES) or a normal table of contents ( NO) in the .chm file. Furthermore it
 # enables the Previous and Next buttons.
 # The default value is: NO.
 # This tag requires that the tag GENERATE_HTMLHELP is set to YES.
@@ -1322,7 +1270,7 @@ GENERATE_QHP           = NO
 # the HTML output folder.
 # This tag requires that the tag GENERATE_QHP is set to YES.
 
-QCH_FILE               = 
+QCH_FILE               =
 
 # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
 # Project output. For more information please see Qt Help Project / Namespace
@@ -1347,7 +1295,7 @@ QHP_VIRTUAL_FOLDER     = doc
 # filters).
 # This tag requires that the tag GENERATE_QHP is set to YES.
 
-QHP_CUST_FILTER_NAME   = 
+QHP_CUST_FILTER_NAME   =
 
 # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
 # custom filter to add. For more information please see Qt Help Project / Custom
@@ -1355,21 +1303,21 @@ QHP_CUST_FILTER_NAME   =
 # filters).
 # This tag requires that the tag GENERATE_QHP is set to YES.
 
-QHP_CUST_FILTER_ATTRS  = 
+QHP_CUST_FILTER_ATTRS  =
 
 # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
 # project's filter section matches. Qt Help Project / Filter Attributes (see:
 # http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
 # This tag requires that the tag GENERATE_QHP is set to YES.
 
-QHP_SECT_FILTER_ATTRS  = 
+QHP_SECT_FILTER_ATTRS  =
 
 # The QHG_LOCATION tag can be used to specify the location of Qt's
 # qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
 # generated .qhp file.
 # This tag requires that the tag GENERATE_QHP is set to YES.
 
-QHG_LOCATION           = 
+QHG_LOCATION           =
 
 # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
 # generated, together with the HTML files, they form an Eclipse help plugin. To
@@ -1408,7 +1356,7 @@ DISABLE_INDEX          = NO
 # index structure (just like the one that is generated for HTML Help). For this
 # to work a browser that supports JavaScript, DHTML, CSS and frames is required
 # (i.e. any modern browser). Windows users are probably better off using the
-# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can
+# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can
 # further fine-tune the look of the index. As an example, the default style
 # sheet generated by doxygen has an example that shows how to put an image at
 # the root of the tree instead of the PROJECT_NAME. Since the tree basically has
@@ -1436,7 +1384,7 @@ ENUM_VALUES_PER_LINE   = 4
 
 TREEVIEW_WIDTH         = 250
 
-# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to
+# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to
 # external symbols imported via tag files in a separate window.
 # The default value is: NO.
 # This tag requires that the tag GENERATE_HTML is set to YES.
@@ -1465,7 +1413,7 @@ FORMULA_TRANSPARENT    = YES
 
 # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
 # http://www.mathjax.org) which uses client side Javascript for the rendering
-# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX
+# instead of using prerendered bitmaps. Use this if you do not have LaTeX
 # installed or if you want to formulas look prettier in the HTML output. When
 # enabled you may also need to install MathJax separately and configure the path
 # to it using the MATHJAX_RELPATH option.
@@ -1502,7 +1450,7 @@ MATHJAX_RELPATH        = http://www.mathjax.org/mathjax
 # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
 # This tag requires that the tag USE_MATHJAX is set to YES.
 
-MATHJAX_EXTENSIONS     = 
+MATHJAX_EXTENSIONS     =
 
 # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
 # of code that will be used on startup of the MathJax code. See the MathJax site
@@ -1510,7 +1458,7 @@ MATHJAX_EXTENSIONS     =
 # example see the documentation.
 # This tag requires that the tag USE_MATHJAX is set to YES.
 
-MATHJAX_CODEFILE       = 
+MATHJAX_CODEFILE       =
 
 # When the SEARCHENGINE tag is enabled doxygen will generate a search box for
 # the HTML output. The underlying search engine uses javascript and DHTML and
@@ -1551,7 +1499,7 @@ SERVER_BASED_SEARCH    = NO
 # external search engine pointed to by the SEARCHENGINE_URL option to obtain the
 # search results.
 #
-# Doxygen ships with an example indexer (doxyindexer) and search engine
+# Doxygen ships with an example indexer ( doxyindexer) and search engine
 # (doxysearch.cgi) which are based on the open source search engine library
 # Xapian (see: http://xapian.org/).
 #
@@ -1564,13 +1512,13 @@ EXTERNAL_SEARCH        = NO
 # The SEARCHENGINE_URL should point to a search engine hosted by a web server
 # which will return the search results when EXTERNAL_SEARCH is enabled.
 #
-# Doxygen ships with an example indexer (doxyindexer) and search engine
+# Doxygen ships with an example indexer ( doxyindexer) and search engine
 # (doxysearch.cgi) which are based on the open source search engine library
 # Xapian (see: http://xapian.org/). See the section "External Indexing and
 # Searching" for details.
 # This tag requires that the tag SEARCHENGINE is set to YES.
 
-SEARCHENGINE_URL       = 
+SEARCHENGINE_URL       =
 
 # When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
 # search data is written to a file for indexing by an external tool. With the
@@ -1586,7 +1534,7 @@ SEARCHDATA_FILE        = searchdata.xml
 # projects and redirect the results back to the right project.
 # This tag requires that the tag SEARCHENGINE is set to YES.
 
-EXTERNAL_SEARCH_ID     = 
+EXTERNAL_SEARCH_ID     =
 
 # The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
 # projects other than the one defined by this configuration file, but that are
@@ -1596,13 +1544,13 @@ EXTERNAL_SEARCH_ID     =
 # EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
 # This tag requires that the tag SEARCHENGINE is set to YES.
 
-EXTRA_SEARCH_MAPPINGS  = 
+EXTRA_SEARCH_MAPPINGS  =
 
 #---------------------------------------------------------------------------
 # Configuration options related to the LaTeX output
 #---------------------------------------------------------------------------
 
-# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.
+# If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output.
 # The default value is: YES.
 
 GENERATE_LATEX         = NO
@@ -1633,7 +1581,7 @@ LATEX_CMD_NAME         = latex
 
 MAKEINDEX_CMD_NAME     = makeindex
 
-# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX
+# If the COMPACT_LATEX tag is set to YES doxygen generates more compact LaTeX
 # documents. This may be useful for small projects and may help to save some
 # trees in general.
 # The default value is: NO.
@@ -1651,12 +1599,9 @@ COMPACT_LATEX          = NO
 PAPER_TYPE             = a4wide
 
 # The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
-# that should be included in the LaTeX output. The package can be specified just
-# by its name or with the correct syntax as to be used with the LaTeX
-# \usepackage command. To get the times font for instance you can specify :
-# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times}
-# To use the option intlimits with the amsmath package you can specify:
-# EXTRA_PACKAGES=[intlimits]{amsmath}
+# that should be included in the LaTeX output. To get the times font for
+# instance you can specify
+# EXTRA_PACKAGES=times
 # If left blank no extra packages will be included.
 # This tag requires that the tag GENERATE_LATEX is set to YES.
 
@@ -1670,35 +1615,22 @@ EXTRA_PACKAGES         = amsmath
 #
 # Note: Only use a user-defined header if you know what you are doing! The
 # following commands have a special meaning inside the header: $title,
-# $datetime, $date, $doxygenversion, $projectname, $projectnumber,
-# $projectbrief, $projectlogo. Doxygen will replace $title with the empty
-# string, for the replacement values of the other commands the user is referred
-# to HTML_HEADER.
+# $datetime, $date, $doxygenversion, $projectname, $projectnumber. Doxygen will
+# replace them by respectively the title of the page, the current date and time,
+# only the current date, the version number of doxygen, the project name (see
+# PROJECT_NAME), or the project number (see PROJECT_NUMBER).
 # This tag requires that the tag GENERATE_LATEX is set to YES.
 
-LATEX_HEADER           = 
+LATEX_HEADER           =
 
 # The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
 # generated LaTeX document. The footer should contain everything after the last
-# chapter. If it is left blank doxygen will generate a standard footer. See
-# LATEX_HEADER for more information on how to generate a default footer and what
-# special commands can be used inside the footer.
+# chapter. If it is left blank doxygen will generate a standard footer.
 #
 # Note: Only use a user-defined footer if you know what you are doing!
 # This tag requires that the tag GENERATE_LATEX is set to YES.
 
-LATEX_FOOTER           = 
-
-# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined
-# LaTeX style sheets that are included after the standard style sheets created
-# by doxygen. Using this option one can overrule certain style aspects. Doxygen
-# will copy the style sheet files to the output directory.
-# Note: The order of the extra style sheet files is of importance (e.g. the last
-# style sheet in the list overrules the setting of the previous ones in the
-# list).
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_EXTRA_STYLESHEET = 
+LATEX_FOOTER           =
 
 # The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
 # other source files which should be copied to the LATEX_OUTPUT output
@@ -1706,7 +1638,7 @@ LATEX_EXTRA_STYLESHEET =
 # markers available.
 # This tag requires that the tag GENERATE_LATEX is set to YES.
 
-LATEX_EXTRA_FILES      = 
+LATEX_EXTRA_FILES      =
 
 # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
 # prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
@@ -1717,8 +1649,8 @@ LATEX_EXTRA_FILES      =
 
 PDF_HYPERLINKS         = NO
 
-# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate
-# the PDF file directly from the LaTeX files. Set this option to YES, to get a
+# If the LATEX_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate
+# the PDF file directly from the LaTeX files. Set this option to YES to get a
 # higher quality PDF documentation.
 # The default value is: YES.
 # This tag requires that the tag GENERATE_LATEX is set to YES.
@@ -1759,19 +1691,11 @@ LATEX_SOURCE_CODE      = NO
 
 LATEX_BIB_STYLE        = plain
 
-# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated
-# page will contain the date and time when the page was generated. Setting this
-# to NO can help when comparing the output of multiple runs.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_TIMESTAMP        = NO
-
 #---------------------------------------------------------------------------
 # Configuration options related to the RTF output
 #---------------------------------------------------------------------------
 
-# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The
+# If the GENERATE_RTF tag is set to YES doxygen will generate RTF output. The
 # RTF output is optimized for Word 97 and may not look too pretty with other RTF
 # readers/editors.
 # The default value is: NO.
@@ -1786,7 +1710,7 @@ GENERATE_RTF           = NO
 
 RTF_OUTPUT             = rtf
 
-# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF
+# If the COMPACT_RTF tag is set to YES doxygen generates more compact RTF
 # documents. This may be useful for small projects and may help to save some
 # trees in general.
 # The default value is: NO.
@@ -1814,30 +1738,20 @@ RTF_HYPERLINKS         = NO
 # default style sheet that doxygen normally uses.
 # This tag requires that the tag GENERATE_RTF is set to YES.
 
-RTF_STYLESHEET_FILE    = 
+RTF_STYLESHEET_FILE    =
 
 # Set optional variables used in the generation of an RTF document. Syntax is
 # similar to doxygen's config file. A template extensions file can be generated
 # using doxygen -e rtf extensionFile.
 # This tag requires that the tag GENERATE_RTF is set to YES.
 
-RTF_EXTENSIONS_FILE    = 
-
-# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code
-# with syntax highlighting in the RTF output.
-#
-# Note that which sources are shown also depends on other settings such as
-# SOURCE_BROWSER.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_SOURCE_CODE        = NO
+RTF_EXTENSIONS_FILE    =
 
 #---------------------------------------------------------------------------
 # Configuration options related to the man page output
 #---------------------------------------------------------------------------
 
-# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for
+# If the GENERATE_MAN tag is set to YES doxygen will generate man pages for
 # classes and files.
 # The default value is: NO.
 
@@ -1866,7 +1780,7 @@ MAN_EXTENSION          = .3
 # MAN_EXTENSION with the initial . removed.
 # This tag requires that the tag GENERATE_MAN is set to YES.
 
-MAN_SUBDIR             = 
+MAN_SUBDIR             =
 
 # If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
 # will generate one additional man file for each entity documented in the real
@@ -1881,7 +1795,7 @@ MAN_LINKS              = NO
 # Configuration options related to the XML output
 #---------------------------------------------------------------------------
 
-# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that
+# If the GENERATE_XML tag is set to YES doxygen will generate an XML file that
 # captures the structure of the code including all documentation.
 # The default value is: NO.
 
@@ -1895,7 +1809,7 @@ GENERATE_XML           = NO
 
 XML_OUTPUT             = xml
 
-# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program
+# If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program
 # listings (including syntax highlighting and cross-referencing information) to
 # the XML output. Note that enabling this will significantly increase the size
 # of the XML output.
@@ -1908,7 +1822,7 @@ XML_PROGRAMLISTING     = YES
 # Configuration options related to the DOCBOOK output
 #---------------------------------------------------------------------------
 
-# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files
+# If the GENERATE_DOCBOOK tag is set to YES doxygen will generate Docbook files
 # that can be used to generate PDF.
 # The default value is: NO.
 
@@ -1922,23 +1836,14 @@ GENERATE_DOCBOOK       = NO
 
 DOCBOOK_OUTPUT         = docbook
 
-# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the
-# program listings (including syntax highlighting and cross-referencing
-# information) to the DOCBOOK output. Note that enabling this will significantly
-# increase the size of the DOCBOOK output.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
-
-DOCBOOK_PROGRAMLISTING = NO
-
 #---------------------------------------------------------------------------
 # Configuration options for the AutoGen Definitions output
 #---------------------------------------------------------------------------
 
-# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an
-# AutoGen Definitions (see http://autogen.sf.net) file that captures the
-# structure of the code including all documentation. Note that this feature is
-# still experimental and incomplete at the moment.
+# If the GENERATE_AUTOGEN_DEF tag is set to YES doxygen will generate an AutoGen
+# Definitions (see http://autogen.sf.net) file that captures the structure of
+# the code including all documentation. Note that this feature is still
+# experimental and incomplete at the moment.
 # The default value is: NO.
 
 GENERATE_AUTOGEN_DEF   = NO
@@ -1947,7 +1852,7 @@ GENERATE_AUTOGEN_DEF   = NO
 # Configuration options related to the Perl module output
 #---------------------------------------------------------------------------
 
-# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module
+# If the GENERATE_PERLMOD tag is set to YES doxygen will generate a Perl module
 # file that captures the structure of the code including all documentation.
 #
 # Note that this feature is still experimental and incomplete at the moment.
@@ -1955,7 +1860,7 @@ GENERATE_AUTOGEN_DEF   = NO
 
 GENERATE_PERLMOD       = NO
 
-# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary
+# If the PERLMOD_LATEX tag is set to YES doxygen will generate the necessary
 # Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
 # output from the Perl module output.
 # The default value is: NO.
@@ -1963,9 +1868,9 @@ GENERATE_PERLMOD       = NO
 
 PERLMOD_LATEX          = NO
 
-# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be nicely
 # formatted so it can be parsed by a human reader. This is useful if you want to
-# understand what is going on. On the other hand, if this tag is set to NO, the
+# understand what is going on. On the other hand, if this tag is set to NO the
 # size of the Perl module output will be much smaller and Perl will parse it
 # just the same.
 # The default value is: YES.
@@ -1979,20 +1884,20 @@ PERLMOD_PRETTY         = YES
 # overwrite each other's variables.
 # This tag requires that the tag GENERATE_PERLMOD is set to YES.
 
-PERLMOD_MAKEVAR_PREFIX = 
+PERLMOD_MAKEVAR_PREFIX =
 
 #---------------------------------------------------------------------------
 # Configuration options related to the preprocessor
 #---------------------------------------------------------------------------
 
-# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all
+# If the ENABLE_PREPROCESSING tag is set to YES doxygen will evaluate all
 # C-preprocessor directives found in the sources and include files.
 # The default value is: YES.
 
 ENABLE_PREPROCESSING   = YES
 
-# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names
-# in the source code. If set to NO, only conditional compilation will be
+# If the MACRO_EXPANSION tag is set to YES doxygen will expand all macro names
+# in the source code. If set to NO only conditional compilation will be
 # performed. Macro expansion can be done in a controlled way by setting
 # EXPAND_ONLY_PREDEF to YES.
 # The default value is: NO.
@@ -2008,7 +1913,7 @@ MACRO_EXPANSION        = NO
 
 EXPAND_ONLY_PREDEF     = NO
 
-# If the SEARCH_INCLUDES tag is set to YES, the include files in the
+# If the SEARCH_INCLUDES tag is set to YES the includes files in the
 # INCLUDE_PATH will be searched if a #include is found.
 # The default value is: YES.
 # This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
@@ -2020,7 +1925,7 @@ SEARCH_INCLUDES        = YES
 # preprocessor.
 # This tag requires that the tag SEARCH_INCLUDES is set to YES.
 
-INCLUDE_PATH           = 
+INCLUDE_PATH           =
 
 # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
 # patterns (like *.h and *.hpp) to filter out the header-files in the
@@ -2028,7 +1933,7 @@ INCLUDE_PATH           =
 # used.
 # This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
 
-INCLUDE_FILE_PATTERNS  = 
+INCLUDE_FILE_PATTERNS  =
 
 # The PREDEFINED tag can be used to specify one or more macro names that are
 # defined before the preprocessor is started (similar to the -D option of e.g.
@@ -2038,7 +1943,7 @@ INCLUDE_FILE_PATTERNS  =
 # recursively expanded use the := operator instead of the = operator.
 # This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
 
-PREDEFINED             = 
+PREDEFINED             =
 
 # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
 # tag can be used to specify a list of macro names that should be expanded. The
@@ -2047,7 +1952,7 @@ PREDEFINED             =
 # definition found in the source code.
 # This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
 
-EXPAND_AS_DEFINED      = 
+EXPAND_AS_DEFINED      =
 
 # If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
 # remove all references to function-like macros that are alone on a line, have
@@ -2076,7 +1981,7 @@ SKIP_FUNCTION_MACROS   = YES
 # the path). If a tag file is not located in the directory in which doxygen is
 # run, you must also specify the path to the tagfile here.
 
-TAGFILES               = 
+TAGFILES               =
 
 # When a file name is specified after GENERATE_TAGFILE, doxygen will create a
 # tag file that is based on the input files it reads. See section "Linking to
@@ -2084,21 +1989,20 @@ TAGFILES               =
 
 GENERATE_TAGFILE       = BppCore.tag
 
-# If the ALLEXTERNALS tag is set to YES, all external class will be listed in
-# the class index. If set to NO, only the inherited external classes will be
-# listed.
+# If the ALLEXTERNALS tag is set to YES all external class will be listed in the
+# class index. If set to NO only the inherited external classes will be listed.
 # The default value is: NO.
 
 ALLEXTERNALS           = NO
 
-# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed
-# in the modules index. If set to NO, only the current project's groups will be
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed in
+# the modules index. If set to NO, only the current project's groups will be
 # listed.
 # The default value is: YES.
 
 EXTERNAL_GROUPS        = YES
 
-# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in
+# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed in
 # the related pages index. If set to NO, only the current project's pages will
 # be listed.
 # The default value is: YES.
@@ -2115,7 +2019,7 @@ PERL_PATH              = /usr/bin/perl
 # Configuration options related to the dot tool
 #---------------------------------------------------------------------------
 
-# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram
+# If the CLASS_DIAGRAMS tag is set to YES doxygen will generate a class diagram
 # (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
 # NO turns the diagrams off. Note that this option also works with HAVE_DOT
 # disabled, but it is recommended to install and use dot, since it yields more
@@ -2131,16 +2035,16 @@ CLASS_DIAGRAMS         = YES
 # the mscgen tool resides. If left empty the tool is assumed to be found in the
 # default search path.
 
-MSCGEN_PATH            = 
+MSCGEN_PATH            =
 
 # You can include diagrams made with dia in doxygen documentation. Doxygen will
 # then run dia to produce the diagram and insert it in the documentation. The
 # DIA_PATH tag allows you to specify the directory where the dia binary resides.
 # If left empty dia is assumed to be found in the default search path.
 
-DIA_PATH               = 
+DIA_PATH               =
 
-# If set to YES the inheritance and collaboration graphs will hide inheritance
+# If set to YES, the inheritance and collaboration graphs will hide inheritance
 # and usage relations if the target is undocumented or is not a class.
 # The default value is: YES.
 
@@ -2165,7 +2069,7 @@ HAVE_DOT               = YES
 
 DOT_NUM_THREADS        = 0
 
-# When you want a differently looking font in the dot files that doxygen
+# When you want a differently looking font n the dot files that doxygen
 # generates you can specify the font name using DOT_FONTNAME. You need to make
 # sure dot is able to find the font, which can be done by putting it in a
 # standard location or by setting the DOTFONTPATH environment variable or by
@@ -2187,7 +2091,7 @@ DOT_FONTSIZE           = 10
 # the path where dot can find it using this tag.
 # This tag requires that the tag HAVE_DOT is set to YES.
 
-DOT_FONTPATH           = 
+DOT_FONTPATH           =
 
 # If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
 # each documented class showing the direct and indirect inheritance relations.
@@ -2213,7 +2117,7 @@ COLLABORATION_GRAPH    = YES
 
 GROUP_GRAPHS           = YES
 
-# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
 # collaboration diagrams in a style similar to the OMG's Unified Modeling
 # Language.
 # The default value is: NO.
@@ -2265,8 +2169,7 @@ INCLUDED_BY_GRAPH      = YES
 #
 # Note that enabling this option will significantly increase the time of a run.
 # So in most cases it will be better to enable call graphs for selected
-# functions only using the \callgraph command. Disabling a call graph can be
-# accomplished by means of the command \hidecallgraph.
+# functions only using the \callgraph command.
 # The default value is: NO.
 # This tag requires that the tag HAVE_DOT is set to YES.
 
@@ -2277,8 +2180,7 @@ CALL_GRAPH             = NO
 #
 # Note that enabling this option will significantly increase the time of a run.
 # So in most cases it will be better to enable caller graphs for selected
-# functions only using the \callergraph command. Disabling a caller graph can be
-# accomplished by means of the command \hidecallergraph.
+# functions only using the \callergraph command.
 # The default value is: NO.
 # This tag requires that the tag HAVE_DOT is set to YES.
 
@@ -2301,17 +2203,13 @@ GRAPHICAL_HIERARCHY    = YES
 DIRECTORY_GRAPH        = YES
 
 # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
-# generated by dot. For an explanation of the image formats see the section
-# output formats in the documentation of the dot tool (Graphviz (see:
-# http://www.graphviz.org/)).
+# generated by dot.
 # Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
 # to make the SVG files visible in IE 9+ (other browsers do not have this
 # requirement).
 # Possible values are: png, png:cairo, png:cairo:cairo, png:cairo:gd, png:gd,
 # png:gd:gd, jpg, jpg:cairo, jpg:cairo:gd, jpg:gd, jpg:gd:gd, gif, gif:cairo,
-# gif:cairo:gd, gif:gd, gif:gd:gd, svg, png:gd, png:gd:gd, png:cairo,
-# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and
-# png:gdiplus:gdiplus.
+# gif:cairo:gd, gif:gd, gif:gd:gd and svg.
 # The default value is: png.
 # This tag requires that the tag HAVE_DOT is set to YES.
 
@@ -2333,39 +2231,26 @@ INTERACTIVE_SVG        = NO
 # found. If left blank, it is assumed the dot tool can be found in the path.
 # This tag requires that the tag HAVE_DOT is set to YES.
 
-DOT_PATH               = 
+DOT_PATH               =
 
 # The DOTFILE_DIRS tag can be used to specify one or more directories that
 # contain dot files that are included in the documentation (see the \dotfile
 # command).
 # This tag requires that the tag HAVE_DOT is set to YES.
 
-DOTFILE_DIRS           = 
+DOTFILE_DIRS           =
 
 # The MSCFILE_DIRS tag can be used to specify one or more directories that
 # contain msc files that are included in the documentation (see the \mscfile
 # command).
 
-MSCFILE_DIRS           = 
+MSCFILE_DIRS           =
 
 # The DIAFILE_DIRS tag can be used to specify one or more directories that
 # contain dia files that are included in the documentation (see the \diafile
 # command).
 
-DIAFILE_DIRS           = 
-
-# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the
-# path where java can find the plantuml.jar file. If left blank, it is assumed
-# PlantUML is not used or called during a preprocessing step. Doxygen will
-# generate a warning when it encounters a \startuml command in this case and
-# will not generate output for the diagram.
-
-PLANTUML_JAR_PATH      = 
-
-# When using plantuml, the specified paths are searched for files specified by
-# the !include statement in a plantuml block.
-
-PLANTUML_INCLUDE_PATH  = 
+DIAFILE_DIRS           =
 
 # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
 # that will be shown in the graph. If the number of nodes in a graph becomes
@@ -2403,7 +2288,7 @@ MAX_DOT_GRAPH_DEPTH    = 0
 
 DOT_TRANSPARENT        = NO
 
-# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
 # files in one run (i.e. multiple -o and -T options on the command line). This
 # makes dot run faster, but since only newer versions of dot (>1.8.10) support
 # this, this feature is disabled by default.
@@ -2420,7 +2305,7 @@ DOT_MULTI_TARGETS      = YES
 
 GENERATE_LEGEND        = YES
 
-# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot
+# If the DOT_CLEANUP tag is set to YES doxygen will remove the intermediate dot
 # files that are used to generate the various graphs.
 # The default value is: YES.
 # This tag requires that the tag HAVE_DOT is set to YES.
diff --git a/bpp_format.py b/bpp_format.py
new file mode 100755
index 0000000..86caca1
--- /dev/null
+++ b/bpp_format.py
@@ -0,0 +1,546 @@
+#!/usr/bin/env python
+
+# Script that can be used to format the file headers of bpp.
+
+import os
+import sys
+import pathlib
+import collections
+import itertools
+import enum
+import datetime
+import dateutil.parser
+
+# Token classes have a match method.
+# This method returns unmatched text on match success.
+# On match failure, it returns None.
+class EmptyToken:
+    ''' Detects an empty buf. Unmatched text is special, just return "". '''
+    def match (self, buf):
+        return "" if buf == "" else None
+class LToken:
+    ''' Matches text on the left. '''
+    def __init__ (self, text):
+        self.text = text.casefold ()
+    def match (self, buf):
+        return buf[len (self.text):] if len (buf) >= len (self.text) and buf[:len(self.text)].casefold () == self.text else None
+class RToken:
+    ''' Matches text on the right. '''
+    def __init__ (self, text):
+        self.text = text.casefold ()
+    def match (self, buf):
+        return buf[:-len (self.text)] if len (buf) >= len (self.text) and buf[-len(self.text):].casefold () == self.text else None
+
+# Some combinators for tokens
+class LStripToken:
+    ''' Combinator: Strip left whitespace and matches subtoken. '''
+    def __init__ (self, next_tok):
+        self.next_tok = next_tok
+    def match (self, buf):
+        return self.next_tok.match (buf.lstrip ())
+class RStripToken:
+    ''' Combinator: Strip right whitespace and matches subtoken. '''
+    def __init__ (self, next_tok):
+        self.next_tok = next_tok
+    def match (self, buf):
+        return self.next_tok.match (buf.rstrip ())
+
+class NotToken:
+    ''' Combinator: Returns buf only if subtoken did not match, allow negative lookahead. '''
+    def __init__ (self, token):
+        self.token = token
+    def match (self, buf):
+        return None if self.token.match (buf) is not None else buf
+
+class LSkipAnyUntil:
+    def __init__ (self, token):
+        self.token = token
+    def match (self, buf):
+        while len(buf) > 0:
+            r = self.token.match (buf)
+            if r is not None:
+                return r
+            buf = buf[1:]
+        return None
+class RSkipAnyUntil:
+    def __init__ (self, token):
+        self.token = token
+    def match (self, buf):
+        while len(buf) > 0:
+            r = self.token.match (buf)
+            if r is not None:
+                return r
+            buf = buf[:-1]
+        return None
+
+# Line parser allows to define a chain of tokens that functions as a sort of regexp.
+class LineParser:
+    '''
+    Parse a line, by tokenizing (with whitespace) or regexp.
+    Methods return new LineParser instances with remaining text (or a match failure value).
+    LineParser can be evaluated as bool, tests if there was a match failure or not.
+    '''
+    def __init__ (self, text = None):
+        self.text = text
+    def __bool__ (self):
+        return self.text is not None
+
+    def __enter__ (self):
+        return self
+    def __exit__ (self, exc_type, exc_value, traceback):
+        return None
+
+    def match (self, tok):
+        if bool (self):
+            return LineParser (tok.match (self.text))
+        return LineParser ()
+
+    def match_eol (self):
+        return self.match (LStripToken (EmptyToken ()))
+    def match_tok (self, token):
+        return self.match (LStripToken (LToken (token)))
+    def match_toks (self, *tokens):
+        ''' Match a sequence of tokens (chainable) '''
+        if bool (self) and len (tokens) > 0:
+            return self.match_tok (tokens[0]).match_toks (*tokens[1:])
+        return self
+
+    def match_or (self, *tests):
+        ''' Branch: test two possibilities (chainable). Use lambdas '''
+        if bool (self):
+            for test in tests:
+                r = test (self)
+                if r:
+                    return r
+        return LineParser ()
+
+    def as_tokens (self):
+        ''' Returns the text as a token iterable (not chainable, fails if badmatch) '''
+        return self.text.split ()
+    def as_date (self):
+        ''' Returns the text as a datetime obkect (not chainable, fails if badmatch) '''
+        return dateutil.parser.parse (self.text.strip ())
+
+# Parse file line by line, store bounds and what has been parsed last
+class FileParser:
+    ''' Parse a file line by line (tracking our position), from both ends '''
+    def __init__ (self, file_path):
+        self.lines = file_path.read_text ().splitlines ()
+        self.next_forward_line = 0 # next line to be read in fwd order
+        self.next_backward_line_after = len (self.lines) # next line to be read (+1) in bwd order
+        self.last_parsed = None
+
+    def get_unparsed_lines (self):
+        return self.lines[self.next_forward_line:self.next_backward_line_after]
+
+    def parse_line (self):
+        if self.next_forward_line < self.next_backward_line_after:
+            index = self.next_forward_line
+            self.next_forward_line += 1
+            return LineParser (self.lines[index])
+        else:
+            raise Exception ("Reached end of forward parsing")
+    def unparse_line (self):
+        assert self.next_forward_line > 0
+        self.next_forward_line -= 1
+
+    def backward_parse_line (self):
+        if self.next_forward_line < self.next_backward_line_after:
+            index = self.next_backward_line_after - 1
+            self.next_backward_line_after -= 1
+            return LineParser (self.lines[index])
+        else:
+            raise Exception ("Reached end of backward parsing")
+    def backward_unparse_line (self):
+        assert self.next_backward_line_after < len (self.lines)
+        self.next_backward_line_after += 1
+
+# Enum of elements we can parse.
+Element = enum.Enum ("Element", [
+    "Space", "File", "Author", "CreationDate", "LastModificationDate", "License",
+    "HeaderGuardTest", "HeaderGuardDef", "Include", "HeaderGuardEndif", "HeaderGuardOnce"
+    ])
+
+class BppFile:
+    def __init__ (self, file_path):
+        # File
+        self.file_path = file_path.resolve ()
+        print ("File: {}".format (self.file_path))
+        # Get path to Bpp/
+        try:
+            self.bpp_dir = next ((d for d in self.file_path.parents if d.name == "Bpp"))
+        except StopIteration:
+            print ("File not in Bpp dir (test ?)")
+            self.bpp_dir = None
+        # Set info variables to default
+        self.authors = []
+        self.license_lines = None
+        self.creation_date = None
+        self.last_modification_date = None
+        self.rel_includes = []
+        self.abs_includes = []
+        self.code_lines = []
+        self.has_doctest = False
+
+    def add_author (self, author_first_last_name):
+        # Remove author from list (exclude suffixes)
+        auth_list = [a for a in self.authors if a.split ()[:2] != author_first_last_name.split()[:2]]
+        # Add it at end
+        auth_list.append (author_first_last_name)
+        self.authors = auth_list
+        print ("Adding author: {}".format (author_first_last_name))
+
+    # Parser setters
+    def add_authors_from_elements (self, elements):
+        # Split elements by "and"
+        authors = (" ".join (g) for k, g in itertools.groupby(elements, lambda s: s == "and") if not k)
+        for a in authors:
+            self.authors.append (a)
+            print ("Found author: {}".format (a))
+    def add_license_line_from_elements (self, elements):
+        self.license_lines = self.license_lines if self.license_lines is not None else []
+        self.license_lines.append (" ".join (elements))
+    def add_absolute_include_from_elements (self, elements, comment = None):
+        include = " ".join (elements)
+        self.abs_includes.append ((include, comment))
+        print ("Found absolute include: {}".format (include))
+    def add_relative_include_from_elements (self, elements, comment = None):
+        relative_original_path = pathlib.Path (" ".join (elements))
+        if relative_original_path.name == "doctest.h":
+            self.has_doctest = True
+            print ("Found doctest include")
+        else:
+            self.rel_includes.append ((relative_original_path, comment))
+            print ("Found relative include: {}".format (relative_original_path))
+
+    # Common parsing functions
+    def parse_file_header (self, file_parser):
+        while True: # Parsing file header
+            line = file_parser.parse_line ()
+            if line.match_eol ():
+                file_parser.last_parsed = Element.Space
+                continue # Empty line
+            with line.match_tok ("//") as comment:
+                if comment:
+                    if comment.match_eol ():
+                        file_parser.last_parsed = Element.Space
+                        continue # Empty comment
+                    if comment.match_toks ("File"):
+                        file_parser.last_parsed = Element.File
+                        continue # ignore filename
+                    with comment.match_or (
+                            lambda p: p.match_tok ("Author").match (NotToken (LToken ("s"))),
+                            lambda p: p.match_tok ("Authors"),
+                            lambda p: p.match_toks ("Created", "by")
+                            ).match_tok (":") as author_field:
+                        if author_field:
+                            self.add_authors_from_elements (author_field.as_tokens ())
+                            file_parser.last_parsed = Element.Author
+                            continue
+                    with comment.match_or (
+                            lambda p: p.match_toks ("Created", "on"),
+                            lambda p: p.match_tok ("Created")
+                            ).match_tok (":") as creation_date:
+                        if creation_date:
+                            self.creation_date = creation_date.as_date ()
+                            print ("Found creation date: {}".format (self.creation_date))
+                            file_parser.last_parsed = Element.CreationDate
+                            continue
+                    with comment.match_tok ("Last").match_or (
+                            lambda p: p.match_tok ("modification"),
+                            lambda p: p.match_tok ("modified")
+                            ).match_tok (":") as modif_date:
+                        if modif_date:
+                            self.last_modification_date = modif_date.as_date ()
+                            print ("Found modification date: {}".format (self.last_modification_date))
+                            file_parser.last_parsed = Element.LastModificationDate
+                            continue
+                    if file_parser.last_parsed == Element.Author:
+                        self.add_authors_from_elements (comment.as_tokens ())
+                        continue
+            if line.match_tok ("/*").match_eol () or line.match_tok ("#include") or line.match_tok ("#ifndef") or line.match_tok ("namespace") or line.match_tok ("#define"):
+                file_parser.unparse_line ()
+                break # Found stuff of next steps, get out
+            print ("Unexpected line (parsing file header): {}".format (line.text))
+            file_parser.unparse_line ()
+            break # Found unexpected line, let other pass try
+    def parse_file_license (self, file_parser):
+        while True: # Parsing license
+            line = file_parser.parse_line ()
+            if file_parser.last_parsed != Element.License:
+                if line.match_eol ():
+                    file_parser.last_parsed = Element.Space
+                    continue # Empty line
+                if line.match_tok ("/*").match_eol ():
+                    file_parser.last_parsed = Element.License
+                    continue # Entering license block
+                print ("Unexpected line (parsing license): {}".format (line.text))
+                file_parser.unparse_line ()
+                break # Failed to find start of license
+            else:
+                if line.match_tok ("*/").match_eol ():
+                    file_parser.last_parsed = Element.Space
+                    break # End of license
+                self.add_license_line_from_elements (line.as_tokens ())
+    def parse_include_line (self, line):
+        # Match a single include line ; returns LineParser with given state
+        with line.match_tok ("#include") as include:
+            if include:
+                # Strip potential trailing comment
+                comment = None
+                stripped_of_comment = include.match (RSkipAnyUntil (RToken ("//")))
+                if stripped_of_comment:
+                    comment_elems = include.match (LSkipAnyUntil (LToken ("//"))).as_tokens ()
+                    comment = " ".join (comment_elems)
+                    include = stripped_of_comment
+                # Continue processing include (either a quote or a system include)
+                with include.match (LStripToken (LToken ("<"))).match (RStripToken (RToken (">"))) as absolute_inc:
+                    if absolute_inc:
+                        self.add_absolute_include_from_elements (absolute_inc.as_tokens (), comment)
+                        return absolute_inc
+                with include.match (LStripToken (LToken ("\""))).match (RStripToken (RToken ("\""))) as relative_inc:
+                    if relative_inc:
+                        self.add_relative_include_from_elements (relative_inc.as_tokens (), comment)
+                        return relative_inc
+        return LineParser ()
+    def parse_file_code (self, file_parser):
+        self.code_lines = file_parser.get_unparsed_lines ()
+
+    # Common writing functions
+    def write_file_header (self, f):
+        f.write ("//\n")
+        f.write ("// File: {}\n".format (self.file_path.name))
+        f.write ("// Authors:\n")
+        f.writelines ("//   {}\n".format (a) for a in self.authors)
+        if self.creation_date is not None:
+            f.write ("// Created: {}\n".format (self.creation_date))
+        if self.last_modification_date is not None:
+            f.write ("// Last modified: {}\n".format (self.last_modification_date))
+        f.write ("//\n")
+        f.write ("\n")
+    def write_file_license (self, f):
+        if self.license_lines:
+            f.write ("/*\n")
+            f.writelines ("  {}\n".format (l) for l in self.license_lines)
+            f.write ("*/\n")
+            f.write ("\n")
+    def write_file_includes (self, f):
+        # Sorted include files
+        self.rel_includes.sort ()
+        self.abs_includes.sort ()
+        def include_line (inc, enclose_path):
+            path, comment = inc
+            enclosed_path = enclose_path (path)
+            if comment:
+                return "#include {} // {}\n".format (enclosed_path, comment)
+            else:
+                return "#include {}\n".format (enclosed_path)
+        f.writelines (include_line (inc, lambda p : "<{}>".format (p)) for inc in self.abs_includes)
+        f.write ("\n")
+        f.writelines (include_line (inc, lambda p : "\"{}\"".format (p)) for inc in self.rel_includes)
+        f.write ("\n")
+    def write_file_code (self, f):
+        f.writelines ("{}\n".format (l) for l in self.code_lines)
+
+class BppHeader (BppFile):
+    def __init__ (self, file_path, parse = True):
+        BppFile.__init__ (self, file_path)
+        # Then build header guard : BPP_DIR_DIR_FILE_H
+        if self.bpp_dir:
+            header_elements = ("Bpp",) + self.file_path.parent.relative_to (self.bpp_dir).parts + (self.file_path.stem, "h")
+            self.header_guard = "_".join (n.upper() for n in header_elements)
+            print ("Header guard: {}".format (self.header_guard))
+        else:
+            raise Exception ("Unable to generate header guard if file is not in bpp dir")
+        # Get header info from file
+        if parse:
+            self.parse_file ()
+
+    def parse_file (self):
+        file_parser = FileParser (self.file_path)
+        self.parse_file_header (file_parser)
+        self.parse_file_license (file_parser)
+        while True: # Parsing header inclusion
+            line = file_parser.parse_line ()
+            if line.match_eol ():
+                file_parser.last_parsed = Element.Space
+                continue # Empty line
+            if line.match_tok ("#ifndef"):
+                file_parser.last_parsed = Element.HeaderGuardTest
+                continue # Remove current header guard
+            if file_parser.last_parsed == Element.HeaderGuardTest and line.match_tok ("#define"):
+                file_parser.last_parsed = Element.HeaderGuardDef
+                continue # Remove current header guard part 2 (must follow part 1)
+            if line.match_toks ("#pragma", "once"):
+                file_parser.last_parsed = Element.HeaderGuardOnce
+                continue # Remove pragma once
+            if self.parse_include_line (line):
+                file_parser.last_parsed = Element.Include
+                continue # Include line upgraded
+            if line.match_toks ("namespace"):
+                file_parser.unparse_line ()
+                break # Start of code
+            print ("Unexpected line (parsing includes): {}".format (line.text))
+            file_parser.unparse_line ()
+            break # Try catching start of code anyway
+        while True: # Parsing bottom of file
+            line = file_parser.backward_parse_line ()
+            if line.match_eol ():
+                file_parser.last_parsed = Element.Space
+                continue # Empty line
+            if line.match_tok ("#endif"):
+                file_parser.last_parsed = Element.HeaderGuardEndif
+                continue # Rm end guard
+            if line.match_tok ("}"):
+                file_parser.backward_unparse_line ()
+                break # Reached code
+            print ("Unexpected line (parsing file footer): {}".format (line.text))
+            file_parser.backward_unparse_line ()
+            break # Try stopping nicely
+        self.parse_file_code (file_parser)
+
+    def write_file (self, file_path):
+        with file_path.open ("w") as f:
+            self.write_file_header (f)
+            self.write_file_license (f)
+            # f.write ("#pragma once\n") If we want to use it...
+            f.write ("#ifndef {}\n".format (self.header_guard))
+            f.write ("#define {}\n".format (self.header_guard))
+            f.write ("\n")
+            self.write_file_includes (f)
+            self.write_file_code (f)
+            f.write ("#endif // {}\n".format (self.header_guard))
+
+class BppCpp (BppFile):
+    def __init__ (self, file_path, parse = True):
+        BppFile.__init__ (self, file_path)
+        if parse:
+            self.parse_file ()
+    
+    def parse_file (self):
+        file_parser = FileParser (self.file_path)
+        self.parse_file_header (file_parser)
+        self.parse_file_license (file_parser)
+        while True: # Parsing header inclusion
+            line = file_parser.parse_line ()
+            if line.match_eol ():
+                file_parser.last_parsed = Element.Space
+                continue # Empty line
+            if self.parse_include_line (line):
+                file_parser.last_parsed = Element.Include
+                continue # Include line upgraded
+            if line.match_toks ("#define", "DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN"):
+                self.has_doctest = True
+                continue # Doctest define
+            if line.match_toks ("namespace"):
+                file_parser.unparse_line ()
+                break # Start of code
+            print ("Unexpected line (parsing includes): {}".format (line.text))
+            file_parser.unparse_line ()
+            break # Try catching start of code anyway
+        self.parse_file_code (file_parser)
+
+    def write_file (self, file_path):
+        with file_path.open ("w") as f:
+            self.write_file_header (f)
+            self.write_file_license (f)
+            if self.has_doctest:
+                f.write ("#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN\n")
+                f.write ("#include \"doctest.h\"\n")
+                f.write ("\n")
+            self.write_file_includes (f)
+            self.write_file_code (f)
+
+def create_bpp_file_object (path, parse_it):
+    if path.suffix == ".h":
+        return BppHeader (path, parse_it)
+    elif path.suffix == ".cpp":
+        return BppCpp (path, parse_it)
+    else:
+        raise Exception ("Unsupported file extension: {}".format (path))
+
+if __name__ == "__main__":
+    # Parse command line
+    authors_to_add = []
+    overwrite = False
+    overwrite_checked = False
+    update_modif_date = True
+    create_from = None
+    args = sys.argv[1:]
+    while True:
+        if len (args) >= 2:
+            if args[0] in ("author", "a"):
+                authors_to_add.append (args[1])
+                args = args[2:]
+                continue
+            if args[0] in ("create_from", "c"):
+                create_from = args[1]
+                args = args[2:]
+                continue
+        if len (args) >= 1:
+            if args[0] in ("overwrite", "O"):
+                overwrite = True
+                overwrite_checked = False
+                args = args[1:]
+                continue
+            if args[0] in ("overwrite_checked", "o"):
+                overwrite = False
+                overwrite_checked = True
+                args = args[1:]
+                continue
+            if args[0] == "keep_date":
+                update_modif_date = False
+                args = args[1:]
+                continue
+        if len (args) == 1 and args[0] not in ("help", "-h", "--help"):
+            break
+        print ("bpp_format.py [args] <file>")
+        print ("\t<file> : file to reformat")
+        print ("\tauthor [name] : adds [name] as recent author of the file")
+        print ("\toverwrite : write directly to <file> (default is writing in <file>.new.<file suffix>)")
+        print ("\toverwrite_checked : same as overwrite, but shows a diff and ask for confirmation")
+        print ("\tkeep_date : do not update the last modification date")
+        print ("\tcreate_from [file] : create a new file from [file] (license, date, guard)")
+        sys.exit ()
+
+    # Create file object.
+    # In create_from mode, do not parse underlying file, just create an empty file.
+    file_path = pathlib.Path (args[0])
+    bpp_file = create_bpp_file_object (file_path, parse_it = create_from is None)
+    # Update last modification date
+    if update_modif_date:
+        bpp_file.last_modification_date = datetime.date.today ()
+    # Add authors
+    for a in authors_to_add:
+        bpp_file.add_author (a)
+    # Fill info in create mode, by taking an example file
+    if create_from is not None:
+        example_file = create_bpp_file_object (pathlib.Path (create_from), True)
+        bpp_file.license_lines = example_file.license_lines
+        bpp_file.creation_date = datetime.date.today ()
+        bpp_file.has_doctest = example_file.has_doctest
+    # Write back
+    out_file_path = file_path if overwrite else file_path.with_suffix (".new" + file_path.suffix)
+    print ("Writing to {}".format (out_file_path))
+    bpp_file.write_file (out_file_path)
+    # If overwrite_checked, show diff, ask before overwriting
+    if overwrite_checked:
+        import subprocess
+        diff_cmd = subprocess.Popen (
+                ["diff", "--color=always", "-U3", file_path.as_posix (), out_file_path.as_posix ()],
+                stdout=subprocess.PIPE)
+        less_cmd = subprocess.Popen (["less"], stdin=diff_cmd.stdout)
+        less_cmd.wait ()
+        diff_cmd.wait ()
+        print ("Overwrite ? [y/N]")
+        ans = input ()
+        if ans in ("y", "Y"):
+            print ("Renaming {} to {}".format (out_file_path, file_path))
+            out_file_path.rename (file_path)
+        else:
+            print ("Delete {} ? [y/N]".format (out_file_path))
+            ans2 = input ()
+            if ans2 in ("y", "Y"):
+                print ("Deleting {}".format (out_file_path))
+                out_file_path.unlink ()
+
diff --git a/src/Bpp/App/ApplicationTools.cpp b/src/Bpp/App/ApplicationTools.cpp
index 2e6bffa..0a5a3be 100644
--- a/src/Bpp/App/ApplicationTools.cpp
+++ b/src/Bpp/App/ApplicationTools.cpp
@@ -61,16 +61,15 @@ int ApplicationTools::warningLevel = 0;
 
 /******************************************************************************/
   
-std::vector<std::string> ApplicationTools::matchingParameters(const std::string& pattern, std::map<std::string, std::string>& params)
+vector<string> ApplicationTools::matchingParameters(const string& pattern, const map<string, string>& params)
 {
   vector<string> retv;
 
-  map<string, string>::iterator it;
-  for (it=params.begin(); it!=params.end(); it++)
+  for (const auto& it : params)
   {
     StringTokenizer stj(pattern, "*", true, false);
     size_t pos1, pos2;
-    string parn = it->first;
+    string parn = it.first;
     bool flag(true);
     string g = stj.nextToken();
     pos1 = parn.find(g);
@@ -96,7 +95,7 @@ std::vector<std::string> ApplicationTools::matchingParameters(const std::string&
   return retv;
 }
 
-std::vector<std::string> ApplicationTools::matchingParameters(const std::string& pattern, std::vector<std::string>& params)
+vector<string> ApplicationTools::matchingParameters(const string& pattern, vector<string>& params)
 {
   vector<string> retv;
 
@@ -104,7 +103,7 @@ std::vector<std::string> ApplicationTools::matchingParameters(const std::string&
   {
     StringTokenizer stj(pattern, "*", true, false);
     size_t pos1, pos2;
-    string parn = params[i];
+    string parn = params.at(i);
     bool flag(true);
     string g = stj.nextToken();
     pos1 = parn.find(g);
@@ -134,13 +133,13 @@ std::vector<std::string> ApplicationTools::matchingParameters(const std::string&
 
 string ApplicationTools::getAFilePath(
   const string& parameter,
-  map<string, string>& params,
+  const map<string, string>& params,
   bool isRequired,
   bool mustExist,
   const string& suffix,
   bool suffixIsOptional,
   const string& defaultPath, 
-  int warn) throw (Exception)
+  int warn)
 {
   string filePath = getStringParameter(parameter, params, defaultPath, suffix, suffixIsOptional, warn);
   if (filePath == "") filePath = "none";
@@ -159,21 +158,21 @@ string ApplicationTools::getAFilePath(
 /******************************************************************************/
 
 double ApplicationTools::getDoubleParameter(
-  const std::string& parameterName,
-  std::map<std::string, std::string>& params,
+  const string& parameterName,
+  const map<string, string>& params,
   double defaultValue,
-  const std::string& suffix,
+  const string& suffix,
   bool suffixIsOptional,
   int warn)
 {
   double dParam = defaultValue;
   if (parameterExists(parameterName + suffix, params))
   {
-    dParam = TextTools::toDouble(params[parameterName + suffix]);
+    dParam = TextTools::toDouble(params.at(parameterName + suffix));
   }
   else if (suffixIsOptional && parameterExists(parameterName, params))
   {
-    dParam = TextTools::toDouble(params[parameterName]);
+    dParam = TextTools::toDouble(params.at(parameterName));
   }
   else if(warn <= warningLevel)
   {
@@ -185,18 +184,18 @@ double ApplicationTools::getDoubleParameter(
 /******************************************************************************/
 
 int ApplicationTools::getIntParameter(
-  const std::string & parameterName,
-  std::map<std::string, std::string> & params,
+  const string & parameterName,
+  const map<string, string> & params,
   int defaultValue,
-  const std::string & suffix,
+  const string & suffix,
   bool suffixIsOptional,
   int warn)
 {
   int iParam = defaultValue;
   if (parameterExists(parameterName + suffix, params)) {
-    iParam = TextTools::toInt(params[parameterName + suffix]);
+    iParam = TextTools::toInt(params.at(parameterName + suffix));
   } else if(suffixIsOptional && parameterExists(parameterName, params)) {
-    iParam = TextTools::toInt(params[parameterName]);
+    iParam = TextTools::toInt(params.at(parameterName));
   } else if (warn <= warningLevel) {
     displayWarning("Parameter " + parameterName + suffix + " not specified. Default used instead: " + TextTools::toString(defaultValue));
   }
@@ -207,10 +206,10 @@ int ApplicationTools::getIntParameter(
 
 
 bool ApplicationTools::getBooleanParameter(
-  const std::string& parameterName,
-  std::map<std::string, std::string>& params,
+  const string& parameterName,
+  const map<string, string>& params,
   bool defaultValue,
-  const std::string& suffix,
+  const string& suffix,
   bool suffixIsOptional,
   int warn)
 {
@@ -218,11 +217,11 @@ bool ApplicationTools::getBooleanParameter(
   bool bParam = defaultValue;
   if (parameterExists(parameterName + suffix, params))
   {
-    sParam = params[parameterName + suffix];
+    sParam = params.at(parameterName + suffix);
   }
   else if (suffixIsOptional && parameterExists(parameterName, params))
   {
-    sParam = params[parameterName];
+    sParam = params.at(parameterName);
   }
   else {
     if (warn <= warningLevel)
@@ -258,13 +257,13 @@ bool ApplicationTools::getBooleanParameter(
 
 /******************************************************************************/
 
-void ApplicationTools::displayMessage(const std::string& text) { if(message) (*message << text).endLine(); }
+void ApplicationTools::displayMessage(const string& text) { if(message) (*message << text).endLine(); }
     
-void ApplicationTools::displayError(const std::string& text) { if(error) (*error << "ERROR!!! " << text).endLine(); }
+void ApplicationTools::displayError(const string& text) { if(error) (*error << "ERROR!!! " << text).endLine(); }
     
-void ApplicationTools::displayWarning(const std::string& text) { if(warning) (*warning << "WARNING!!! " << text).endLine(); }
+void ApplicationTools::displayWarning(const string& text) { if(warning) (*warning << "WARNING!!! " << text).endLine(); }
 
-void ApplicationTools::displayTask(const std::string& text, bool eof)
+void ApplicationTools::displayTask(const string& text, bool eof)
 {
   if (message)
   {
@@ -278,7 +277,7 @@ void ApplicationTools::displayTaskDone() { if(message) (*message << "Done.").end
 
 /******************************************************************************/
 
-void ApplicationTools::displayGauge(size_t iter, size_t total, char symbol, const std::string& mes)
+void ApplicationTools::displayGauge(size_t iter, size_t total, char symbol, const string& mes)
 {
   if (!message) return;
   if (total == 0) return;//We do not display anything in that case.
@@ -316,7 +315,7 @@ void ApplicationTools::displayGauge(size_t iter, size_t total, char symbol, cons
 
 /******************************************************************************/
 
-void ApplicationTools::displayUnlimitedGauge(size_t iter, const std::string& mes)
+void ApplicationTools::displayUnlimitedGauge(size_t iter, const string& mes)
 {
   if (!message) return;
   string chars = "-/-\\";
@@ -339,7 +338,7 @@ void ApplicationTools::displayUnlimitedGauge(size_t iter, const std::string& mes
 
 /******************************************************************************/
   
-void ApplicationTools::displayTime(const std::string& msg)
+void ApplicationTools::displayTime(const string& msg)
 {
   time_t endTime;
   time(&endTime);
diff --git a/src/Bpp/App/ApplicationTools.h b/src/Bpp/App/ApplicationTools.h
index 77a8ab1..946c0f5 100644
--- a/src/Bpp/App/ApplicationTools.h
+++ b/src/Bpp/App/ApplicationTools.h
@@ -170,7 +170,7 @@ namespace bpp
      * @param params  The parameter list.
      * @return a vector of matching names.
      */  
-    static std::vector<std::string> matchingParameters(const std::string& pattern, std::map<std::string, std::string>& params);
+    static std::vector<std::string> matchingParameters(const std::string& pattern, const std::map<std::string, std::string>& params);
 
     static std::vector<std::string> matchingParameters(const std::string& pattern, std::vector<std::string>& params);
 
@@ -187,7 +187,7 @@ namespace bpp
      */
     static double getDoubleParameter(
       const std::string& parameterName,
-      std::map<std::string, std::string>& params,
+      const std::map<std::string, std::string>& params,
       double defaultValue,
       const std::string& suffix = "",
       bool suffixIsOptional = true,
@@ -206,7 +206,7 @@ namespace bpp
      */
     static int getIntParameter(
       const std::string& parameterName,
-      std::map<std::string, std::string>& params,
+      const std::map<std::string, std::string>& params,
       int defaultValue,
       const std::string& suffix = "",
       bool suffixIsOptional = true,
@@ -264,7 +264,7 @@ namespace bpp
      */
     static bool getBooleanParameter(
       const std::string& parameterName,
-      std::map<std::string, std::string>& params,
+      const std::map<std::string, std::string>& params,
       bool defaultValue,
       const std::string& suffix = "",
       bool suffixIsOptional = true,
@@ -283,7 +283,7 @@ namespace bpp
      */
     template<class T> static T getParameter(
       const std::string& parameterName,
-      std::map<std::string, std::string>& params,
+      const std::map<std::string, std::string>& params,
       T defaultValue,
       const std::string& suffix = "",
       bool suffixIsOptional = true,
@@ -292,11 +292,11 @@ namespace bpp
       T tParam = defaultValue;
       if (parameterExists(parameterName + suffix, params))
       {
-        tParam = TextTools::to<T>(params[parameterName + suffix]);
+        tParam = TextTools::to<T>(params.at(parameterName + suffix));
       }
       else if (suffixIsOptional && parameterExists(parameterName, params))
       {
-        tParam = TextTools::to<T>(params[parameterName]);
+        tParam = TextTools::to<T>(params.at(parameterName));
       }
       else if (warn <= warningLevel)
       {
@@ -325,13 +325,13 @@ namespace bpp
      */
     static std::string getAFilePath(
       const std::string& parameter,
-      std::map<std::string, std::string>& params,
+      const std::map<std::string, std::string>& params,
       bool isRequired = true,
       bool mustExist = true,
       const std::string& suffix = "",
       bool suffixIsOptional = false,
       const std::string& defaultPath = "none", 
-      int warn = 0) throw (Exception);
+      int warn = 0);
 
     /**
      * @brief Get a vector.
@@ -347,7 +347,7 @@ namespace bpp
      */
     template<class T> static std::vector<T> getVectorParameter(
       const std::string& parameterName,
-      std::map<std::string, std::string>& params,
+      const std::map<std::string, std::string>& params,
       char separator,
       const std::string& defaultValue,
       const std::string& suffix = "",
@@ -389,7 +389,7 @@ namespace bpp
      */
     template<class T> static std::vector<T> getVectorParameter(
       const std::string& parameterName,
-      std::map<std::string, std::string>& params,
+      const std::map<std::string, std::string>& params,
       char separator,
       char rangeOperator,
       const std::string& defaultValue,
@@ -449,7 +449,7 @@ namespace bpp
 
     template<class T> static RowMatrix<T> getMatrixParameter(
       const std::string& parameterName,
-      std::map<std::string, std::string>& params,
+      const std::map<std::string, std::string>& params,
       char separator,
       const std::string& defaultValue,
       const std::string& suffix = "",
diff --git a/src/Bpp/App/BppApplication.h b/src/Bpp/App/BppApplication.h
index 78286f0..91645ee 100644
--- a/src/Bpp/App/BppApplication.h
+++ b/src/Bpp/App/BppApplication.h
@@ -65,7 +65,7 @@ namespace bpp
 
       std::map<std::string, std::string>& getParams() { return params_; }
 
-      const std::string& getParam(const std::string& name) const throw (Exception)
+      const std::string& getParam(const std::string& name) const
       {
         if (params_.find(name) == params_.end()) throw Exception("BppApplication::getParam(). Parameter '" + name + "' not found.");
         return params_[name];
diff --git a/src/Bpp/App/NumCalcApplicationTools.cpp b/src/Bpp/App/NumCalcApplicationTools.cpp
index 71d7cc8..227ce80 100644
--- a/src/Bpp/App/NumCalcApplicationTools.cpp
+++ b/src/Bpp/App/NumCalcApplicationTools.cpp
@@ -68,7 +68,7 @@ vector<int> NumCalcApplicationTools::seqFromString(const std::string& s, const s
 
 
 
-vector<double> NumCalcApplicationTools::getVector(const std::string& desc) throw (Exception)
+vector<double> NumCalcApplicationTools::getVector(const std::string& desc)
 {
   vector<double> values;
   string key, val;
@@ -125,7 +125,7 @@ ParameterGrid* NumCalcApplicationTools::getParameterGrid(
     map<string, string>& params,
     const string& suffix,
     bool suffixIsOptional,
-    bool warn) throw (Exception)
+    bool warn)
 {
   unsigned int nbParams = ApplicationTools::getParameter<unsigned int>("grid.number_of_parameters", params, 1, suffix, suffixIsOptional, warn);
   ParameterGrid* grid = new ParameterGrid();
diff --git a/src/Bpp/App/NumCalcApplicationTools.h b/src/Bpp/App/NumCalcApplicationTools.h
index b250940..cd161cc 100644
--- a/src/Bpp/App/NumCalcApplicationTools.h
+++ b/src/Bpp/App/NumCalcApplicationTools.h
@@ -88,7 +88,7 @@ class NumCalcApplicationTools
      * @return A vector containing the corresponding values as double.
      * @throw Exception If the syntax describing the set is not correct.
      */
-    static std::vector<double> getVector(const std::string& desc) throw (Exception);
+    static std::vector<double> getVector(const std::string& desc);
 
     /**
      * @brief Returns the value of the Parameter of the given name
@@ -125,7 +125,7 @@ class NumCalcApplicationTools
         std::map<std::string, std::string>& params,
         const std::string& suffix = "",
         bool suffixIsOptional = true,
-        bool warn = true) throw (Exception);
+        bool warn = true);
 
 };
 
diff --git a/src/Bpp/BppBoolean.h b/src/Bpp/BppBoolean.h
index 78f1f5b..09e788b 100644
--- a/src/Bpp/BppBoolean.h
+++ b/src/Bpp/BppBoolean.h
@@ -1,89 +1,72 @@
 //
 // File: BppBoolean.h
-// Created by: Julien Dutheil
-// Created on: Fri 31 10:44 2010
+// Authors:
+//   Julien Dutheil
+//   Francois Gindraud (2017)
+// Last modified: 2017-06-27
 //
 
 /*
-Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
-
-This software is a computer program whose purpose is to provide utilitary
-classes. This file belongs to the Bio++ Project.
-
-This software is governed by the CeCILL  license under French law and
-abiding by the rules of distribution of free software.  You can  use, 
-modify and/ or redistribute the software under the terms of the CeCILL
-license as circulated by CEA, CNRS and INRIA at the following URL
-"http://www.cecill.info". 
-
-As a counterpart to the access to the source code and  rights to copy,
-modify and redistribute granted by the license, users are provided only
-with a limited warranty  and the software's author,  the holder of the
-economic rights,  and the successive licensors  have only  limited
-liability. 
-
-In this respect, the user's attention is drawn to the risks associated
-with loading,  using,  modifying and/or developing or reproducing the
-software by the user in light of its specific status of free software,
-that may mean  that it is complicated to manipulate,  and  that  also
-therefore means  that it is reserved for developers  and  experienced
-professionals having in-depth computer knowledge. Users are therefore
-encouraged to load and test the software's suitability as regards their
-requirements in conditions enabling the security of their systems and/or 
-data to be ensured and,  more generally, to use and operate it in the 
-same conditions as regards security. 
-
-The fact that you are presently reading this means that you have had
-knowledge of the CeCILL license and that you accept its terms.
+  Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
+  
+  This software is a computer program whose purpose is to provide utilitary
+  classes. This file belongs to the Bio++ Project.
+  
+  This software is governed by the CeCILL license under French law and
+  abiding by the rules of distribution of free software. You can use,
+  modify and/ or redistribute the software under the terms of the CeCILL
+  license as circulated by CEA, CNRS and INRIA at the following URL
+  "http://www.cecill.info".
+  
+  As a counterpart to the access to the source code and rights to copy,
+  modify and redistribute granted by the license, users are provided only
+  with a limited warranty and the software's author, the holder of the
+  economic rights, and the successive licensors have only limited
+  liability.
+  
+  In this respect, the user's attention is drawn to the risks associated
+  with loading, using, modifying and/or developing or reproducing the
+  software by the user in light of its specific status of free software,
+  that may mean that it is complicated to manipulate, and that also
+  therefore means that it is reserved for developers and experienced
+  professionals having in-depth computer knowledge. Users are therefore
+  encouraged to load and test the software's suitability as regards their
+  requirements in conditions enabling the security of their systems and/or
+  data to be ensured and, more generally, to use and operate it in the
+  same conditions as regards security.
+  
+  The fact that you are presently reading this means that you have had
+  knowledge of the CeCILL license and that you accept its terms.
 */
 
-#ifndef _BPP_BOOLEAN_H_
-#define _BPP_BOOLEAN_H_
-
-#include "Clonable.h"
+#ifndef BPP_BPPBOOLEAN_H
+#define BPP_BPPBOOLEAN_H
 
-// From the STL:
-#include <string>
 #include <ostream>
 
+#include "Clonable.h"
+
 namespace bpp
 {
-
-/**
- * @brief The BppBoolean object class.
- *
+  /** @brief The BppBoolean object class.
  * This class extends the bool type to support the Clonable interface.
  */
-class BppBoolean: public virtual Clonable
-{
+  class BppBoolean : public virtual Clonable
+  {
   private:
     bool value_;
 
-	public:
-		
-		BppBoolean(): value_(false) {}
-		BppBoolean(bool value): value_(value) {}
-		virtual ~BppBoolean() {}
-	
-	public:
-	
-		/**
-		 * @name The Clonable interface.
-		 *
-		 * @{
-		 */
-		BppBoolean * clone() const { return new BppBoolean(*this); }
-		/** @} */
+  public:
+    BppBoolean(bool value = false)
+      : value_(value)
+    {
+    }
 
-    const bool getValue() const { return value_; }
-    
-};
+    BppBoolean* clone() const { return new BppBoolean(*this); }
 
-std::ostream& operator<<(std::ostream& out, const BppBoolean& s) {
-  return out << s.getValue();
-}
-
-} //end of namespace bpp.
-
-#endif	//_BPP_BOOLEAN_H_
+    const bool getValue() const { return value_; }
+  };
 
+  inline std::ostream& operator<<(std::ostream& out, const BppBoolean& s) { return out << s.getValue(); }
+} // namespace bpp
+#endif // BPP_BPPBOOLEAN_H
diff --git a/src/Bpp/BppString.cpp b/src/Bpp/BppString.cpp
index 5df0fcb..0f4c616 100644
--- a/src/Bpp/BppString.cpp
+++ b/src/Bpp/BppString.cpp
@@ -1,50 +1,78 @@
 //
 // File: BppString.cpp
-// Created by: Julien Dutheil
-// Created on: Thu May 04 10:21 2006
+// Authors:
+//   Julien Dutheil
+//   Francois Gindraud (2017)
+// Created: 2006-05-04 10:21:00
+// Last modified: 2017-06-27
 //
 
 /*
-Copyright or © or Copr. CNRS, (November 17, 2004)
-
-This software is a computer program whose purpose is to provide utilitary
-classes. This file belongs to the Bio++ Project.
-
-This software is governed by the CeCILL  license under French law and
-abiding by the rules of distribution of free software.  You can  use, 
-modify and/ or redistribute the software under the terms of the CeCILL
-license as circulated by CEA, CNRS and INRIA at the following URL
-"http://www.cecill.info". 
-
-As a counterpart to the access to the source code and  rights to copy,
-modify and redistribute granted by the license, users are provided only
-with a limited warranty  and the software's author,  the holder of the
-economic rights,  and the successive licensors  have only  limited
-liability. 
-
-In this respect, the user's attention is drawn to the risks associated
-with loading,  using,  modifying and/or developing or reproducing the
-software by the user in light of its specific status of free software,
-that may mean  that it is complicated to manipulate,  and  that  also
-therefore means  that it is reserved for developers  and  experienced
-professionals having in-depth computer knowledge. Users are therefore
-encouraged to load and test the software's suitability as regards their
-requirements in conditions enabling the security of their systems and/or 
-data to be ensured and,  more generally, to use and operate it in the 
-same conditions as regards security. 
-
-The fact that you are presently reading this means that you have had
-knowledge of the CeCILL license and that you accept its terms.
+  Copyright or © or Copr. CNRS, (November 17, 2004)
+  
+  This software is a computer program whose purpose is to provide utilitary
+  classes. This file belongs to the Bio++ Project.
+  
+  This software is governed by the CeCILL license under French law and
+  abiding by the rules of distribution of free software. You can use,
+  modify and/ or redistribute the software under the terms of the CeCILL
+  license as circulated by CEA, CNRS and INRIA at the following URL
+  "http://www.cecill.info".
+  
+  As a counterpart to the access to the source code and rights to copy,
+  modify and redistribute granted by the license, users are provided only
+  with a limited warranty and the software's author, the holder of the
+  economic rights, and the successive licensors have only limited
+  liability.
+  
+  In this respect, the user's attention is drawn to the risks associated
+  with loading, using, modifying and/or developing or reproducing the
+  software by the user in light of its specific status of free software,
+  that may mean that it is complicated to manipulate, and that also
+  therefore means that it is reserved for developers and experienced
+  professionals having in-depth computer knowledge. Users are therefore
+  encouraged to load and test the software's suitability as regards their
+  requirements in conditions enabling the security of their systems and/or
+  data to be ensured and, more generally, to use and operate it in the
+  same conditions as regards security.
+  
+  The fact that you are presently reading this means that you have had
+  knowledge of the CeCILL license and that you accept its terms.
 */
 
-#include "BppString.h"
+#include <ostream>
 
-using namespace bpp;
+#include "BppString.h"
 
-std::ostream& bpp::operator<<(std::ostream& out, const BppString& s)
+namespace bpp
 {
-  out << s.toSTL();
-  return out;
-}
+  BppString::BppString() = default;
+  BppString::BppString(const char* value)
+    : text_(value)
+  {
+  }
+  BppString::BppString(const std::string& value)
+    : text_(value)
+  {
+  }
+  BppString& BppString::operator=(const char* value)
+  {
+    text_ = value;
+    return *this;
+  }
+  BppString& BppString::operator=(const std::string& value)
+  {
+    text_ = value;
+    return *this;
+  }
+
+  BppString* BppString::clone() const { return new BppString(*this); }
 
+  const std::string& BppString::toSTL() const { return text_; }
 
+  std::ostream& operator<<(std::ostream& out, const BppString& s)
+  {
+    out << s.toSTL();
+    return out;
+  }
+} // namespace bpp
diff --git a/src/Bpp/BppString.h b/src/Bpp/BppString.h
index 98e942c..342c401 100644
--- a/src/Bpp/BppString.h
+++ b/src/Bpp/BppString.h
@@ -1,90 +1,74 @@
 //
 // File: BppString.h
-// Created by: Julien Dutheil
-// Created on: Thu May 04 10:21 2006
+// Authors:
+//   Julien Dutheil
+//   Francois Gindraud (2017)
+// Created: 2006-05-04 10:21:00
+// Last modified: 2017-06-27
 //
 
 /*
-Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
-
-This software is a computer program whose purpose is to provide utilitary
-classes. This file belongs to the Bio++ Project.
-
-This software is governed by the CeCILL  license under French law and
-abiding by the rules of distribution of free software.  You can  use, 
-modify and/ or redistribute the software under the terms of the CeCILL
-license as circulated by CEA, CNRS and INRIA at the following URL
-"http://www.cecill.info". 
-
-As a counterpart to the access to the source code and  rights to copy,
-modify and redistribute granted by the license, users are provided only
-with a limited warranty  and the software's author,  the holder of the
-economic rights,  and the successive licensors  have only  limited
-liability. 
-
-In this respect, the user's attention is drawn to the risks associated
-with loading,  using,  modifying and/or developing or reproducing the
-software by the user in light of its specific status of free software,
-that may mean  that it is complicated to manipulate,  and  that  also
-therefore means  that it is reserved for developers  and  experienced
-professionals having in-depth computer knowledge. Users are therefore
-encouraged to load and test the software's suitability as regards their
-requirements in conditions enabling the security of their systems and/or 
-data to be ensured and,  more generally, to use and operate it in the 
-same conditions as regards security. 
-
-The fact that you are presently reading this means that you have had
-knowledge of the CeCILL license and that you accept its terms.
+  Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
+  
+  This software is a computer program whose purpose is to provide utilitary
+  classes. This file belongs to the Bio++ Project.
+  
+  This software is governed by the CeCILL license under French law and
+  abiding by the rules of distribution of free software. You can use,
+  modify and/ or redistribute the software under the terms of the CeCILL
+  license as circulated by CEA, CNRS and INRIA at the following URL
+  "http://www.cecill.info".
+  
+  As a counterpart to the access to the source code and rights to copy,
+  modify and redistribute granted by the license, users are provided only
+  with a limited warranty and the software's author, the holder of the
+  economic rights, and the successive licensors have only limited
+  liability.
+  
+  In this respect, the user's attention is drawn to the risks associated
+  with loading, using, modifying and/or developing or reproducing the
+  software by the user in light of its specific status of free software,
+  that may mean that it is complicated to manipulate, and that also
+  therefore means that it is reserved for developers and experienced
+  professionals having in-depth computer knowledge. Users are therefore
+  encouraged to load and test the software's suitability as regards their
+  requirements in conditions enabling the security of their systems and/or
+  data to be ensured and, more generally, to use and operate it in the
+  same conditions as regards security.
+  
+  The fact that you are presently reading this means that you have had
+  knowledge of the CeCILL license and that you accept its terms.
 */
 
-#ifndef _BPP_STRING_H_
-#define _BPP_STRING_H_
+#ifndef BPP_BPPSTRING_H
+#define BPP_BPPSTRING_H
 
-#include "Clonable.h"
-
-// From the STL:
+#include <iosfwd>
 #include <string>
-#include <ostream>
 
-namespace bpp
-{
+#include "Clonable.h"
 
-/**
- * @brief The BppString object class.
- *
- * This class extends the stl::string class to support the Clonable interface.
- */
-class BppString: public virtual Clonable
+namespace bpp
 {
+  /** @brief The BppString object class.
+   * This class extends the stl::string class to support the Clonable interface.
+   */
+  class BppString : public Clonable
+  {
   private:
-    std::string text_;
-
-	public:
-		
-		BppString(): text_() {}
-		BppString(const char* value): text_(value) {}
-		BppString(const std::string& value): text_(value) {}
-		BppString& operator=(const char* value) { text_ = value; return *this; }
-		BppString& operator=(const std::string& value) { text_ = value; return *this; }
-		virtual ~BppString() {}
-	
-	public:
-	
-		/**
-		 * @name The Clonable interface.
-		 *
-		 * @{
-		 */
-		BppString * clone() const { return new BppString(*this); }
-		/** @} */
-
-    const std::string& toSTL() const { return text_; }
-    
-};
-
-std::ostream& operator<<(std::ostream& out, const BppString& s);
-
-} //end of namespace bpp.
-
-#endif	//_BPP_STRING_H_
-
+    std::string text_{};
+
+  public:
+    BppString();
+    BppString(const char* value);
+    BppString(const std::string& value);
+    BppString& operator=(const char* value);
+    BppString& operator=(const std::string& value);
+    BppString* clone() const;
+    const std::string& toSTL() const;
+  };
+
+  std::ostream& operator<<(std::ostream& out, const BppString& s);
+
+} // namespace bpp
+#endif // BPP_BPPSTRING_H
diff --git a/src/Bpp/BppVector.h b/src/Bpp/BppVector.h
index e9a921c..15e5ac0 100644
--- a/src/Bpp/BppVector.h
+++ b/src/Bpp/BppVector.h
@@ -1,100 +1,73 @@
 //
 // File: BppVector.h
-// Created by: Julien Dutheil
-// Created on: Mon Apr 07 15:14 2008
+// Authors:
+//   Julien Dutheil
+//   Francois Gindraud (2017)
+// Created: 2008-04-07 15:14:00
+// Last modified: 2017-06-27
 //
 
 /*
-Copyright or © or Copr. CNRS, (November 17, 2004)
-
-This software is a computer program whose purpose is to provide utilitary
-classes. This file belongs to the Bio++ Project.
-
-This software is governed by the CeCILL  license under French law and
-abiding by the rules of distribution of free software.  You can  use, 
-modify and/ or redistribute the software under the terms of the CeCILL
-license as circulated by CEA, CNRS and INRIA at the following URL
-"http://www.cecill.info". 
-
-As a counterpart to the access to the source code and  rights to copy,
-modify and redistribute granted by the license, users are provided only
-with a limited warranty  and the software's author,  the holder of the
-economic rights,  and the successive licensors  have only  limited
-liability. 
-
-In this respect, the user's attention is drawn to the risks associated
-with loading,  using,  modifying and/or developing or reproducing the
-software by the user in light of its specific status of free software,
-that may mean  that it is complicated to manipulate,  and  that  also
-therefore means  that it is reserved for developers  and  experienced
-professionals having in-depth computer knowledge. Users are therefore
-encouraged to load and test the software's suitability as regards their
-requirements in conditions enabling the security of their systems and/or 
-data to be ensured and,  more generally, to use and operate it in the 
-same conditions as regards security. 
-
-The fact that you are presently reading this means that you have had
-knowledge of the CeCILL license and that you accept its terms.
+  Copyright or © or Copr. CNRS, (November 17, 2004)
+  
+  This software is a computer program whose purpose is to provide utilitary
+  classes. This file belongs to the Bio++ Project.
+  
+  This software is governed by the CeCILL license under French law and
+  abiding by the rules of distribution of free software. You can use,
+  modify and/ or redistribute the software under the terms of the CeCILL
+  license as circulated by CEA, CNRS and INRIA at the following URL
+  "http://www.cecill.info".
+  
+  As a counterpart to the access to the source code and rights to copy,
+  modify and redistribute granted by the license, users are provided only
+  with a limited warranty and the software's author, the holder of the
+  economic rights, and the successive licensors have only limited
+  liability.
+  
+  In this respect, the user's attention is drawn to the risks associated
+  with loading, using, modifying and/or developing or reproducing the
+  software by the user in light of its specific status of free software,
+  that may mean that it is complicated to manipulate, and that also
+  therefore means that it is reserved for developers and experienced
+  professionals having in-depth computer knowledge. Users are therefore
+  encouraged to load and test the software's suitability as regards their
+  requirements in conditions enabling the security of their systems and/or
+  data to be ensured and, more generally, to use and operate it in the
+  same conditions as regards security.
+  
+  The fact that you are presently reading this means that you have had
+  knowledge of the CeCILL license and that you accept its terms.
 */
 
-#ifndef _BPPVECTOR_H_
-#define _BPPVECTOR_H_
-
-#include "Clonable.h"
+#ifndef BPP_BPPVECTOR_H
+#define BPP_BPPVECTOR_H
 
-// From the STL:
+#include <utility>
 #include <vector>
 
-namespace bpp
-{
+#include "Clonable.h"
 
-/**
- * @brief The BppVector object class.
- *
- * This class extends the std::vector class to support the Clonable interface.
- */
-template<class TYPE>
-class BppVector: public Clonable
+namespace bpp
 {
-  private:
-    std::vector<TYPE> vector_;
-
-  public:
-
-    BppVector():
-      vector_() {}
-    
-    BppVector(typename std::vector<TYPE>::size_type num, const TYPE& val = TYPE() ):
-      vector_(num, val) {}
-
-    BppVector(typename std::vector<TYPE>::iterator start, typename std::vector<TYPE>::iterator end):
-      vector_(start, end) {}
-
-    virtual ~BppVector() {}
-  
+  /** @brief The BppVector object class.
+   * This class extends the std::vector class to support the Clonable interface.
+   * @deprecated Do not use in new code anymore.
+   */
+  template <typename T>
+  class BppVector : public Clonable, public std::vector<T>
+  {
   public:
-  
-    /**
-     * @name The Clonable interface.
-     *
-     * @{
-     */
-    BppVector<TYPE> * clone() const { return new BppVector<TYPE>(*this); }
-    /** @} */
-
-    const std::vector<TYPE>& toSTL() const { return vector_; }
-    
-    std::vector<TYPE>& toSTL() { return vector_; }
-
-    unsigned int size() const { return vector_.size(); }
-
-    TYPE& operator[] (unsigned int i) { return vector_[i]; }
-    
-    const TYPE& operator[] (unsigned int i) const { return vector_[i]; }
-  
-};
-
-} //end of namespace bpp.
-
-#endif  //_BPPVECTOR_H_
-
+    template <typename... Args>
+    BppVector(Args&&... args)
+      : std::vector<T>(std::forward<Args>(args)...)
+    {
+    }
+
+    BppVector<T>* clone() const { return new BppVector<T>(*this); }
+
+    const std::vector<T>& toSTL() const { return *this; }
+    std::vector<T>& toSTL() { return *this; }
+  };
+} // namespace bpp
+#endif // BPP_BPPVECTOR_H
diff --git a/src/Bpp/Clonable.h b/src/Bpp/Clonable.h
index f976847..105f9ec 100644
--- a/src/Bpp/Clonable.h
+++ b/src/Bpp/Clonable.h
@@ -1,44 +1,48 @@
 //
 // File: Clonable.h
-// Created by: Julien Dutheil
-// Created on: Wed Nov 12 15:55:03 2003
+// Authors:
+//   Julien Dutheil
+//   Francois Gindraud (2017)
+// Created: 2003-11-12 15:55:03
+// Last modified: 2017-06-26
 //
 
 /*
-Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
-
-This software is a computer program whose purpose is to provide utilitary
-classes. This file belongs to the Bio++ Project.
-
-This software is governed by the CeCILL  license under French law and
-abiding by the rules of distribution of free software.  You can  use, 
-modify and/ or redistribute the software under the terms of the CeCILL
-license as circulated by CEA, CNRS and INRIA at the following URL
-"http://www.cecill.info". 
-
-As a counterpart to the access to the source code and  rights to copy,
-modify and redistribute granted by the license, users are provided only
-with a limited warranty  and the software's author,  the holder of the
-economic rights,  and the successive licensors  have only  limited
-liability. 
-
-In this respect, the user's attention is drawn to the risks associated
-with loading,  using,  modifying and/or developing or reproducing the
-software by the user in light of its specific status of free software,
-that may mean  that it is complicated to manipulate,  and  that  also
-therefore means  that it is reserved for developers  and  experienced
-professionals having in-depth computer knowledge. Users are therefore
-encouraged to load and test the software's suitability as regards their
-requirements in conditions enabling the security of their systems and/or 
-data to be ensured and,  more generally, to use and operate it in the 
-same conditions as regards security. 
-
-The fact that you are presently reading this means that you have had
-knowledge of the CeCILL license and that you accept its terms.
+  Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
+  
+  This software is a computer program whose purpose is to provide utilitary
+  classes. This file belongs to the Bio++ Project.
+  
+  This software is governed by the CeCILL license under French law and
+  abiding by the rules of distribution of free software. You can use,
+  modify and/ or redistribute the software under the terms of the CeCILL
+  license as circulated by CEA, CNRS and INRIA at the following URL
+  "http://www.cecill.info".
+  
+  As a counterpart to the access to the source code and rights to copy,
+  modify and redistribute granted by the license, users are provided only
+  with a limited warranty and the software's author, the holder of the
+  economic rights, and the successive licensors have only limited
+  liability.
+  
+  In this respect, the user's attention is drawn to the risks associated
+  with loading, using, modifying and/or developing or reproducing the
+  software by the user in light of its specific status of free software,
+  that may mean that it is complicated to manipulate, and that also
+  therefore means that it is reserved for developers and experienced
+  professionals having in-depth computer knowledge. Users are therefore
+  encouraged to load and test the software's suitability as regards their
+  requirements in conditions enabling the security of their systems and/or
+  data to be ensured and, more generally, to use and operate it in the
+  same conditions as regards security.
+  
+  The fact that you are presently reading this means that you have had
+  knowledge of the CeCILL license and that you accept its terms.
 */
 
-#ifndef _CLONABLE_H_
-#define _CLONABLE_H_
+#ifndef BPP_CLONABLE_H
+#define BPP_CLONABLE_H
+
 
 /**
  * @mainpage
@@ -86,35 +90,23 @@ knowledge of the CeCILL license and that you accept its terms.
 
 namespace bpp
 {
-
-/**
- * @brief The Clonable interface (allow an object to be cloned).
- *
- * A clone is a deep (or hard) copy of an object.
- * This interface provides a method that dynamically creates a copy of itself
- * and send a pointer toward it.
- *
- * This method allows an object to be copied when you do not now its class.
- */
-class Clonable
-{
-  public:
-    
-    Clonable() {}
-  
-    virtual ~Clonable() {}
-  
+  /** @brief The Clonable interface (allow an object to be cloned).
+   *
+   * A clone is a deep (or hard) copy of an object.
+   * This interface provides a method that dynamically creates a copy of itself
+   * and send a pointer toward it.
+   *
+   * This method allows an object to be copied when you do not now its class.
+   */
+  class Clonable
+  {
   public:
-    
-    /**
-     * @brief Create a copy of this object and send a pointer to it.
-     *
+    virtual ~Clonable() = default;
+
+    /** @brief Create a copy of this object and send a pointer to it.
      * @return A pointer toward the copy object.
      */
-    virtual Clonable * clone() const = 0;
-};
-
-} //end of namespace bpp.
-
-#endif  //_CLONABLE_H_
-
+    virtual Clonable* clone() const = 0;
+  };
+} // namespace bpp
+#endif // BPP_CLONABLE_H
diff --git a/src/Bpp/Exceptions.cpp b/src/Bpp/Exceptions.cpp
index 60baf8d..f25b249 100644
--- a/src/Bpp/Exceptions.cpp
+++ b/src/Bpp/Exceptions.cpp
@@ -1,104 +1,130 @@
 //
-// File Exceptions.cpp
-// Created by: Guillaume Deuchst
-//              Julien Dutheil
-//              Sylvain Gaillard
-// Last modification : Thu Jul 22 2004
+// File: Exceptions.cpp
+// Authors:
+//   Guillaume Deuchst
+//   Julien Dutheil
+//   Sylvain Gaillard
+//   Francois Gindraud (2017)
+// Created: 2017-03-28 00:00:00
+// Last modified: 2017-06-27
 //
 
 /*
-Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
-
-This software is a computer program whose purpose is to provide utilitary
-classes. This file belongs to the Bio++ Project.
-
-This software is governed by the CeCILL  license under French law and
-abiding by the rules of distribution of free software.  You can  use, 
-modify and/ or redistribute the software under the terms of the CeCILL
-license as circulated by CEA, CNRS and INRIA at the following URL
-"http://www.cecill.info". 
-
-As a counterpart to the access to the source code and  rights to copy,
-modify and redistribute granted by the license, users are provided only
-with a limited warranty  and the software's author,  the holder of the
-economic rights,  and the successive licensors  have only  limited
-liability. 
-
-In this respect, the user's attention is drawn to the risks associated
-with loading,  using,  modifying and/or developing or reproducing the
-software by the user in light of its specific status of free software,
-that may mean  that it is complicated to manipulate,  and  that  also
-therefore means  that it is reserved for developers  and  experienced
-professionals having in-depth computer knowledge. Users are therefore
-encouraged to load and test the software's suitability as regards their
-requirements in conditions enabling the security of their systems and/or 
-data to be ensured and,  more generally, to use and operate it in the 
-same conditions as regards security. 
-
-The fact that you are presently reading this means that you have had
-knowledge of the CeCILL license and that you accept its terms.
-*/
-
-#include "Exceptions.h"
-#include "Text/TextTools.h"
-
-using namespace bpp;
-using namespace std;
-
-/******************************************************************************/
+  Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
   
-BadIntegerException::BadIntegerException(const char* text, int badInt):
-  Exception(string(text) + "(" + TextTools::toString(badInt) + ")"),
-  badInt_(badInt) {}
-
-BadIntegerException::BadIntegerException(const std::string& text, int badInt):
-  Exception(text + "(" + TextTools::toString(badInt) + ")"),
-  badInt_(badInt) {}
-
-/******************************************************************************/
-
-BadNumberException::BadNumberException(const char* text, double badNumber):
-  Exception(string(text) + "(" + TextTools::toString(badNumber) + ")"),
-  badNumber_(badNumber) {}
-
-BadNumberException::BadNumberException(const std::string& text, double badNumber):
-  Exception(text + "(" + TextTools::toString(badNumber) + ")"),
-  badNumber_(badNumber) {}
-
-/******************************************************************************/
-
-NumberFormatException::NumberFormatException(const char* text, const std::string& badNumber):
-  Exception(string(text) + "(" + badNumber + ")"),
-  badNumber_(badNumber) {}
-
-NumberFormatException::NumberFormatException(const std::string& text, const std::string& badNumber):
-  Exception(text + "(" + badNumber + ")"),
-  badNumber_(badNumber) {}
-
-/******************************************************************************/
-
-vector<size_t> IndexOutOfBoundsException::getBounds() const
-{
-  vector<size_t> bounds(2);
-  bounds[0] = lowerBound_;
-  bounds[1] = upperBound_;
-  return bounds;
-}
-
-/******************************************************************************/
+  This software is a computer program whose purpose is to provide utilitary
+  classes. This file belongs to the Bio++ Project.
   
-BadSizeException::BadSizeException(const std::string& text, size_t badSize, size_t correctSize):
-  Exception("Incorrect size " + TextTools::toString(badSize) + ", expected " + TextTools::toString(correctSize) + ". " + text),
-  badSize_(badSize),
-  correctSize_(correctSize) {}
-
-/******************************************************************************/
+  This software is governed by the CeCILL license under French law and
+  abiding by the rules of distribution of free software. You can use,
+  modify and/ or redistribute the software under the terms of the CeCILL
+  license as circulated by CEA, CNRS and INRIA at the following URL
+  "http://www.cecill.info".
+  
+  As a counterpart to the access to the source code and rights to copy,
+  modify and redistribute granted by the license, users are provided only
+  with a limited warranty and the software's author, the holder of the
+  economic rights, and the successive licensors have only limited
+  liability.
+  
+  In this respect, the user's attention is drawn to the risks associated
+  with loading, using, modifying and/or developing or reproducing the
+  software by the user in light of its specific status of free software,
+  that may mean that it is complicated to manipulate, and that also
+  therefore means that it is reserved for developers and experienced
+  professionals having in-depth computer knowledge. Users are therefore
+  encouraged to load and test the software's suitability as regards their
+  requirements in conditions enabling the security of their systems and/or
+  data to be ensured and, more generally, to use and operate it in the
+  same conditions as regards security.
+  
+  The fact that you are presently reading this means that you have had
+  knowledge of the CeCILL license and that you accept its terms.
+*/
 
-OutOfRangeException::OutOfRangeException(const std::string& text, double badValue, double lowerBound, double upperBound):
-  Exception(TextTools::toString(badValue) + " out of [" + TextTools::toString(lowerBound) + ", " + TextTools::toString(upperBound) +  "])" + text),
-  lowerBound_(lowerBound),
-  upperBound_(upperBound)
-{}
+#include <string>
+#include <utility>
 
-/******************************************************************************/
+#include "Exceptions.h"
 
+namespace bpp
+{
+  Exception::Exception(std::string text)
+    : message_(std::move(text))
+  {
+  }
+  const char* Exception::what() const noexcept { return message_.c_str(); }
+  const std::string& Exception::message() const noexcept { return message_; }
+
+  IOException::IOException(std::string text)
+    : Exception(std::move(text))
+  {
+  }
+
+  NullPointerException::NullPointerException(std::string text)
+    : Exception(std::move(text))
+  {
+  }
+
+  ZeroDivisionException::ZeroDivisionException(std::string text)
+    : Exception(std::move(text))
+  {
+  }
+
+  BadIntegerException::BadIntegerException(std::string text, int badInt)
+    : Exception(std::move(text) + '(' + std::to_string(badInt) + ')')
+    , badInt_(badInt)
+  {
+  }
+  int BadIntegerException::getBadInteger() const { return badInt_; }
+
+  BadNumberException::BadNumberException(std::string text, double badNumber)
+    : Exception(std::move(text) + '(' + std::to_string(badNumber) + ')')
+    , badNumber_(badNumber)
+  {
+  }
+  double BadNumberException::getBadNumber() const { return badNumber_; }
+
+  NumberFormatException::NumberFormatException(std::string text, std::string badNumber)
+    : Exception(std::move(text) + '(' + std::move(badNumber) + ')')
+    , badNumber_(badNumber)
+  {
+  }
+  const std::string& NumberFormatException::getBadNumber() const { return badNumber_; }
+
+  IndexOutOfBoundsException::IndexOutOfBoundsException(std::string text, std::size_t badInt, std::size_t lowerBound,
+                                                       std::size_t upperBound)
+    : Exception("out of [" + std::to_string(lowerBound) + ", " + std::to_string(upperBound) + "])" + std::move(text))
+    , badIndex_(badInt)
+    , bounds_{{lowerBound, upperBound}}
+  {
+  }
+  const std::array<std::size_t, 2>& IndexOutOfBoundsException::getBounds() const { return bounds_; }
+  std::size_t IndexOutOfBoundsException::getBadIndex() const { return badIndex_; }
+
+  BadSizeException::BadSizeException(std::string text, std::size_t badSize, std::size_t correctSize)
+    : Exception("Incorrect size " + std::to_string(badSize) + ", expected " + std::to_string(correctSize) + ". " +
+                std::move(text))
+    , badSize_(badSize)
+    , correctSize_(correctSize)
+  {
+  }
+  std::size_t BadSizeException::getBadSize() const { return badSize_; }
+  std::size_t BadSizeException::getCorrectSize() const { return correctSize_; }
+
+  OutOfRangeException::OutOfRangeException(std::string text, double badValue, double lowerBound, double upperBound)
+    : Exception(std::to_string(badValue) + " out of [" + std::to_string(lowerBound) + ", " +
+                std::to_string(upperBound) + "])" + std::move(text))
+    , badValue_(badValue)
+    , bounds_{{lowerBound, upperBound}}
+  {
+  }
+  double OutOfRangeException::getBadValue() const { return badValue_; }
+  double OutOfRangeException::getLowerBound() const { return bounds_[0]; }
+  double OutOfRangeException::getUpperBound() const { return bounds_[1]; }
+
+  NotImplementedException::NotImplementedException(std::string text)
+    : Exception(std::move(text))
+  {
+  }
+} // namespace bpp
diff --git a/src/Bpp/Exceptions.h b/src/Bpp/Exceptions.h
index 2c1bc08..e7df415 100644
--- a/src/Bpp/Exceptions.h
+++ b/src/Bpp/Exceptions.h
@@ -1,425 +1,231 @@
 //
-// File Exceptions.h
-// Created by: Guillaume Deuchst
-//              Julien Dutheil
-//              Sylvain Gaillard
-// Last modification : Thu Jul 22 2004
+// File: Exceptions.h
+// Authors:
+//   Guillaume Deuchst
+//   Julien Dutheil
+//   Sylvain Gaillard
+//   Francois Gindraud (2017)
+// Last modified: 2017-06-26
 //
 
 /*
-Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
-
-This software is a computer program whose purpose is to provide utilitary
-classes. This file belongs to the Bio++ Project.
-
-This software is governed by the CeCILL  license under French law and
-abiding by the rules of distribution of free software.  You can  use, 
-modify and/ or redistribute the software under the terms of the CeCILL
-license as circulated by CEA, CNRS and INRIA at the following URL
-"http://www.cecill.info". 
-
-As a counterpart to the access to the source code and  rights to copy,
-modify and redistribute granted by the license, users are provided only
-with a limited warranty  and the software's author,  the holder of the
-economic rights,  and the successive licensors  have only  limited
-liability. 
-
-In this respect, the user's attention is drawn to the risks associated
-with loading,  using,  modifying and/or developing or reproducing the
-software by the user in light of its specific status of free software,
-that may mean  that it is complicated to manipulate,  and  that  also
-therefore means  that it is reserved for developers  and  experienced
-professionals having in-depth computer knowledge. Users are therefore
-encouraged to load and test the software's suitability as regards their
-requirements in conditions enabling the security of their systems and/or 
-data to be ensured and,  more generally, to use and operate it in the 
-same conditions as regards security. 
-
-The fact that you are presently reading this means that you have had
-knowledge of the CeCILL license and that you accept its terms.
+  Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
+  
+  This software is a computer program whose purpose is to provide utilitary
+  classes. This file belongs to the Bio++ Project.
+  
+  This software is governed by the CeCILL license under French law and
+  abiding by the rules of distribution of free software. You can use,
+  modify and/ or redistribute the software under the terms of the CeCILL
+  license as circulated by CEA, CNRS and INRIA at the following URL
+  "http://www.cecill.info".
+  
+  As a counterpart to the access to the source code and rights to copy,
+  modify and redistribute granted by the license, users are provided only
+  with a limited warranty and the software's author, the holder of the
+  economic rights, and the successive licensors have only limited
+  liability.
+  
+  In this respect, the user's attention is drawn to the risks associated
+  with loading, using, modifying and/or developing or reproducing the
+  software by the user in light of its specific status of free software,
+  that may mean that it is complicated to manipulate, and that also
+  therefore means that it is reserved for developers and experienced
+  professionals having in-depth computer knowledge. Users are therefore
+  encouraged to load and test the software's suitability as regards their
+  requirements in conditions enabling the security of their systems and/or
+  data to be ensured and, more generally, to use and operate it in the
+  same conditions as regards security.
+  
+  The fact that you are presently reading this means that you have had
+  knowledge of the CeCILL license and that you accept its terms.
 */
 
-#ifndef _EXCEPTIONS_H_
-#define _EXCEPTIONS_H_
+#ifndef BPP_EXCEPTIONS_H
+#define BPP_EXCEPTIONS_H
 
+#include <array>
 #include <stdexcept>
-#include <vector>
 #include <string>
-#include "Text/TextTools.h"
 
 namespace bpp
 {
-
-/**
- * @brief Exception base class.
- *
- * Overload exception constructor (to control the exceptions mechanism).</p>
- */
-class Exception:
-  public std::exception
-{
-  protected:
+  /** @brief Exception base class.
+   * Overload exception constructor (to control the exceptions mechanism).
+   * Destructor is already virtual (from std::exception)
+   */
+  class Exception : public std::exception
+  {
+  private:
     std::string message_;
-  
-  public:
-    /**
-     * @brief Build a new Exception.
-     *
-     * @param text A message to be passed to the exception hierarchy.
-     */
-    Exception(const char* text): message_(std::string(text)) {}
-
-    /**
-     * @brief Build a new Exception.
-     *
-     * @param text A message to be passed to the exception hierarchy.
-     */
-    Exception(const std::string& text): message_(text) {}
-  
-    virtual ~Exception() throw() {}
 
   public:
-    
-    /**
-     * @brief Method to get the message of the exception (STL method redefinition).
-     *
-     * @return The message passed to the exception hierarchy.
-     */
-    const char* what() const throw() { return message_.c_str(); }
-};
-
-
-/**
- * @brief The base class exception for IO error.
- */
-class IOException:
-  public Exception
-{
-  public: // Class constructors and destructor:
-    
-    /**
-     * @brief Build a new IOException.
-     *
+    /** @brief Build a new Exception.
      * @param text A message to be passed to the exception hierarchy.
      */
-    IOException(const char* text): Exception(text) {}
-
-    /**
-     * @brief Build a new IOException.
-     *
-     * @param text A message to be passed to the exception hierarchy.
+    Exception(std::string text);
+    /** @brief Method to get the message of the exception (STL method redefinition).
+     * @return The message passed to the exception hierarchy.
      */
-    IOException(const std::string& text): Exception(text) {} 
-  
-    virtual ~IOException() throw() {}
-
-};
-
+    const char* what() const noexcept override;
+    /// Access the message as a std::string.
+    const std::string& message() const noexcept;
+  };
 
-/**
- * @brief The base class exception for NULL pointer error.
- *
- * This exception may be thrown when an unexpected NULL pointer is found.
- */
-class NullPointerException:
-  public Exception
-{
+  /// The base class exception for IO error.
+  class IOException : public Exception
+  {
   public:
-
-    /**
-     * @brief Build a new NullPointerException.
-     *
+    /** @brief Build a new IOException.
      * @param text A message to be passed to the exception hierarchy.
      */
-    NullPointerException(const char* text): Exception(text) {}
-
-    /**
-     * @brief Build a new NullPointerException.
-     *
-     * @param text A message to be passed to the exception hierarchy.
-     */
-    NullPointerException(const std::string& text): Exception(text) {}
-
-    virtual ~NullPointerException() throw() {}
-};
-
+    IOException(std::string text);
+  };
 
-/**
- * @brief The base class exception for zero division error.
- */
-class ZeroDivisionException:
-  public Exception
-{
+  /** @brief The base class exception for NULL pointer error.
+   * This exception may be thrown when an unexpected NULL pointer is found.
+   */
+  class NullPointerException : public Exception
+  {
   public:
-
-    /**
-     * @brief Build a new ZeroDivisionException.
-     *
+    /** @brief Build a new NullPointerException.
      * @param text A message to be passed to the exception hierarchy.
      */
-    ZeroDivisionException(const char* text): Exception(text) {}
+    NullPointerException(std::string text);
+  };
 
-    /**
-     * @brief Build a new ZeroDivisionException.
-     *
+  /// The base class exception for zero division error.
+  class ZeroDivisionException : public Exception
+  {
+  public:
+    /** @brief Build a new ZeroDivisionException.
      * @param text A message to be passed to the exception hierarchy.
      */
-    ZeroDivisionException(const std::string& text): Exception(text) {}
+    ZeroDivisionException(std::string text);
+  };
 
-    virtual ~ZeroDivisionException() throw() {}
-};
-
-  
-/**
- * @brief Number exception: integers.
- */
-class BadIntegerException:
-  public Exception
-{
-  protected:
+  /// Number exception: integers.
+  class BadIntegerException : public Exception
+  {
+  private:
     int badInt_;
-  
-  public:
-    
-    /**
-     * @brief Build a new BadIntegerException.
-     *
-     * @param text   A message to be passed to the exception hierarchy.
-     * @param badInt The faulty integer.
-     */
-    BadIntegerException(const char* text, int badInt);
 
-    /**
-     * @brief Build a new BadIntegerException.
-     *
+  public:
+    /** @brief Build a new BadIntegerException.
      * @param text   A message to be passed to the exception hierarchy.
      * @param badInt The faulty integer.
      */
-    BadIntegerException(const std::string& text, int badInt);
-  
-    virtual ~BadIntegerException() throw() {}
-
-  public:
-    
-    /**
-     * @brief Get the integer that threw this exception.
-     *
+    BadIntegerException(std::string text, int badInt);
+    /** @brief Get the integer that threw this exception.
      * @return The faulty integer.
      */
-    int getBadInteger() const { return badInt_; }
-  
-};
-
+    int getBadInteger() const;
+  };
 
-/**
- * @brief Number exception: doubles.
- */
-class BadNumberException:
-  public Exception
-{
-  protected:
+  /// Number exception: doubles.
+  class BadNumberException : public Exception
+  {
+  private:
     double badNumber_;
-  
-  public:
-    
-    /**
-     * @brief Build a new BadNumberException.
-     *
-     * @param text      A message to be passed to the exception hierarchy.
-     * @param badNumber The faulty number.
-     */
-    BadNumberException(const char* text, double badNumber);
 
-    /**
-     * @brief Build a new BadNumberException.
-     *
+  public:
+    /** @brief Build a new BadNumberException.
      * @param text      A message to be passed to the exception hierarchy.
      * @param badNumber The faulty number.
      */
-    BadNumberException(const std::string& text, double badNumber);
-  
-    virtual ~BadNumberException() throw() {}
-
-  public:
-    
-    /**
-     * @brief Get the number that threw this exception.
-     *
+    BadNumberException(std::string text, double badNumber);
+    /** @brief Get the number that threw this exception.
      * @return The faulty number.
      */
-    double getBadNumber() const { return badNumber_; }
-  
-};
+    double getBadNumber() const;
+  };
 
-
-/**
- * @brief Number format exception.
- */
-class NumberFormatException:
-  public Exception
-{
-  protected:
+  /// Number format exception.
+  class NumberFormatException : public Exception
+  {
+  private:
     std::string badNumber_;
-  
-  public:
-    
-    /**
-     * @brief Build a new NumberFormatException.
-     *
-     * @param text      A message to be passed to the exception hierarchy.
-     * @param badNumber The faulty number.
-     */
-    NumberFormatException(const char* text, const std::string& badNumber);
 
-    /**
-     * @brief Build a new NumberFormatException.
-     *
+  public:
+    /** @brief Build a new NumberFormatException.
      * @param text      A message to be passed to the exception hierarchy.
      * @param badNumber The faulty number.
      */
-    NumberFormatException(const std::string& text, const std::string& badNumber);
-  
-    virtual ~NumberFormatException() throw() {}
-
-  public:
-    
-    /**
-     * @brief Get the number that threw this exception.
-     *
+    NumberFormatException(std::string text, std::string badNumber);
+    /** @brief Get the number that threw this exception.
      * @return The faulty number.
      */
-    std::string getBadNumber() const { return badNumber_; }
-  
-};
+    const std::string& getBadNumber() const;
+  };
 
+  /// Index out of bounds exception class.
+  class IndexOutOfBoundsException : public Exception
+  {
+  private:
+    std::size_t badIndex_;
+    std::array<std::size_t, 2> bounds_;
 
-/**
- * @brief Index out of bounds exception class.
- */
-class IndexOutOfBoundsException:
-  public virtual Exception
-{
-  protected:
-    size_t badIndex_, lowerBound_, upperBound_;
-  
   public:
-
-    /**
-     * @brief Build a new IndexOutOfBoundsException.
-     *
+    /** @brief Build a new IndexOutOfBoundsException.
      * @param text   A message to be passed to the exception hierarchy.
      * @param badInt The faulty integer.
      * @param lowerBound Lower limit.
      * @param upperBound Upper limit.
      */
-  IndexOutOfBoundsException(const std::string& text, size_t badInt, size_t lowerBound, size_t upperBound) :
-    Exception("out of [" + TextTools::toString(lowerBound) + ", " + TextTools::toString(upperBound) +  "])" + text),
-    badIndex_(badInt),
-    lowerBound_(lowerBound),
-    upperBound_(upperBound) {}
-  
-    virtual ~IndexOutOfBoundsException() throw() {}
-
-  public:
-    
-    /**
-     * @brief Get the bounds.
-     *
-     * @return The bounds.
-     */
-    std::vector<size_t> getBounds() const;
+    IndexOutOfBoundsException(std::string text, std::size_t badInt, std::size_t lowerBound, std::size_t upperBound);
+    /// Get the bounds.
+    const std::array<std::size_t, 2>& getBounds() const;
+    std::size_t getBadIndex() const;
+  };
 
-    size_t getBadIndex() const { return badIndex_; }
-};
+  /// Wrong size exception class.
+  class BadSizeException : public Exception
+  {
+  private:
+    std::size_t badSize_;
+    std::size_t correctSize_;
 
-
-/**
- * @brief Wrong size exception class.
- */
-class BadSizeException:
-  public virtual Exception
-{
-  protected:
-    size_t badSize_, correctSize_;
-  
   public:
-    
-    /**
-     * @brief Build a new BadSizeException.
-     *
+    /** @brief Build a new BadSizeException.
      * @param text   A message to be passed to the exception hierarchy.
      * @param badSize The faulty size.
      * @param correctSize The expected size.
      */
-    BadSizeException(const std::string& text, size_t badSize, size_t correctSize);
-  
-    virtual ~BadSizeException() throw() {}
+    BadSizeException(std::string text, std::size_t badSize, std::size_t correctSize);
 
-  public:
-    
-    size_t getBadSize() const { return badSize_; }
-    size_t getCorrectSize() const { return correctSize_; }
-};
+    std::size_t getBadSize() const;
+    std::size_t getCorrectSize() const;
+  };
 
+  /// Out of range exception class.
+  class OutOfRangeException : public Exception
+  {
+  private:
+    double badValue_;
+    std::array<double, 2> bounds_;
 
-/**
- * @brief Out of range exception class.
- */
-class OutOfRangeException:
-  public Exception
-{
-  protected:
-    double lowerBound_, upperBound_;
-  
   public:
-    
-    /**
-     * @brief Build a new OutOfRangeException.
-     *
+    /** @brief Build a new OutOfRangeException.
      * @param text   A message to be passed to the exception hierarchy.
      * @param badValue The faulty value.
      * @param lowerBound Lower limit.
      * @param upperBound Upper limit.
      */
-    OutOfRangeException(const std::string& text, double badValue, double lowerBound, double upperBound);
-  
-    virtual ~OutOfRangeException() throw() {}
+    OutOfRangeException(std::string text, double badValue, double lowerBound, double upperBound);
 
-  public:
-    
-    /**
-     * @return The lower bound.
-     */
-    double getLowerBound() const { return lowerBound_; }
-
-    /**
-     * @return The upper bound.
-     */
-    double getUpperBound() const { return upperBound_; }
-};
+    double getBadValue () const;
+    double getLowerBound() const;
+    double getUpperBound() const;
+  };
 
-
-/**
- * @brief This expeption is sent when a given method is not implemented.
- */
-class NotImplementedException:
-  public Exception
-{
+  /// This exception is sent when a given method is not implemented.
+  class NotImplementedException : public Exception
+  {
   public:
-
-    /**
-     * @brief Build a new NotImplementedException.
-     *
+    /** @brief Build a new NotImplementedException.
      * @param text A message to be passed to the exception hierarchy.
      */
-    NotImplementedException(const std::string& text): Exception(text) {}
-
-    virtual ~NotImplementedException() throw() {}
-};
-
-
-
-} //end of namespace bpp.
-
-#endif // _EXCEPTIONS_H_
-
+    NotImplementedException(std::string text);
+  };
+} // namespace bpp
+#endif // BPP_EXCEPTIONS_H
diff --git a/src/Bpp/Graph/AssociationDAGraphImplObserver.h b/src/Bpp/Graph/AssociationDAGraphImplObserver.h
index d5d18c2..6a825f0 100644
--- a/src/Bpp/Graph/AssociationDAGraphImplObserver.h
+++ b/src/Bpp/Graph/AssociationDAGraphImplObserver.h
@@ -217,7 +217,7 @@ public:
 
   NodeIndex getSon(const EdgeIndex edgeId) const
   {
-    return this->getNodeIndex(this->getNode(this->getGraph()->getBottom(this->getEdgeGraphid(this->getEdge(edgeId)))));
+    return this->getNodeIndex(this->getNodeFromGraphid(this->getGraph()->getBottom(this->getEdgeGraphid(this->getEdge(edgeId)))));
   }
 
 
@@ -234,7 +234,7 @@ public:
 
   NodeIndex getFather(const EdgeIndex edge) const
   {
-    return this->getNodeIndex(this->getNode(this->getGraph()->getTop(this->getEdgeGraphid(this->getEdge(edge)))));
+    return this->getNodeIndex(this->getNodeFromGraphid(this->getGraph()->getTop(this->getEdgeGraphid(this->getEdge(edge)))));
   }
 
   /**
@@ -365,6 +365,11 @@ public:
     return this->incomingNeighborNodesIterator(node);
   }
 
+  std::unique_ptr<typename AssociationDAGraphObserver<N, E>::NodeIterator> fathersIterator(std::shared_ptr<N> node) const
+  {
+    return this->incomingNeighborNodesIterator(node);
+  }
+
   /*
    * @brief builds iterator on the sons of a Node
    *
@@ -375,6 +380,11 @@ public:
     return this->outgoingNeighborNodesIterator(node);
   }
 
+  std::unique_ptr<typename AssociationDAGraphObserver<N, E>::NodeIterator> sonsIterator(std::shared_ptr<N> node) const
+  {
+    return this->outgoingNeighborNodesIterator(node);
+  }
+
   /**
    * @brief Get Below Objects.
    *
diff --git a/src/Bpp/Graph/AssociationDAGraphObserver.h b/src/Bpp/Graph/AssociationDAGraphObserver.h
index e1694e4..5a6f570 100644
--- a/src/Bpp/Graph/AssociationDAGraphObserver.h
+++ b/src/Bpp/Graph/AssociationDAGraphObserver.h
@@ -232,6 +232,8 @@ public:
 
   virtual std::unique_ptr<NodeIterator> sonsIterator(std::shared_ptr<N> node) = 0;
 
+  virtual std::unique_ptr<NodeIterator> sonsIterator(std::shared_ptr<N> node) const = 0;
+
   /*
    * @brief builds iterator on the fathers of a Node
    *
@@ -239,6 +241,8 @@ public:
 
   virtual std::unique_ptr<NodeIterator> fathersIterator(std::shared_ptr<N> node) = 0;
 
+  virtual std::unique_ptr<NodeIterator> fathersIterator(std::shared_ptr<N> node) const = 0;
+
   /**
    * @brief Get Below Objects.
    *
diff --git a/src/Bpp/Graph/AssociationGraphImplObserver.h b/src/Bpp/Graph/AssociationGraphImplObserver.h
index 3a4409e..accb73f 100644
--- a/src/Bpp/Graph/AssociationGraphImplObserver.h
+++ b/src/Bpp/Graph/AssociationGraphImplObserver.h
@@ -1,57 +1,58 @@
 //
-// File AssociationGraphImplObserver.h
-// Created by: Thomas Bigot
-// Last modification : vendredi 4 novembre 2016, à 10h 21
+// File: AssociationGraphImplObserver.h
+// Authors:
+//   Thomas Bigot
+// Last modified: 2017-06-27
 //
 
 /*
-   Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
-
-   This software is a computer program whose purpose is to provide utilitary
-   classes. This file belongs to the Bio++ Project.
-
-   This software is governed by the CeCILL  license under French law and
-   abiding by the rules of distribution of free software.  You can  use,
-   modify and/ or redistribute the software under the terms of the CeCILL
-   license as circulated by CEA, CNRS and INRIA at the following URL
-   "http://www.cecill.info".
-
-   As a counterpart to the access to the source code and  rights to copy,
-   modify and redistribute granted by the license, users are provided only
-   with a limited warranty  and the software's author,  the holder of the
-   economic rights,  and the successive licensors  have only  limited
-   liability.
-
-   In this respect, the user's attention is drawn to the risks associated
-   with loading,  using,  modifying and/or developing or reproducing the
-   software by the user in light of its specific status of free software,
-   that may mean  that it is complicated to manipulate,  and  that  also
-   therefore means  that it is reserved for developers  and  experienced
-   professionals having in-depth computer knowledge. Users are therefore
-   encouraged to load and test the software's suitability as regards their
-   requirements in conditions enabling the security of their systems and/or
-   data to be ensured and,  more generally, to use and operate it in the
-   same conditions as regards security.
-
-   The fact that you are presently reading this means that you have had
-   knowledge of the CeCILL license and that you accept its terms.
- */
-
-#ifndef _ASSOCIATION_GRAPH_IMPL_OBSERVER_HPP_
-#define _ASSOCIATION_GRAPH_IMPL_OBSERVER_HPP_
+  Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
+  
+  This software is a computer program whose purpose is to provide utilitary
+  classes. This file belongs to the Bio++ Project.
+  
+  This software is governed by the CeCILL license under French law and
+  abiding by the rules of distribution of free software. You can use,
+  modify and/ or redistribute the software under the terms of the CeCILL
+  license as circulated by CEA, CNRS and INRIA at the following URL
+  "http://www.cecill.info".
+  
+  As a counterpart to the access to the source code and rights to copy,
+  modify and redistribute granted by the license, users are provided only
+  with a limited warranty and the software's author, the holder of the
+  economic rights, and the successive licensors have only limited
+  liability.
+  
+  In this respect, the user's attention is drawn to the risks associated
+  with loading, using, modifying and/or developing or reproducing the
+  software by the user in light of its specific status of free software,
+  that may mean that it is complicated to manipulate, and that also
+  therefore means that it is reserved for developers and experienced
+  professionals having in-depth computer knowledge. Users are therefore
+  encouraged to load and test the software's suitability as regards their
+  requirements in conditions enabling the security of their systems and/or
+  data to be ensured and, more generally, to use and operate it in the
+  same conditions as regards security.
+  
+  The fact that you are presently reading this means that you have had
+  knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#ifndef BPP_GRAPH_ASSOCIATIONGRAPHIMPLOBSERVER_H
+#define BPP_GRAPH_ASSOCIATIONGRAPHIMPLOBSERVER_H
 
-#include "AssociationGraphObserver.h"
-#include "GlobalGraph.h"
-
-#include "../Exceptions.h"
-#include "../Clonable.h"
-
-#include <vector>
-#include <map>
 #include <iostream>
-#include <ostream>
+#include <map>
 #include <memory>
+#include <ostream>
 #include <type_traits>
+#include <vector>
+
+#include "../Clonable.h"
+#include "../Exceptions.h"
+#include "../Text/TextTools.h"
+#include "AssociationGraphObserver.h"
+#include "GlobalGraph.h"
 
 namespace bpp
 {
@@ -525,6 +526,9 @@ public:
    */
   void associateNode(std::shared_ptr<N>  nodeObject, NodeGraphid graphNode)
   {
+    if (NToGraphid_.find(nodeObject) != NToGraphid_.end())
+      throw Exception("AssociationGraphImplObserver::associateNode : node already exists");
+
     // nodes vector must be the right size. Eg: to store a node with
     // the ID 3, the vector must be of size 4: {0,1,2,3} (size = 4)
     if (graphidToN_.size() < graphNode + 1)
@@ -542,7 +546,10 @@ public:
    */
   void associateEdge(std::shared_ptr<E>  edgeObject, EdgeGraphid graphEdge)
   {
-    // nodes vector must be the right size. Eg: to store an edge with
+    if (EToGraphid_.find(edgeObject) != EToGraphid_.end())
+      throw Exception("AssociationGraphImplObserver::associateEdge : edge already exists");
+    
+    // edges vector must be the right size. Eg: to store an edge with
     // the ID 3, the vector must be of size 4: {0,1,2,3} (size = 4)
     if (graphidToE_.size() < graphEdge + 1)
       graphidToE_.resize(graphEdge + 1);
@@ -1083,16 +1090,29 @@ public:
     return indexesToReturn;
   }
 
+  std::vector<EdgeIndex> getAllEdgesIndexes() const
+  {
+    std::vector<typename AssociationGraphObserver<N, E>::EdgeIndex > indexesToReturn;
+    for (typename std::vector<std::shared_ptr<E> >::const_iterator currEdgeObject = graphidToE_.begin(); currEdgeObject != graphidToE_.end(); currEdgeObject++)
+    {
+      if (*currEdgeObject != 00)
+      {
+        indexesToReturn.push_back(getEdgeIndex(*currEdgeObject));
+      }
+    }
+    return indexesToReturn;
+  }
+
 
   template<class GraphIterator, bool is_const>
   class EdgeIteratorClass :
     public AssociationGraphObserver<N, E>::EdgeIterator
   {
-private:
+  private:
     EdgesIteratorClass<GraphIterator, is_const> it_;
     const AssociationGraphImplObserver<N, E, GraphImpl>& agio_;
-
-public:
+    
+  public:
     EdgeIteratorClass<GraphIterator, is_const>(AssociationGraphImplObserver<N, E, GraphImpl> &agio) : it_(*agio.getGraph()),
       agio_(agio) { start(); };
 
@@ -1183,6 +1203,11 @@ public:
     return getGraph()->isLeaf(this->getNodeGraphid(node));
   }
 
+  bool isLeaf(const NodeIndex nodeid) const
+  {
+    return getGraph()->isLeaf(this->getNodeGraphid(getNode(nodeid)));
+  }
+
   /**
    * Get nodes located at the extremities of an edge
    * @param edge an edge
@@ -1328,5 +1353,4 @@ public:
 template<class N, class E>
 using AssociationGlobalGraphObserver = AssociationGraphImplObserver<N, E, GlobalGraph>;
 }
-
-#endif
+#endif // BPP_GRAPH_ASSOCIATIONGRAPHIMPLOBSERVER_H
diff --git a/src/Bpp/Graph/AssociationGraphObserver.h b/src/Bpp/Graph/AssociationGraphObserver.h
index 1788f3f..0717be0 100644
--- a/src/Bpp/Graph/AssociationGraphObserver.h
+++ b/src/Bpp/Graph/AssociationGraphObserver.h
@@ -459,6 +459,8 @@ public:
    */
 
   virtual std::vector<std::shared_ptr<E> > getAllEdges() const = 0;
+  virtual std::vector<EdgeIndex> getAllEdgesIndexes() const = 0;
+
 
   /**
    * Returns the Edge between two nodes nodeA -> nodeB
diff --git a/src/Bpp/Graph/AssociationTreeGraphImplObserver.h b/src/Bpp/Graph/AssociationTreeGraphImplObserver.h
index 48cb98c..6895f7d 100644
--- a/src/Bpp/Graph/AssociationTreeGraphImplObserver.h
+++ b/src/Bpp/Graph/AssociationTreeGraphImplObserver.h
@@ -239,7 +239,7 @@ public:
 
   NodeIndex getSon(const EdgeIndex edge) const
   {
-    return this->getNodeIndex(this->getNode(this->getGraph()->getBottom(this->getEdgeGraphid(this->getEdge(edge)))));
+    return this->getNodeIndex(this->getNodeFromGraphid(this->getGraph()->getBottom(this->getEdgeGraphid(this->getEdge(edge)))));
   }
 
   /**
@@ -255,7 +255,7 @@ public:
 
   NodeIndex getFather(const EdgeIndex edge) const
   {
-    return this->getNodeIndex(this->getNode(this->getGraph()->getTop(this->getEdgeGraphid(this->getEdge(edge)))));
+    return this->getNodeIndex(this->getNodeFromGraphid(this->getGraph()->getTop(this->getEdgeGraphid(this->getEdge(edge)))));
   }
 
 
@@ -346,6 +346,11 @@ public:
     return this->outgoingNeighborNodesIterator(node);
   }
 
+  std::unique_ptr<typename AssociationTreeGraphObserver<N, E>::NodeIterator> sonsIterator(std::shared_ptr<N> node) const
+  {
+    return this->outgoingNeighborNodesIterator(node);
+  }
+
   /*
    * @brief builds iterator on the branches to sons of a Node
    *
@@ -356,6 +361,11 @@ public:
     return this->outgoingEdgesIterator(node);
   }
 
+  std::unique_ptr<typename AssociationTreeGraphObserver<N, E>::EdgeIterator> branchesIterator(std::shared_ptr<N> node) const
+  {
+    return this->outgoingEdgesIterator(node); 
+  }
+
   /**
    * @brief Get a vector of ancestor nodes between to nodes.
    *
diff --git a/src/Bpp/Graph/AssociationTreeGraphObserver.h b/src/Bpp/Graph/AssociationTreeGraphObserver.h
index e748ed0..e7a11f8 100644
--- a/src/Bpp/Graph/AssociationTreeGraphObserver.h
+++ b/src/Bpp/Graph/AssociationTreeGraphObserver.h
@@ -55,7 +55,7 @@ namespace bpp
  * @brief Defines a Tree Graph Associator. It is a template which follows
  * (subscribed to) a Graph.
  *
- * @author Thomas Bigot
+ * @author Thomas Bigot, Laurent Guéguen
  */
 
 template<class N, class E>
@@ -225,6 +225,8 @@ public:
 
   virtual std::unique_ptr<NodeIterator> sonsIterator(std::shared_ptr<N> node) = 0;
 
+  virtual std::unique_ptr<NodeIterator> sonsIterator(std::shared_ptr<N> node) const = 0;
+
   /*
    * @brief builds iterator on the branches to sons of a Node
    *
@@ -232,6 +234,8 @@ public:
 
   virtual std::unique_ptr<EdgeIterator> branchesIterator(std::shared_ptr<N> node) = 0;
 
+  virtual std::unique_ptr<EdgeIterator> branchesIterator(std::shared_ptr<N> node) const = 0;
+
   /**
    * @brief Get a vector of ancestor nodes between to nodes.
    *
diff --git a/src/Bpp/Graph/GlobalGraph.cpp b/src/Bpp/Graph/GlobalGraph.cpp
index ab8f2df..b4a9259 100644
--- a/src/Bpp/Graph/GlobalGraph.cpp
+++ b/src/Bpp/Graph/GlobalGraph.cpp
@@ -1,51 +1,52 @@
 //
-// File GlobalGraph.cpp
-// Created by: Thomas Bigot
-// Last modification : vendredi 4 novembre 2016, à 10h 22
+// File: GlobalGraph.cpp
+// Authors:
+//   Thomas Bigot
+// Last modified: 2017-06-27
 //
 
 /*
-   Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
-
-   This software is a computer program whose purpose is to provide utilitary
-   classes. This file belongs to the Bio++ Project.
-
-   This software is governed by the CeCILL  license under French law and
-   abiding by the rules of distribution of free software.  You can  use,
-   modify and/ or redistribute the software under the terms of the CeCILL
-   license as circulated by CEA, CNRS and INRIA at the following URL
-   "http://www.cecill.info".
-
-   As a counterpart to the access to the source code and  rights to copy,
-   modify and redistribute granted by the license, users are provided only
-   with a limited warranty  and the software's author,  the holder of the
-   economic rights,  and the successive licensors  have only  limited
-   liability.
-
-   In this respect, the user's attention is drawn to the risks associated
-   with loading,  using,  modifying and/or developing or reproducing the
-   software by the user in light of its specific status of free software,
-   that may mean  that it is complicated to manipulate,  and  that  also
-   therefore means  that it is reserved for developers  and  experienced
-   professionals having in-depth computer knowledge. Users are therefore
-   encouraged to load and test the software's suitability as regards their
-   requirements in conditions enabling the security of their systems and/or
-   data to be ensured and,  more generally, to use and operate it in the
-   same conditions as regards security.
-
-   The fact that you are presently reading this means that you have had
-   knowledge of the CeCILL license and that you accept its terms.
- */
-
+  Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
+  
+  This software is a computer program whose purpose is to provide utilitary
+  classes. This file belongs to the Bio++ Project.
+  
+  This software is governed by the CeCILL license under French law and
+  abiding by the rules of distribution of free software. You can use,
+  modify and/ or redistribute the software under the terms of the CeCILL
+  license as circulated by CEA, CNRS and INRIA at the following URL
+  "http://www.cecill.info".
+  
+  As a counterpart to the access to the source code and rights to copy,
+  modify and redistribute granted by the license, users are provided only
+  with a limited warranty and the software's author, the holder of the
+  economic rights, and the successive licensors have only limited
+  liability.
+  
+  In this respect, the user's attention is drawn to the risks associated
+  with loading, using, modifying and/or developing or reproducing the
+  software by the user in light of its specific status of free software,
+  that may mean that it is complicated to manipulate, and that also
+  therefore means that it is reserved for developers and experienced
+  professionals having in-depth computer knowledge. Users are therefore
+  encouraged to load and test the software's suitability as regards their
+  requirements in conditions enabling the security of their systems and/or
+  data to be ensured and, more generally, to use and operate it in the
+  same conditions as regards security.
+  
+  The fact that you are presently reading this means that you have had
+  knowledge of the CeCILL license and that you accept its terms.
+*/
 
+#include <algorithm>
+#include <sstream>
 #include <string>
 #include <vector>
-#include <sstream>
-#include <algorithm>
 
-#include "GraphObserver.h"
-#include "GlobalGraph.h"
 #include "../Exceptions.h"
+#include "../Text/TextTools.h"
+#include "GlobalGraph.h"
+#include "GraphObserver.h"
 
 using namespace bpp;
 using namespace std;
@@ -181,7 +182,7 @@ void GlobalGraph::switchNodes(Graph::NodeId nodeA, Graph::NodeId nodeB)
   }
 
   // Edge
-  GlobalGraph::Edge& foundEdge = foundForwardRelation->second;
+  GlobalGraph::Edge foundEdge = foundForwardRelation->second;
 
   // Backwards
   map<GlobalGraph::Node, GlobalGraph::Edge>::iterator foundBackwardsRelation = nodeSonRow->second.second.find(father);
@@ -241,7 +242,7 @@ unsigned int GlobalGraph::unlinkInNodeStructure_(const GlobalGraph::Node& nodeA,
   if (foundForwardRelation == nodeARow->second.first.end())
     throw Exception("GlobalGraph::unlinkInNodeStructure_ : no edge to erase " + TextTools::toString(nodeA) + "->" + TextTools::toString(nodeB));
 
-  GlobalGraph::Edge& foundEdge = foundForwardRelation->second;
+  GlobalGraph::Edge foundEdge = foundForwardRelation->second;
   nodeARow->second.first.erase(foundForwardRelation);
 
   // Backwards
diff --git a/src/Bpp/Graph/TreeGraph.h b/src/Bpp/Graph/TreeGraph.h
index c791507..e3e7736 100644
--- a/src/Bpp/Graph/TreeGraph.h
+++ b/src/Bpp/Graph/TreeGraph.h
@@ -116,12 +116,16 @@ public:
 
   virtual std::unique_ptr<Graph::NodeIterator> sonsIterator(Graph::NodeId node) = 0;
 
+  virtual std::unique_ptr<Graph::NodeIterator> sonsIterator(Graph::NodeId node) const = 0;
+
   /**
    * Get a iterator on the branches to sons of a node
    */
 
   virtual std::unique_ptr<Graph::EdgeIterator> branchesIterator(Graph::NodeId node) = 0;
 
+  virtual std::unique_ptr<Graph::EdgeIterator> branchesIterator(Graph::NodeId node) const = 0;
+
   /**
    * @brief Get the number of sons node
    */
diff --git a/src/Bpp/Graph/TreeGraphImpl.h b/src/Bpp/Graph/TreeGraphImpl.h
index c51bf1e..dda0612 100644
--- a/src/Bpp/Graph/TreeGraphImpl.h
+++ b/src/Bpp/Graph/TreeGraphImpl.h
@@ -5,37 +5,37 @@
 //
 
 /*
-   Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
-
-   This software is a computer program whose purpose is to provide utilitary
-   classes. This file belongs to the Bio++ Project.
-
-   This software is governed by the CeCILL  license under French law and
-   abiding by the rules of distribution of free software.  You can  use,
-   modify and/ or redistribute the software under the terms of the CeCILL
-   license as circulated by CEA, CNRS and INRIA at the following URL
-   "http://www.cecill.info".
-
-   As a counterpart to the access to the source code and  rights to copy,
-   modify and redistribute granted by the license, users are provided only
-   with a limited warranty  and the software's author,  the holder of the
-   economic rights,  and the successive licensors  have only  limited
-   liability.
-
-   In this respect, the user's attention is drawn to the risks associated
-   with loading,  using,  modifying and/or developing or reproducing the
-   software by the user in light of its specific status of free software,
-   that may mean  that it is complicated to manipulate,  and  that  also
-   therefore means  that it is reserved for developers  and  experienced
-   professionals having in-depth computer knowledge. Users are therefore
-   encouraged to load and test the software's suitability as regards their
-   requirements in conditions enabling the security of their systems and/or
-   data to be ensured and,  more generally, to use and operate it in the
-   same conditions as regards security.
-
-   The fact that you are presently reading this means that you have had
-   knowledge of the CeCILL license and that you accept its terms.
- */
+  Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
+
+  This software is a computer program whose purpose is to provide utilitary
+  classes. This file belongs to the Bio++ Project.
+
+  This software is governed by the CeCILL  license under French law and
+  abiding by the rules of distribution of free software.  You can  use,
+  modify and/ or redistribute the software under the terms of the CeCILL
+  license as circulated by CEA, CNRS and INRIA at the following URL
+  "http://www.cecill.info".
+
+  As a counterpart to the access to the source code and  rights to copy,
+  modify and redistribute granted by the license, users are provided only
+  with a limited warranty  and the software's author,  the holder of the
+  economic rights,  and the successive licensors  have only  limited
+  liability.
+
+  In this respect, the user's attention is drawn to the risks associated
+  with loading,  using,  modifying and/or developing or reproducing the
+  software by the user in light of its specific status of free software,
+  that may mean  that it is complicated to manipulate,  and  that  also
+  therefore means  that it is reserved for developers  and  experienced
+  professionals having in-depth computer knowledge. Users are therefore
+  encouraged to load and test the software's suitability as regards their
+  requirements in conditions enabling the security of their systems and/or
+  data to be ensured and,  more generally, to use and operate it in the
+  same conditions as regards security.
+
+  The fact that you are presently reading this means that you have had
+  knowledge of the CeCILL license and that you accept its terms.
+*/
 
 #ifndef _TREEGRAPH_IMPL_H_
 #define _TREEGRAPH_IMPL_H_
@@ -54,540 +54,556 @@
 
 namespace bpp
 {
-template<class GraphImpl>
-class TreeGraphImpl :
-  public virtual TreeGraph,
-  public GraphImpl
-{
-private:
-  /**
-   * Is the graph a tree? Set to false when structure is modified, true after validation.
-   */
-  mutable bool isValid_;
+  template<class GraphImpl>
+  class TreeGraphImpl :
+    public virtual TreeGraph,
+    public GraphImpl
+  {
+  private:
+    /**
+     * Is the graph a tree? Set to false when structure is modified, true after validation.
+     */
+    mutable bool isValid_;
+
+    // unvalidate the tree
+    void topologyHasChanged_() const;
 
-  // unvalidate the tree
-  void topologyHasChanged_() const;
+    // will throw an exception if the tree is not valid
+    void mustBeValid_() const;
 
-  // will throw an exception if the tree is not valid
-  void mustBeValid_() const;
+    // will throw an exception if the tree is not rooted
+    void mustBeRooted_() const;
 
-  // will throw an exception if the tree is not rooted
-  void mustBeRooted_() const;
+    // test the validity of the tree
+    bool validate_() const;
 
-  // test the validity of the tree
-  bool validate_() const;
+    /**
+     * Reorient all the edges starting from a node:
+     * the father node becomes a son, and so on.
+     */
+    void propagateDirection_(Graph::NodeId node);
 
-  /**
-   * Reorient all the edges starting from a node:
-   * the father node becomes a son, and so on.
-   */
-  void propagateDirection_(Graph::NodeId node);
+    // recursive function for getSubtreeNodes
+    void fillSubtreeMetNodes_(std::vector<Graph::NodeId>& metNodes, Graph::NodeId localRoot) const;
 
-  // recursive function for getSubtreeNodes
-  void fillSubtreeMetNodes_(std::vector<Graph::NodeId>& metNodes, Graph::NodeId localRoot) const;
+    // recursive function for getSubtreeEdges
+    void fillSubtreeMetEdges_(std::vector<Graph::EdgeId>& metEdges, Graph::NodeId localRoot) const;
 
-  // recursive function for getSubtreeEdges
-  void fillSubtreeMetEdges_(std::vector<Graph::EdgeId>& metEdges, Graph::NodeId localRoot) const;
+    // recursive function for getLeavesUnderNode
+    void fillListOfLeaves_(Graph::NodeId startingNode, std::vector<Graph::NodeId>& foundLeaves) const;
 
-  // recursive function for getLeavesUnderNode
-  void fillListOfLeaves_(Graph::NodeId startingNode, std::vector<Graph::NodeId>& foundLeaves) const;
+  public:
+    TreeGraphImpl();
 
-public:
-  TreeGraphImpl();
+    TreeGraphImpl(bool rooted = true);
 
-  TreeGraphImpl(bool rooted = true);
+    /**
+     * Is the graph a tree? A tree must be acyclic and with no isolated node.
+     * @return true if valid tree
+     */
+    bool isValid() const;
 
-  /**
-   * Is the graph a tree? A tree must be acyclic and with no isolated node.
-   * @return true if valid tree
-   */
-  bool isValid() const;
+    /**
+     * Is the tree rooted?
+     *
+     * @return true if rooted, ie is directed.
+     */
 
-  /**
-   * Is the tree rooted?
-   *
-   * @return true if rooted, ie is directed.
-   */
+    bool isRooted() const;
 
-  bool isRooted() const;
+    /**
+     * Get the father node of a node in a rooted tree
+     * @return the father node
+     */
 
-  /**
-   * Get the father node of a node in a rooted tree
-   * @return the father node
-   */
+    Graph::NodeId getFather(Graph::NodeId nodeid) const;
 
-  Graph::NodeId getFather(Graph::NodeId nodeid) const;
+    /**
+     * Get the branch leading to the father in a rooted tree
+     * @return the branch between a node and its father
+     */
 
-  /**
-   * Get the branch leading to the father in a rooted tree
-   * @return the branch between a node and its father
-   */
+    Graph::EdgeId getEdgeToFather(Graph::NodeId node) const;
 
-  Graph::EdgeId getEdgeToFather(Graph::NodeId node) const;
+    /**
+     * Check if node has a father
+     */
 
-  /**
-   * Check if node has a father
-   */
+    bool hasFather(Graph::NodeId node) const;
 
-  bool hasFather(Graph::NodeId node) const;
+    /**
+     * Says if  a node is a leaf (ie has at most one neighbor).
+     */
 
-  /**
-   * Says if  a node is a leaf (ie has at most one neighbor).
-   */
+    bool isLeaf(Graph::NodeId node) const;
 
-  bool isLeaf(Graph::NodeId node) const;
+    /**
+     * Get the leaves under a node
+     * @param node the starting node
+     * @return a vector containing the leaves
+     */
 
-  /**
-   * Get the leaves under a node
-   * @param node the starting node
-   * @return a vector containing the leaves
-   */
+    std::vector<Graph::NodeId> getLeavesUnderNode(Graph::NodeId node) const;
 
-  std::vector<Graph::NodeId> getLeavesUnderNode(Graph::NodeId node) const;
+    /**
+     * Get the sons node of a node
+     */
 
-  /**
-   * Get the sons node of a node
-   */
+    std::vector<Graph::NodeId> getSons(Graph::NodeId node) const;
 
-  std::vector<Graph::NodeId> getSons(Graph::NodeId node) const;
+    /**
+     * Get the branches to the sons node of a node
+     */
 
-  /**
-   * Get the branches to the sons node of a node
-   */
+    std::vector<Graph::EdgeId> getBranches(Graph::NodeId node) const;
 
-  std::vector<Graph::EdgeId> getBranches(Graph::NodeId node) const;
+    /**
+     * Get a iterator on the sons node of a node
+     */
 
-  /**
-   * Get a iterator on the sons node of a node
-   */
+    std::unique_ptr<Graph::NodeIterator> sonsIterator(Graph::NodeId node);
 
-  std::unique_ptr<Graph::NodeIterator> sonsIterator(Graph::NodeId node);
+    std::unique_ptr<Graph::NodeIterator> sonsIterator(Graph::NodeId node) const;
 
-  /**
-   * Get a iterator on the branches to sons of a node
-   */
+    /**
+     * Get a iterator on the branches to sons of a node
+     */
 
-  std::unique_ptr<Graph::EdgeIterator> branchesIterator(Graph::NodeId node);
+    std::unique_ptr<Graph::EdgeIterator> branchesIterator(Graph::NodeId node);
 
-  /**
-   * @brief Get the number of sons node
-   */
+    std::unique_ptr<Graph::EdgeIterator> branchesIterator(Graph::NodeId node) const;
 
-  size_t getNumberOfSons(Graph::NodeId node) const;
+    /**
+     * @brief Get the number of sons node
+     */
 
-  /**
-   * set the father node of a node in a rooted tree
-   */
+    size_t getNumberOfSons(Graph::NodeId node) const;
 
-  void setFather(Graph::NodeId node, Graph::NodeId fatherNode);
-  void setFather(Graph::NodeId node, Graph::NodeId fatherNode, Graph::EdgeId edgeId);
+    /**
+     * set the father node of a node in a rooted tree
+     */
 
-  /**
-   * Add a son to a node in a rooted tree
-   */
+    void setFather(Graph::NodeId node, Graph::NodeId fatherNode);
+    void setFather(Graph::NodeId node, Graph::NodeId fatherNode, Graph::EdgeId edgeId);
 
-  void addSon(Graph::NodeId node, Graph::NodeId sonNode);
+    /**
+     * Add a son to a node in a rooted tree
+     */
 
-  void addSon(Graph::NodeId node, Graph::NodeId sonNode, Graph::EdgeId edgeId);
+    void addSon(Graph::NodeId node, Graph::NodeId sonNode);
 
-  /**
-   * Remove all the sons
-   */
+    void addSon(Graph::NodeId node, Graph::NodeId sonNode, Graph::EdgeId edgeId);
 
-  std::vector<Graph::NodeId> removeSons(Graph::NodeId node);
+    /**
+     * Remove all the sons
+     */
 
-  /**
-   * Remove one son
-   */
+    std::vector<Graph::NodeId> removeSons(Graph::NodeId node);
 
-  void removeSon(Graph::NodeId node, Graph::NodeId son);
+    /**
+     * Remove one son
+     */
 
-  /**
-   * Re-root the tree with the new root
-   */
+    void removeSon(Graph::NodeId node, Graph::NodeId son);
 
-  void rootAt(Graph::NodeId newRoot);
+    /**
+     * Re-root the tree with the new root
+     */
 
-  /**
-   * Set the tree to its flat unrooted version.
-   * As an algorithmical convenience, a root node is kept, but it has
-   * no logical significance.
-   */
+    void rootAt(Graph::NodeId newRoot);
 
-  void unRoot(bool joinRootSons);
+    /**
+     * Set the tree to its flat unrooted version.
+     * As an algorithmical convenience, a root node is kept, but it has
+     * no logical significance.
+     */
 
-  /**
-   * Set a node as a new outgroup in a rooted tree, will make a root between
-   * the given node and its father.
-   */
+    void unRoot(bool joinRootSons);
 
-  void setOutGroup(Graph::NodeId newOutGroup);
+    /**
+     * Set a node as a new outgroup in a rooted tree, will make a root between
+     * the given node and its father.
+     */
 
-  /**
-   * Get all the nodes of a subtree
-   */
+    void setOutGroup(Graph::NodeId newOutGroup);
 
-  std::vector<Graph::NodeId> getSubtreeNodes(Graph::NodeId localRoot) const;
+    /**
+     * Get all the nodes of a subtree
+     */
 
-  /**
-   * Get all the branches of a subtree
-   */
+    std::vector<Graph::NodeId> getSubtreeNodes(Graph::NodeId localRoot) const;
 
-  std::vector<Graph::EdgeId> getSubtreeEdges(Graph::NodeId localRoot) const;
+    /**
+     * Get all the branches of a subtree
+     */
 
-  // ///FROM TREETOOLS & TREETOOLS COMPAT
+    std::vector<Graph::EdgeId> getSubtreeEdges(Graph::NodeId localRoot) const;
 
+    // ///FROM TREETOOLS & TREETOOLS COMPAT
 
-  std::vector<Graph::NodeId> getNodePathBetweenTwoNodes(Graph::NodeId nodeA, Graph::NodeId nodeB, bool includeAncestor = true) const;
-  std::vector<Graph::EdgeId> getEdgePathBetweenTwoNodes(Graph::NodeId nodeA, Graph::NodeId nodeB) const;
-};
+
+    std::vector<Graph::NodeId> getNodePathBetweenTwoNodes(Graph::NodeId nodeA, Graph::NodeId nodeB, bool includeAncestor = true) const;
+    std::vector<Graph::EdgeId> getEdgePathBetweenTwoNodes(Graph::NodeId nodeA, Graph::NodeId nodeB) const;
+  };
 
 
 /******************/
 
-typedef TreeGraphImpl<GlobalGraph> TreeGlobalGraph;
+  typedef TreeGraphImpl<GlobalGraph> TreeGlobalGraph;
 
 /*****************/
 
 
-template<class GraphImpl>
-TreeGraphImpl<GraphImpl>::TreeGraphImpl(bool rooted) :
-  GraphImpl(rooted),
-  isValid_(false)
-{}
+  template<class GraphImpl>
+  TreeGraphImpl<GraphImpl>::TreeGraphImpl(bool rooted) :
+    GraphImpl(rooted),
+    isValid_(false)
+  {}
 
 
-template<class GraphImpl>
-bool TreeGraphImpl<GraphImpl>::isValid() const
-{
-  return isValid_ || validate_();
-}
+  template<class GraphImpl>
+  bool TreeGraphImpl<GraphImpl>::isValid() const
+  {
+    return isValid_ || validate_();
+  }
 
-template<class GraphImpl>
-Graph::NodeId TreeGraphImpl<GraphImpl>::getFather(Graph::NodeId node) const
-{
-  std::vector<Graph::NodeId> incomers = getIncomingNeighbors(node);
-  if (incomers.size() > 1)
-    throw Exception("TreeGraphImpl<GraphImpl>::getFather: more than one father for Node " + TextTools::toString(node) + " : " + VectorTools::paste(incomers, ",") + ". Should never happen since validity has been controled. Please report this bug.");
-  if (incomers.size() == 0)
-    throw Exception("TreeGraphImpl<GraphImpl>::getFather: node " + TextTools::toString(node) + " has no father.");
-  return *incomers.begin();
-}
+  template<class GraphImpl>
+  Graph::NodeId TreeGraphImpl<GraphImpl>::getFather(Graph::NodeId node) const
+  {
+    std::vector<Graph::NodeId> incomers = getIncomingNeighbors(node);
+    if (incomers.size() > 1)
+      throw Exception("TreeGraphImpl<GraphImpl>::getFather: more than one father for Node " + TextTools::toString(node) + " : " + VectorTools::paste(incomers, ",") + ". Should never happen since validity has been controled. Please report this bug.");
+    if (incomers.size() == 0)
+      throw Exception("TreeGraphImpl<GraphImpl>::getFather: node " + TextTools::toString(node) + " has no father.");
+    return *incomers.begin();
+  }
 
-template<class GraphImpl>
-Graph::EdgeId TreeGraphImpl<GraphImpl>::getEdgeToFather(Graph::NodeId node) const
-{
-  Graph::NodeId father = getFather(node);
-  return GraphImpl::getEdge(father, node);
-}
+  template<class GraphImpl>
+  Graph::EdgeId TreeGraphImpl<GraphImpl>::getEdgeToFather(Graph::NodeId node) const
+  {
+    Graph::NodeId father = getFather(node);
+    return GraphImpl::getEdge(father, node);
+  }
 
-template<class GraphImpl>
-bool TreeGraphImpl<GraphImpl>::hasFather(Graph::NodeId node) const
-{
-  return GraphImpl::getNumberOfIncomingNeighbors(node) >= 1;
-}
+  template<class GraphImpl>
+  bool TreeGraphImpl<GraphImpl>::hasFather(Graph::NodeId node) const
+  {
+    return GraphImpl::getNumberOfIncomingNeighbors(node) >= 1;
+  }
 
-template<class GraphImpl>
-bool TreeGraphImpl<GraphImpl>::isLeaf(Graph::NodeId node) const
-{
-  return (!GraphImpl::isDirected() && GraphImpl::getNumberOfOutgoingNeighbors(node) <= 1)
-         || (GraphImpl::isDirected() && GraphImpl::getNumberOfOutgoingNeighbors(node) == 0);
-}
+  template<class GraphImpl>
+  bool TreeGraphImpl<GraphImpl>::isLeaf(Graph::NodeId node) const
+  {
+    return (!GraphImpl::isDirected() && GraphImpl::getNumberOfOutgoingNeighbors(node) <= 1)
+      || (GraphImpl::isDirected() && GraphImpl::getNumberOfOutgoingNeighbors(node) == 0);
+  }
 
-template<class GraphImpl>
-void TreeGraphImpl<GraphImpl>::fillListOfLeaves_(Graph::NodeId startingNode, std::vector<Graph::NodeId>& foundLeaves) const
-{
-  const std::vector<Graph::NodeId> sons = getSons(startingNode);
-  if (sons.size() > 1)
+  template<class GraphImpl>
+  void TreeGraphImpl<GraphImpl>::fillListOfLeaves_(Graph::NodeId startingNode, std::vector<Graph::NodeId>& foundLeaves) const
   {
-    for (std::vector<Graph::NodeId>::const_iterator currNeighbor = sons.begin(); currNeighbor != sons.end(); currNeighbor++)
+    const std::vector<Graph::NodeId> sons = getSons(startingNode);
+    if (sons.size() > 1)
     {
-      fillListOfLeaves_(*currNeighbor, foundLeaves);
+      for (std::vector<Graph::NodeId>::const_iterator currNeighbor = sons.begin(); currNeighbor != sons.end(); currNeighbor++)
+      {
+        fillListOfLeaves_(*currNeighbor, foundLeaves);
+      }
+    }
+    else
+    {
+      foundLeaves.push_back(startingNode);
     }
   }
-  else
-  {
-    foundLeaves.push_back(startingNode);
-  }
-}
-
-template<class GraphImpl>
-std::vector<Graph::NodeId> TreeGraphImpl<GraphImpl>::getLeavesUnderNode(Graph::NodeId node) const
-{
-  std::vector<Graph::NodeId> foundLeaves;
-  fillListOfLeaves_(node, foundLeaves);
-
-  return foundLeaves;
-}
-
-template<class GraphImpl>
-void TreeGraphImpl<GraphImpl>::mustBeRooted_() const
-{
-  if (!isRooted())
-    throw Exception("TreeGraphImpl<GraphImpl>: The tree must be rooted.");
-}
-
-template<class GraphImpl>
-void TreeGraphImpl<GraphImpl>::mustBeValid_() const
-{
-  if (!isValid())
-    throw Exception("TreeGraphImpl<GraphImpl>: The tree is not valid.");
-}
 
-template<class GraphImpl>
-bool TreeGraphImpl<GraphImpl>::isRooted() const
-{
-  return GraphImpl::isDirected();
-}
-
-template<class GraphImpl>
-bool TreeGraphImpl<GraphImpl>::validate_() const
-{
-  isValid_ = GraphImpl::isTree();
-  return isValid_;
-}
+  template<class GraphImpl>
+  std::vector<Graph::NodeId> TreeGraphImpl<GraphImpl>::getLeavesUnderNode(Graph::NodeId node) const
+  {
+    std::vector<Graph::NodeId> foundLeaves;
+    fillListOfLeaves_(node, foundLeaves);
 
-template<class GraphImpl>
-void TreeGraphImpl<GraphImpl>::topologyHasChanged_() const
-{
-  isValid_ = false;
-}
+    return foundLeaves;
+  }
 
-template<class GraphImpl>
-void TreeGraphImpl<GraphImpl>::rootAt(Graph::NodeId newRoot)
-{
-  if (!isValid())
-    throw Exception("TreeGraphImpl::rootAt: Tree is not Valid.");
-
-  GraphImpl::makeDirected();
-  // set the new root on the Graph
-  GraphImpl::setRoot(newRoot);
-  // change edge direction between the new node and the former one
-  propagateDirection_(newRoot);
-}
+  template<class GraphImpl>
+  void TreeGraphImpl<GraphImpl>::mustBeRooted_() const
+  {
+    if (!isRooted())
+      throw Exception("TreeGraphImpl<GraphImpl>: The tree must be rooted.");
+  }
 
-template<class GraphImpl>
-void TreeGraphImpl<GraphImpl>::propagateDirection_(Graph::NodeId node)
-{
-  if (hasFather(node))
+  template<class GraphImpl>
+  void TreeGraphImpl<GraphImpl>::mustBeValid_() const
   {
-    NodeId father = getFather(node);
-    propagateDirection_(father);
-    GraphImpl::switchNodes(father, node);
+    if (!isValid())
+      throw Exception("TreeGraphImpl<GraphImpl>: The tree is not valid.");
   }
-}
 
-template<class GraphImpl>
-void TreeGraphImpl<GraphImpl>::setFather(Graph::NodeId node, Graph::NodeId fatherNode)
-{
-  if (hasFather(node))
-    GraphImpl::unlink(getFather(node), node);
-  GraphImpl::link(fatherNode, node);
-  topologyHasChanged_();
-}
+  template<class GraphImpl>
+  bool TreeGraphImpl<GraphImpl>::isRooted() const
+  {
+    return GraphImpl::isDirected();
+  }
 
-template<class GraphImpl>
-void TreeGraphImpl<GraphImpl>::setFather(Graph::NodeId node, Graph::NodeId fatherNode, Graph::EdgeId edgeId)
-{
-  if (hasFather(node))
-    GraphImpl::unlink(getFather(node), node);
-  GraphImpl::link(fatherNode, node, edgeId);
-  topologyHasChanged_();
-}
+  template<class GraphImpl>
+  bool TreeGraphImpl<GraphImpl>::validate_() const
+  {
+    isValid_ = GraphImpl::isTree();
+    return isValid_;
+  }
 
+  template<class GraphImpl>
+  void TreeGraphImpl<GraphImpl>::topologyHasChanged_() const
+  {
+    isValid_ = false;
+  }
 
-template<class GraphImpl>
-void TreeGraphImpl<GraphImpl>::addSon(Graph::NodeId node, Graph::NodeId sonNode)
-{
-  GraphImpl::link(node, sonNode);
-  topologyHasChanged_();
-}
+  template<class GraphImpl>
+  void TreeGraphImpl<GraphImpl>::rootAt(Graph::NodeId newRoot)
+  {
+    if (!isValid())
+      throw Exception("TreeGraphImpl::rootAt: Tree is not Valid.");
+
+    GraphImpl::makeDirected();
+    // set the new root on the Graph
+    GraphImpl::setRoot(newRoot);
+    // change edge direction between the new node and the former one
+    propagateDirection_(newRoot);
+  }
 
-template<class GraphImpl>
-void TreeGraphImpl<GraphImpl>::addSon(Graph::NodeId node, Graph::NodeId sonNode, Graph::EdgeId edgeId)
-{
-  GraphImpl::link(node, sonNode, edgeId);
-  topologyHasChanged_();
-}
+  template<class GraphImpl>
+  void TreeGraphImpl<GraphImpl>::propagateDirection_(Graph::NodeId node)
+  {
+    if (hasFather(node))
+    {
+      NodeId father = getFather(node);
+      propagateDirection_(father);
+      GraphImpl::switchNodes(father, node);
+    }
+  }
 
-template<class GraphImpl>
-void TreeGraphImpl<GraphImpl>::unRoot(bool joinRootSons)
-{
-  if (joinRootSons)
-  {
-    // the root must have exactly two joinRootSons
-    std::vector<Graph::NodeId> sons = getSons(GraphImpl::getRoot());
-    if (sons.size() != 2)
-      throw Exception("The root must have two sons to join them.");
-    GraphImpl::unlink(GraphImpl::getRoot(), sons.at(0));
-    GraphImpl::unlink(GraphImpl::getRoot(), sons.at(1));
-    GraphImpl::link(sons.at(0), sons.at(1));
-    GraphImpl::setRoot(sons.at(0));
-  }
-  GraphImpl::makeUndirected();
-}
+  template<class GraphImpl>
+  void TreeGraphImpl<GraphImpl>::setFather(Graph::NodeId node, Graph::NodeId fatherNode)
+  {
+    if (hasFather(node))
+      GraphImpl::unlink(getFather(node), node);
+    GraphImpl::link(fatherNode, node);
+    topologyHasChanged_();
+  }
 
-template<class GraphImpl>
-std::vector<Graph::NodeId> TreeGraphImpl<GraphImpl>::getSons(Graph::NodeId node) const
-{
-  return GraphImpl::getOutgoingNeighbors(node);
-}
+  template<class GraphImpl>
+  void TreeGraphImpl<GraphImpl>::setFather(Graph::NodeId node, Graph::NodeId fatherNode, Graph::EdgeId edgeId)
+  {
+    if (hasFather(node))
+      GraphImpl::unlink(getFather(node), node);
+    GraphImpl::link(fatherNode, node, edgeId);
+    topologyHasChanged_();
+  }
 
-template<class GraphImpl>
-std::vector<Graph::EdgeId> TreeGraphImpl<GraphImpl>::getBranches(Graph::NodeId node) const
-{
-  return GraphImpl::getOutgoingEdges(node);
-}
 
-template<class GraphImpl>
-std::unique_ptr<Graph::NodeIterator> TreeGraphImpl<GraphImpl>::sonsIterator(Graph::NodeId node)
-{
-  return GraphImpl::outgoingNeighborNodesIterator(node);
-}
+  template<class GraphImpl>
+  void TreeGraphImpl<GraphImpl>::addSon(Graph::NodeId node, Graph::NodeId sonNode)
+  {
+    GraphImpl::link(node, sonNode);
+    topologyHasChanged_();
+  }
 
-template<class GraphImpl>
-std::unique_ptr<Graph::EdgeIterator> TreeGraphImpl<GraphImpl>::branchesIterator(Graph::NodeId node)
-{
-  return GraphImpl::outgoingEdgesIterator(node);
-}
+  template<class GraphImpl>
+  void TreeGraphImpl<GraphImpl>::addSon(Graph::NodeId node, Graph::NodeId sonNode, Graph::EdgeId edgeId)
+  {
+    GraphImpl::link(node, sonNode, edgeId);
+    topologyHasChanged_();
+  }
 
-template<class GraphImpl>
-size_t TreeGraphImpl<GraphImpl>::getNumberOfSons(Graph::NodeId node) const
-{
-  return GraphImpl::getNumberOfOutgoingNeighbors(node);
-}
+  template<class GraphImpl>
+  void TreeGraphImpl<GraphImpl>::unRoot(bool joinRootSons)
+  {
+    if (joinRootSons)
+    {
+      // the root must have exactly two joinRootSons
+      std::vector<Graph::NodeId> sons = getSons(GraphImpl::getRoot());
+      if (sons.size() != 2)
+        throw Exception("The root must have two sons to join them.");
+      GraphImpl::unlink(GraphImpl::getRoot(), sons.at(0));
+      GraphImpl::unlink(GraphImpl::getRoot(), sons.at(1));
+      GraphImpl::link(sons.at(0), sons.at(1));
+      GraphImpl::setRoot(sons.at(0));
+    }
+    GraphImpl::makeUndirected();
+  }
 
-template<class GraphImpl>
-std::vector<Graph::NodeId> TreeGraphImpl<GraphImpl>::removeSons(Graph::NodeId node)
-{
-  std::vector<Graph::NodeId> sons = getSons(node);
-  for (std::vector<Graph::NodeId>::iterator currSon = sons.begin(); currSon != sons.end(); currSon++)
+  template<class GraphImpl>
+  std::vector<Graph::NodeId> TreeGraphImpl<GraphImpl>::getSons(Graph::NodeId node) const
   {
-    removeSon(node, *currSon);
+    return GraphImpl::getOutgoingNeighbors(node);
   }
-  return sons;
-}
 
-template<class GraphImpl>
-void TreeGraphImpl<GraphImpl>::removeSon(Graph::NodeId node, Graph::NodeId son)
-{
-  GraphImpl::unlink(node, son);
-  topologyHasChanged_();
-}
+  template<class GraphImpl>
+  std::vector<Graph::EdgeId> TreeGraphImpl<GraphImpl>::getBranches(Graph::NodeId node) const
+  {
+    return GraphImpl::getOutgoingEdges(node);
+  }
 
-template<class GraphImpl>
-void TreeGraphImpl<GraphImpl>::setOutGroup(Graph::NodeId newOutGroup)
-{
-  mustBeRooted_();
-  deleteNode(GraphImpl::getRoot());
+  template<class GraphImpl>
+  std::unique_ptr<Graph::NodeIterator> TreeGraphImpl<GraphImpl>::sonsIterator(Graph::NodeId node)
+  {
+    return GraphImpl::outgoingNeighborNodesIterator(node);
+  }
 
-  Graph::NodeId newRoot = GraphImpl::createNodeFromEdge(getEdge(getFather(newOutGroup), newOutGroup));
-  rootAt(newRoot);
-}
+  template<class GraphImpl>
+  std::unique_ptr<Graph::NodeIterator> TreeGraphImpl<GraphImpl>::sonsIterator(Graph::NodeId node) const
+  {
+    return GraphImpl::outgoingNeighborNodesIterator(node);
+  }
 
-template<class GraphImpl>
-std::vector<Graph::NodeId> TreeGraphImpl<GraphImpl>::getNodePathBetweenTwoNodes(Graph::NodeId nodeA, Graph::NodeId nodeB, bool includeAncestor) const
-{
-  GraphImpl::nodeMustExist_(nodeA);
-  GraphImpl::nodeMustExist_(nodeB);
-  std::vector<Graph::NodeId> path;
-  std::vector<Graph::NodeId> pathMatrix1;
-  std::vector<Graph::NodeId> pathMatrix2;
+  template<class GraphImpl>
+  std::unique_ptr<Graph::EdgeIterator> TreeGraphImpl<GraphImpl>::branchesIterator(Graph::NodeId node)
+  {
+    return GraphImpl::outgoingEdgesIterator(node);
+  }
 
-  Graph::NodeId nodeUp = nodeA;
-  while (hasFather(nodeUp))
+  template<class GraphImpl>
+  std::unique_ptr<Graph::EdgeIterator> TreeGraphImpl<GraphImpl>::branchesIterator(Graph::NodeId node) const
   {
-    pathMatrix1.push_back(nodeUp);
-    nodeUp = getFather(nodeUp);
+    return GraphImpl::outgoingEdgesIterator(node);
   }
-  pathMatrix1.push_back(nodeUp); // The root.
 
-  nodeUp = nodeB;
-  while (hasFather(nodeUp))
+  template<class GraphImpl>
+  size_t TreeGraphImpl<GraphImpl>::getNumberOfSons(Graph::NodeId node) const
   {
-    pathMatrix2.push_back(nodeUp);
-    nodeUp = getFather(nodeUp);
+    return GraphImpl::getNumberOfOutgoingNeighbors(node);
   }
-  pathMatrix2.push_back(nodeUp); // The root.
-  // Must check that the two nodes have the same root!!!
 
-  size_t tmp1 = pathMatrix1.size();
-  size_t tmp2 = pathMatrix2.size();
+  template<class GraphImpl>
+  std::vector<Graph::NodeId> TreeGraphImpl<GraphImpl>::removeSons(Graph::NodeId node)
+  {
+    std::vector<Graph::NodeId> sons = getSons(node);
+    for (std::vector<Graph::NodeId>::iterator currSon = sons.begin(); currSon != sons.end(); currSon++)
+    {
+      removeSon(node, *currSon);
+    }
+    return sons;
+  }
 
-  while ((tmp1 > 0) && (tmp2 > 0))
+  template<class GraphImpl>
+  void TreeGraphImpl<GraphImpl>::removeSon(Graph::NodeId node, Graph::NodeId son)
   {
-    if (pathMatrix1[tmp1 - 1] != pathMatrix2[tmp2 - 1])
-      break;
-    tmp1--; tmp2--;
+    GraphImpl::unlink(node, son);
+    topologyHasChanged_();
   }
-  // (tmp1 - 1) and (tmp2 - 1) now point toward the first non-common nodes
 
-  for (size_t y = 0; y < tmp1; ++y)
+  template<class GraphImpl>
+  void TreeGraphImpl<GraphImpl>::setOutGroup(Graph::NodeId newOutGroup)
   {
-    path.push_back(pathMatrix1[y]);
+    mustBeRooted_();
+    deleteNode(GraphImpl::getRoot());
+
+    Graph::NodeId newRoot = GraphImpl::createNodeFromEdge(getEdge(getFather(newOutGroup), newOutGroup));
+    rootAt(newRoot);
   }
-  if (includeAncestor) // FIXME: one of the extremities may be the ancestor!!!
-    path.push_back(pathMatrix1[tmp1]);                                            // pushing once, the Node that was common to both.
-  for (size_t j = tmp2; j > 0; --j)
+
+  template<class GraphImpl>
+  std::vector<Graph::NodeId> TreeGraphImpl<GraphImpl>::getNodePathBetweenTwoNodes(Graph::NodeId nodeA, Graph::NodeId nodeB, bool includeAncestor) const
   {
-    path.push_back(pathMatrix2[j - 1]);
+    GraphImpl::nodeMustExist_(nodeA);
+    GraphImpl::nodeMustExist_(nodeB);
+    std::vector<Graph::NodeId> path;
+    std::vector<Graph::NodeId> pathMatrix1;
+    std::vector<Graph::NodeId> pathMatrix2;
+
+    Graph::NodeId nodeUp = nodeA;
+    while (hasFather(nodeUp))
+    {
+      pathMatrix1.push_back(nodeUp);
+      nodeUp = getFather(nodeUp);
+    }
+    pathMatrix1.push_back(nodeUp); // The root.
+
+    nodeUp = nodeB;
+    while (hasFather(nodeUp))
+    {
+      pathMatrix2.push_back(nodeUp);
+      nodeUp = getFather(nodeUp);
+    }
+    pathMatrix2.push_back(nodeUp); // The root.
+    // Must check that the two nodes have the same root!!!
+
+    size_t tmp1 = pathMatrix1.size();
+    size_t tmp2 = pathMatrix2.size();
+
+    while ((tmp1 > 0) && (tmp2 > 0))
+    {
+      if (pathMatrix1[tmp1 - 1] != pathMatrix2[tmp2 - 1])
+        break;
+      tmp1--; tmp2--;
+    }
+    // (tmp1 - 1) and (tmp2 - 1) now point toward the first non-common nodes
+
+    for (size_t y = 0; y < tmp1; ++y)
+    {
+      path.push_back(pathMatrix1[y]);
+    }
+    if (includeAncestor) // FIXME: one of the extremities may be the ancestor!!!
+      path.push_back(pathMatrix1[tmp1]);                                            // pushing once, the Node that was common to both.
+    for (size_t j = tmp2; j > 0; --j)
+    {
+      path.push_back(pathMatrix2[j - 1]);
+    }
+    return path;
   }
-  return path;
-}
 
-template<class GraphImpl>
-std::vector<Graph::EdgeId> TreeGraphImpl<GraphImpl>::getEdgePathBetweenTwoNodes(Graph::NodeId nodeA, Graph::NodeId nodeB) const
-{
-  std::vector<Graph::EdgeId> path;
-  std::vector<Graph::NodeId> pathNodes = getNodePathBetweenTwoNodes(nodeA, nodeB, true);
-  for (size_t currNodeNr = 0; currNodeNr + 1 < pathNodes.size(); currNodeNr++)
+  template<class GraphImpl>
+  std::vector<Graph::EdgeId> TreeGraphImpl<GraphImpl>::getEdgePathBetweenTwoNodes(Graph::NodeId nodeA, Graph::NodeId nodeB) const
   {
-    path.push_back(GraphImpl::getAnyEdge(pathNodes.at(currNodeNr), pathNodes.at(currNodeNr + 1)));
+    std::vector<Graph::EdgeId> path;
+    std::vector<Graph::NodeId> pathNodes = getNodePathBetweenTwoNodes(nodeA, nodeB, true);
+    for (size_t currNodeNr = 0; currNodeNr + 1 < pathNodes.size(); currNodeNr++)
+    {
+      path.push_back(GraphImpl::getAnyEdge(pathNodes.at(currNodeNr), pathNodes.at(currNodeNr + 1)));
+    }
+    return path;
   }
-  return path;
-}
 
-template<class GraphImpl>
-std::vector<Graph::NodeId> TreeGraphImpl<GraphImpl>::getSubtreeNodes(Graph::NodeId localRoot) const
-{
-  mustBeValid_();
-  std::vector<Graph::EdgeId> metNodes;
-  fillSubtreeMetNodes_(metNodes, localRoot);
-  return metNodes;
-}
+  template<class GraphImpl>
+  std::vector<Graph::NodeId> TreeGraphImpl<GraphImpl>::getSubtreeNodes(Graph::NodeId localRoot) const
+  {
+    mustBeValid_();
+    std::vector<Graph::EdgeId> metNodes;
+    fillSubtreeMetNodes_(metNodes, localRoot);
+    return metNodes;
+  }
 
-template<class GraphImpl>
-std::vector<Graph::EdgeId> TreeGraphImpl<GraphImpl>::getSubtreeEdges(Graph::NodeId localRoot) const
-{
-  mustBeValid_();
-  std::vector<Graph::EdgeId> metEdges;
-  fillSubtreeMetEdges_(metEdges, localRoot);
-  return metEdges;
-}
+  template<class GraphImpl>
+  std::vector<Graph::EdgeId> TreeGraphImpl<GraphImpl>::getSubtreeEdges(Graph::NodeId localRoot) const
+  {
+    mustBeValid_();
+    std::vector<Graph::EdgeId> metEdges;
+    fillSubtreeMetEdges_(metEdges, localRoot);
+    return metEdges;
+  }
 
 
-template<class GraphImpl>
-void TreeGraphImpl<GraphImpl>::fillSubtreeMetNodes_(std::vector<Graph::NodeId>& metNodes, Graph::NodeId localRoot) const
-{
-  metNodes.push_back(localRoot);
-  std::vector<Graph::NodeId> sons = GraphImpl::getOutgoingNeighbors(localRoot);
-  for (std::vector<Graph::NodeId>::iterator currSon = sons.begin(); currSon != sons.end(); currSon++)
+  template<class GraphImpl>
+  void TreeGraphImpl<GraphImpl>::fillSubtreeMetNodes_(std::vector<Graph::NodeId>& metNodes, Graph::NodeId localRoot) const
   {
-    fillSubtreeMetNodes_(metNodes, *currSon);
+    metNodes.push_back(localRoot);
+    std::vector<Graph::NodeId> sons = GraphImpl::getOutgoingNeighbors(localRoot);
+    for (std::vector<Graph::NodeId>::iterator currSon = sons.begin(); currSon != sons.end(); currSon++)
+    {
+      fillSubtreeMetNodes_(metNodes, *currSon);
+    }
   }
-}
 
-template<class GraphImpl>
-void TreeGraphImpl<GraphImpl>::fillSubtreeMetEdges_(std::vector<Graph::EdgeId>& metEdges, Graph::NodeId localRoot) const
-{
-  std::vector<Graph::EdgeId> edgesToSons = GraphImpl::getOutgoingEdges(localRoot);
-  for (std::vector<Graph::EdgeId>::iterator currEdgeToSon = edgesToSons.begin(); currEdgeToSon != edgesToSons.end(); currEdgeToSon++)
+  template<class GraphImpl>
+  void TreeGraphImpl<GraphImpl>::fillSubtreeMetEdges_(std::vector<Graph::EdgeId>& metEdges, Graph::NodeId localRoot) const
   {
-    metEdges.push_back(*currEdgeToSon);
-    fillSubtreeMetEdges_(metEdges, GraphImpl::getBottom(*currEdgeToSon));
+    std::vector<Graph::EdgeId> edgesToSons = GraphImpl::getOutgoingEdges(localRoot);
+    for (std::vector<Graph::EdgeId>::iterator currEdgeToSon = edgesToSons.begin(); currEdgeToSon != edgesToSons.end(); currEdgeToSon++)
+    {
+      metEdges.push_back(*currEdgeToSon);
+      fillSubtreeMetEdges_(metEdges, GraphImpl::getBottom(*currEdgeToSon));
+    }
   }
 }
-}
 
 
 #endif
diff --git a/src/Bpp/Graphics/AbstractGraphicDevice.h b/src/Bpp/Graphics/AbstractGraphicDevice.h
index 6f2e629..79d8ccc 100644
--- a/src/Bpp/Graphics/AbstractGraphicDevice.h
+++ b/src/Bpp/Graphics/AbstractGraphicDevice.h
@@ -80,7 +80,7 @@ class AbstractGraphicDevice:
     void setCurrentBackgroundColor(const RGBColor& color) { bgColor_ = color; }
     void setCurrentFont(const Font& font) { font_ = font; }
     void setCurrentPointSize(unsigned int size) { pointSize_ = size; }
-    void setCurrentLineType(short type) throw (Exception)
+    void setCurrentLineType(short type)
     { 
       if       (type == LINE_SOLID) lineType_ = type;
       else if (type == LINE_DASHED) lineType_ = type;
diff --git a/src/Bpp/Graphics/ColorManager.h b/src/Bpp/Graphics/ColorManager.h
index 7666026..49604a7 100644
--- a/src/Bpp/Graphics/ColorManager.h
+++ b/src/Bpp/Graphics/ColorManager.h
@@ -75,7 +75,7 @@ namespace bpp
          * @return The color associated to a given code.
          * @throw exception if the code is not valid.
          */
-        virtual const RGBColor& getColor(CodeType& code) const throw (Exception) = 0;
+        virtual const RGBColor& getColor(CodeType& code) const = 0;
 
         /**
          * @return All valid codes.
@@ -168,7 +168,7 @@ namespace bpp
         codes_.push_back(currentCode_);
         return currentCode_;
       }
-      const RGBColor& getColor(unsigned int &code) const throw (Exception)
+      const RGBColor& getColor(unsigned int &code) const
       {
         for(unsigned int i = 0; i < codes_.size(); i++)
         {
diff --git a/src/Bpp/Graphics/ColorSet.h b/src/Bpp/Graphics/ColorSet.h
index df880c1..daba384 100644
--- a/src/Bpp/Graphics/ColorSet.h
+++ b/src/Bpp/Graphics/ColorSet.h
@@ -67,7 +67,7 @@ class ColorSet
      * @return The color associated to the given name.
      * @throw Exception if the name is not assigned to any color.
      */
-    virtual const RGBColor& getColor(const std::string& name) const throw (Exception) = 0;
+    virtual const RGBColor& getColor(const std::string& name) const = 0;
 
     /**
      * @brief Get the ith color object in the set.
@@ -76,7 +76,7 @@ class ColorSet
      * @return The color associated to the given index.
      * @throw IndexOutOfBoundsException if the index is not assigned to any color.
      */
-    virtual const RGBColor& getColor(unsigned int index) const throw (IndexOutOfBoundsException) = 0;
+    virtual const RGBColor& getColor(unsigned int index) const = 0;
 
     /**
      * @return All valid color names.
@@ -106,14 +106,14 @@ class AbstractColorSet:
     virtual ~AbstractColorSet() {}
 
   public:
-    const RGBColor& getColor(const std::string& name) const throw (Exception)
+    const RGBColor& getColor(const std::string& name) const
     {
       std::map<std::string, RGBColor>::const_iterator it = colors_.find(name);
       if (it != colors_.end()) return it->second;
       else throw Exception("AbstractColorSet::getColor(name): no color with name " + name);
     }
 
-    const RGBColor& getColor(unsigned int index) const throw (IndexOutOfBoundsException)
+    const RGBColor& getColor(unsigned int index) const
     {
       if (index >= colors_.size()) throw IndexOutOfBoundsException("AbstractColorSet::getColor(index): invalid index.", index, 0, colors_.size() - 1);
       std::map<std::string, RGBColor>::const_iterator it = colors_.begin();
diff --git a/src/Bpp/Graphics/Fig/XFigGraphicDevice.cpp b/src/Bpp/Graphics/Fig/XFigGraphicDevice.cpp
index fc0ce44..c8ae670 100644
--- a/src/Bpp/Graphics/Fig/XFigGraphicDevice.cpp
+++ b/src/Bpp/Graphics/Fig/XFigGraphicDevice.cpp
@@ -153,7 +153,7 @@ void XFigGraphicDevice::drawCircle(double x, double y, double radius, short fill
   content_.push_back(oss.str());
 }
 
-void XFigGraphicDevice::drawText(double x, double y, const std::string& text, short hpos, short vpos, double angle) throw (UnvalidFlagException)
+void XFigGraphicDevice::drawText(double x, double y, const std::string& text, short hpos, short vpos, double angle)
 {
   int xrel = static_cast<int>(round(x_(x)));
   short sub = 0;
diff --git a/src/Bpp/Graphics/Fig/XFigGraphicDevice.h b/src/Bpp/Graphics/Fig/XFigGraphicDevice.h
index de91f69..4428472 100644
--- a/src/Bpp/Graphics/Fig/XFigGraphicDevice.h
+++ b/src/Bpp/Graphics/Fig/XFigGraphicDevice.h
@@ -97,7 +97,7 @@ class XFigGraphicDevice:
     void setCurrentForegroundColor(const RGBColor& color);
     void setCurrentBackgroundColor(const RGBColor& color);
     void setCurrentFont(const Font& font);
-    void setCurrentLineType(short type) throw (Exception)
+    void setCurrentLineType(short type)
     { 
       if(type == LINE_SOLID) lineTypeCode_ = 0;
       else if(type == LINE_DASHED) lineTypeCode_ = 1;
@@ -108,7 +108,7 @@ class XFigGraphicDevice:
     void drawLine(double x1, double y1, double x2, double y2);
     void drawRect(double x, double y, double width, double height, short fill = FILL_EMPTY);
     void drawCircle(double x, double y, double radius, short fill = FILL_EMPTY);
-    void drawText(double x, double y, const std::string& text, short hpos = TEXT_HORIZONTAL_LEFT, short vpos = TEXT_VERTICAL_BOTTOM, double angle = 0) throw (UnvalidFlagException);
+    void drawText(double x, double y, const std::string& text, short hpos = TEXT_HORIZONTAL_LEFT, short vpos = TEXT_VERTICAL_BOTTOM, double angle = 0);
     void comment(const std::string& text)
     {
       content_.push_back("#" + text);
diff --git a/src/Bpp/Graphics/Font/FontManager.h b/src/Bpp/Graphics/Font/FontManager.h
index 6f8889c..a8539b5 100644
--- a/src/Bpp/Graphics/Font/FontManager.h
+++ b/src/Bpp/Graphics/Font/FontManager.h
@@ -69,14 +69,14 @@ public:
    * @param font The font to look for.
    * @return The code associated to a given font.
    */
-  virtual CodeType getCode(const Font& font) const throw (Exception) = 0;
+  virtual CodeType getCode(const Font& font) const = 0;
 
   /**
    * @param code The code to look for.
    * @return The font associated to a given code.
    * @throw exception if the code is not valid.
    */
-  virtual const Font& getFont(CodeType& code) const throw (Exception) = 0;
+  virtual const Font& getFont(CodeType& code) const = 0;
 
   /**
    * @return All valid codes.
@@ -108,7 +108,7 @@ public:
   AbstractFontManager() : fonts_(), codes_() {}
 
 public:
-  CodeType getCode(const Font& font) const throw (Exception)
+  CodeType getCode(const Font& font) const
   {
     for (unsigned int i = 0; i < fonts_.size(); i++)
     {
@@ -120,7 +120,7 @@ public:
     throw Exception("AbstractFontManager::getCode. Unknown font: " + font.toString());
   }
 
-  const Font& getFont(int &code) const throw (Exception)
+  const Font& getFont(int &code) const
   {
     for (unsigned int i = 0; i < codes_.size(); i++)
     {
diff --git a/src/Bpp/Graphics/GraphicDevice.h b/src/Bpp/Graphics/GraphicDevice.h
index 6715cda..694de5c 100644
--- a/src/Bpp/Graphics/GraphicDevice.h
+++ b/src/Bpp/Graphics/GraphicDevice.h
@@ -166,7 +166,7 @@ namespace bpp
        * @param vpos Vertical adjustment, one of TEXT_VERTICAL_LEFT, TEXT_VERTICAL_CENTER or TEXT_VERTICAL_RIGHT.
        * @param angle Angle i radian to rotate the text.
        */
-      virtual void drawText(double x, double y, const std::string& text, short hpos = TEXT_HORIZONTAL_LEFT, short vpos = TEXT_VERTICAL_BOTTOM, double angle = 0) throw (UnvalidFlagException) = 0;
+      virtual void drawText(double x, double y, const std::string& text, short hpos = TEXT_HORIZONTAL_LEFT, short vpos = TEXT_VERTICAL_BOTTOM, double angle = 0) = 0;
 
       /**
        * @brief Add a comment in the output.
diff --git a/src/Bpp/Graphics/Latex/PgfGraphicDevice.cpp b/src/Bpp/Graphics/Latex/PgfGraphicDevice.cpp
index 0b72269..8ab0cb5 100644
--- a/src/Bpp/Graphics/Latex/PgfGraphicDevice.cpp
+++ b/src/Bpp/Graphics/Latex/PgfGraphicDevice.cpp
@@ -195,7 +195,7 @@ void PgfGraphicDevice::setCurrentPointSize(unsigned int size)
   content_.push_back(oss.str());
 }
 
-void PgfGraphicDevice::setCurrentLineType(short type) throw (Exception)
+void PgfGraphicDevice::setCurrentLineType(short type)
 { 
   AbstractGraphicDevice::setCurrentLineType(type);
   if(type == LINE_SOLID)
@@ -272,7 +272,7 @@ void PgfGraphicDevice::drawCircle(double x, double y, double radius, short fill)
   contentStarted_ = true;
 }
 
-void PgfGraphicDevice::drawText(double x, double y, const std::string& text, short hpos, short vpos, double angle) throw (UnvalidFlagException)
+void PgfGraphicDevice::drawText(double x, double y, const std::string& text, short hpos, short vpos, double angle)
 {
   string anchor;
   if(vpos == TEXT_VERTICAL_BOTTOM)
diff --git a/src/Bpp/Graphics/Latex/PgfGraphicDevice.h b/src/Bpp/Graphics/Latex/PgfGraphicDevice.h
index aecb9ed..7b8c25d 100644
--- a/src/Bpp/Graphics/Latex/PgfGraphicDevice.h
+++ b/src/Bpp/Graphics/Latex/PgfGraphicDevice.h
@@ -93,13 +93,13 @@ class PgfGraphicDevice:
     void setCurrentBackgroundColor(const RGBColor& color);
     void setCurrentFont(const Font& font);
     void setCurrentPointSize(unsigned int size);
-    void setCurrentLineType(short type) throw (Exception);
+    void setCurrentLineType(short type);
     void setCurrentLayer(int layerIndex);
    
     void drawLine(double x1, double y1, double x2, double y2);
     void drawRect(double x, double y, double width, double height, short fill = FILL_EMPTY);
     void drawCircle(double x, double y, double radius, short fill = FILL_EMPTY);
-    void drawText(double x, double y, const std::string & text, short hpos = TEXT_HORIZONTAL_LEFT, short vpos = TEXT_VERTICAL_BOTTOM, double angle = 0) throw (UnvalidFlagException);
+    void drawText(double x, double y, const std::string & text, short hpos = TEXT_HORIZONTAL_LEFT, short vpos = TEXT_VERTICAL_BOTTOM, double angle = 0);
     void comment(const std::string& text)
     {
       content_.push_back("%" + text);
diff --git a/src/Bpp/Graphics/Svg/SvgGraphicDevice.cpp b/src/Bpp/Graphics/Svg/SvgGraphicDevice.cpp
index 0c68013..b540d70 100644
--- a/src/Bpp/Graphics/Svg/SvgGraphicDevice.cpp
+++ b/src/Bpp/Graphics/Svg/SvgGraphicDevice.cpp
@@ -141,7 +141,7 @@ void SvgGraphicDevice::drawCircle(double x, double y, double radius, short fill)
   layers_[getCurrentLayer()].push_back(oss.str());
 }
 
-void SvgGraphicDevice::drawText(double x, double y, const std::string & text, short hpos, short vpos, double angle) throw (UnvalidFlagException)
+void SvgGraphicDevice::drawText(double x, double y, const std::string & text, short hpos, short vpos, double angle)
 {
   x = x_(x);
   y = y_(y);
diff --git a/src/Bpp/Graphics/Svg/SvgGraphicDevice.h b/src/Bpp/Graphics/Svg/SvgGraphicDevice.h
index 24fc012..452c6d7 100644
--- a/src/Bpp/Graphics/Svg/SvgGraphicDevice.h
+++ b/src/Bpp/Graphics/Svg/SvgGraphicDevice.h
@@ -86,7 +86,7 @@ class SvgGraphicDevice:
     void drawLine(double x1, double y1, double x2, double y2);
     void drawRect(double x, double y, double width, double height, short fill = FILL_EMPTY);
     void drawCircle(double x, double y, double radius, short fill = FILL_EMPTY);
-    void drawText(double x, double y, const std::string& text, short hpos = TEXT_HORIZONTAL_LEFT, short vpos = TEXT_VERTICAL_BOTTOM, double angle = 0) throw (UnvalidFlagException);
+    void drawText(double x, double y, const std::string& text, short hpos = TEXT_HORIZONTAL_LEFT, short vpos = TEXT_VERTICAL_BOTTOM, double angle = 0);
     void comment(const std::string& text)
     {
       layers_[getCurrentLayer()].push_back("<!-- " + text + " -->");
diff --git a/src/Bpp/Io/BppODiscreteDistributionFormat.cpp b/src/Bpp/Io/BppODiscreteDistributionFormat.cpp
index 7fdbc2a..e1a694e 100644
--- a/src/Bpp/Io/BppODiscreteDistributionFormat.cpp
+++ b/src/Bpp/Io/BppODiscreteDistributionFormat.cpp
@@ -419,7 +419,7 @@ void BppODiscreteDistributionFormat::write(const DiscreteDistribution& dist,
 }
 
 void BppODiscreteDistributionFormat::initialize_(
-  DiscreteDistribution& rDist) throw (Exception)
+  DiscreteDistribution& rDist)
 {
   ParameterList pl = rDist.getIndependentParameters();
 
diff --git a/src/Bpp/Io/BppODiscreteDistributionFormat.h b/src/Bpp/Io/BppODiscreteDistributionFormat.h
index ecd8ec4..016a791 100644
--- a/src/Bpp/Io/BppODiscreteDistributionFormat.h
+++ b/src/Bpp/Io/BppODiscreteDistributionFormat.h
@@ -87,7 +87,7 @@ protected:
    * @param rDist The distribution to set up.
    * @throw Exception if an error occured.
    */
-  void initialize_(DiscreteDistribution& rDist) throw (Exception);
+  void initialize_(DiscreteDistribution& rDist);
 };
 
 } // end of namespace bpp.
diff --git a/src/Bpp/Io/FileTools.cpp b/src/Bpp/Io/FileTools.cpp
index 9dbf2f9..766ea96 100644
--- a/src/Bpp/Io/FileTools.cpp
+++ b/src/Bpp/Io/FileTools.cpp
@@ -54,7 +54,7 @@ char FileTools::DIR_SEP = '/';
 bool FileTools::fileExists(const std::string& filename)
 {
   ifstream file(filename.c_str());
-  bool test = file ? true : false; //needed for CLang.
+  bool test = file.good(); //needed for CLang.
   file.close();
   return test;
 }
@@ -64,7 +64,7 @@ bool FileTools::fileExists(const std::string& filename)
 bool FileTools::directoryExists(const std::string& path)
 {
   ifstream file(path.c_str());
-  bool test = file ? true : false; //needed for CLang.
+  bool test = file.good(); //needed for CLang.
   file.close();
   return test;
 }
diff --git a/src/Bpp/Io/IoDiscreteDistributionFactory.cpp b/src/Bpp/Io/IoDiscreteDistributionFactory.cpp
index 7fb3346..dc8a343 100644
--- a/src/Bpp/Io/IoDiscreteDistributionFactory.cpp
+++ b/src/Bpp/Io/IoDiscreteDistributionFactory.cpp
@@ -43,13 +43,13 @@ using namespace bpp;
 
 const std::string IoDiscreteDistributionFactory::BPPO_FORMAT = "Bpp0"; 
 
-IDiscreteDistribution* IoDiscreteDistributionFactory::createReader(const std::string& format) throw (Exception)
+IDiscreteDistribution* IoDiscreteDistributionFactory::createReader(const std::string& format)
 {
   if(format == BPPO_FORMAT) return new BppODiscreteDistributionFormat();
   else throw Exception("Format " + format + " is not supported for input.");
 }
   
-ODiscreteDistribution* IoDiscreteDistributionFactory::createWriter(const std::string& format) throw (Exception)
+ODiscreteDistribution* IoDiscreteDistributionFactory::createWriter(const std::string& format)
 {
   if(format == BPPO_FORMAT) return new BppODiscreteDistributionFormat();
   else throw Exception("Format " + format + " is not supported for output.");
diff --git a/src/Bpp/Io/IoDiscreteDistributionFactory.h b/src/Bpp/Io/IoDiscreteDistributionFactory.h
index e18d12b..c173271 100644
--- a/src/Bpp/Io/IoDiscreteDistributionFactory.h
+++ b/src/Bpp/Io/IoDiscreteDistributionFactory.h
@@ -81,7 +81,7 @@ public:
    * @return A pointer toward a new IDiscreteDistribution object.
    * @throw Exception If the format name do not match any available format.
    */
-  virtual IDiscreteDistribution* createReader(const std::string& format) throw (Exception);
+  virtual IDiscreteDistribution* createReader(const std::string& format);
   
   /**
    * @brief Get a new dynamically created ODiscreteDistribution object.
@@ -90,7 +90,7 @@ public:
    * @return A pointer toward a new ODiscreteDistribution object.
    * @throw Exception If the format name do not match any available format.
    */
-  virtual ODiscreteDistribution* createWriter(const std::string& format) throw (Exception);
+  virtual ODiscreteDistribution* createWriter(const std::string& format);
 };
 
 } //end of namespace bpp.
diff --git a/src/Bpp/Numeric/AbstractParameterAliasable.cpp b/src/Bpp/Numeric/AbstractParameterAliasable.cpp
index ce7c5ba..b081349 100644
--- a/src/Bpp/Numeric/AbstractParameterAliasable.cpp
+++ b/src/Bpp/Numeric/AbstractParameterAliasable.cpp
@@ -111,7 +111,6 @@ AbstractParameterAliasable::~AbstractParameterAliasable()
 }
 
 void AbstractParameterAliasable::aliasParameters(const std::string& p1, const std::string& p2)
-throw (ParameterNotFoundException, Exception)
 {
   // In case this is the first time we call this method:
   if (getNumberOfParameters() > 0 && independentParameters_.size() == 0)
@@ -214,7 +213,6 @@ void AbstractParameterAliasable::aliasParameters(map<string, string>& unparsedPa
 
 
 void AbstractParameterAliasable::unaliasParameters(const std::string& p1, const std::string& p2)
-throw (ParameterNotFoundException, Exception)
 {
   if (!hasParameter(p1))
     throw ParameterNotFoundException("AbstractParameterAliasable::unaliasParameters", p1);
diff --git a/src/Bpp/Numeric/AbstractParameterAliasable.h b/src/Bpp/Numeric/AbstractParameterAliasable.h
index 4db3441..fcfba18 100644
--- a/src/Bpp/Numeric/AbstractParameterAliasable.h
+++ b/src/Bpp/Numeric/AbstractParameterAliasable.h
@@ -100,9 +100,9 @@ public:
 
   void setParameterList(ParameterList* pl) { pl_ = pl; }
 
-  void parameterNameChanged(ParameterEvent& event) throw (Exception) {}
+  void parameterNameChanged(ParameterEvent& event) {}
 
-  void parameterValueChanged(ParameterEvent& event) throw (Exception)
+  void parameterValueChanged(ParameterEvent& event)
   {
     Parameter* p = &(*pl_)[alias_];
     if (p->getName() != name_)
@@ -162,9 +162,9 @@ public:
 
   size_t getNumberOfIndependentParameters() const { return independentParameters_.size(); }
 
-  void aliasParameters(const std::string& p1, const std::string& p2) throw (ParameterNotFoundException, Exception);
+  void aliasParameters(const std::string& p1, const std::string& p2);
 
-  void unaliasParameters(const std::string& p1, const std::string& p2) throw (ParameterNotFoundException, Exception);
+  void unaliasParameters(const std::string& p1, const std::string& p2);
 
   /**
    * @brief alias the parameters following the links described in a
@@ -245,7 +245,7 @@ protected:
   }
 
 
-  void deleteParameter_(size_t index) throw (IndexOutOfBoundsException)
+  void deleteParameter_(size_t index)
   {
     std::string name = getParameterNameWithoutNamespace(getParameter_(index).getName());
     AbstractParametrizable::deleteParameter_(index);
@@ -253,7 +253,7 @@ protected:
       independentParameters_.deleteParameter(name);
   }
 
-  void deleteParameter_(std::string& name) throw (IndexOutOfBoundsException)
+  void deleteParameter_(std::string& name)
   {
     AbstractParametrizable::deleteParameter_(name);
     if (independentParameters_.hasParameter(name))
diff --git a/src/Bpp/Numeric/AbstractParametrizable.h b/src/Bpp/Numeric/AbstractParametrizable.h
index 4aa989f..7347135 100644
--- a/src/Bpp/Numeric/AbstractParametrizable.h
+++ b/src/Bpp/Numeric/AbstractParametrizable.h
@@ -76,45 +76,40 @@ class AbstractParametrizable:
 
     const ParameterList& getParameters() const { return parameters_; }
     
-    const Parameter& getParameter(const std::string& name) const throw (ParameterNotFoundException)
+    const Parameter& getParameter(const std::string& name) const
     {
       return parameters_.getParameter(prefix_ + name);
     }
 
-  const std::shared_ptr<Parameter>& getSharedParameter(const std::string& name) const throw (ParameterNotFoundException)
+  const std::shared_ptr<Parameter>& getSharedParameter(const std::string& name) const
   {
     return parameters_.getSharedParameter(prefix_ + name);
   }
 
     double getParameterValue(const std::string& name) const
-      throw (ParameterNotFoundException)
     { 
       return getParameter(name).getValue();
     }
 
-    void setAllParametersValues(const ParameterList & parameters) 
-      throw (ParameterNotFoundException, ConstraintException)
+    void setAllParametersValues(const ParameterList & parameters)
     {
       parameters_.setAllParametersValues(parameters);
       fireParameterChanged(parameters);
     }
 
-    void setParameterValue(const std::string& name, double value) 
-      throw (ParameterNotFoundException, ConstraintException)
+    void setParameterValue(const std::string& name, double value)
     {
       parameters_.setParameterValue(prefix_ + name, value);
       fireParameterChanged(parameters_.subList(prefix_ + name));
     }
 
     void setParametersValues(const ParameterList& parameters)
-      throw (ParameterNotFoundException, ConstraintException)
     { 
       parameters_.setParametersValues(parameters);
       fireParameterChanged(parameters);
     }
 
     bool matchParametersValues(const ParameterList& parameters)
-      throw (ConstraintException)
     {
       std::unique_ptr< std::vector<size_t> >updatedParameters(new std::vector<size_t>());
       bool test = parameters_.matchParametersValues(parameters, updatedParameters.get());
@@ -169,7 +164,7 @@ class AbstractParametrizable:
     parameters_.includeParameters(parameters);
   }
 
-  virtual void deleteParameter_(size_t index) throw (IndexOutOfBoundsException)
+  virtual void deleteParameter_(size_t index)
   {
     if (index >= parameters_.size())
       throw IndexOutOfBoundsException("AbstractParametrizable::deleteParameter_.", index, 0, parameters_.size() - 1);
@@ -196,7 +191,7 @@ class AbstractParametrizable:
      * @return A reference toward the corresponding parameter.
      * @throw ParameterNotFoundException If no parameter with that name is found in the list.
      */
-    Parameter& getParameter_(const std::string& name) throw (ParameterNotFoundException)
+    Parameter& getParameter_(const std::string& name)
     {
       return parameters_.getParameter(prefix_ + name);
     }
@@ -206,7 +201,7 @@ class AbstractParametrizable:
      * @return A reference toward the corresponding parameter.
      * @throw ParameterNotFoundException If no parameter with that name is found in the list.
      */
-    Parameter& getParameterWithNamespace_(const std::string& name) throw (ParameterNotFoundException)
+    Parameter& getParameterWithNamespace_(const std::string& name)
     {
       return getParameter_(name);
     }
@@ -215,19 +210,19 @@ class AbstractParametrizable:
      * @return A reference toward the corresponding parameter.
      * @throw ParameterNotFoundException If no parameter with that name is found in the list.
      */
-    const Parameter& getParameterWithNamespace_(const std::string& name) const throw (ParameterNotFoundException)
+    const Parameter& getParameterWithNamespace_(const std::string& name) const
     {
       return getParameter(name);
     }
 
-    Parameter& getParameter_(size_t index) throw (IndexOutOfBoundsException)
+    Parameter& getParameter_(size_t index)
     {
       if (index >= parameters_.size())
         throw IndexOutOfBoundsException("AbstractParametrizable::getParameter_.", index, 0, parameters_.size() - 1);
       return parameters_[index];
     }
 
-  const Parameter& getParameter_(size_t index) const throw (IndexOutOfBoundsException)
+  const Parameter& getParameter_(size_t index) const
     {
       if(index >= parameters_.size())
         throw IndexOutOfBoundsException("AbstractParametrizable::getParameter_.", index, 0, parameters_.size() - 1);
diff --git a/src/Bpp/Numeric/AutoParameter.cpp b/src/Bpp/Numeric/AutoParameter.cpp
index 7093a3b..b08b81b 100644
--- a/src/Bpp/Numeric/AutoParameter.cpp
+++ b/src/Bpp/Numeric/AutoParameter.cpp
@@ -58,7 +58,7 @@ string AutoParameter::CONSTRAINTS_KEEP   = "keep";
 
 /** Constructors: *************************************************************/
 
-AutoParameter::AutoParameter(const std::string& name, double value, Constraint* constraint, bool attachConstraint) throw (ConstraintException):
+AutoParameter::AutoParameter(const std::string& name, double value, Constraint* constraint, bool attachConstraint):
 Parameter(name, value, constraint, attachConstraint), messageHandler_(ApplicationTools::message) {}
 
 AutoParameter::AutoParameter(const Parameter& p): Parameter(p), messageHandler_(ApplicationTools::message) {}
@@ -74,7 +74,7 @@ AutoParameter& AutoParameter::operator=(const AutoParameter& p)
 
 /******************************************************************************/
 
-void AutoParameter::setValue(double value) throw (ConstraintException)
+void AutoParameter::setValue(double value)
 {
   try
   { 
diff --git a/src/Bpp/Numeric/AutoParameter.h b/src/Bpp/Numeric/AutoParameter.h
index 3343232..6d4870f 100644
--- a/src/Bpp/Numeric/AutoParameter.h
+++ b/src/Bpp/Numeric/AutoParameter.h
@@ -73,7 +73,7 @@ class AutoParameter:
      * between different objects. See Parameter.
 		 * @throw ConstraintException If the parameter value does not match the contraint.
 		 */
-		AutoParameter(const std::string& name = "", double value = 0, Constraint* constraint = 0, bool attachConstraint = false) throw (ConstraintException);
+		AutoParameter(const std::string& name = "", double value = 0, Constraint* constraint = 0, bool attachConstraint = false);
 
 		/**
 		 * @brief Copy constructor.
@@ -116,7 +116,7 @@ class AutoParameter:
 		 * @param value the new parameter value.
 		 * @throw ConstraintException Never thrown!
 		 */
-		virtual void setValue(double value) throw (ConstraintException);
+		virtual void setValue(double value);
 	
 	public: //Specific method:
 		
diff --git a/src/Bpp/Numeric/DataTable.cpp b/src/Bpp/Numeric/DataTable.cpp
index 5049655..71efe93 100644
--- a/src/Bpp/Numeric/DataTable.cpp
+++ b/src/Bpp/Numeric/DataTable.cpp
@@ -69,7 +69,7 @@ DataTable::DataTable(size_t nCol) :
   colNames_(0)
 {}
 
-DataTable::DataTable(const std::vector<std::string>& colNames) throw (DuplicatedTableColumnNameException) :
+DataTable::DataTable(const std::vector<std::string>& colNames) :
   nRow_(0),
   nCol_(colNames.size()),
   data_(colNames.size()),
@@ -125,7 +125,7 @@ DataTable::~DataTable()
 /*                             Cell access                                    */
 /******************************************************************************/
 
-string& DataTable::operator()(size_t rowIndex, size_t colIndex) throw (IndexOutOfBoundsException)
+string& DataTable::operator()(size_t rowIndex, size_t colIndex)
 {
   if (colIndex >= nCol_)
     throw IndexOutOfBoundsException("DataTable::operator(size_t, size_t).", colIndex, 0, nCol_ - 1);
@@ -134,7 +134,7 @@ string& DataTable::operator()(size_t rowIndex, size_t colIndex) throw (IndexOutO
   return data_[colIndex][rowIndex];
 }
 
-const string& DataTable::operator()(size_t rowIndex, size_t colIndex) const throw (IndexOutOfBoundsException)
+const string& DataTable::operator()(size_t rowIndex, size_t colIndex) const
 {
   if (colIndex >= nCol_)
     throw IndexOutOfBoundsException("DataTable::operator(size_t, size_t).", colIndex, 0, nCol_ - 1);
@@ -146,7 +146,6 @@ const string& DataTable::operator()(size_t rowIndex, size_t colIndex) const thro
 /******************************************************************************/
 
 string& DataTable::operator()(const string& rowName, const string& colName)
-throw (NoTableRowNamesException, NoTableColumnNamesException, TableNameNotFoundException)
 {
   if (rowNames_ == NULL)
     throw NoTableRowNamesException("DataTable::operator(const string &, const string &).");
@@ -165,7 +164,6 @@ throw (NoTableRowNamesException, NoTableColumnNamesException, TableNameNotFoundE
 }
 
 const string& DataTable::operator()(const string& rowName, const string& colName) const
-throw (NoTableRowNamesException, NoTableColumnNamesException, TableNameNotFoundException)
 {
   if (rowNames_ == NULL)
     throw NoTableRowNamesException("DataTable::operator(const string &, const string &).");
@@ -186,7 +184,6 @@ throw (NoTableRowNamesException, NoTableColumnNamesException, TableNameNotFoundE
 /******************************************************************************/
 
 string& DataTable::operator()(const string& rowName, size_t colIndex)
-throw (NoTableRowNamesException, TableNameNotFoundException, IndexOutOfBoundsException)
 {
   if (rowNames_ == NULL)
     throw NoTableRowNamesException("DataTable::operator(const string &, size_t).");
@@ -204,7 +201,6 @@ throw (NoTableRowNamesException, TableNameNotFoundException, IndexOutOfBoundsExc
 }
 
 const string& DataTable::operator()(const string& rowName, size_t colIndex) const
-throw (NoTableRowNamesException, TableNameNotFoundException, IndexOutOfBoundsException)
 {
   if (rowNames_ == NULL)
     throw NoTableRowNamesException("DataTable::operator(const string &, size_t).");
@@ -224,7 +220,6 @@ throw (NoTableRowNamesException, TableNameNotFoundException, IndexOutOfBoundsExc
 /******************************************************************************/
 
 string& DataTable::operator()(size_t rowIndex, const string& colName)
-throw (IndexOutOfBoundsException, NoTableColumnNamesException, TableNameNotFoundException)
 {
   if (colNames_ == NULL)
     throw NoTableColumnNamesException("DataTable::operator(size_t, const string &).");
@@ -242,7 +237,6 @@ throw (IndexOutOfBoundsException, NoTableColumnNamesException, TableNameNotFound
 }
 
 const string& DataTable::operator()(size_t rowIndex, const string& colName) const
-throw (IndexOutOfBoundsException, NoTableColumnNamesException, TableNameNotFoundException)
 {
   if (colNames_ == NULL)
     throw NoTableColumnNamesException("DataTable::operator(size_t, const string &).");
@@ -264,7 +258,6 @@ throw (IndexOutOfBoundsException, NoTableColumnNamesException, TableNameNotFound
 /******************************************************************************/
 
 void DataTable::setRowNames(const vector<string>& rowNames)
-throw (DimensionException, DuplicatedTableRowNameException)
 {
   if (!VectorTools::isUnique(rowNames))
   {
@@ -280,14 +273,14 @@ throw (DimensionException, DuplicatedTableRowNameException)
   }
 }
 
-vector<string> DataTable::getRowNames() const throw (NoTableRowNamesException)
+vector<string> DataTable::getRowNames() const
 {
   if (rowNames_ == NULL)
     throw NoTableRowNamesException("DataTable::getRowNames().");
   return *rowNames_;
 }
 
-string DataTable::getRowName(size_t index) const throw (NoTableRowNamesException, IndexOutOfBoundsException)
+string DataTable::getRowName(size_t index) const
 {
   if (rowNames_ == NULL)
     throw NoTableRowNamesException("DataTable::getRowName(size_t).");
@@ -299,7 +292,6 @@ string DataTable::getRowName(size_t index) const throw (NoTableRowNamesException
 /******************************************************************************/
 
 void DataTable::setColumnNames(const vector<string>& colNames)
-throw (DimensionException, DuplicatedTableColumnNameException)
 {
   if (!VectorTools::isUnique(colNames))
     throw DuplicatedTableColumnNameException("DataTable::setColumnNames(...). Column names must be unique.");
@@ -313,14 +305,14 @@ throw (DimensionException, DuplicatedTableColumnNameException)
   }
 }
 
-vector<string> DataTable::getColumnNames() const throw (NoTableColumnNamesException)
+vector<string> DataTable::getColumnNames() const
 {
   if (colNames_ == NULL)
     throw NoTableColumnNamesException("DataTable::getColumnNames().");
   return *colNames_;
 }
 
-string DataTable::getColumnName(size_t index) const throw (NoTableColumnNamesException, IndexOutOfBoundsException)
+string DataTable::getColumnName(size_t index) const
 {
   if (colNames_ == NULL)
     throw NoTableColumnNamesException("DataTable::getColumnName(size_t).");
@@ -334,7 +326,6 @@ string DataTable::getColumnName(size_t index) const throw (NoTableColumnNamesExc
 /******************************************************************************/
 
 vector<string>& DataTable::getColumn(size_t index)
-throw (IndexOutOfBoundsException)
 {
   if (index >= nCol_)
     throw IndexOutOfBoundsException("DataTable::getColumn(size_t).", index, 0, nCol_ - 1);
@@ -342,7 +333,6 @@ throw (IndexOutOfBoundsException)
 }
 
 const vector<string>& DataTable::getColumn(size_t index) const
-throw (IndexOutOfBoundsException)
 {
   if (index >= nCol_)
     throw IndexOutOfBoundsException("DataTable::getColumn(size_t).", index, 0, nCol_ - 1);
@@ -350,7 +340,6 @@ throw (IndexOutOfBoundsException)
 }
 
 vector<string>& DataTable::getColumn(const string& colName)
-throw (NoTableColumnNamesException, TableColumnNameNotFoundException)
 {
   if (colNames_ == NULL)
     throw NoTableColumnNamesException("DataTable::getColumn(const string &).");
@@ -366,7 +355,6 @@ throw (NoTableColumnNamesException, TableColumnNameNotFoundException)
 }
 
 const vector<string>& DataTable::getColumn(const string& colName) const
-throw (NoTableColumnNamesException, TableColumnNameNotFoundException)
 {
   if (colNames_ == NULL)
     throw NoTableColumnNamesException("DataTable::getColumn(const string &).");
@@ -394,7 +382,6 @@ bool DataTable::hasColumn(const string& colName) const
 }
 
 void DataTable::deleteColumn(size_t index)
-throw (IndexOutOfBoundsException)
 {
   if (index >= nCol_)
     throw IndexOutOfBoundsException("DataTable::deleteColumn(size_t).", index, 0, nCol_ - 1);
@@ -405,7 +392,6 @@ throw (IndexOutOfBoundsException)
 }
 
 void DataTable::deleteColumn(const string& colName)
-throw (NoTableColumnNamesException, TableColumnNameNotFoundException)
 {
   if (!colNames_)
     throw NoTableColumnNamesException("DataTable::deleteColumn(const string &).");
@@ -423,7 +409,6 @@ throw (NoTableColumnNamesException, TableColumnNameNotFoundException)
 }
 
 void DataTable::addColumn(const vector<string>& newColumn)
-throw (DimensionException, TableColumnNamesException)
 {
   if (colNames_)
     throw TableColumnNamesException("DataTable::addColumn. Table has column names.");
@@ -434,7 +419,6 @@ throw (DimensionException, TableColumnNamesException)
 }
 
 void DataTable::addColumn(const string& colName, const vector<string>& newColumn)
-throw (DimensionException, NoTableColumnNamesException, DuplicatedTableColumnNameException)
 {
   if (!colNames_)
   {
@@ -457,7 +441,6 @@ throw (DimensionException, NoTableColumnNamesException, DuplicatedTableColumnNam
 /******************************************************************************/
 
 vector<string> DataTable::getRow(size_t index) const
-throw (IndexOutOfBoundsException)
 {
   if (index >= nRow_)
     throw IndexOutOfBoundsException("DataTable::getRow(size_t).", index, 0, nRow_ - 1);
@@ -470,7 +453,6 @@ throw (IndexOutOfBoundsException)
 }
 
 vector<string> DataTable::getRow(const string& rowName) const
-throw (NoTableRowNamesException, TableRowNameNotFoundException)
 {
   if (!rowNames_)
     throw NoTableRowNamesException("DataTable::getRow(const string &).");
@@ -503,7 +485,6 @@ bool DataTable::hasRow(const string& rowName) const
 }
 
 void DataTable::deleteRow(size_t index)
-throw (IndexOutOfBoundsException)
 {
   for (size_t j = 0; j < nCol_; j++)
   {
@@ -518,7 +499,6 @@ throw (IndexOutOfBoundsException)
 }
 
 void DataTable::deleteRow(const string& rowName)
-throw (NoTableRowNamesException, TableRowNameNotFoundException)
 {
   if (!rowNames_)
     throw NoTableRowNamesException("DataTable::deleteRow(const string &).");
@@ -540,7 +520,6 @@ throw (NoTableRowNamesException, TableRowNameNotFoundException)
 }
 
 void DataTable::addRow(const vector<string>& newRow)
-throw (DimensionException, TableRowNamesException)
 {
   if (rowNames_)
     throw TableRowNamesException("DataTable::addRow. Table has row names.");
@@ -554,7 +533,6 @@ throw (DimensionException, TableRowNamesException)
 }
 
 void DataTable::addRow(const string& rowName, const vector<string>& newRow)
-throw (DimensionException, NoTableRowNamesException, DuplicatedTableRowNameException)
 {
   if (!rowNames_)
   {
@@ -580,7 +558,6 @@ throw (DimensionException, NoTableRowNamesException, DuplicatedTableRowNameExcep
 /******************************************************************************/
 
 DataTable* DataTable::read(istream& in, const string& sep, bool header, int rowNames)
-throw (DimensionException, IndexOutOfBoundsException, DuplicatedTableRowNameException)
 {
   string firstLine  = FileTools::getNextLine(in);
   StringTokenizer st1(firstLine, sep, false, true);
diff --git a/src/Bpp/Numeric/DataTable.h b/src/Bpp/Numeric/DataTable.h
index ce30784..b7b7321 100644
--- a/src/Bpp/Numeric/DataTable.h
+++ b/src/Bpp/Numeric/DataTable.h
@@ -91,7 +91,7 @@ public:
    * @param colNames The names of the columns of the DataTable.
    * @throw DuplicatedTableColumnNameException If colnames contains identical names.
    */
-  DataTable(const std::vector<std::string>& colNames) throw (DuplicatedTableColumnNameException);
+  DataTable(const std::vector<std::string>& colNames);
 
   DataTable(const DataTable& table);
 
@@ -108,7 +108,7 @@ public:
    * @param colIndex Column number.
    * @throw IndexOutOfBoundsException If one of the index is greater or equal to the corresponding number of columns/rows.
    */
-  std::string& operator()(size_t rowIndex, size_t colIndex) throw (IndexOutOfBoundsException);
+  std::string& operator()(size_t rowIndex, size_t colIndex);
 
   /**
    * @return The element at a given position.
@@ -116,7 +116,7 @@ public:
    * @param colIndex Column number.
    * @throw IndexOutOfBoundsException If one of the index is greater or equal to the corresponding number of columns/rows.
    */
-  const std::string& operator()(size_t rowIndex, size_t colIndex) const throw (IndexOutOfBoundsException);
+  const std::string& operator()(size_t rowIndex, size_t colIndex) const;
 
   /**
    * @return The element at a given position.
@@ -126,8 +126,7 @@ public:
    * @throw NoTableColumnNamesException If the table does not have names associated to columns.
    * @throw TableNameNotFoundException If one of rowName or colName do not match existing names.
    */
-  std::string& operator()(const std::string& rowName, const std::string& colName)
-  throw (NoTableRowNamesException, NoTableColumnNamesException, TableNameNotFoundException);
+  std::string& operator()(const std::string& rowName, const std::string& colName);
 
   /**
    * @return The element at a given position.
@@ -137,8 +136,7 @@ public:
    * @throw NoTableColumnNamesException If the table does not have names associated to columns.
    * @throw TableNameNotFoundException If one of rowName or colName do not match existing names.
    */
-  const std::string& operator()(const std::string& rowName, const std::string& colName) const
-  throw (NoTableRowNamesException, NoTableColumnNamesException, TableNameNotFoundException);
+  const std::string& operator()(const std::string& rowName, const std::string& colName) const;
 
   /**
    * @return The element at a given position.
@@ -148,8 +146,7 @@ public:
    * @throw IndexOutOfBoundsException If the index is greater or equal to the number of columns.
    * @throw TableNameNotFoundException If rowName do not match existing names.
    */
-  std::string& operator()(const std::string& rowName, size_t colIndex)
-  throw (NoTableRowNamesException, TableNameNotFoundException, IndexOutOfBoundsException);
+  std::string& operator()(const std::string& rowName, size_t colIndex);
 
   /**
    * @return The element at a given position.
@@ -159,8 +156,7 @@ public:
    * @throw IndexOutOfBoundsException If the index is greater or equal to the number of columns.
    * @throw TableNameNotFoundException If rowName do not match existing names.
    */
-  const std::string& operator()(const std::string& rowName, size_t colIndex) const
-  throw (NoTableRowNamesException, TableNameNotFoundException, IndexOutOfBoundsException);
+  const std::string& operator()(const std::string& rowName, size_t colIndex) const;
 
   /**
    * @return The element at a given position.
@@ -170,8 +166,7 @@ public:
    * @throw NoTableColumnNamesException If the table does not have names associated to columns.
    * @throw TableNameNotFoundException If colName do not match existing names.
    */
-  std::string& operator()(size_t rowIndex, const std::string& colName)
-  throw (IndexOutOfBoundsException, NoTableColumnNamesException, TableNameNotFoundException);
+  std::string& operator()(size_t rowIndex, const std::string& colName);
 
   /**
    * @return The element at a given position.
@@ -181,8 +176,7 @@ public:
    * @throw NoTableColumnNamesException If the table does not have names associated to columns.
    * @throw TableNameNotFoundException If colName do not match existing names.
    */
-  const std::string& operator()(size_t rowIndex, const std::string& colName) const
-  throw (IndexOutOfBoundsException, NoTableColumnNamesException, TableNameNotFoundException);
+  const std::string& operator()(size_t rowIndex, const std::string& colName) const;
 
   /**
    * @name Work on columns.
@@ -202,14 +196,14 @@ public:
    * @throw DimensionException If the number of names do not match the number of columns in the table.
    * @throw DuplicatedTableColumnNameException If names are not unique.
    */
-  void setColumnNames(const std::vector<std::string>& colNames) throw (DimensionException, DuplicatedTableColumnNameException);
+  void setColumnNames(const std::vector<std::string>& colNames);
   /**
    * @brief Get the column names of this table.
    *
    * @return The column names of this table.
    * @throw NoTableColumnNamesException If no column names are associated to this table.
    */
-  std::vector<std::string> getColumnNames() const throw (NoTableColumnNamesException);
+  std::vector<std::string> getColumnNames() const;
   /**
    * @brief Get a given column name.
    *
@@ -218,7 +212,7 @@ public:
    * @throw NoTableColumnNamesException If no column names are associated to this table.
    * @throw IndexOutOfBoundsException If index is >= number of columns.
    */
-  std::string getColumnName(size_t index) const throw (NoTableColumnNamesException, IndexOutOfBoundsException);
+  std::string getColumnName(size_t index) const;
 
   /**
    * @return true If column names are associated to this table.
@@ -230,13 +224,13 @@ public:
    * @param index The index of the column.
    * @throw IndexOutOfBoundsException If index is >= number of columns.
    */
-  std::vector<std::string>& getColumn(size_t index) throw (IndexOutOfBoundsException);
+  std::vector<std::string>& getColumn(size_t index);
   /**
    * @return The values in the given column.
    * @param index The index of the column.
    * @throw IndexOutOfBoundsException If index is >= number of columns.
    */
-  const std::vector<std::string>& getColumn(size_t index) const throw (IndexOutOfBoundsException);
+  const std::vector<std::string>& getColumn(size_t index) const;
 
   /**
    * @return The values in the given column.
@@ -244,14 +238,14 @@ public:
    * @throw NoTableColumnNamesException If no column names are associated to this table.
    * @throw TableColumnNameNotFoundException If colName do not match existing column names.
    */
-  std::vector<std::string>& getColumn(const std::string& colName) throw (NoTableColumnNamesException, TableColumnNameNotFoundException);
+  std::vector<std::string>& getColumn(const std::string& colName);
   /**
    * @return The values in the given column.
    * @param colName The name of the column.
    * @throw NoTableColumnNamesException If no column names are associated to this table.
    * @throw TableColumnNameNotFoundException If colName do not match existing column names.
    */
-  const std::vector<std::string>& getColumn(const std::string& colName) const throw (NoTableColumnNamesException, TableColumnNameNotFoundException);
+  const std::vector<std::string>& getColumn(const std::string& colName) const;
 
   /**
    * @brief Tell is a given column exists.
@@ -267,7 +261,7 @@ public:
    * @param index The index of the column.
    * @throw IndexOutOfBoundsException If index is >= number of columns.
    */
-  void deleteColumn(size_t index) throw (IndexOutOfBoundsException);
+  void deleteColumn(size_t index);
 
   /**
    * @brief Delete the given column.
@@ -276,7 +270,7 @@ public:
    * @throw NoTableColumnNamesException If no column names are associated to this table.
    * @throw TableColumnNameNotFoundException If colName do not match existing column names.
    */
-  void deleteColumn(const std::string& colName) throw (NoTableColumnNamesException, TableColumnNameNotFoundException);
+  void deleteColumn(const std::string& colName);
 
   /**
    * @brief Add a new column.
@@ -285,7 +279,7 @@ public:
    * @throw DimensionException If the number of values does not match the number of rows.
    * @throw TableColumnNamesException If the table has row names.
    */
-  void addColumn(const std::vector<std::string>& newColumn) throw (DimensionException, TableColumnNamesException);
+  void addColumn(const std::vector<std::string>& newColumn);
   /**
    * @brief Add a new column.
    *
@@ -295,7 +289,7 @@ public:
    * @throw NoTableColumnNamesException If the table does not have row names.
    * @throw DuplicatedTableColumnNameException If colName is already used.
    */
-  void addColumn(const std::string& colName, const std::vector<std::string>& newColumn) throw (DimensionException, NoTableColumnNamesException, DuplicatedTableColumnNameException);
+  void addColumn(const std::string& colName, const std::vector<std::string>& newColumn);
   /** @} */
 
   /**
@@ -316,7 +310,7 @@ public:
    * @throw DimensionException If the number of names do not match the number of rows in the table.
    * @throw DuplicatedTableRowNameException If names are not unique.
    */
-  void setRowNames(const std::vector<std::string>& rowNames) throw (DimensionException, DuplicatedTableRowNameException);
+  void setRowNames(const std::vector<std::string>& rowNames);
 
   /**
    * @brief Get the row names of this table.
@@ -324,7 +318,7 @@ public:
    * @return The row names of this table.
    * @throw NoTableRowNamesException If no row names are associated to this table.
    */
-  std::vector<std::string> getRowNames() const throw (NoTableRowNamesException);
+  std::vector<std::string> getRowNames() const;
 
   /**
    * @brief Tell is a given row exists.
@@ -342,7 +336,7 @@ public:
    * @throw NoTableRowNamesException If no row names are associated to this table.
    * @throw IndexOutOfBoundsException If index is >= number of rows.
    */
-  std::string getRowName(size_t index) const throw (NoTableRowNamesException, IndexOutOfBoundsException);
+  std::string getRowName(size_t index) const;
 
   /**
    * @return true If row names are associated to this table.
@@ -354,7 +348,7 @@ public:
    * @param index The index of the row.
    * @throw IndexOutOfBoundsException If index is >= number of rows.
    */
-  std::vector<std::string> getRow(size_t index) const throw (IndexOutOfBoundsException);
+  std::vector<std::string> getRow(size_t index) const;
 
   /**
    * @return A vector which contains a copy  in the given row.
@@ -362,7 +356,7 @@ public:
    * @throw NoTableRowNamesException If no row names are associated to this table.
    * @throw TableRowNameNotFoundException If rowName do not match existing row names.
    */
-  std::vector<std::string> getRow(const std::string& rowName) const throw (NoTableRowNamesException, TableRowNameNotFoundException);
+  std::vector<std::string> getRow(const std::string& rowName) const;
 
   /**
    * @brief Delete the given row.
@@ -370,7 +364,7 @@ public:
    * @param index The index of the row.
    * @throw IndexOutOfBoundsException If index is >= number of row.
    */
-  void deleteRow(size_t index) throw (IndexOutOfBoundsException);
+  void deleteRow(size_t index);
 
   /**
    * @brief Delete the given row.
@@ -379,7 +373,7 @@ public:
    * @throw NoTableRowNamesException If no row names are associated to this table.
    * @throw TableRowNameNotFoundException If rowName do not match existing column names.
    */
-  void deleteRow(const std::string& rowName) throw (NoTableRowNamesException, TableRowNameNotFoundException);
+  void deleteRow(const std::string& rowName);
 
   /**
    * @brief Add a new row.
@@ -388,7 +382,7 @@ public:
    * @throw DimensionException If the number of values does not match the number of columns.
    * @throw TableRowNamesException If the table has column names.
    */
-  void addRow(const std::vector<std::string>& newRow) throw (DimensionException, TableRowNamesException);
+  void addRow(const std::vector<std::string>& newRow);
   /**
    * @brief Add a new row.
    *
@@ -398,7 +392,7 @@ public:
    * @throw NoTableRowNamesException If the table does not have column names.
    * @throw DuplicatedTableRowNameException If rowName is already used.
    */
-  void addRow(const std::string& rowName, const std::vector<std::string>& newRow) throw (DimensionException, NoTableRowNamesException, DuplicatedTableRowNameException);
+  void addRow(const std::string& rowName, const std::vector<std::string>& newRow);
   /** @} */
 
 public:
@@ -417,8 +411,7 @@ public:
    * @param rowNames Use a column as rowNames. If positive, use the specified column to compute rownames, otherwise use default;
    * @return         A pointer toward a new DataTable object.
    */
-  static DataTable* read(std::istream& in, const std::string& sep = "\t", bool header = true, int rowNames = -1)
-  throw (DimensionException, IndexOutOfBoundsException, DuplicatedTableRowNameException);
+  static DataTable* read(std::istream& in, const std::string& sep = "\t", bool header = true, int rowNames = -1);
 
   /**
    * @brief Write a DataTable object to stream in CVS-like format.
diff --git a/src/Bpp/Numeric/Function/AbstractNumericalDerivative.h b/src/Bpp/Numeric/Function/AbstractNumericalDerivative.h
index 70e9b4e..f448205 100644
--- a/src/Bpp/Numeric/Function/AbstractNumericalDerivative.h
+++ b/src/Bpp/Numeric/Function/AbstractNumericalDerivative.h
@@ -160,7 +160,6 @@ class AbstractNumericalDerivative:
     bool enableFirstOrderDerivatives() const { return computeD1_; }
     
     double getFirstOrderDerivative(const std::string& variable) const
-      throw (Exception)
     {
       std::map<std::string, size_t>::iterator it = index_.find(variable);
       if (computeD1_ && it != index_.end())
@@ -183,7 +182,6 @@ class AbstractNumericalDerivative:
     bool enableSecondOrderDerivatives() const { return computeD2_; }
 
     double getSecondOrderDerivative(const std::string& variable) const
-      throw (Exception)
     {
       std::map<std::string, size_t>::iterator it = index_.find(variable);
       if(computeD2_ && it != index_.end())
@@ -196,7 +194,6 @@ class AbstractNumericalDerivative:
     }
 
     double getSecondOrderDerivative(const std::string& variable1, const std::string& variable2) const
-      throw (Exception)
     {
       std::map<std::string, size_t>::iterator it1 = index_.find(variable1);
       std::map<std::string, size_t>::iterator it2 = index_.find(variable2);
@@ -215,40 +212,35 @@ class AbstractNumericalDerivative:
      *
      * @{
      */
-    double f(const ParameterList& parameters) throw (Exception)
+    double f(const ParameterList& parameters)
     {
       setParameters(parameters);
       return getValue();
     }
     void setParameters(const ParameterList& parameters)
-      throw (ParameterNotFoundException, ConstraintException)
     {
       function_->setParameters(parameters);
       updateDerivatives(parameters);
     }
     void setAllParametersValues(const ParameterList& parameters)
-      throw (ParameterNotFoundException, ConstraintException)
     {
       function_->setAllParametersValues(parameters);
       updateDerivatives(parameters);
     }
     
     void setParameterValue(const std::string& name, double value)
-      throw (ParameterNotFoundException, ConstraintException)
     {
       function_->setParameterValue(name, value);
       updateDerivatives(function_->getParameters().subList(name));
     }
     
     void setParametersValues(const ParameterList& parameters)
-      throw (ParameterNotFoundException, ConstraintException)
     {
       function_->setParametersValues(parameters);
       updateDerivatives(parameters);
     }
     
     bool matchParametersValues(const ParameterList& parameters)
-      throw (ConstraintException)
     {
       bool test = function_->matchParametersValues(parameters);
       updateDerivatives(parameters);
diff --git a/src/Bpp/Numeric/Function/AbstractOptimizer.cpp b/src/Bpp/Numeric/Function/AbstractOptimizer.cpp
index 0bfd823..d6869ef 100644
--- a/src/Bpp/Numeric/Function/AbstractOptimizer.cpp
+++ b/src/Bpp/Numeric/Function/AbstractOptimizer.cpp
@@ -150,7 +150,7 @@ AbstractOptimizer& AbstractOptimizer::operator=(const AbstractOptimizer& opt)
 
 /******************************************************************************/
 	
-void AbstractOptimizer::init(const ParameterList& params) throw (Exception)
+void AbstractOptimizer::init(const ParameterList& params)
 {
   if (!function_) throw Exception("AbstractOptimizer::init. Optimizer currently has no function.");
   //We do this in order to keep original constraints:
@@ -185,7 +185,7 @@ void AbstractOptimizer::init(const ParameterList& params) throw (Exception)
 
 /******************************************************************************/
 
-double AbstractOptimizer::step() throw (Exception)
+double AbstractOptimizer::step()
 {
   currentValue_ = doStep();
   printPoint(parameters_, currentValue_);
@@ -205,7 +205,7 @@ double AbstractOptimizer::step() throw (Exception)
 
 /**************************************************************************/
 
-double AbstractOptimizer::optimize() throw (Exception)
+double AbstractOptimizer::optimize()
 {
   if (!isInitialized_)
     throw Exception("AbstractOptimizer::optimize. Optimizer not initialized: call the 'init' method first!");
diff --git a/src/Bpp/Numeric/Function/AbstractOptimizer.h b/src/Bpp/Numeric/Function/AbstractOptimizer.h
index a7564d6..34acfd5 100644
--- a/src/Bpp/Numeric/Function/AbstractOptimizer.h
+++ b/src/Bpp/Numeric/Function/AbstractOptimizer.h
@@ -173,19 +173,19 @@ class AbstractOptimizer:
      *
      * Store all parameters, call the doInit method, print to profiler, initialize timer and notify all listeners.
      */
-    void init(const ParameterList& params) throw (Exception);
+    void init(const ParameterList& params);
     /**
      * @brief Basic implementation.
      *
      * Check if the optimizer is initialized, check if parameters need update because of listeners, call the doStep method, print the current point to the profiler, notify all listeners and return the current value of the function.
      */
-    double step() throw (Exception);
+    double step();
     /**
      * @brief Basic implementation.
      *
      * Call the step method untill tolerance is reached.
      */
-    double optimize() throw (Exception);
+    double optimize();
     bool isInitialized() const { return isInitialized_; }
     const ParameterList& getParameters() const { return parameters_; }
   double getParameterValue(const std::string& name) const { return parameters_.getParameterValue(name); }
@@ -197,7 +197,7 @@ class AbstractOptimizer:
     const Function* getFunction() const { return function_; }
     Function* getFunction() { return function_; }
     bool hasFunction() const { return function_ != 0; }
-    double getFunctionValue() const throw (NullPointerException)
+    double getFunctionValue() const
     {
       if (!function_) throw NullPointerException("AbstractOptimizer::getFunctionValue. No function associated to this optimizer.");
       return currentValue_;
@@ -271,14 +271,14 @@ class AbstractOptimizer:
      *
      * @param params The parameters to use for initialization.
      */
-    virtual void doInit(const ParameterList& params) throw (Exception) = 0;
+    virtual void doInit(const ParameterList& params) = 0;
     
     /**
      * @brief This function is called by the step() method and contains all calculations.
      *
      * @return The value of the function after the optimization step.
      */
-    virtual double doStep() throw (Exception) = 0;
+    virtual double doStep() = 0;
     
     /**
      * @name Inner utilitary functions
diff --git a/src/Bpp/Numeric/Function/BfgsMultiDimensions.cpp b/src/Bpp/Numeric/Function/BfgsMultiDimensions.cpp
index c3035f8..d09f2cf 100644
--- a/src/Bpp/Numeric/Function/BfgsMultiDimensions.cpp
+++ b/src/Bpp/Numeric/Function/BfgsMultiDimensions.cpp
@@ -65,7 +65,7 @@ BfgsMultiDimensions::BfgsMultiDimensions(DerivableFirstOrder* function) :
 
 /******************************************************************************/
 
-void BfgsMultiDimensions::doInit(const ParameterList& params) throw (Exception)
+void BfgsMultiDimensions::doInit(const ParameterList& params)
 {
   size_t nbParams = params.size();
   p_.resize(nbParams);
@@ -123,7 +123,7 @@ void BfgsMultiDimensions::doInit(const ParameterList& params) throw (Exception)
 
 /******************************************************************************/
 
-double BfgsMultiDimensions::doStep() throw (Exception)
+double BfgsMultiDimensions::doStep()
 {
   double f;
   size_t n = getParameters().size();
diff --git a/src/Bpp/Numeric/Function/BfgsMultiDimensions.h b/src/Bpp/Numeric/Function/BfgsMultiDimensions.h
index ab8c7c7..08107a5 100644
--- a/src/Bpp/Numeric/Function/BfgsMultiDimensions.h
+++ b/src/Bpp/Numeric/Function/BfgsMultiDimensions.h
@@ -95,9 +95,9 @@ namespace bpp
     {
       return dynamic_cast<DerivableFirstOrder*>(AbstractOptimizer::getFunction());
     }
-    void doInit(const ParameterList& params) throw (Exception);
+    void doInit(const ParameterList& params);
 
-    double doStep() throw (Exception);
+    double doStep();
     /** @} */
 
     void getGradient(std::vector<double>& gradient) const;
diff --git a/src/Bpp/Numeric/Function/BrentOneDimension.cpp b/src/Bpp/Numeric/Function/BrentOneDimension.cpp
index 1203ce3..0f3223e 100644
--- a/src/Bpp/Numeric/Function/BrentOneDimension.cpp
+++ b/src/Bpp/Numeric/Function/BrentOneDimension.cpp
@@ -82,7 +82,7 @@ double BrentOneDimension::ZEPS  = 1.0e-10;
   
 /******************************************************************************/
   
-void BrentOneDimension::doInit(const ParameterList& params) throw (Exception)
+void BrentOneDimension::doInit(const ParameterList& params)
 {
   if (params.size() != 1)
     throw Exception("BrentOneDimension::init(). This optimizer only deals with one parameter.");
@@ -135,7 +135,7 @@ void BrentOneDimension::setInitialInterval(double inf, double sup)
 
 /******************************************************************************/
 
-double BrentOneDimension::doStep() throw (Exception)
+double BrentOneDimension::doStep()
 {
   xm   = 0.5 * (a + b);
   tol2 = 2.0 * (tol1 = getStopCondition()->getTolerance() * NumTools::abs(x) + ZEPS);
@@ -202,7 +202,7 @@ double BrentOneDimension::doStep() throw (Exception)
 
 /******************************************************************************/
   
-double BrentOneDimension::optimize() throw (Exception)
+double BrentOneDimension::optimize()
 {
   if (!isInitialIntervalSet_)
     throw Exception("BrentOneDimension::optimize. Initial interval not set: call the 'setInitialInterval' method first!");
diff --git a/src/Bpp/Numeric/Function/BrentOneDimension.h b/src/Bpp/Numeric/Function/BrentOneDimension.h
index 21250e6..ed55156 100644
--- a/src/Bpp/Numeric/Function/BrentOneDimension.h
+++ b/src/Bpp/Numeric/Function/BrentOneDimension.h
@@ -109,12 +109,12 @@ class BrentOneDimension:
 		 * <li>Function evaluation count reseting.</li>
      * </ul>
 		 */
-    double optimize() throw (Exception); //redefinition
+    double optimize(); //redefinition
 		/** @} */
 		
-    void doInit(const ParameterList& params) throw (Exception);
+    void doInit(const ParameterList& params);
 		
-    double doStep() throw (Exception);
+    double doStep();
 	
 	public:
 
diff --git a/src/Bpp/Numeric/Function/ConjugateGradientMultiDimensions.cpp b/src/Bpp/Numeric/Function/ConjugateGradientMultiDimensions.cpp
index bdfb3aa..ca31f6f 100644
--- a/src/Bpp/Numeric/Function/ConjugateGradientMultiDimensions.cpp
+++ b/src/Bpp/Numeric/Function/ConjugateGradientMultiDimensions.cpp
@@ -56,7 +56,7 @@ ConjugateGradientMultiDimensions::ConjugateGradientMultiDimensions(DerivableFirs
 
 /******************************************************************************/
 
-void ConjugateGradientMultiDimensions::doInit(const ParameterList & params) throw (Exception)
+void ConjugateGradientMultiDimensions::doInit(const ParameterList & params)
 {
   size_t nbParams = params.size();
   g_.resize(nbParams);
@@ -74,7 +74,7 @@ void ConjugateGradientMultiDimensions::doInit(const ParameterList & params) thro
 
 /******************************************************************************/
 
-double ConjugateGradientMultiDimensions::doStep() throw (Exception)
+double ConjugateGradientMultiDimensions::doStep()
 {
   double gg, gam, f, dgg;
   size_t n = getParameters().size();
diff --git a/src/Bpp/Numeric/Function/ConjugateGradientMultiDimensions.h b/src/Bpp/Numeric/Function/ConjugateGradientMultiDimensions.h
index 3c1925d..18c7066 100644
--- a/src/Bpp/Numeric/Function/ConjugateGradientMultiDimensions.h
+++ b/src/Bpp/Numeric/Function/ConjugateGradientMultiDimensions.h
@@ -89,9 +89,9 @@ namespace bpp
     {
       return dynamic_cast<DerivableFirstOrder*>(AbstractOptimizer::getFunction());
     }
-    void doInit(const ParameterList& params) throw (Exception);
+    void doInit(const ParameterList& params);
 
-    double doStep() throw (Exception);
+    double doStep();
     /** @} */
 
     void getGradient(std::vector<double>& gradient) const;
diff --git a/src/Bpp/Numeric/Function/DirectionFunction.cpp b/src/Bpp/Numeric/Function/DirectionFunction.cpp
index 65828df..80e4122 100644
--- a/src/Bpp/Numeric/Function/DirectionFunction.cpp
+++ b/src/Bpp/Numeric/Function/DirectionFunction.cpp
@@ -46,7 +46,6 @@ using namespace std;
 /******************************************************************************/
 
 void DirectionFunction::setParameters(const ParameterList & params)
-  throw (ParameterNotFoundException, ConstraintException)
 {
   params_ = params;
   double x = params_[0].getValue();
@@ -60,14 +59,14 @@ void DirectionFunction::setParameters(const ParameterList & params)
 
 /******************************************************************************/
 
-double DirectionFunction::getValue() const throw (Exception)
+double DirectionFunction::getValue() const
 {
   return function_->getValue();
 }
 
 /******************************************************************************/
 
-const ParameterList & DirectionFunction::getParameters() const throw (Exception)
+const ParameterList & DirectionFunction::getParameters() const
 {
   return params_;
 }
diff --git a/src/Bpp/Numeric/Function/DirectionFunction.h b/src/Bpp/Numeric/Function/DirectionFunction.h
index 0363f60..11e6876 100644
--- a/src/Bpp/Numeric/Function/DirectionFunction.h
+++ b/src/Bpp/Numeric/Function/DirectionFunction.h
@@ -89,10 +89,9 @@ class DirectionFunction:
     DirectionFunction* clone() const { return new DirectionFunction(*this); }
 
   public: // Function interface implementation:
-    void setParameters(const ParameterList& parameters)
-      throw (ParameterNotFoundException, ConstraintException);
-    double getValue() const throw (Exception);
-    const ParameterList & getParameters() const throw (Exception);
+    void setParameters(const ParameterList& parameters);
+    double getValue() const;
+    const ParameterList & getParameters() const;
 
   public: // Specific methods:
     void init(const ParameterList & p, const std::vector<double> & xi);
diff --git a/src/Bpp/Numeric/Function/DownhillSimplexMethod.cpp b/src/Bpp/Numeric/Function/DownhillSimplexMethod.cpp
index b6df0d9..fcfc4cc 100644
--- a/src/Bpp/Numeric/Function/DownhillSimplexMethod.cpp
+++ b/src/Bpp/Numeric/Function/DownhillSimplexMethod.cpp
@@ -66,7 +66,7 @@ DownhillSimplexMethod::DownhillSimplexMethod(Function* function):
 
 /******************************************************************************/
 
-void DownhillSimplexMethod::doInit(const ParameterList& params) throw (Exception)
+void DownhillSimplexMethod::doInit(const ParameterList& params)
 {
 	size_t nDim = getParameters().size();
 	nbEval_ = 0;
@@ -100,7 +100,7 @@ void DownhillSimplexMethod::doInit(const ParameterList& params) throw (Exception
 	
 /******************************************************************************/
 
-double DownhillSimplexMethod::doStep() throw (Exception)
+double DownhillSimplexMethod::doStep()
 {
 	// The number of dimensions of the parameter space:
 	size_t nDim = simplex_.getDimension();
@@ -175,7 +175,7 @@ double DownhillSimplexMethod::doStep() throw (Exception)
 
 /******************************************************************************/
 
-double DownhillSimplexMethod::optimize() throw (Exception)
+double DownhillSimplexMethod::optimize()
 {
   AbstractOptimizer::optimize();
 
diff --git a/src/Bpp/Numeric/Function/DownhillSimplexMethod.h b/src/Bpp/Numeric/Function/DownhillSimplexMethod.h
index efb5f3f..5fc3194 100644
--- a/src/Bpp/Numeric/Function/DownhillSimplexMethod.h
+++ b/src/Bpp/Numeric/Function/DownhillSimplexMethod.h
@@ -128,12 +128,12 @@ class DownhillSimplexMethod:
      * @brief Multidimensional minimization of the function function_ by the
      * downhill simplex method of Nelder and Mead.
      */
-    double optimize() throw (Exception);
+    double optimize();
     /** @} */
 
-    void doInit(const ParameterList& params) throw (Exception);
+    void doInit(const ParameterList& params);
     
-    double doStep() throw (Exception);
+    double doStep();
   
   protected:
     
diff --git a/src/Bpp/Numeric/Function/FivePointsNumericalDerivative.cpp b/src/Bpp/Numeric/Function/FivePointsNumericalDerivative.cpp
index ab6c02f..22d6ac4 100644
--- a/src/Bpp/Numeric/Function/FivePointsNumericalDerivative.cpp
+++ b/src/Bpp/Numeric/Function/FivePointsNumericalDerivative.cpp
@@ -42,7 +42,6 @@ using namespace bpp;
 using namespace std;
 
 void FivePointsNumericalDerivative::updateDerivatives(const ParameterList parameters)
-throw (ParameterNotFoundException, ConstraintException)
 {
   if (computeD1_ && variables_.size() > 0)
   {
diff --git a/src/Bpp/Numeric/Function/FivePointsNumericalDerivative.h b/src/Bpp/Numeric/Function/FivePointsNumericalDerivative.h
index 30c8388..d68c7bd 100644
--- a/src/Bpp/Numeric/Function/FivePointsNumericalDerivative.h
+++ b/src/Bpp/Numeric/Function/FivePointsNumericalDerivative.h
@@ -115,20 +115,18 @@ public:
   FivePointsNumericalDerivative* clone() const { return new FivePointsNumericalDerivative(*this); }
 
 public:
-  double getValue() const throw (Exception)
+  double getValue() const
   {
     return f3_;
   }
 
   double getSecondOrderDerivative(const std::string& variable1, const std::string& variable2) const
-  throw (Exception)
   {
     throw Exception("Unimplemented cross derivative.");
   }
 
 protected:
-  void updateDerivatives(const ParameterList parameters)
-  throw (ParameterNotFoundException, ConstraintException);
+  void updateDerivatives(const ParameterList parameters);
 };
 } // end of namespace bpp.
 
diff --git a/src/Bpp/Numeric/Function/FunctionTools.cpp b/src/Bpp/Numeric/Function/FunctionTools.cpp
index fa16e5d..536a65a 100644
--- a/src/Bpp/Numeric/Function/FunctionTools.cpp
+++ b/src/Bpp/Numeric/Function/FunctionTools.cpp
@@ -46,7 +46,7 @@ using namespace bpp;
 #include <algorithm>
 using namespace std;
 
-void ParameterGrid::addDimension(const std::string& name, const Vdouble& values) throw (Exception)
+void ParameterGrid::addDimension(const std::string& name, const Vdouble& values)
 {
   if (find(names_.begin(), names_.end(), name) != names_.end()) throw Exception("ParameterGrid::addDimension(). A dimension with name '" + name + "' already exists in the grid.");
   if (values.size() == 0) throw Exception("ParameterGrid::addDimension(). Empty vector given! The dimension should at least contain one point.");
@@ -54,7 +54,7 @@ void ParameterGrid::addDimension(const std::string& name, const Vdouble& values)
   grid_.push_back(values);
 }
  
-const Vdouble& ParameterGrid::getPointsForDimension(const std::string& name) const throw (Exception)
+const Vdouble& ParameterGrid::getPointsForDimension(const std::string& name) const
 {
   for(unsigned int i = 0; i < names_.size(); i++)
     if (names_[i] == name)
@@ -62,7 +62,7 @@ const Vdouble& ParameterGrid::getPointsForDimension(const std::string& name) con
   throw Exception("ParameterGrid::getPointsForDimension(). No dimension with name '" + name + "' was found in the grid.");
 }
 
-const Vdouble& ParameterGrid::getPointsForDimension(unsigned int i) const throw (IndexOutOfBoundsException)
+const Vdouble& ParameterGrid::getPointsForDimension(unsigned int i) const
 {
   if (i >= names_.size()) throw IndexOutOfBoundsException("ParameterGrid::getPointsForDimension().", i, 0, names_.size() - 1);
   return grid_[i];
@@ -79,7 +79,7 @@ size_t ParameterGrid::getTotalNumberOfPoints() const
 
 VVdouble* FunctionTools::computeGrid(
     Function& function,
-    const ParameterGrid& grid) throw (Exception)
+    const ParameterGrid& grid)
 {
   //Init stuff...
   size_t n = grid.getNumberOfDimensions();
diff --git a/src/Bpp/Numeric/Function/FunctionTools.h b/src/Bpp/Numeric/Function/FunctionTools.h
index d406120..b4c92db 100644
--- a/src/Bpp/Numeric/Function/FunctionTools.h
+++ b/src/Bpp/Numeric/Function/FunctionTools.h
@@ -69,11 +69,11 @@ class ParameterGrid
      * @param values The values the parameter will take.
      * @throw Exception in case the dimension is note valid (duplicated parameter name for instance).
      */
-    void addDimension(const std::string& name, const Vdouble& values) throw (Exception);
+    void addDimension(const std::string& name, const Vdouble& values);
 
     const std::vector<std::string>& getDimensionNames() const { return names_; }
     
-    const std::string& getDimensionName(unsigned int i) const throw (IndexOutOfBoundsException)
+    const std::string& getDimensionName(unsigned int i) const
     {
       if (i >= names_.size()) throw IndexOutOfBoundsException("ParameterGrid::getDimensionName().", i, 0, names_.size()-1);
       return names_[i];
@@ -87,8 +87,8 @@ class ParameterGrid
     size_t getTotalNumberOfPoints() const;
 
     const VVdouble& getPoints() const { return grid_; }
-    const Vdouble& getPointsForDimension(unsigned int i) const throw (IndexOutOfBoundsException);
-    const Vdouble& getPointsForDimension(const std::string& name) const throw (Exception);
+    const Vdouble& getPointsForDimension(unsigned int i) const;
+    const Vdouble& getPointsForDimension(const std::string& name) const;
 };
 
 /**
@@ -113,7 +113,7 @@ class FunctionTools
      */
     static VVdouble* computeGrid(
         Function& function,
-        const ParameterGrid& grid) throw (Exception);
+        const ParameterGrid& grid);
 };
 
 } //end of namespace bpp
diff --git a/src/Bpp/Numeric/Function/Functions.h b/src/Bpp/Numeric/Function/Functions.h
index ed782c7..ad9bba2 100644
--- a/src/Bpp/Numeric/Function/Functions.h
+++ b/src/Bpp/Numeric/Function/Functions.h
@@ -97,7 +97,7 @@ class Function:
      *
      * @param parameters The parameter set to pass to the function.
      */
-    virtual void setParameters(const ParameterList& parameters) throw (ParameterNotFoundException, ConstraintException, Exception) = 0;
+    virtual void setParameters(const ParameterList& parameters) = 0;
 
     /**
      * @brief Get the value of the function at the current point.
@@ -105,7 +105,7 @@ class Function:
      * @return The value of the function.
      * @throw Exception If no point is specified or if an error occured.
      */
-    virtual double getValue() const throw (Exception) = 0;
+    virtual double getValue() const = 0;
     
     /**
      * @brief Get the value of the function according to a given set of parameters.
@@ -114,7 +114,7 @@ class Function:
      * @return The value of the function with the given parameter set.
      * @throw Exception If an error occured.
      */
-    virtual double f(const ParameterList& parameters) throw (Exception)
+    virtual double f(const ParameterList& parameters)
     {
       setParameters(parameters);
       return getValue();
@@ -158,7 +158,7 @@ class DerivableFirstOrder:
      * @return The value of the function.
      * @throw Exception If no point is specified or if an error occured.
      */
-    virtual double getFirstOrderDerivative(const std::string& variable) const throw (Exception) = 0;
+    virtual double getFirstOrderDerivative(const std::string& variable) const = 0;
     
     /**
      * @brief Get the value of the first derivative of the function
@@ -169,7 +169,7 @@ class DerivableFirstOrder:
      * @return The value of the function with the given parameter set.
      * @throw Exception If an error occured.
      */
-    virtual double df(const std::string& variable, const ParameterList& parameters) throw (Exception)
+    virtual double df(const std::string& variable, const ParameterList& parameters)
     {
       setParameters(parameters);
       return getFirstOrderDerivative(variable);
@@ -214,7 +214,7 @@ class DerivableSecondOrder:
      * @return The value of the function.
      * @throw Exception If no point is specified or if an error occured.
      */
-    virtual double getSecondOrderDerivative(const std::string& variable) const throw (Exception) = 0;
+    virtual double getSecondOrderDerivative(const std::string& variable) const = 0;
   
     /**
      * @brief Get the value of the second order derivative of the function
@@ -225,7 +225,7 @@ class DerivableSecondOrder:
      * @return The value of the function with the given parameter set.
      * @throw Exception If an error occured.
      */
-    virtual double d2f(const std::string& variable, const ParameterList& parameters) throw (Exception)
+    virtual double d2f(const std::string& variable, const ParameterList& parameters)
     {
       setParameters(parameters);
       return getSecondOrderDerivative(variable);
@@ -240,7 +240,7 @@ class DerivableSecondOrder:
      * @return The value of the function with the given parameter set.
      * @throw Exception If an error occured.
      */
-    virtual double getSecondOrderDerivative(const std::string& variable1, const std::string& variable2) const throw (Exception) = 0;  
+    virtual double getSecondOrderDerivative(const std::string& variable1, const std::string& variable2) const = 0;  
     
     /**
      * @brief Get the value of the cross derivative of the function
@@ -252,7 +252,7 @@ class DerivableSecondOrder:
      * @return The value of the function with the given parameter set.
      * @throw Exception If an error occured.
      */
-    virtual double d2f(const std::string& variable1, const std::string& variable2, const ParameterList& parameters) throw (Exception)
+    virtual double d2f(const std::string& variable1, const std::string& variable2, const ParameterList& parameters)
     {
       setParameters(parameters);
       return getSecondOrderDerivative(variable1, variable2);
@@ -285,56 +285,51 @@ class FunctionWrapper:
     }
 
     void setParameters(const ParameterList & parameters)
-      throw (ParameterNotFoundException, ConstraintException)
     {
       function_->setParameters(parameters);
     }
 
-    const ParameterList& getParameters() const throw (Exception)
+    const ParameterList& getParameters() const
     {
       return function_->getParameters();  
     }
 
-    const Parameter& getParameter(const std::string & name) const throw (ParameterNotFoundException)
+    const Parameter& getParameter(const std::string & name) const
     {
       return function_->getParameter(name);
     }
 
-    double getValue() const throw (Exception)
+    double getValue() const
     {
       return function_->getValue();
     }
     
-    double f(const ParameterList& parameters) throw (Exception)
+    double f(const ParameterList& parameters)
     {
       return function_->f(parameters);
     }
     
-    double getParameterValue(const std::string& name) const throw (ParameterNotFoundException)
+    double getParameterValue(const std::string& name) const
     {
       return function_->getParameterValue(name);
     }
       
     void setAllParametersValues(const ParameterList & parameters)
-      throw (ParameterNotFoundException, ConstraintException)
     {
       function_->setAllParametersValues(parameters);
     }
     
     void setParameterValue(const std::string& name, double value)
-      throw (ParameterNotFoundException, ConstraintException)
     {
       function_->setParameterValue(name, value);
     }
     
     void setParametersValues(const ParameterList& parameters)
-      throw (ParameterNotFoundException, ConstraintException)
     {
       function_->setParametersValues(parameters);
     }
     
     bool matchParametersValues(const ParameterList& parameters)
-      throw (ConstraintException)
     {
       return function_->matchParametersValues(parameters);
     }
@@ -383,7 +378,7 @@ class DerivableFirstOrderWrapper:
       return dynamic_cast<DerivableFirstOrder*>(function_)->enableFirstOrderDerivatives();
     }
 
-    double getFirstOrderDerivative(const std::string& variable) const throw (Exception) {
+    double getFirstOrderDerivative(const std::string& variable) const {
       return dynamic_cast<DerivableFirstOrder*>(function_)->getFirstOrderDerivative(variable);
     }
 
@@ -411,11 +406,11 @@ class DerivableSecondOrderWrapper:
       return dynamic_cast<DerivableSecondOrder*>(function_)->enableSecondOrderDerivatives();
     }
 
-    double getSecondOrderDerivative(const std::string& variable) const throw (Exception) {
+    double getSecondOrderDerivative(const std::string& variable) const {
       return dynamic_cast<DerivableSecondOrder*>(function_)->getSecondOrderDerivative(variable);
     }
 
-    double getSecondOrderDerivative(const std::string& variable1, const std::string& variable2) const throw (Exception) {
+    double getSecondOrderDerivative(const std::string& variable1, const std::string& variable2) const {
       return dynamic_cast<DerivableSecondOrder*>(function_)->getSecondOrderDerivative(variable1, variable2);
     }
 
@@ -445,7 +440,6 @@ class InfinityFunctionWrapper:
   public:
 
     void setParameters(const ParameterList& parameters)
-      throw (ParameterNotFoundException, ConstraintException)
     {
       try
       {
@@ -458,19 +452,18 @@ class InfinityFunctionWrapper:
       }
     }
 
-    double getValue() const throw (Exception)
+    double getValue() const
     {
       return constraintMatch_ ? -log(0.) :  function_->getValue();
     }
     
-    double f(const ParameterList& parameters) throw (Exception)
+    double f(const ParameterList& parameters)
     {
       setParameters(parameters);
       return getValue();
     }
           
     void setAllParametersValues(const ParameterList & parameters)
-      throw (ParameterNotFoundException, ConstraintException)
     {
       try
       {
@@ -484,7 +477,6 @@ class InfinityFunctionWrapper:
     }
     
     void setParameterValue(const std::string& name, double value)
-      throw (ParameterNotFoundException, ConstraintException)
     {
       try
       {
@@ -498,7 +490,6 @@ class InfinityFunctionWrapper:
     }
     
     void setParametersValues(const ParameterList& parameters)
-      throw (ParameterNotFoundException, ConstraintException)
     {
       try
       {
@@ -512,7 +503,6 @@ class InfinityFunctionWrapper:
     }
     
     bool matchParametersValues(const ParameterList& parameters)
-      throw (ConstraintException)
     {
       try
       {
@@ -545,12 +535,12 @@ class InfinityDerivableFirstOrderWrapper :
 
   public:
     
-    double getFirstOrderDerivative(const std::string& variable) const throw (Exception)
+    double getFirstOrderDerivative(const std::string& variable) const
     {
       return constraintMatch_ ? -log(0.) :  (dynamic_cast<DerivableFirstOrder *>(function_)->getFirstOrderDerivative(variable));    
     }
     
-    double df(const std::string& variable, const ParameterList& parameters) throw (Exception)
+    double df(const std::string& variable, const ParameterList& parameters)
     {
       setParameters(parameters);
       return getFirstOrderDerivative(variable);
@@ -575,23 +565,23 @@ class InfinityDerivableSecondOrderWrapper :
 
   public:
 
-    double getSecondOrderDerivative(const std::string& variable) const throw (Exception)
+    double getSecondOrderDerivative(const std::string& variable) const
     {
       return constraintMatch_ ? -log(0.) :  (dynamic_cast<DerivableSecondOrder *>(function_)->getSecondOrderDerivative(variable));          
     }
   
-    double d2f(const std::string & variable, const ParameterList& parameters) throw (Exception)
+    double d2f(const std::string & variable, const ParameterList& parameters)
     {
       setParameters(parameters);
       return getSecondOrderDerivative(variable);
     }    
 
-    double getSecondOrderDerivative(const std::string& variable1, const std::string& variable2) const throw (Exception)
+    double getSecondOrderDerivative(const std::string& variable1, const std::string& variable2) const
     {
       return constraintMatch_ ? -log(0.) :  (dynamic_cast<DerivableSecondOrder *>(function_)->getSecondOrderDerivative(variable1, variable2));      
     }
     
-    double d2f(const std::string & variable1, const std::string& variable2, const ParameterList& parameters) throw (Exception)
+    double d2f(const std::string & variable1, const std::string& variable2, const ParameterList& parameters)
     {
       setParameters(parameters);
       return getSecondOrderDerivative(variable1, variable2);
@@ -618,12 +608,12 @@ class TestFunction :
 
     Clonable* clone() const { return new TestFunction(*this); }
 
-    void setParameters(const ParameterList& parameters) throw (Exception) 
+    void setParameters(const ParameterList& parameters) 
     {
       matchParametersValues(parameters);
     }
 
-    double getValue() const throw (Exception)
+    double getValue() const
     {
       double x = getParameter("x").getValue();
       double y = getParameter("y").getValue();
diff --git a/src/Bpp/Numeric/Function/GoldenSectionSearch.cpp b/src/Bpp/Numeric/Function/GoldenSectionSearch.cpp
index 5ef7070..b5ab778 100644
--- a/src/Bpp/Numeric/Function/GoldenSectionSearch.cpp
+++ b/src/Bpp/Numeric/Function/GoldenSectionSearch.cpp
@@ -76,7 +76,7 @@ GoldenSectionSearch::GoldenSectionSearch(Function* function) :
 
 /******************************************************************************/
 
-void GoldenSectionSearch::doInit(const ParameterList& params) throw (Exception)
+void GoldenSectionSearch::doInit(const ParameterList& params)
 {
   // Set the initial value (no use here! Use setInitialValues() instead).
   if(params.size() != 1) throw Exception("GoldenSectionSearch::init(). This optimizer only deals with one parameter.");
@@ -130,7 +130,7 @@ void GoldenSectionSearch::setInitialInterval(double inf, double sup)
 
 /******************************************************************************/
 
-double GoldenSectionSearch::doStep() throw (Exception)
+double GoldenSectionSearch::doStep()
 {
   if (!isInitialIntervalSet_) throw Exception("GoldenSectionSearch::step. Initial interval not set: call the 'setInitialInterval' method first!");
   
@@ -162,7 +162,7 @@ double GoldenSectionSearch::doStep() throw (Exception)
 
 /******************************************************************************/
 
-double GoldenSectionSearch::getFunctionValue() const throw (NullPointerException)
+double GoldenSectionSearch::getFunctionValue() const
 {
   if (!hasFunction())
     throw NullPointerException("GoldenSectionSearch::getFunctionValue. No function associated to this optimizer.");
diff --git a/src/Bpp/Numeric/Function/GoldenSectionSearch.h b/src/Bpp/Numeric/Function/GoldenSectionSearch.h
index be3ae33..7a43e9a 100644
--- a/src/Bpp/Numeric/Function/GoldenSectionSearch.h
+++ b/src/Bpp/Numeric/Function/GoldenSectionSearch.h
@@ -108,12 +108,12 @@ class GoldenSectionSearch:
 		 * <li>Function evaluation count reseting.</li>
 		 * </ul>
 		 */
-		double getFunctionValue() const throw (NullPointerException);
+		double getFunctionValue() const;
 		/** @} */
 		
-    void doInit(const ParameterList & params) throw (Exception);
+    void doInit(const ParameterList & params);
 
-		double doStep() throw (Exception);
+		double doStep();
 	
 		/**
 		 * @name Specific method
diff --git a/src/Bpp/Numeric/Function/MetaOptimizer.cpp b/src/Bpp/Numeric/Function/MetaOptimizer.cpp
index 6dad184..413d8d4 100644
--- a/src/Bpp/Numeric/Function/MetaOptimizer.cpp
+++ b/src/Bpp/Numeric/Function/MetaOptimizer.cpp
@@ -111,7 +111,6 @@ MetaOptimizer::~MetaOptimizer()
 /**************************************************************************/
 
 void MetaOptimizer::doInit(const ParameterList& parameters)
-  throw (Exception)
 {
   optParameters_.resize(optDesc_->getNumberOfOptimizers());
   for (unsigned int i = 0; i < optDesc_->getNumberOfOptimizers(); i++)
@@ -155,7 +154,7 @@ void MetaOptimizer::doInit(const ParameterList& parameters)
 
 /**************************************************************************/
 
-double MetaOptimizer::doStep() throw (Exception)
+double MetaOptimizer::doStep()
 {
   stepCount_++;
   
diff --git a/src/Bpp/Numeric/Function/MetaOptimizer.h b/src/Bpp/Numeric/Function/MetaOptimizer.h
index 6c50d70..2039832 100644
--- a/src/Bpp/Numeric/Function/MetaOptimizer.h
+++ b/src/Bpp/Numeric/Function/MetaOptimizer.h
@@ -224,9 +224,9 @@ namespace bpp
         optDesc_->getOptimizer(i)->setFunction(function);
     }
 
-    void doInit(const ParameterList& parameters) throw (Exception);
+    void doInit(const ParameterList& parameters);
     
-    double doStep() throw (Exception);
+    double doStep();
 
     /**
      * @return The MetaOptimizerInfos object associated to this optimizer.
diff --git a/src/Bpp/Numeric/Function/NewtonBacktrackOneDimension.cpp b/src/Bpp/Numeric/Function/NewtonBacktrackOneDimension.cpp
index 888d56f..6484cf8 100644
--- a/src/Bpp/Numeric/Function/NewtonBacktrackOneDimension.cpp
+++ b/src/Bpp/Numeric/Function/NewtonBacktrackOneDimension.cpp
@@ -57,7 +57,7 @@ NewtonBacktrackOneDimension::NewtonBacktrackOneDimension(Function* function, dou
 
 /******************************************************************************/
   
-void NewtonBacktrackOneDimension::doInit(const ParameterList& params) throw (Exception)
+void NewtonBacktrackOneDimension::doInit(const ParameterList& params)
 {
   // Set the initial value (no use here! Use setInitialValues() instead).
   if(params.size() != 1) throw Exception("NewtonBacktrackOneDimension::init(). This optimizer only deals with one parameter.");
@@ -69,7 +69,7 @@ void NewtonBacktrackOneDimension::doInit(const ParameterList& params) throw (Exc
 
 /******************************************************************************/
 
-double NewtonBacktrackOneDimension::doStep() throw (Exception)
+double NewtonBacktrackOneDimension::doStep()
 {
   if (alam_<alamin_){
     getParameter_(0).setValue(0);
diff --git a/src/Bpp/Numeric/Function/NewtonBacktrackOneDimension.h b/src/Bpp/Numeric/Function/NewtonBacktrackOneDimension.h
index bfe2368..332c244 100644
--- a/src/Bpp/Numeric/Function/NewtonBacktrackOneDimension.h
+++ b/src/Bpp/Numeric/Function/NewtonBacktrackOneDimension.h
@@ -106,9 +106,9 @@ namespace bpp
     
   public:
 		
-    void doInit(const ParameterList& params) throw (Exception);
+    void doInit(const ParameterList& params);
 		
-    double doStep() throw (Exception);
+    double doStep();
 
   protected:
     DerivableFirstOrder* getFunction_()
diff --git a/src/Bpp/Numeric/Function/NewtonOneDimension.cpp b/src/Bpp/Numeric/Function/NewtonOneDimension.cpp
index 2887243..48eaa4c 100644
--- a/src/Bpp/Numeric/Function/NewtonOneDimension.cpp
+++ b/src/Bpp/Numeric/Function/NewtonOneDimension.cpp
@@ -57,7 +57,7 @@ NewtonOneDimension::NewtonOneDimension(DerivableSecondOrder* function) :
 
 /******************************************************************************/
   
-void NewtonOneDimension::doInit(const ParameterList& params) throw (Exception)
+void NewtonOneDimension::doInit(const ParameterList& params)
 {
   // Set the initial value (no use here! Use setInitialValues() instead).
   if (params.size() != 1)
@@ -69,7 +69,7 @@ void NewtonOneDimension::doInit(const ParameterList& params) throw (Exception)
 
 /******************************************************************************/
 
-double NewtonOneDimension::doStep() throw (Exception)
+double NewtonOneDimension::doStep()
 {
   double movement;  
   ParameterList newPoint = getParameters();
diff --git a/src/Bpp/Numeric/Function/NewtonOneDimension.h b/src/Bpp/Numeric/Function/NewtonOneDimension.h
index 18f27d4..1df704b 100644
--- a/src/Bpp/Numeric/Function/NewtonOneDimension.h
+++ b/src/Bpp/Numeric/Function/NewtonOneDimension.h
@@ -72,9 +72,9 @@ class NewtonOneDimension:
       return dynamic_cast<DerivableSecondOrder*>(AbstractOptimizer::getFunction());
     }
 
-    void doInit(const ParameterList& params) throw (Exception);
+    void doInit(const ParameterList& params);
 		
-    double doStep() throw (Exception);
+    double doStep();
 
     void setMaximumNumberOfCorrections(unsigned int mx) { _maxCorrection = mx; }
 	
diff --git a/src/Bpp/Numeric/Function/Optimizer.h b/src/Bpp/Numeric/Function/Optimizer.h
index 61278a1..bdd12bc 100644
--- a/src/Bpp/Numeric/Function/Optimizer.h
+++ b/src/Bpp/Numeric/Function/Optimizer.h
@@ -139,7 +139,7 @@ namespace bpp
      * @param params The initial values of parameters.
      * @throw Exception If a problem occured during initialization.
      */
-    virtual void init(const ParameterList& params) throw (Exception) = 0;
+    virtual void init(const ParameterList& params) = 0;
 
     /**
      * @return 'true' if this optimizer has been initialized.
@@ -152,7 +152,7 @@ namespace bpp
      * @return the value of the function after this step.
      * @throw Exception If a problem occured during optimization or if the optimizer has not been initialized.
      */
-    virtual double step() throw (Exception) = 0;
+    virtual double step() = 0;
 
     /**
      * @return The parameters with their current values.
@@ -170,7 +170,7 @@ namespace bpp
      * @return The value of the function at the point specified by _parameters.
      * @throw NullPointerException If no function is associated with this optimizer.
      */
-      virtual double getFunctionValue() const throw (NullPointerException) = 0;
+      virtual double getFunctionValue() const = 0;
 		
     /**
      * @brief Perform as many optimization steps untill the stop condition is met.
@@ -178,7 +178,7 @@ namespace bpp
      * @return The value of the function after optimization is completed.
      * @throw Exception If a problem occured during optimization or if the optimizer has not been initialized.
      */
-    virtual double optimize() throw (Exception) = 0;
+    virtual double optimize() = 0;
 	
     /**
      * @brief Set the function to optimize.
diff --git a/src/Bpp/Numeric/Function/PowellMultiDimensions.cpp b/src/Bpp/Numeric/Function/PowellMultiDimensions.cpp
index 6f164f3..42705eb 100644
--- a/src/Bpp/Numeric/Function/PowellMultiDimensions.cpp
+++ b/src/Bpp/Numeric/Function/PowellMultiDimensions.cpp
@@ -72,7 +72,7 @@ AbstractOptimizer(function), fp_(0), fret_(0), pt_(), xi_(), ncom_(0), pcom_(),
 
 /******************************************************************************/
 
-void PowellMultiDimensions::doInit(const ParameterList& params) throw (Exception)
+void PowellMultiDimensions::doInit(const ParameterList& params)
 {
   // Build the initial matrix:
   size_t n = params.size();
@@ -95,7 +95,7 @@ void PowellMultiDimensions::doInit(const ParameterList& params) throw (Exception
   
 /******************************************************************************/
   
-double PowellMultiDimensions::doStep() throw (Exception)
+double PowellMultiDimensions::doStep()
 {
   size_t n = getParameters().size();
   fp_ = fret_;
@@ -159,7 +159,7 @@ double PowellMultiDimensions::doStep() throw (Exception)
 
 /******************************************************************************/
 
-double PowellMultiDimensions::optimize() throw (Exception)
+double PowellMultiDimensions::optimize()
 {
   AbstractOptimizer::optimize();
   // Apply best parameter:
diff --git a/src/Bpp/Numeric/Function/PowellMultiDimensions.h b/src/Bpp/Numeric/Function/PowellMultiDimensions.h
index f65897a..1b3357b 100644
--- a/src/Bpp/Numeric/Function/PowellMultiDimensions.h
+++ b/src/Bpp/Numeric/Function/PowellMultiDimensions.h
@@ -100,12 +100,12 @@ class PowellMultiDimensions:
 		 *
 		 * @{
 		 */		
-		double optimize() throw (Exception);
+		double optimize();
 		/** @} */
 
-		void doInit(const ParameterList & params) throw (Exception);
+		void doInit(const ParameterList & params);
 		
-    double doStep() throw (Exception);	
+    double doStep();	
 	
 };
 
diff --git a/src/Bpp/Numeric/Function/ReparametrizationFunctionWrapper.h b/src/Bpp/Numeric/Function/ReparametrizationFunctionWrapper.h
index 05d9f96..2aa8bf8 100644
--- a/src/Bpp/Numeric/Function/ReparametrizationFunctionWrapper.h
+++ b/src/Bpp/Numeric/Function/ReparametrizationFunctionWrapper.h
@@ -118,7 +118,6 @@ class ReparametrizationFunctionWrapper:
     virtual Function& getFunction() { return *function_; } 
 
     void setParameters(const ParameterList& parameters)
-      throw (ParameterNotFoundException, ConstraintException)
     {
 //      parameters.printParameters(std::cout);
       matchParametersValues(parameters);
@@ -127,7 +126,7 @@ class ReparametrizationFunctionWrapper:
       function_->setParameters(functionParameters_.subList(parameters.getParameterNames()));
     }
 
-    double getValue() const throw (Exception)
+    double getValue() const
     {
       return function_->getValue();
     }
@@ -183,7 +182,7 @@ class ReparametrizationDerivableFirstOrderWrapper:
     
     bool enableFirstOrderDerivatives() const { return dynamic_cast<const DerivableFirstOrder&>(getFunction()).enableFirstOrderDerivatives(); }
 
-    double getFirstOrderDerivative(const std::string& variable) const throw (Exception)
+    double getFirstOrderDerivative(const std::string& variable) const
     {
       return dynamic_cast<const DerivableFirstOrder&>(getFunction()).getFirstOrderDerivative(variable)
            * dynamic_cast<const TransformedParameter&>(getParameter(variable)).getFirstOrderDerivative();
@@ -239,7 +238,7 @@ class ReparametrizationDerivableSecondOrderWrapper:
     
     bool enableSecondOrderDerivatives() const { return dynamic_cast<const DerivableSecondOrder&>(getFunction()).enableSecondOrderDerivatives(); }
 
-    double getSecondOrderDerivative(const std::string& variable) const throw (Exception)
+    double getSecondOrderDerivative(const std::string& variable) const
     {
       return dynamic_cast<const DerivableSecondOrder&>(getFunction()).getSecondOrderDerivative(variable)
            * pow(dynamic_cast<const TransformedParameter&>(getParameter(variable)).getFirstOrderDerivative(), 2)
@@ -247,7 +246,7 @@ class ReparametrizationDerivableSecondOrderWrapper:
            * dynamic_cast<const TransformedParameter&>(getParameter(variable)).getSecondOrderDerivative();
     }
 
-    double getSecondOrderDerivative(const std::string& variable1, const std::string& variable2) const throw (Exception)
+    double getSecondOrderDerivative(const std::string& variable1, const std::string& variable2) const
     {
       return dynamic_cast<const DerivableSecondOrder&>(getFunction()).getSecondOrderDerivative(variable1, variable2)
            * dynamic_cast<const TransformedParameter&>(getParameter(variable1)).getFirstOrderDerivative()
diff --git a/src/Bpp/Numeric/Function/SimpleMultiDimensions.cpp b/src/Bpp/Numeric/Function/SimpleMultiDimensions.cpp
index a651f9d..1fcd720 100644
--- a/src/Bpp/Numeric/Function/SimpleMultiDimensions.cpp
+++ b/src/Bpp/Numeric/Function/SimpleMultiDimensions.cpp
@@ -65,7 +65,7 @@ void SimpleMultiDimensions::setFunction(Function* function)
 
 /******************************************************************************/
 
-void SimpleMultiDimensions::doInit(const ParameterList& params) throw (Exception)
+void SimpleMultiDimensions::doInit(const ParameterList& params)
 {
   nbParams_ = params.size();
   if (nbParams_ == 0) return;
@@ -84,7 +84,7 @@ void SimpleMultiDimensions::doInit(const ParameterList& params) throw (Exception
 
 /******************************************************************************/
 
-double SimpleMultiDimensions::doStep() throw (Exception)
+double SimpleMultiDimensions::doStep()
 {
   double f = getFunction()->getValue();
   for (unsigned int i = 0; i < nbParams_; i++)
diff --git a/src/Bpp/Numeric/Function/SimpleMultiDimensions.h b/src/Bpp/Numeric/Function/SimpleMultiDimensions.h
index 2747f10..37c2e32 100644
--- a/src/Bpp/Numeric/Function/SimpleMultiDimensions.h
+++ b/src/Bpp/Numeric/Function/SimpleMultiDimensions.h
@@ -79,9 +79,9 @@ class SimpleMultiDimensions:
 		void setFunction(Function * function);
 		/** @} */
 		
-		void doInit(const ParameterList& params) throw (Exception);
+		void doInit(const ParameterList& params);
 
-    double doStep() throw (Exception);
+    double doStep();
 
     /**
      * @return The optimizer used to optimize each parameter.
diff --git a/src/Bpp/Numeric/Function/SimpleNewtonMultiDimensions.cpp b/src/Bpp/Numeric/Function/SimpleNewtonMultiDimensions.cpp
index 12b3603..60a6b16 100644
--- a/src/Bpp/Numeric/Function/SimpleNewtonMultiDimensions.cpp
+++ b/src/Bpp/Numeric/Function/SimpleNewtonMultiDimensions.cpp
@@ -64,7 +64,7 @@ void SimpleNewtonMultiDimensions::setFunction(Function* function)
 
 /******************************************************************************/
 
-void SimpleNewtonMultiDimensions::doInit(const ParameterList& params) throw (Exception)
+void SimpleNewtonMultiDimensions::doInit(const ParameterList& params)
 {
   nbParams_ = params.size();
   if (nbParams_ == 0) return;
@@ -83,7 +83,7 @@ void SimpleNewtonMultiDimensions::doInit(const ParameterList& params) throw (Exc
 
 /******************************************************************************/
 
-double SimpleNewtonMultiDimensions::doStep() throw (Exception)
+double SimpleNewtonMultiDimensions::doStep()
 {
   double f = getFunction()->getValue();
   for (unsigned int i = 0; i < nbParams_; i++)
diff --git a/src/Bpp/Numeric/Function/SimpleNewtonMultiDimensions.h b/src/Bpp/Numeric/Function/SimpleNewtonMultiDimensions.h
index 7de20e4..ec91354 100644
--- a/src/Bpp/Numeric/Function/SimpleNewtonMultiDimensions.h
+++ b/src/Bpp/Numeric/Function/SimpleNewtonMultiDimensions.h
@@ -78,9 +78,9 @@ class SimpleNewtonMultiDimensions:
 		void setFunction(Function* function);
 		/** @} */
 
-		void doInit(const ParameterList& params) throw (Exception);
+		void doInit(const ParameterList& params);
 
-		double doStep() throw (Exception);
+		double doStep();
 
     /**
      * @return The optimizer used to optimize each parameter.
diff --git a/src/Bpp/Numeric/Function/ThreePointsNumericalDerivative.cpp b/src/Bpp/Numeric/Function/ThreePointsNumericalDerivative.cpp
index 64dfe03..802a890 100644
--- a/src/Bpp/Numeric/Function/ThreePointsNumericalDerivative.cpp
+++ b/src/Bpp/Numeric/Function/ThreePointsNumericalDerivative.cpp
@@ -43,7 +43,6 @@ using namespace bpp;
 using namespace std;
 
 void ThreePointsNumericalDerivative::updateDerivatives(const ParameterList parameters)
-throw (ParameterNotFoundException, ConstraintException)
 {
   if (computeD1_ && variables_.size() > 0)
   {
diff --git a/src/Bpp/Numeric/Function/ThreePointsNumericalDerivative.h b/src/Bpp/Numeric/Function/ThreePointsNumericalDerivative.h
index e413494..81e354d 100644
--- a/src/Bpp/Numeric/Function/ThreePointsNumericalDerivative.h
+++ b/src/Bpp/Numeric/Function/ThreePointsNumericalDerivative.h
@@ -120,14 +120,13 @@ public:
   ThreePointsNumericalDerivative* clone() const { return new ThreePointsNumericalDerivative(*this); }
 
 public:
-  double getValue() const throw (Exception)
+  double getValue() const
   {
     return f2_;
   }
 
 protected:
-  void updateDerivatives(const ParameterList parameters)
-  throw (ParameterNotFoundException, ConstraintException);
+  void updateDerivatives(const ParameterList parameters);
 };
 } // end of namespace bpp.
 
diff --git a/src/Bpp/Numeric/Function/TwoPointsNumericalDerivative.cpp b/src/Bpp/Numeric/Function/TwoPointsNumericalDerivative.cpp
index 295b7d7..dee32db 100644
--- a/src/Bpp/Numeric/Function/TwoPointsNumericalDerivative.cpp
+++ b/src/Bpp/Numeric/Function/TwoPointsNumericalDerivative.cpp
@@ -43,7 +43,6 @@ using namespace bpp;
 using namespace std;
 
 void TwoPointsNumericalDerivative::updateDerivatives(const ParameterList parameters)
-throw (ParameterNotFoundException, ConstraintException)
 {
   if (computeD1_ && variables_.size() > 0)
   {
diff --git a/src/Bpp/Numeric/Function/TwoPointsNumericalDerivative.h b/src/Bpp/Numeric/Function/TwoPointsNumericalDerivative.h
index c871606..df80418 100644
--- a/src/Bpp/Numeric/Function/TwoPointsNumericalDerivative.h
+++ b/src/Bpp/Numeric/Function/TwoPointsNumericalDerivative.h
@@ -91,7 +91,7 @@ public:
   TwoPointsNumericalDerivative* clone() const { return new TwoPointsNumericalDerivative(*this); }
 
 public:
-  double getValue() const throw (Exception) { return f1_; }
+  double getValue() const { return f1_; }
 
   /**
    * @name The DerivableSecondOrder interface
@@ -99,21 +99,18 @@ public:
    * @{
    */
   double getSecondOrderDerivative(const std::string& variable) const
-  throw (Exception)
   {
     throw Exception("Second order derivative not avalaible with two points method.");
   }
 
   double getSecondOrderDerivative(const std::string& variable1, const std::string& variable2) const
-  throw (Exception)
   {
     throw Exception("Unimplemented cross derivative.");
   }
   /** @} */
 
 protected:
-  void updateDerivatives(const ParameterList parameters)
-  throw (ParameterNotFoundException, ConstraintException);
+  void updateDerivatives(const ParameterList parameters);
 };
 } // end of namespace bpp.
 
diff --git a/src/Bpp/Numeric/Hmm/AbstractHmmTransitionMatrix.cpp b/src/Bpp/Numeric/Hmm/AbstractHmmTransitionMatrix.cpp
index 028f7df..87b9377 100644
--- a/src/Bpp/Numeric/Hmm/AbstractHmmTransitionMatrix.cpp
+++ b/src/Bpp/Numeric/Hmm/AbstractHmmTransitionMatrix.cpp
@@ -75,7 +75,7 @@ AbstractHmmTransitionMatrix& AbstractHmmTransitionMatrix::operator=(const Abstra
   return *this;
 }
 
-void AbstractHmmTransitionMatrix::setHmmStateAlphabet(const HmmStateAlphabet* stateAlphabet) throw (HmmUnvalidAlphabetException)
+void AbstractHmmTransitionMatrix::setHmmStateAlphabet(const HmmStateAlphabet* stateAlphabet)
 {
   if (stateAlphabet==NULL)
     throw HmmUnvalidAlphabetException("Null alphabet in AbstractHmmTransitionMatrix::setHmmStateAlphabet");
diff --git a/src/Bpp/Numeric/Hmm/AbstractHmmTransitionMatrix.h b/src/Bpp/Numeric/Hmm/AbstractHmmTransitionMatrix.h
index c850cf4..d3698fa 100644
--- a/src/Bpp/Numeric/Hmm/AbstractHmmTransitionMatrix.h
+++ b/src/Bpp/Numeric/Hmm/AbstractHmmTransitionMatrix.h
@@ -89,7 +89,7 @@ public:
    * @throw UnvalidStateAlphabetException if the new alphabet is uncorrect (for instance is NULL pointer).
    */
   
-  void setHmmStateAlphabet(const HmmStateAlphabet* stateAlphabet) throw (HmmUnvalidAlphabetException);
+  void setHmmStateAlphabet(const HmmStateAlphabet* stateAlphabet);
    
   /**
    * @return The number of states in the model.
diff --git a/src/Bpp/Numeric/Hmm/HmmEmissionProbabilities.h b/src/Bpp/Numeric/Hmm/HmmEmissionProbabilities.h
index 970c662..e8f4f56 100644
--- a/src/Bpp/Numeric/Hmm/HmmEmissionProbabilities.h
+++ b/src/Bpp/Numeric/Hmm/HmmEmissionProbabilities.h
@@ -74,7 +74,7 @@ namespace bpp
      * @param stateAlphabet The new state alphabet.
      * @throw UnvalidStateAlphabetException if the new alphabet is uncorrect (for instance is NULL pointer).
      */
-    virtual void setHmmStateAlphabet(const HmmStateAlphabet* stateAlphabet) throw (HmmUnvalidAlphabetException) = 0;
+    virtual void setHmmStateAlphabet(const HmmStateAlphabet* stateAlphabet) = 0;
 
     /**
      * @brief Operator access to the emission probabilities.
diff --git a/src/Bpp/Numeric/Hmm/HmmLikelihood.cpp b/src/Bpp/Numeric/Hmm/HmmLikelihood.cpp
index da9acb7..8ba98eb 100644
--- a/src/Bpp/Numeric/Hmm/HmmLikelihood.cpp
+++ b/src/Bpp/Numeric/Hmm/HmmLikelihood.cpp
@@ -65,7 +65,7 @@ AbstractHmmLikelihood& AbstractHmmLikelihood::operator=(const AbstractHmmLikelih
   return *this;
 }
 
-double AbstractHmmLikelihood::getFirstOrderDerivative(const std::string& variable) const throw (Exception)
+double AbstractHmmLikelihood::getFirstOrderDerivative(const std::string& variable) const
 {
   if (variable!=dVariable_){
     dVariable_=variable;
@@ -77,7 +77,7 @@ double AbstractHmmLikelihood::getFirstOrderDerivative(const std::string& variabl
   
 }
     
-double AbstractHmmLikelihood::getSecondOrderDerivative(const std::string& variable) const throw (Exception)
+double AbstractHmmLikelihood::getSecondOrderDerivative(const std::string& variable) const
 {
   if (variable!=d2Variable_){
     d2Variable_=variable;
diff --git a/src/Bpp/Numeric/Hmm/HmmLikelihood.h b/src/Bpp/Numeric/Hmm/HmmLikelihood.h
index 08c9189..17be304 100644
--- a/src/Bpp/Numeric/Hmm/HmmLikelihood.h
+++ b/src/Bpp/Numeric/Hmm/HmmLikelihood.h
@@ -90,7 +90,7 @@ namespace bpp
     virtual const HmmEmissionProbabilities& getHmmEmissionProbabilities() const = 0;
     virtual HmmEmissionProbabilities& getHmmEmissionProbabilities() = 0;
 
-    virtual void getHiddenStatesPosteriorProbabilities(std::vector< std::vector<double> >& probs, bool append) const throw (Exception) = 0;
+    virtual void getHiddenStatesPosteriorProbabilities(std::vector< std::vector<double> >& probs, bool append) const = 0;
 
     virtual Vdouble getHiddenStatesPosteriorProbabilitiesForASite(size_t site) const = 0;
 
@@ -165,7 +165,7 @@ namespace bpp
     
     bool enableFirstOrderDerivatives() const { return true;}
 
-    double getFirstOrderDerivative(const std::string& variable) const throw (Exception);
+    double getFirstOrderDerivative(const std::string& variable) const;
 
     double getDLogLikelihood() const
     {
@@ -187,14 +187,14 @@ namespace bpp
     
     bool enableSecondOrderDerivatives() const {return true;}
 
-    double getSecondOrderDerivative(const std::string& variable) const throw (Exception);
+    double getSecondOrderDerivative(const std::string& variable) const;
   
     double getD2LogLikelihood() const
     {
       return d2LogLik_;
     }
 
-    double getSecondOrderDerivative(const std::string& variable1, const std::string& variable2) const throw (Exception) {
+    double getSecondOrderDerivative(const std::string& variable1, const std::string& variable2) const {
       throw (NotImplementedException("AbstractHmmLikelihood::getSecondOrderDerivative is not defined for 2 variables."));
     }
     
diff --git a/src/Bpp/Numeric/Hmm/HmmStateAlphabet.h b/src/Bpp/Numeric/Hmm/HmmStateAlphabet.h
index 40442a6..ce36a6f 100644
--- a/src/Bpp/Numeric/Hmm/HmmStateAlphabet.h
+++ b/src/Bpp/Numeric/Hmm/HmmStateAlphabet.h
@@ -72,7 +72,7 @@ namespace bpp {
      * @return The corresponding hidden state.
      * @see getNumberOfStates
      */
-    virtual const Clonable& getState(size_t stateIndex) const throw (HmmBadStateException) = 0;
+    virtual const Clonable& getState(size_t stateIndex) const = 0;
 
 
     virtual size_t getNumberOfStates() const = 0;
diff --git a/src/Bpp/Numeric/Hmm/HmmTransitionMatrix.h b/src/Bpp/Numeric/Hmm/HmmTransitionMatrix.h
index 34ab889..eb2d481 100644
--- a/src/Bpp/Numeric/Hmm/HmmTransitionMatrix.h
+++ b/src/Bpp/Numeric/Hmm/HmmTransitionMatrix.h
@@ -72,7 +72,7 @@ namespace bpp
      * @param stateAlphabet The new state alphabet.
      * @throw UnvalidStateAlphabetException if the new alphabet is uncorrect (for instance is NULL pointer).
      */
-    virtual void setHmmStateAlphabet(const HmmStateAlphabet* stateAlphabet) throw (HmmUnvalidAlphabetException) = 0;
+    virtual void setHmmStateAlphabet(const HmmStateAlphabet* stateAlphabet) = 0;
    
     /**
      * @return The number of states in the model.
diff --git a/src/Bpp/Numeric/Hmm/LogsumHmmLikelihood.cpp b/src/Bpp/Numeric/Hmm/LogsumHmmLikelihood.cpp
index 423755b..72f7538 100644
--- a/src/Bpp/Numeric/Hmm/LogsumHmmLikelihood.cpp
+++ b/src/Bpp/Numeric/Hmm/LogsumHmmLikelihood.cpp
@@ -50,7 +50,7 @@ LogsumHmmLikelihood::LogsumHmmLikelihood(
     HmmTransitionMatrix* transitionMatrix,
     HmmEmissionProbabilities* emissionProbabilities,
     bool ownsPointers,
-    const std::string& prefix) throw (Exception):
+    const std::string& prefix):
   AbstractHmmLikelihood(),
   AbstractParametrizable(prefix),
   hiddenAlphabet_(hiddenAlphabet),
@@ -345,7 +345,7 @@ Vdouble LogsumHmmLikelihood::getHiddenStatesPosteriorProbabilitiesForASite(size_
   return probs;
 }
 
-void LogsumHmmLikelihood::getHiddenStatesPosteriorProbabilities(std::vector< std::vector<double> >& probs, bool append) const throw (Exception)
+void LogsumHmmLikelihood::getHiddenStatesPosteriorProbabilities(std::vector< std::vector<double> >& probs, bool append) const
 {
   size_t offset = append ? probs.size() : 0;
   probs.resize(offset + nbSites_);
diff --git a/src/Bpp/Numeric/Hmm/LogsumHmmLikelihood.h b/src/Bpp/Numeric/Hmm/LogsumHmmLikelihood.h
index 67158e9..60c15c8 100644
--- a/src/Bpp/Numeric/Hmm/LogsumHmmLikelihood.h
+++ b/src/Bpp/Numeric/Hmm/LogsumHmmLikelihood.h
@@ -142,7 +142,7 @@ namespace bpp {
       HmmTransitionMatrix* transitionMatrix,
       HmmEmissionProbabilities* emissionProbabilities,
       bool ownsPointers_ = true,
-      const std::string& prefix = "") throw (Exception);
+      const std::string& prefix = "");
 
     LogsumHmmLikelihood(const LogsumHmmLikelihood& lik):
       AbstractHmmLikelihood(lik),
@@ -251,12 +251,12 @@ namespace bpp {
 
     const std::vector<size_t>& getBreakPoints() const { return breakPoints_; }
 
-    void setParameters(const ParameterList& pl) throw (Exception)
+    void setParameters(const ParameterList& pl)
     {
       setParametersValues(pl);
     }
 
-    double getValue() const throw (Exception) { return -logLik_; }
+    double getValue() const { return -logLik_; }
 
     double getLogLikelihood() const { return logLik_; }
 
@@ -274,7 +274,7 @@ namespace bpp {
     
     Vdouble getHiddenStatesPosteriorProbabilitiesForASite(size_t site) const;
 
-    void getHiddenStatesPosteriorProbabilities(std::vector< std::vector<double> >& probs, bool append = false) const throw (Exception);
+    void getHiddenStatesPosteriorProbabilities(std::vector< std::vector<double> >& probs, bool append = false) const;
 
     void computeLikelihood();
   protected:
diff --git a/src/Bpp/Numeric/Hmm/LowMemoryRescaledHmmLikelihood.cpp b/src/Bpp/Numeric/Hmm/LowMemoryRescaledHmmLikelihood.cpp
index 1a21fd3..2688b92 100644
--- a/src/Bpp/Numeric/Hmm/LowMemoryRescaledHmmLikelihood.cpp
+++ b/src/Bpp/Numeric/Hmm/LowMemoryRescaledHmmLikelihood.cpp
@@ -50,7 +50,7 @@ LowMemoryRescaledHmmLikelihood::LowMemoryRescaledHmmLikelihood(
   HmmTransitionMatrix* transitionMatrix,
   HmmEmissionProbabilities* emissionProbabilities,
   const std::string& prefix,
-  size_t maxSize) throw (Exception) :
+  size_t maxSize) :
   AbstractHmmLikelihood(),
   AbstractParametrizable(prefix),
   hiddenAlphabet_(hiddenAlphabet),
diff --git a/src/Bpp/Numeric/Hmm/LowMemoryRescaledHmmLikelihood.h b/src/Bpp/Numeric/Hmm/LowMemoryRescaledHmmLikelihood.h
index 4ab7162..855aee7 100644
--- a/src/Bpp/Numeric/Hmm/LowMemoryRescaledHmmLikelihood.h
+++ b/src/Bpp/Numeric/Hmm/LowMemoryRescaledHmmLikelihood.h
@@ -110,7 +110,7 @@ public:
     HmmTransitionMatrix* transitionMatrix,
     HmmEmissionProbabilities* emissionProbabilities,
     const std::string& prefix,
-    size_t maxSize = 1000000) throw (Exception);
+    size_t maxSize = 1000000);
 
   LowMemoryRescaledHmmLikelihood(const LowMemoryRescaledHmmLikelihood& lik) :
     AbstractHmmLikelihood(lik),
@@ -173,12 +173,12 @@ public:
 
   const std::vector<size_t>& getBreakPoints() const { return breakPoints_; }
 
-  void setParameters(const ParameterList& pl) throw (Exception)
+  void setParameters(const ParameterList& pl)
   {
     setParametersValues(pl);
   }
 
-  double getValue() const throw (Exception) { return -logLik_; }
+  double getValue() const { return -logLik_; }
 
   double getLogLikelihood() const { return logLik_; }
 
@@ -202,7 +202,7 @@ public:
     throw (NotImplementedException("LowMemoryRescaledHmmLikelihood::getHiddenStatesPosteriorProbabilitiesForASite. This class can't compute posterior probabilities, use RescaledHmmLikelihood instead."));    
   }
 
-  void getHiddenStatesPosteriorProbabilities(std::vector< std::vector<double> >& probs, bool append = false) const throw (NotImplementedException)
+  void getHiddenStatesPosteriorProbabilities(std::vector< std::vector<double> >& probs, bool append = false) const
   {
     throw (NotImplementedException("LowMemoryRescaledHmmLikelihood::getHiddenStatesPosteriorProbabilities. This class can't compute posterior probabilities, use RescaledHmmLikelihood instead."));    
   }
diff --git a/src/Bpp/Numeric/Hmm/RescaledHmmLikelihood.cpp b/src/Bpp/Numeric/Hmm/RescaledHmmLikelihood.cpp
index d2a93d1..f12a7ac 100644
--- a/src/Bpp/Numeric/Hmm/RescaledHmmLikelihood.cpp
+++ b/src/Bpp/Numeric/Hmm/RescaledHmmLikelihood.cpp
@@ -51,7 +51,7 @@ RescaledHmmLikelihood::RescaledHmmLikelihood(
     HmmStateAlphabet* hiddenAlphabet,
     HmmTransitionMatrix* transitionMatrix,
     HmmEmissionProbabilities* emissionProbabilities,
-    const std::string& prefix) throw (Exception):
+    const std::string& prefix):
   AbstractHmmLikelihood(),
   AbstractParametrizable(prefix),
   hiddenAlphabet_(hiddenAlphabet),
@@ -357,7 +357,7 @@ Vdouble RescaledHmmLikelihood::getHiddenStatesPosteriorProbabilitiesForASite(siz
 }
 
 
-void RescaledHmmLikelihood::getHiddenStatesPosteriorProbabilities(std::vector< std::vector<double> >& probs, bool append) const throw (Exception)
+void RescaledHmmLikelihood::getHiddenStatesPosteriorProbabilities(std::vector< std::vector<double> >& probs, bool append) const
 {
   size_t offset = append ? probs.size() : 0;
   probs.resize(offset + nbSites_);
diff --git a/src/Bpp/Numeric/Hmm/RescaledHmmLikelihood.h b/src/Bpp/Numeric/Hmm/RescaledHmmLikelihood.h
index 0cb76cb..df843d0 100644
--- a/src/Bpp/Numeric/Hmm/RescaledHmmLikelihood.h
+++ b/src/Bpp/Numeric/Hmm/RescaledHmmLikelihood.h
@@ -132,7 +132,7 @@ namespace bpp {
                           HmmStateAlphabet* hiddenAlphabet,
                           HmmTransitionMatrix* transitionMatrix,
                           HmmEmissionProbabilities* emissionProbabilities,
-                          const std::string& prefix) throw (Exception);
+                          const std::string& prefix);
     
     RescaledHmmLikelihood(const RescaledHmmLikelihood& lik):
     AbstractHmmLikelihood(lik),
@@ -206,12 +206,12 @@ namespace bpp {
 
     const std::vector<size_t>& getBreakPoints() const { return breakPoints_; }
 
-    void setParameters(const ParameterList& pl) throw (Exception)
+    void setParameters(const ParameterList& pl)
     {
       setParametersValues(pl);
     }
 
-    double getValue() const throw (Exception) { return -logLik_; }
+    double getValue() const { return -logLik_; }
 
     double getLogLikelihood() const { return logLik_; }
 
@@ -229,7 +229,7 @@ namespace bpp {
 
     Vdouble getHiddenStatesPosteriorProbabilitiesForASite(size_t site) const;
 
-    void getHiddenStatesPosteriorProbabilities(std::vector< std::vector<double> >& probs, bool append = false) const throw (Exception);
+    void getHiddenStatesPosteriorProbabilities(std::vector< std::vector<double> >& probs, bool append = false) const;
 
     
   protected:
diff --git a/src/Bpp/Numeric/IntegerTools.h b/src/Bpp/Numeric/IntegerTools.h
new file mode 100644
index 0000000..446ad33
--- /dev/null
+++ b/src/Bpp/Numeric/IntegerTools.h
@@ -0,0 +1,86 @@
+//
+// File: IntegerTools.h
+// Authors:
+//   Francois Gindraud (2017)
+// Created: 2017-03-28 00:00:00
+// Last modified: 2017-06-26
+//
+
+/*
+  Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
+  
+  This software is a computer program whose purpose is to provide utilitary
+  classes. This file belongs to the Bio++ Project.
+  
+  This software is governed by the CeCILL license under French law and
+  abiding by the rules of distribution of free software. You can use,
+  modify and/ or redistribute the software under the terms of the CeCILL
+  license as circulated by CEA, CNRS and INRIA at the following URL
+  "http://www.cecill.info".
+  
+  As a counterpart to the access to the source code and rights to copy,
+  modify and redistribute granted by the license, users are provided only
+  with a limited warranty and the software's author, the holder of the
+  economic rights, and the successive licensors have only limited
+  liability.
+  
+  In this respect, the user's attention is drawn to the risks associated
+  with loading, using, modifying and/or developing or reproducing the
+  software by the user in light of its specific status of free software,
+  that may mean that it is complicated to manipulate, and that also
+  therefore means that it is reserved for developers and experienced
+  professionals having in-depth computer knowledge. Users are therefore
+  encouraged to load and test the software's suitability as regards their
+  requirements in conditions enabling the security of their systems and/or
+  data to be ensured and, more generally, to use and operate it in the
+  same conditions as regards security.
+  
+  The fact that you are presently reading this means that you have had
+  knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#ifndef BPP_NUMERIC_INTEGERTOOLS_H
+#define BPP_NUMERIC_INTEGERTOOLS_H
+
+#include <type_traits>
+
+namespace bpp
+{
+  /// Namespace for integer utils.
+  namespace IntegerTools
+  {
+
+    /// Returns floor(n/divisor).
+    template <typename T>
+    T divideDown(T n, T divisor) noexcept
+    {
+      static_assert (std::is_integral<T>::value, "T must be an integral type");
+      return n / divisor;
+    }
+
+    /// Returns ceil (n/divisor).
+    template <typename T>
+    T divideUp(T n, T divisor) noexcept
+    {
+      static_assert (std::is_integral<T>::value, "T must be an integral type");
+      return divideDown(n + divisor - 1, divisor);
+    }
+
+    /// Round n to previous divisor multiple.
+    template <typename T>
+    T roundDown(T n, T divisor) noexcept
+    {
+      static_assert (std::is_integral<T>::value, "T must be an integral type");
+      return divisor * divideDown(n, divisor);
+    }
+
+    /// Round n to next divisor multiple.
+    template <typename T>
+    T roundUp(T n, T divisor) noexcept
+    {
+      static_assert (std::is_integral<T>::value, "T must be an integral type");
+      return divisor * divideUp(n, divisor);
+    }
+  }
+} // namespace bpp
+#endif // BPP_NUMERIC_INTEGERTOOLS_H
diff --git a/src/Bpp/Numeric/Matrix/LUDecomposition.h b/src/Bpp/Numeric/Matrix/LUDecomposition.h
index dc3b8cc..ad6201e 100644
--- a/src/Bpp/Numeric/Matrix/LUDecomposition.h
+++ b/src/Bpp/Numeric/Matrix/LUDecomposition.h
@@ -335,7 +335,7 @@ public:
    * If B is nonconformant or LU is singular, an Exception is raised.
    *
    */
-  Real solve (const Matrix<Real>& B, Matrix<Real>& X) const throw (BadIntegerException, ZeroDivisionException)
+  Real solve (const Matrix<Real>& B, Matrix<Real>& X) const
   {
     /* Dimensions: A is mxn, X is nxk, B is mxk */
 
@@ -409,7 +409,7 @@ public:
    *
    * If B is nonconformant or LU is singular, an Exception is raised.
    */
-  Real solve (const std::vector<Real>& b, std::vector<Real>& x)  const throw (BadIntegerException, ZeroDivisionException)
+  Real solve (const std::vector<Real>& b, std::vector<Real>& x)  const
   {
     /* Dimensions: A is mxn, X is nxk, B is mxk */
 
diff --git a/src/Bpp/Numeric/Matrix/Matrix.h b/src/Bpp/Numeric/Matrix/Matrix.h
index 72393c6..f1c2d0a 100644
--- a/src/Bpp/Numeric/Matrix/Matrix.h
+++ b/src/Bpp/Numeric/Matrix/Matrix.h
@@ -219,7 +219,7 @@ public:
     }
   }
 
-  void addRow(const std::vector<Scalar>& newRow) throw (DimensionException)
+  void addRow(const std::vector<Scalar>& newRow)
   {
     if (getNumberOfColumns()!=0 && newRow.size() != getNumberOfColumns())
       throw DimensionException("RowMatrix::addRow: invalid row dimension", newRow.size(), getNumberOfColumns());
@@ -306,6 +306,11 @@ public:
       return m_[i];
     }
 
+    std::vector<Scalar>& getCol(size_t i) 
+    {
+      return m_[i];
+    }
+
     std::vector<Scalar> col(size_t j) const
     {
       std::vector<Scalar> c(getNumberOfRows());
@@ -322,7 +327,7 @@ public:
       }
     }
 
-    void addCol(const std::vector<Scalar>& newCol) throw (DimensionException)
+    void addCol(const std::vector<Scalar>& newCol)
     {
       if (getNumberOfRows()!=0 && newCol.size() != getNumberOfRows())
         throw DimensionException("ColMatrix::addCol: invalid column dimension", newCol.size(), getNumberOfRows());
diff --git a/src/Bpp/Numeric/Matrix/MatrixTools.h b/src/Bpp/Numeric/Matrix/MatrixTools.h
index 3b3719b..5d3ef92 100644
--- a/src/Bpp/Numeric/Matrix/MatrixTools.h
+++ b/src/Bpp/Numeric/Matrix/MatrixTools.h
@@ -81,6 +81,56 @@ namespace bpp
     }
 
     /**
+     * @brief O(i,j)=A(i+1,j) and O(nbRow,j)=0
+     *
+     * @param A [in] Original matrix.
+     * @param O [out] A copy of the given matrix.
+     */
+    
+    template<class MatrixA, class MatrixO>
+    static void copyUp(const MatrixA& A, MatrixO& O)
+    {
+      size_t nr(A.getNumberOfRows()),nc(A.getNumberOfColumns());
+      O.resize(nr,nc);
+      for (size_t i = 0; i < nr-1; i++)
+      {
+        for (size_t j = 0; j < nc; j++)
+        {
+          O(i, j) = A(i+1, j);
+        }
+      }
+      for (size_t j = 0; j < nc; j++)
+      {
+        O(nr-1, j) = 0;
+      }
+    }
+
+    /**
+     * @brief O(i,j)=A(i-1,j) and O(0,j)=0
+     *
+     * @param A [in] Original matrix.
+     * @param O [out] A copy of the given matrix.
+     */
+    
+    template<class MatrixA, class MatrixO>
+    static void copyDown(const MatrixA& A, MatrixO& O)
+    {
+      size_t nr(A.getNumberOfRows()),nc(A.getNumberOfColumns());
+      O.resize(nr,nc);
+      for (size_t i = 1; i < nr; i++)
+      {
+        for (size_t j = 0; j < nc; j++)
+        {
+          O(i, j) = A(i-1, j);
+        }
+      }
+      for (size_t j = 0; j < nc; j++)
+      {
+        O(0, j) = 0;
+      }
+    }
+
+    /**
      * @brief Get a identity matrix of a given size.
      *
      * @param n the size of the matrix.
@@ -134,7 +184,7 @@ namespace bpp
      * @throw DimensionException If M is not a square matrix.
      */
     template<class Scalar>
-    static void diag(const Matrix<Scalar>& M, std::vector<Scalar>& O) throw (DimensionException)
+    static void diag(const Matrix<Scalar>& M, std::vector<Scalar>& O)
     {
       size_t nc = M.getNumberOfColumns();
       size_t nr = M.getNumberOfRows();
@@ -199,7 +249,7 @@ namespace bpp
      * @param O [out] The dot product of two matrices.
      */
     template<class Scalar>
-    static void mult(const Matrix<Scalar>& A, const Matrix<Scalar>& B, Matrix<Scalar>& O) throw (DimensionException)
+    static void mult(const Matrix<Scalar>& A, const Matrix<Scalar>& B, Matrix<Scalar>& O)
     {
       size_t ncA = A.getNumberOfColumns();
       size_t nrA = A.getNumberOfRows();
@@ -221,6 +271,42 @@ namespace bpp
     }
 
     /**
+     * @brief Product of complex matrices as couples of matrices
+     *
+     * @param A  [in] First matrix (real part)
+     * @param iA [in] First matrix (imaginary part)
+     * @param B  [in] Second matrix (real part)     
+     * @param iB [in] Second matrix(imaginary part)
+     * @param O  [out] The dot product of two matrices (real part)     
+     * @param iO [out] The dot product of two matrices(imaginary part)
+     */
+    
+    template<class Scalar>
+    static void mult(const Matrix<Scalar>& A, const Matrix<Scalar>& iA, const Matrix<Scalar>& B, const Matrix<Scalar>& iB, Matrix<Scalar>& O, Matrix<Scalar>& iO) throw (DimensionException)
+    {
+      size_t ncA = A.getNumberOfColumns();
+      size_t nrA = A.getNumberOfRows();
+      size_t nrB = B.getNumberOfRows();
+      size_t ncB = B.getNumberOfColumns();
+      if (ncA != nrB) throw DimensionException("MatrixTools::mult(). nrows B != ncols A.", nrB, ncA);
+      O.resize(nrA, ncB);
+      iO.resize(nrA, ncB);
+      for (size_t i = 0; i < nrA; i++)
+      {
+        for (size_t j = 0; j < ncB; j++)
+        {
+          O(i, j) = 0;
+          iO(i, j) = 0;
+          for (size_t k = 0; k < ncA; k++)
+          {
+            O(i, j) += A(i, k) * B(k, j) - iA(i,k) * iB(k,j);
+            iO(i, j) += A(i, k) * iB(k, j) + iA(i,k) * B(k,j);
+          }
+        }
+      }
+    }
+
+    /**
      * @brief Compute A . D . B where D is a diagonal matrix in O(n^3).
      *
      * Since D is a diagonal matrix, this function is more efficient than doing
@@ -233,7 +319,7 @@ namespace bpp
      * @throw DimensionException If matrices have not the appropriate size.
      */
     template<class Scalar>
-    static void mult(const Matrix<Scalar>& A, const std::vector<Scalar>& D, const Matrix<Scalar>& B, Matrix<Scalar>& O) throw (DimensionException)
+    static void mult(const Matrix<Scalar>& A, const std::vector<Scalar>& D, const Matrix<Scalar>& B, Matrix<Scalar>& O)
     {
       size_t ncA = A.getNumberOfColumns();
       size_t nrA = A.getNumberOfRows();
@@ -256,6 +342,54 @@ namespace bpp
     }
 
     /**
+     * @brief Compute A . D . B where D is a diagonal matrix in O(n^3).
+     *
+     * Since D is a diagonal matrix, this function is more efficient than doing
+     * mult(mult(A, diag(D)), B), which involves two 0(n^3) operations.
+     *
+     * @param A  [in] First matrix (real part)
+     * @param iA [in] First matrix (imaginary part)
+     * @param D [in] The diagonal matrix (only diagonal elements in a
+     * vector) (real part)
+     * @param iD [in] The diagonal matrix (only diagonal elements in a
+     * vector) (imaginary part)
+     * @param B  [in] Second matrix (real part)     
+     * @param iB [in] Second matrix(imaginary part)
+     * @param O  [out] The dot product of two matrices (real part)     
+     * @param iO [out] The dot product of two matrices(imaginary part)
+     * @throw DimensionException If matrices have not the appropriate size.
+     */
+    template<class Scalar>
+    static void mult(const Matrix<Scalar>& A, const Matrix<Scalar>& iA, const std::vector<Scalar>& D, const std::vector<Scalar>& iD, const Matrix<Scalar>& B, const Matrix<Scalar>& iB, Matrix<Scalar>& O, Matrix<Scalar>& iO) throw (DimensionException)
+    {
+      size_t ncA = A.getNumberOfColumns();
+      size_t nrA = A.getNumberOfRows();
+      size_t nrB = B.getNumberOfRows();
+      size_t ncB = B.getNumberOfColumns();
+      if (ncA != nrB) throw DimensionException("MatrixTools::mult(). nrows B != ncols A.", nrB, ncA);
+      if (ncA != D.size()) throw DimensionException("MatrixTools::mult(). Vector size is not equal to matrix size.", D.size(), ncA);
+      O.resize(nrA, ncB);
+      Scalar ab,iaib,iab,aib;
+      
+      for (size_t i = 0; i < nrA; i++)
+      {
+        for (size_t j = 0; j < ncB; j++)
+        {
+          O(i, j) = 0;
+          iO(i, j) = 0;
+          for (size_t k = 0; k < ncA; k++)
+          {
+            ab=A(i, k) * B(k, j) - iA(i,k) * iB(k,j);
+            aib=A(i, k) * iB(k, j) + iA(i, k) * B(k, j);
+            
+            O(i, j) += ab * D[k] - aib * iD[k];
+            iO(i, j) += ab * iD[k] + aib * D[k];
+          }
+        }
+      }
+    }
+
+    /**
      * @brief Compute A . (U+D+L) . B where D is a diagonal matrix, U
      * (resp. L) is a matrix in which the only non-zero terms are on the
      * diagonal that is over (resp. under) the main diagonal, in O(n^3).
@@ -272,7 +406,7 @@ namespace bpp
      * @throw DimensionException If matrices have not the appropriate size.
      */
     template<class Scalar>
-    static void mult(const Matrix<Scalar>& A, const std::vector<Scalar>& D, const std::vector<Scalar>& U, const std::vector<Scalar>& L, const Matrix<Scalar>& B, Matrix<Scalar>& O) throw (DimensionException)
+    static void mult(const Matrix<Scalar>& A, const std::vector<Scalar>& D, const std::vector<Scalar>& U, const std::vector<Scalar>& L, const Matrix<Scalar>& B, Matrix<Scalar>& O)
     {
       size_t ncA = A.getNumberOfColumns();
       size_t nrA = A.getNumberOfRows();
@@ -310,7 +444,7 @@ namespace bpp
      */
     
     template<class MatrixA, class MatrixB>
-    static void add(MatrixA& A, const MatrixB& B) throw (DimensionException)
+    static void add(MatrixA& A, const MatrixB& B)
     {
       size_t ncA = A.getNumberOfColumns();
       size_t nrA = A.getNumberOfRows();
@@ -338,7 +472,7 @@ namespace bpp
      * @throw DimensionException If A and B have note the same size.
      */
     template<class MatrixA, class MatrixB, class Scalar>
-    static void add(MatrixA& A, Scalar& x, const MatrixB& B) throw (DimensionException)
+    static void add(MatrixA& A, Scalar& x, const MatrixB& B)
     {
       size_t ncA = A.getNumberOfColumns();
       size_t nrA = A.getNumberOfRows();
@@ -368,7 +502,7 @@ namespace bpp
      * @throw DimensionException If m is not a square matrix.
      */
     template<class Matrix>
-    static void pow(const Matrix& A, size_t p, Matrix& O) throw (DimensionException)
+    static void pow(const Matrix& A, size_t p, Matrix& O)
     {
       size_t n = A.getNumberOfRows();
       if (n != A.getNumberOfColumns()) throw DimensionException("MatrixTools::pow(). nrows != ncols.", A.getNumberOfColumns(), A.getNumberOfRows());
@@ -407,7 +541,7 @@ namespace bpp
      * @throw DimensionException If m is not a square matrix.
      */
     template<class Scalar>
-    static void pow(const Matrix<Scalar>& A, double p, Matrix<Scalar>& O) throw (DimensionException)
+    static void pow(const Matrix<Scalar>& A, double p, Matrix<Scalar>& O)
     {
       size_t n = A.getNumberOfRows();
       if (n != A.getNumberOfColumns()) throw DimensionException("MatrixTools::pow(). nrows != ncols.", A.getNumberOfColumns(), A.getNumberOfRows());
@@ -429,7 +563,7 @@ namespace bpp
      * @throw DimensionException If m is not a square matrix.
      */
     template<class Scalar>
-    static void exp(const Matrix<Scalar>& A, Matrix<Scalar>& O) throw (DimensionException)
+    static void exp(const Matrix<Scalar>& A, Matrix<Scalar>& O)
     {
       size_t n = A.getNumberOfRows();
       if (n != A.getNumberOfColumns()) throw DimensionException("MatrixTools::exp(). nrows != ncols.", A.getNumberOfColumns(), A.getNumberOfRows());
@@ -451,7 +585,7 @@ namespace bpp
      */
   
     template<class Matrix, class Scalar>
-    static void Taylor(const Matrix& A, size_t p, std::vector< RowMatrix<Scalar> > & vO) throw (DimensionException)
+    static void Taylor(const Matrix& A, size_t p, std::vector< RowMatrix<Scalar> > & vO)
     {
       size_t n = A.getNumberOfRows();
       if (n != A.getNumberOfColumns())
@@ -644,6 +778,9 @@ namespace bpp
       out << variableName << "<-matrix(c(";
       for (size_t i = 0; i < m.getNumberOfRows(); i++)
       {
+        if (i>0)
+          out << std::endl;
+        
         for (size_t j = 0; j < m.getNumberOfColumns(); j++)
         {
           if (i > 0 || j > 0)
@@ -688,7 +825,7 @@ namespace bpp
      * @throw DimensionException If A is not a square matrix.
      */
     template<class Scalar>
-    static Scalar inv(const Matrix<Scalar>& A, Matrix<Scalar>& O) throw (DimensionException, ZeroDivisionException)
+    static Scalar inv(const Matrix<Scalar>& A, Matrix<Scalar>& O)
     {
       if (!isSquare(A)) throw DimensionException("MatrixTools::inv(). Matrix A is not a square matrix.", A.getNumberOfRows(), A.getNumberOfColumns());
       LUDecomposition<Scalar> lu(A);
@@ -707,7 +844,7 @@ namespace bpp
      * @throw DimensionException If A is not a square matrix.
      */
     template<class Scalar>
-    static double det(const Matrix<Scalar>& A) throw (DimensionException)
+    static double det(const Matrix<Scalar>& A)
     {
       if (!isSquare(A)) throw DimensionException("MatrixTools::det(). Matrix A is not a square matrix.", A.getNumberOfRows(), A.getNumberOfColumns());
       LUDecomposition<Scalar> lu(A);
@@ -906,6 +1043,37 @@ namespace bpp
     }
 
     /**
+     * @brief Compute the Hadamard product of two row matrices with same dimensions.
+     *
+     * @param A  [in] First matrix (real part)
+     * @param iA [in] First matrix (imaginary part)
+     * @param B  [in] Second matrix (real part)     
+     * @param iB [in] Second matrix(imaginary part)
+     * @param O [out] The 'Hadamard' product (real part)
+     * @param iO [out] The 'Hadamard' product(imaginary part)
+     */
+    template<class Scalar>
+    static void hadamardMult(const Matrix<Scalar>& A, const Matrix<Scalar>& iA, const Matrix<Scalar>& B, const Matrix<Scalar>& iB, Matrix<Scalar>& O, Matrix<Scalar>& iO)
+    {
+      size_t ncA = A.getNumberOfColumns();
+      size_t nrA = A.getNumberOfRows();
+      size_t nrB = B.getNumberOfRows();
+      size_t ncB = B.getNumberOfColumns();
+      if (nrA != nrB) throw DimensionException("MatrixTools::hadamardMult(). nrows A != nrows B.", nrA, nrB);
+      if (ncA != ncB) throw DimensionException("MatrixTools::hadamardMult(). ncols A != ncols B.", ncA, ncB);
+      O.resize(nrA, ncA);
+      iO.resize(nrA, ncA);
+      for (size_t i = 0; i < nrA; i++)
+      {
+        for (size_t j = 0; j < ncA; j++)
+        {
+          O(i, j) = A(i, j) * B(i, j) -  iA(i, j) * iB(i, j);
+          iO(i, j) = iA(i, j) * B(i, j) +  A(i, j) * iB(i, j);
+        }
+      }
+    }
+
+    /**
      * @brief Compute the "Hadamard" product of a row matrix and a vector containing weights, according to rows or columns.
      *
      * @param A [in] The row matrix.
@@ -1093,7 +1261,7 @@ namespace bpp
                       std::vector<int> &rowSol, 
                       std::vector<int> &colSol, 
                       std::vector<Scalar> &u, 
-                      std::vector<Scalar> &v) throw (Exception)
+                      std::vector<Scalar> &v)
     {
       size_t dim = assignCost.getNumberOfRows();
       if (assignCost.getNumberOfColumns() != dim)
diff --git a/src/Bpp/Numeric/NumTools.cpp b/src/Bpp/Numeric/NumTools.cpp
index 3157d30..76cac7e 100644
--- a/src/Bpp/Numeric/NumTools.cpp
+++ b/src/Bpp/Numeric/NumTools.cpp
@@ -45,7 +45,7 @@ using namespace std;
 
 /******************************************************************************/
   
-double NumTools::uniRoot(Function& f, const std::string& param, double a, double b, double tolerance) throw (Exception)
+double NumTools::uniRoot(Function& f, const std::string& param, double a, double b, double tolerance)
 {
   ParameterList pl;
   pl.addParameter(Parameter(param, a));
diff --git a/src/Bpp/Numeric/NumTools.h b/src/Bpp/Numeric/NumTools.h
index 1e48920..3dffa50 100644
--- a/src/Bpp/Numeric/NumTools.h
+++ b/src/Bpp/Numeric/NumTools.h
@@ -173,7 +173,7 @@ public:
    * @return The value of the parameter for which the function is zero.
    * @throw Exception If something bad happened or if the initial interval do not contains a root.
    */
-  static double uniRoot(Function & f, const std::string & param, double a, double b, double tolerance) throw (Exception);
+  static double uniRoot(Function & f, const std::string & param, double a, double b, double tolerance);
   
   /**************************************************************************/
   
diff --git a/src/Bpp/Numeric/Parameter.cpp b/src/Bpp/Numeric/Parameter.cpp
index 836891d..d12ab07 100644
--- a/src/Bpp/Numeric/Parameter.cpp
+++ b/src/Bpp/Numeric/Parameter.cpp
@@ -54,8 +54,7 @@ ParameterEvent::ParameterEvent(Parameter* parameter): parameter_(parameter) {}
 
 /** Constructors: *************************************************************/
 
-Parameter::Parameter(const std::string& name, double value, Constraint* constraint, bool attachConstraint, double precision)
-  throw (ConstraintException) :
+Parameter::Parameter(const std::string& name, double value, Constraint* constraint, bool attachConstraint, double precision) :
   name_(name), value_(0), precision_(0), constraint_(constraint), attach_(attachConstraint), listeners_(), listenerAttach_()
 {
   // This may throw a ConstraintException:
@@ -63,8 +62,7 @@ Parameter::Parameter(const std::string& name, double value, Constraint* constrai
   setPrecision(precision);
 }
 
-Parameter::Parameter(const std::string& name, double value, const Constraint* constraint, double precision)
-  throw (ConstraintException) :
+Parameter::Parameter(const std::string& name, double value, const Constraint* constraint, double precision) :
   name_(name), value_(0), precision_(0), constraint_(constraint ? constraint->clone() : 0), attach_(true), listeners_(), listenerAttach_()
 {
   // This may throw a ConstraintException:
@@ -120,7 +118,7 @@ Parameter::~Parameter()
 
 /** Value: ********************************************************************/
 
-void Parameter::setValue(double value) throw (ConstraintException)
+void Parameter::setValue(double value)
 {
   if (std::abs(value-value_)>precision_/2){
     if (constraint_ && !constraint_->isCorrect(value)) 
diff --git a/src/Bpp/Numeric/Parameter.h b/src/Bpp/Numeric/Parameter.h
index 9f3a99c..5c0f1c0 100644
--- a/src/Bpp/Numeric/Parameter.h
+++ b/src/Bpp/Numeric/Parameter.h
@@ -153,8 +153,7 @@ namespace bpp
      * and duplicated when the parameter is copied.
      * @throw ConstraintException If the parameter value does not match the contraint.
      */
-    Parameter(const std::string& name, double value, Constraint* constraint, bool attachConstraint, double precision=0)
-      throw (ConstraintException);
+    Parameter(const std::string& name, double value, Constraint* constraint, bool attachConstraint, double precision=0);
 
     /**
      * @brief Build a new parameter.
@@ -165,8 +164,7 @@ namespace bpp
      * @param precision An optional parameter precision (default 0)
      * @throw ConstraintException If the parameter value does not match the contraint.
      */
-    Parameter(const std::string& name, double value, const Constraint* constraint = 0, double precision=0)
-      throw (ConstraintException);
+    Parameter(const std::string& name, double value, const Constraint* constraint = 0, double precision=0);
 
 
     /**
@@ -202,7 +200,7 @@ namespace bpp
      *
      * @param value the new parameter value.
      */
-    virtual void setValue(double value) throw (ConstraintException);
+    virtual void setValue(double value);
   
     /**
      * @brief Set the precision of this parameter.
diff --git a/src/Bpp/Numeric/ParameterAliasable.h b/src/Bpp/Numeric/ParameterAliasable.h
index b9c6f68..20cea66 100644
--- a/src/Bpp/Numeric/ParameterAliasable.h
+++ b/src/Bpp/Numeric/ParameterAliasable.h
@@ -106,7 +106,7 @@ namespace bpp
      * @throw ParameterNotFoundException if p1 or p2 do not correspond to existing parameters.
      * @throw Exception when trying to perform non-valid association.
      */
-    virtual void aliasParameters(const std::string & p1, const std::string & p2) throw (ParameterNotFoundException, Exception) = 0; 
+    virtual void aliasParameters(const std::string & p1, const std::string & p2) = 0; 
 
     /**
      * @brief alias the parameters following the links described in a
@@ -129,7 +129,7 @@ namespace bpp
      * @throw ParameterNotFoundException if p1 or p2 do not correspond to existing parameters.
      * @throw Exception when trying to perform non-valid dissociation.
      */
-    virtual void unaliasParameters(const std::string & p1, const std::string & p2) throw (ParameterNotFoundException, Exception)  = 0;
+    virtual void unaliasParameters(const std::string & p1, const std::string & p2)  = 0;
 
     /**
      * @brief Get the minimal list of parameters to set the model.
@@ -179,8 +179,8 @@ namespace bpp
      * @{
      */
     const ParameterList & getIndependentParameters() const { return getParameters(); }
-    void aliasParameters(const std::string & p1, const std::string & p2) throw (ParameterNotFoundException, Exception) {}
-    void unaliasParameters(const std::string & p1, const std::string & p2) throw (ParameterNotFoundException, Exception) {}
+    void aliasParameters(const std::string & p1, const std::string & p2) {}
+    void unaliasParameters(const std::string & p1, const std::string & p2) {}
     unsigned int getNumberOfIndependentParameters() const{ return 0; }
     std::vector<std::string> getAlias(const std::string& name) const { return std::vector<std::string>(); }
     std::map<std::string, std::string> getAliases() const { return std::map<std::string, std::string>(); }
diff --git a/src/Bpp/Numeric/ParameterExceptions.h b/src/Bpp/Numeric/ParameterExceptions.h
index 72ce6d3..f9341c4 100644
--- a/src/Bpp/Numeric/ParameterExceptions.h
+++ b/src/Bpp/Numeric/ParameterExceptions.h
@@ -83,7 +83,7 @@ class ParameterException :
       return *this;
     }
 	
-		virtual ~ParameterException() throw () {}
+		virtual ~ParameterException() {}
 		
 	public:
 		/**
@@ -115,7 +115,7 @@ class ConstraintException : public ParameterException
 		 */	
 		ConstraintException(const std::string& text, const Parameter* param, double badValue);
 
-		virtual ~ConstraintException() throw () {}
+		virtual ~ConstraintException() {}
 	
 	public:
 		/**
@@ -147,7 +147,7 @@ class ParameterNotFoundException : public Exception
 		 */	
 		ParameterNotFoundException(const std::string& text, const std::string& param = "");
 	
-		virtual ~ParameterNotFoundException() throw () {}
+		virtual ~ParameterNotFoundException() {}
 		
 	public:
 		/**
diff --git a/src/Bpp/Numeric/ParameterList.cpp b/src/Bpp/Numeric/ParameterList.cpp
index 35f8c34..e294e82 100644
--- a/src/Bpp/Numeric/ParameterList.cpp
+++ b/src/Bpp/Numeric/ParameterList.cpp
@@ -84,7 +84,7 @@ ParameterList::~ParameterList()
 
 /******************************************************************************/
 
-const Parameter& ParameterList::getParameter(const std::string& name) const throw (ParameterNotFoundException)
+const Parameter& ParameterList::getParameter(const std::string& name) const
 {
   for (size_t i = 0; i < size(); i++)
   {
@@ -96,7 +96,7 @@ const Parameter& ParameterList::getParameter(const std::string& name) const thro
 
 /******************************************************************************/
 
-const shared_ptr<Parameter>& ParameterList::getSharedParameter(const std::string& name) const throw (ParameterNotFoundException)
+const shared_ptr<Parameter>& ParameterList::getSharedParameter(const std::string& name) const
 {
   for (size_t i = 0; i < size(); i++)
   {
@@ -110,7 +110,7 @@ const shared_ptr<Parameter>& ParameterList::getSharedParameter(const std::string
 
 /******************************************************************************/
 
-double ParameterList::getParameterValue(const std::string& name) const throw (ParameterNotFoundException)
+double ParameterList::getParameterValue(const std::string& name) const
 {
   for (size_t i = 0; i < size(); i++)
   {
@@ -122,7 +122,7 @@ double ParameterList::getParameterValue(const std::string& name) const throw (Pa
 
 /******************************************************************************/
 
-Parameter& ParameterList::getParameter(const std::string& name) throw (ParameterNotFoundException)
+Parameter& ParameterList::getParameter(const std::string& name)
 {
   for (size_t i = 0; i < size(); i++)
   {
@@ -134,7 +134,7 @@ Parameter& ParameterList::getParameter(const std::string& name) throw (Parameter
 
 /******************************************************************************/
 
-shared_ptr<Parameter>& ParameterList::getSharedParameter(const std::string& name) throw (ParameterNotFoundException)
+shared_ptr<Parameter>& ParameterList::getSharedParameter(const std::string& name)
 {
   for (size_t i = 0; i < size(); i++)
   {
@@ -148,7 +148,7 @@ shared_ptr<Parameter>& ParameterList::getSharedParameter(const std::string& name
 
 /******************************************************************************/
 
-ParameterList ParameterList::subList(const std::vector<std::string>& names) const throw (ParameterNotFoundException)
+ParameterList ParameterList::subList(const std::vector<std::string>& names) const
 {
   ParameterList pl;
   for (size_t i = 0; i < names.size(); i++)
@@ -161,7 +161,7 @@ ParameterList ParameterList::subList(const std::vector<std::string>& names) cons
 
 /******************************************************************************/
 
-ParameterList ParameterList::subList(const std::string& name) const throw (ParameterNotFoundException)
+ParameterList ParameterList::subList(const std::string& name) const
 {
   ParameterList pl;
   Parameter param = getParameter(name);
@@ -256,7 +256,7 @@ vector<string> ParameterList::getMatchingParameterNames(const string& pattern) c
 
 /******************************************************************************/
 
-void ParameterList::addParameter(const Parameter& param) throw (ParameterException)
+void ParameterList::addParameter(const Parameter& param)
 {
   if (hasParameter(param.getName()))
     throw ParameterException("ParameterList::addParameter. Parameter with name '" + param.getName() + "' already exists.", &param);
@@ -266,7 +266,7 @@ void ParameterList::addParameter(const Parameter& param) throw (ParameterExcepti
 
 /******************************************************************************/
 
-void ParameterList::addParameter(Parameter* param) throw (ParameterException)
+void ParameterList::addParameter(Parameter* param)
 {
   if (hasParameter(param->getName()))
     throw ParameterException("ParameterList::addParameter. Parameter with name '" + param->getName() + "' already exists.", param);
@@ -275,7 +275,7 @@ void ParameterList::addParameter(Parameter* param) throw (ParameterException)
 
 /******************************************************************************/
 
-void ParameterList::shareParameter(const std::shared_ptr<Parameter>& param) throw (ParameterException)
+void ParameterList::shareParameter(const std::shared_ptr<Parameter>& param)
 {
   if (hasParameter(param->getName()))
     setParameterValue(param->getName(), param->getValue());
@@ -286,7 +286,7 @@ void ParameterList::shareParameter(const std::shared_ptr<Parameter>& param) thro
 
 /******************************************************************************/
 
-void ParameterList::setParameter(size_t index, const Parameter& param) throw (IndexOutOfBoundsException)
+void ParameterList::setParameter(size_t index, const Parameter& param)
 {
   if (index >= size()) throw IndexOutOfBoundsException("ParameterList::setParameter.", index, 0, size());
   parameters_[index] = shared_ptr<Parameter>(param.clone());
@@ -309,7 +309,6 @@ void ParameterList::includeParameters(const ParameterList& params)
 /******************************************************************************/
 
 void ParameterList::addParameters(const ParameterList& params)
-throw (ParameterException)
 {
   for (size_t i = 0; i < params.size(); i++)
   {
@@ -320,7 +319,6 @@ throw (ParameterException)
 /******************************************************************************/
 
 void ParameterList::shareParameters(const ParameterList& params)
-  throw (ParameterException)
 {
   for (size_t i = 0; i < params.size(); i++)
   {
@@ -331,7 +329,6 @@ void ParameterList::shareParameters(const ParameterList& params)
 /******************************************************************************/
 
 void ParameterList::setParameterValue(const string& name, double value)
-throw (ParameterNotFoundException, ConstraintException)
 {
   Parameter* p = &getParameter(name);
   p->setValue(value);
@@ -340,7 +337,6 @@ throw (ParameterNotFoundException, ConstraintException)
 /******************************************************************************/
 
 void ParameterList::setAllParametersValues(const ParameterList& params)
-throw (ParameterNotFoundException, ConstraintException)
 {
   // First we check if all values are correct:
   for (vector<shared_ptr<Parameter> >::iterator it = parameters_.begin(); it < parameters_.end(); it++)
@@ -419,7 +415,6 @@ bool ParameterList::testParametersValues(const ParameterList& params) const
 /******************************************************************************/
 
 bool ParameterList::matchParametersValues(const ParameterList& params, vector<size_t>* updatedParameters)
-throw (ConstraintException)
 {
   // First we check if all values are correct:
   for (vector<shared_ptr<Parameter> >::const_iterator it = params.parameters_.begin(); it < params.parameters_.end(); it++)
@@ -455,7 +450,6 @@ throw (ConstraintException)
 
 /******************************************************************************/
 void ParameterList::setAllParameters(const ParameterList& params)
-throw (ParameterNotFoundException)
 {
   for (vector<shared_ptr<Parameter> >::iterator it = parameters_.begin(); it < parameters_.end(); it++)
   {
@@ -466,7 +460,6 @@ throw (ParameterNotFoundException)
 
 /******************************************************************************/
 void ParameterList::setParameters(const ParameterList& params)
-throw (ParameterNotFoundException)
 {
   for (vector<shared_ptr<Parameter> >::const_iterator it = params.parameters_.begin(); it < params.parameters_.end(); it++)
   {
@@ -501,7 +494,7 @@ void ParameterList::matchParameters(const ParameterList& params)
 }
 
 /******************************************************************************/
-void ParameterList::deleteParameter(const std::string& name) throw (ParameterNotFoundException)
+void ParameterList::deleteParameter(const std::string& name)
 {
   for (unsigned int i = 0; i < size(); i++)
   {
@@ -517,7 +510,7 @@ void ParameterList::deleteParameter(const std::string& name) throw (ParameterNot
 }
 
 /******************************************************************************/
-void ParameterList::deleteParameters(const std::vector<std::string>& names, bool mustExist) throw (ParameterNotFoundException)
+void ParameterList::deleteParameters(const std::vector<std::string>& names, bool mustExist)
 {
   for (unsigned int i = 0; i < names.size(); i++)
   {
@@ -536,7 +529,7 @@ void ParameterList::deleteParameters(const std::vector<std::string>& names, bool
 }
 
 /******************************************************************************/
-void ParameterList::deleteParameter(size_t index) throw (IndexOutOfBoundsException)
+void ParameterList::deleteParameter(size_t index)
 {
   if (index >= size()) throw IndexOutOfBoundsException("ParameterList::deleteParameter.", index, 0, size());
   // Parameter* p = parameters_[index].get();
@@ -545,7 +538,7 @@ void ParameterList::deleteParameter(size_t index) throw (IndexOutOfBoundsExcepti
 }
 
 /******************************************************************************/
-void ParameterList::deleteParameters(const std::vector<size_t>& indices) throw (IndexOutOfBoundsException)
+void ParameterList::deleteParameters(const std::vector<size_t>& indices)
 {
   vector<size_t> tmp(indices);
   sort(tmp.begin(), tmp.end());
@@ -560,7 +553,7 @@ void ParameterList::deleteParameters(const std::vector<size_t>& indices) throw (
 }
 
 /******************************************************************************/
-size_t ParameterList::whichParameterHasName(const std::string& name) const throw (ParameterNotFoundException)
+size_t ParameterList::whichParameterHasName(const std::string& name) const
 {
   for (size_t i = 0; i < size(); i++)
   {
diff --git a/src/Bpp/Numeric/ParameterList.h b/src/Bpp/Numeric/ParameterList.h
index fb47c2d..4287054 100644
--- a/src/Bpp/Numeric/ParameterList.h
+++ b/src/Bpp/Numeric/ParameterList.h
@@ -110,7 +110,7 @@ public:
    * @return A const reference toward the parameter with name <i>name</i>.
    * @throw ParameterNotFoundException If no parameter with the given name is found.
    */
-  virtual const Parameter& getParameter(const std::string& name) const throw (ParameterNotFoundException);
+  virtual const Parameter& getParameter(const std::string& name) const;
 
   /**
    * @brief Get the parameter with name <i>name</i> as a shared pointer.
@@ -119,7 +119,7 @@ public:
    * @return A const shared parameter toward the parameter with name <i>name</i>.
    * @throw ParameterNotFoundException If no parameter with the given name is found.
    */
-  virtual const std::shared_ptr<Parameter>& getSharedParameter(const std::string& name) const throw (ParameterNotFoundException);
+  virtual const std::shared_ptr<Parameter>& getSharedParameter(const std::string& name) const;
 
   /**
    * @brief Get the value of the parameter with name <i>name</i>.
@@ -129,7 +129,7 @@ public:
    * @throw ParameterNotFoundException If no parameter with the given name is found.
    */
 
-  virtual double getParameterValue(const std::string& name) const throw (ParameterNotFoundException);
+  virtual double getParameterValue(const std::string& name) const;
 
   /**
    * @brief Get the parameter with name <i>name</i>.
@@ -138,7 +138,7 @@ public:
    * @return A reference toward the parameter with name <i>name</i>.
    * @throw ParameterNotFoundException If no parameter with the given name is found.
    */
-  virtual Parameter& getParameter(const std::string& name) throw (ParameterNotFoundException);
+  virtual Parameter& getParameter(const std::string& name);
 
   /**
    * @brief Get the parameter with name <i>name</i> as a shared pointer.
@@ -147,7 +147,7 @@ public:
    * @return A shared parameter toward the parameter with name <i>name</i>.
    * @throw ParameterNotFoundException If no parameter with the given name is found.
    */
-  virtual std::shared_ptr<Parameter>& getSharedParameter(const std::string& name) throw (ParameterNotFoundException);
+  virtual std::shared_ptr<Parameter>& getSharedParameter(const std::string& name);
 
   /**
    * @brief Get given parameters as a sublist.
@@ -156,7 +156,7 @@ public:
    * @return A list with all parameters specified.
    * @throw ParameterNotFoundException If at least one name does not correspond to a parameter in the list.
    */
-  virtual ParameterList subList(const std::vector<std::string>& names) const throw (ParameterNotFoundException);
+  virtual ParameterList subList(const std::vector<std::string>& names) const;
 
   /**
    * @brief Get given parameter as a sublist.
@@ -165,7 +165,7 @@ public:
    * @return A list with the parameter specified.
    * @throw ParameterNotFoundException If no parameter with the given name is found.
    */
-  virtual ParameterList subList(const std::string& name) const throw (ParameterNotFoundException);
+  virtual ParameterList subList(const std::string& name) const;
 
   /**
    * @brief Get given parameters as a sublist.
@@ -213,7 +213,7 @@ public:
    *
    * @param param The parameter to add to the list.
    */
-  virtual void addParameter(const Parameter& param) throw (ParameterException);
+  virtual void addParameter(const Parameter& param);
 
   /**
    * @brief Add a new parameter at the end of the list.
@@ -225,7 +225,7 @@ public:
    * @param param A ppointer toward the parameter to add to the list.
    */
 
-  virtual void addParameter(Parameter* param) throw (ParameterException);
+  virtual void addParameter(Parameter* param);
 
   /**
    * @brief Share a parameter at the end of the list.
@@ -233,7 +233,7 @@ public:
    * @param param The shared_ptr parameter to add to the list.
    */
   
-  virtual void shareParameter(const std::shared_ptr<Parameter>& param) throw (ParameterException);
+  virtual void shareParameter(const std::shared_ptr<Parameter>& param);
 
 
   /**
@@ -244,9 +244,9 @@ public:
    * @throw IndexOutOfBoundsException if the index is not valid.
    */
   
-  virtual void setParameter(size_t index, const Parameter& param) throw (IndexOutOfBoundsException);
+  virtual void setParameter(size_t index, const Parameter& param);
 
-//  virtual void setParameter(size_t index, Parameter* param) throw (IndexOutOfBoundsException);
+//  virtual void setParameter(size_t index, Parameter* param);
 
   /**
    * @brief Add new parameters at the end of the list.
@@ -254,7 +254,7 @@ public:
    * @param params The parameter list containing the new parameters to
    * add to the list.
    */
-  virtual void addParameters(const ParameterList& params) throw (ParameterException);
+  virtual void addParameters(const ParameterList& params);
 
   /**
    * @brief Share parameters with a given list. They are added the end of this list.
@@ -263,7 +263,7 @@ public:
    * share with to the list.
    */
   
-  virtual void shareParameters(const ParameterList& params) throw (ParameterException);
+  virtual void shareParameters(const ParameterList& params);
 
   /**
    * @brief Add parameters to the list. If the parameter already
@@ -282,8 +282,7 @@ public:
    * @throw ParameterNotFoundException If no parameter with the given name is found in the list.
    * @throw ConstraintException If the value is incorrect.
    */
-  virtual void setParameterValue(const std::string& name, double value)
-    throw (ParameterNotFoundException, ConstraintException);
+  virtual void setParameterValue(const std::string& name, double value);
 
   /**
    * @brief Set the parameters to be equals to <i>params</i>.
@@ -296,8 +295,7 @@ public:
    * @throw ParameterNotFoundException If at least one name does not correspond to a parameter in the list.
    * @throw ConstraintException If one value is incorrect (and the two parameter list do not have the same constraints).
    */
-  virtual void setAllParametersValues(const ParameterList& params)
-    throw (ParameterNotFoundException, ConstraintException);
+  virtual void setAllParametersValues(const ParameterList& params);
 
   /**
    * @brief Update the parameters from the ones in <i>params</i>
@@ -339,8 +337,7 @@ public:
    * @see setParameters(), setAllParameters()
    */
 
-  virtual bool matchParametersValues(const ParameterList& params, std::vector<size_t>* updatedParameters = 0)
-    throw (ConstraintException);
+  virtual bool matchParametersValues(const ParameterList& params, std::vector<size_t>* updatedParameters = 0);
 
   /**
    * @brief Set the parameters to be equals to <i>params</i>.
@@ -351,8 +348,7 @@ public:
    * @param params A list with all parameters.
    * @see setParameters(), matchParameters();
    */
-  virtual void setAllParameters(const ParameterList& params)
-    throw (ParameterNotFoundException);
+  virtual void setAllParameters(const ParameterList& params);
 
   /**
    * @brief Update the parameters from <i>params</i>.
@@ -362,8 +358,7 @@ public:
    * @param params A list containing all parameters to update.
    * @see setAllParameters(), matchParameters()
    */
-  virtual void setParameters(const ParameterList& params)
-    throw (ParameterNotFoundException);
+  virtual void setParameters(const ParameterList& params);
 
   /**
    * @brief Update the parameters from <i>params</i>.
@@ -380,7 +375,7 @@ public:
    *
    * @param name The name of the parameter to delete from the list.
    */
-  virtual void deleteParameter(const std::string& name) throw (ParameterNotFoundException);
+  virtual void deleteParameter(const std::string& name);
 
   /**
    * @brief Delete several parameters from the list.
@@ -390,14 +385,14 @@ public:
    *                    not match an extant parameter.
    */
   
-  virtual void deleteParameters(const std::vector<std::string>& names, bool mustExist = true) throw (ParameterNotFoundException);
+  virtual void deleteParameters(const std::vector<std::string>& names, bool mustExist = true);
 
   /**
    * @brief Delete a parameter from the list.
    *
    * @param index The position of the parameter to delete in the list.
    */
-  virtual void deleteParameter(size_t index) throw (IndexOutOfBoundsException);
+  virtual void deleteParameter(size_t index);
 
   /**
    * @brief Delete several parameters from the list.
@@ -405,7 +400,7 @@ public:
    * @param indices The positions of the parameters to delete in the list.
    * Duplicated positions will be considered only one time.
    */
-  virtual void deleteParameters(const std::vector<size_t>& indices) throw (IndexOutOfBoundsException);
+  virtual void deleteParameters(const std::vector<size_t>& indices);
 
   /**
    * @brief Get the position of a given parameter according to its name.
@@ -415,7 +410,7 @@ public:
    * the position of the first one is returned.
    * @throw ParameterNotFoundException If no parameter with the given name is found.
    */
-  virtual size_t whichParameterHasName(const std::string& name) const throw (ParameterNotFoundException);
+  virtual size_t whichParameterHasName(const std::string& name) const;
 
   /**
    * @brief Print all parameters.
diff --git a/src/Bpp/Numeric/Parametrizable.h b/src/Bpp/Numeric/Parametrizable.h
index 3c1a095..6ab29d5 100644
--- a/src/Bpp/Numeric/Parametrizable.h
+++ b/src/Bpp/Numeric/Parametrizable.h
@@ -87,7 +87,7 @@ class Parametrizable:
      * @return The parameter with given name.
      * @throw ParameterNotFoundException if no parameter with this name is found.
      */
-    virtual const Parameter& getParameter(const std::string& name) const throw (ParameterNotFoundException) = 0;
+    virtual const Parameter& getParameter(const std::string& name) const = 0;
 	
 		/**
 		 * @brief Get the value for parameter of name 'name'.
@@ -96,7 +96,7 @@ class Parametrizable:
 		 * @return the value of parameter <i>name</i>.
 		 */
 		virtual double getParameterValue(const std::string& name) const
-			throw (ParameterNotFoundException) = 0;
+			 = 0;
 
 		/**
 		 * @brief Set the parameters values to be equals to those of <i>parameters</i>.
@@ -109,8 +109,7 @@ class Parametrizable:
 		 * @throw ConstraintException If a value in <i>parameters</i> does not match the constraint in the
 		 * corresponding parameter in the list.
 		 */
-		virtual void setAllParametersValues(const ParameterList& parameters) 
-			throw (ParameterNotFoundException, ConstraintException) = 0;
+		virtual void setAllParametersValues(const ParameterList& parameters) = 0;
 
 		/**
 		 * @brief Set the value of parameter with name <i>name</i> to be equal to <i>value</i>.
@@ -121,8 +120,7 @@ class Parametrizable:
 		 * @throw ConstraintException If <i>value</i> does not match the constraint associated to
 		 * parameter <i>name</i>.
 		 */
-		virtual void setParameterValue(const std::string& name, double value) 
-			throw (ParameterNotFoundException, ConstraintException) = 0;
+		virtual void setParameterValue(const std::string& name, double value) = 0;
 
 		/**
 		 * @brief Update the parameters from <i>parameters</i>.
@@ -134,8 +132,7 @@ class Parametrizable:
 		 * @throw ConstraintException If a value in <i>parameters</i> does not match the constraint in the
 		 * corresponding parameter in the list.
 		 */
-		virtual void setParametersValues(const ParameterList& parameters)
-			throw (ParameterNotFoundException, ConstraintException) = 0;
+		virtual void setParametersValues(const ParameterList& parameters) = 0;
 
 		/**
 		 * @brief Update the parameters from <i>parameters</i>.
@@ -147,8 +144,7 @@ class Parametrizable:
 		 * @throw ConstraintException If a value in <i>parameters</i> does not match the constraint in the
 		 * corresponding parameter in the list.
 		 */
-		virtual bool matchParametersValues(const ParameterList& parameters)
-			throw (ConstraintException) = 0;
+		virtual bool matchParametersValues(const ParameterList& parameters) = 0;
 
     /**
      * @brief Get the number of parameters.
@@ -205,18 +201,13 @@ class ParametrizableAdapter:
 		 */
     bool hasParameter(const std::string & name) const { return parameters_.hasParameter(name); }
 		const ParameterList & getParameters() const { return parameters_; }
-    const Parameter & getParameter(const std::string & name) const throw (ParameterNotFoundException) { return parameter_; }
-		double getParameterValue(const std::string & name) const
-			throw (ParameterNotFoundException) { return 0; };
-		void setAllParametersValues(const ParameterList & parameters) 
-			throw (ParameterNotFoundException, ConstraintException) {}
-		void setParameterValue(const std::string & name, double value) 
-			throw (ParameterNotFoundException, ConstraintException) {}
-		void setParametersValues(const ParameterList & parameters)
-			throw (ParameterNotFoundException, ConstraintException) {}
-		bool matchParametersValues(const ParameterList & parameters)
-			throw (ConstraintException) { return false ;}
-    size_t getNumberOfParameters() const{ return 0; }
+    const Parameter & getParameter(const std::string & name) const { return parameter_; }
+		double getParameterValue(const std::string & name) const { return 0; }
+		void setAllParametersValues(const ParameterList & parameters) {}
+		void setParameterValue(const std::string & name, double value) {}
+		void setParametersValues(const ParameterList & parameters) {}
+		bool matchParametersValues(const ParameterList & parameters) { return false; }
+    size_t getNumberOfParameters() const { return 0; }
     void setNamespace(const std::string& prefix) {}
     std::string getNamespace() const { return ""; }
     std::string getParameterNameWithoutNamespace(const std::string& name) const { return name; }
diff --git a/src/Bpp/Numeric/Prob/AbstractDiscreteDistribution.h b/src/Bpp/Numeric/Prob/AbstractDiscreteDistribution.h
index 64b90e4..f65bf25 100644
--- a/src/Bpp/Numeric/Prob/AbstractDiscreteDistribution.h
+++ b/src/Bpp/Numeric/Prob/AbstractDiscreteDistribution.h
@@ -168,14 +168,14 @@ namespace bpp
     double getSupCumulativeProbability(double category) const;
     double getSSupCumulativeProbability(double category) const;
     double rand() const;
-    double randC() const throw (Exception) { throw Exception("AbstractDiscreteDistribution::randC. No continuous version available for this distribution."); }
+    double randC() const { throw Exception("AbstractDiscreteDistribution::randC. No continuous version available for this distribution."); }
 
     /*
      *@return value of the internal bound
      *
      */
     
-    double getBound(size_t i) const throw (IndexOutOfBoundsException)
+    double getBound(size_t i) const
     {
       if (i >= numberOfCategories_ - 1)
         throw IndexOutOfBoundsException("AbstractDiscreteDistribution::getBound(i)", i , 0, numberOfCategories_-1);
diff --git a/src/Bpp/Numeric/Prob/BetaDiscreteDistribution.h b/src/Bpp/Numeric/Prob/BetaDiscreteDistribution.h
index c4e66d3..e3926cf 100644
--- a/src/Bpp/Numeric/Prob/BetaDiscreteDistribution.h
+++ b/src/Bpp/Numeric/Prob/BetaDiscreteDistribution.h
@@ -93,7 +93,7 @@ namespace bpp
 
     void fireParameterChanged(const ParameterList & parameters);
   
-    double randC() const throw (Exception)
+    double randC() const
     {
       double x= RandomTools::randBeta(getParameterValue("alpha"),
                                       getParameterValue("beta"));
diff --git a/src/Bpp/Numeric/Prob/ConstantDistribution.h b/src/Bpp/Numeric/Prob/ConstantDistribution.h
index 75d9e9b..6777e77 100644
--- a/src/Bpp/Numeric/Prob/ConstantDistribution.h
+++ b/src/Bpp/Numeric/Prob/ConstantDistribution.h
@@ -82,7 +82,7 @@ namespace bpp
   public:
     void fireParameterChanged(const ParameterList& parameters);
     
-    double randC() const throw (Exception) { return value_; }
+    double randC() const { return value_; }
 
     std::string getName() const { return("Constant"); }
 
diff --git a/src/Bpp/Numeric/Prob/DiscreteDistribution.h b/src/Bpp/Numeric/Prob/DiscreteDistribution.h
index 2c14d2e..129795b 100644
--- a/src/Bpp/Numeric/Prob/DiscreteDistribution.h
+++ b/src/Bpp/Numeric/Prob/DiscreteDistribution.h
@@ -199,7 +199,7 @@ namespace bpp
      * @return A random number according to this distribution.
      * @throw Exception If there is no continuous version of this distribution.
      */
-    virtual double randC() const throw (Exception) = 0;
+    virtual double randC() const = 0;
 
     /**
      * @brief Return the quantile of the continuous version of the
diff --git a/src/Bpp/Numeric/Prob/ExponentialDiscreteDistribution.h b/src/Bpp/Numeric/Prob/ExponentialDiscreteDistribution.h
index 26c18ac..5a1958a 100644
--- a/src/Bpp/Numeric/Prob/ExponentialDiscreteDistribution.h
+++ b/src/Bpp/Numeric/Prob/ExponentialDiscreteDistribution.h
@@ -92,7 +92,7 @@ public:
   
   void fireParameterChanged(const ParameterList& parameters);
 
-  double randC() const throw (Exception)
+  double randC() const
   {
     double x = RandomTools::randExponential(1. / getParameterValue("lambda"));
     while (!intMinMax_.isCorrect(x))
diff --git a/src/Bpp/Numeric/Prob/GammaDiscreteDistribution.h b/src/Bpp/Numeric/Prob/GammaDiscreteDistribution.h
index e84a0a6..0483fed 100644
--- a/src/Bpp/Numeric/Prob/GammaDiscreteDistribution.h
+++ b/src/Bpp/Numeric/Prob/GammaDiscreteDistribution.h
@@ -100,7 +100,7 @@ namespace bpp
 
     void fireParameterChanged(const ParameterList & parameters);
   
-    double randC() const throw (Exception)
+    double randC() const
     {
       double x= RandomTools::randGamma(getParameterValue("alpha"),
                                        getParameterValue("beta"));
diff --git a/src/Bpp/Numeric/Prob/GaussianDiscreteDistribution.h b/src/Bpp/Numeric/Prob/GaussianDiscreteDistribution.h
index a7fb8bc..2411cc4 100644
--- a/src/Bpp/Numeric/Prob/GaussianDiscreteDistribution.h
+++ b/src/Bpp/Numeric/Prob/GaussianDiscreteDistribution.h
@@ -85,7 +85,7 @@ public:
 
   void fireParameterChanged(const ParameterList & parameters);
   
-  double randC() const throw (Exception)
+  double randC() const
   {
     return RandomTools::randGaussian(mu_,sigma_);
   }
diff --git a/src/Bpp/Numeric/Prob/Simplex.cpp b/src/Bpp/Numeric/Prob/Simplex.cpp
index acc424f..6afae04 100644
--- a/src/Bpp/Numeric/Prob/Simplex.cpp
+++ b/src/Bpp/Numeric/Prob/Simplex.cpp
@@ -198,10 +198,13 @@ void Simplex::fireParameterChanged(const ParameterList& parameters)
       vProb_[i + 1] = th;
       x += vProb_[i + 1];
     }
-    for (unsigned int i = 0; i < dim_; i++)
-    {
-      vProb_[i] /= x;
-    }
+
+    if (x>NumConstants::TINY()) // avoid rounding pb
+      for (auto& vp : vProb_)
+        vp /= x;
+    else
+      for (auto& vp : vProb_)
+        vp = 1.0/double(dim_);
 
     break;
   case 3:
diff --git a/src/Bpp/Numeric/Prob/TruncatedExponentialDiscreteDistribution.h b/src/Bpp/Numeric/Prob/TruncatedExponentialDiscreteDistribution.h
index 8ed06af..632f575 100644
--- a/src/Bpp/Numeric/Prob/TruncatedExponentialDiscreteDistribution.h
+++ b/src/Bpp/Numeric/Prob/TruncatedExponentialDiscreteDistribution.h
@@ -112,7 +112,7 @@ public:
 
   void fireParameterChanged(const ParameterList& parameters);
 
-  double randC() const throw (Exception)
+  double randC() const
   {
     double x = RandomTools::randExponential(1. / getParameterValue("lambda"));
     while (!intMinMax_.isCorrect(x))
diff --git a/src/Bpp/Numeric/Prob/UniformDiscreteDistribution.h b/src/Bpp/Numeric/Prob/UniformDiscreteDistribution.h
index 965d054..67567e3 100644
--- a/src/Bpp/Numeric/Prob/UniformDiscreteDistribution.h
+++ b/src/Bpp/Numeric/Prob/UniformDiscreteDistribution.h
@@ -82,7 +82,7 @@ namespace bpp
 
     void fireParameterChanged(const ParameterList & parameters);
 
-    double randC() const throw (Exception)
+    double randC() const
     {
       double x= RandomTools::giveRandomNumberBetweenZeroAndEntry(max_-min_)+min_;
       while (!intMinMax_.isCorrect(x))
diff --git a/src/Bpp/Numeric/Random/RandomTools.h b/src/Bpp/Numeric/Random/RandomTools.h
index cf44569..b2e6171 100644
--- a/src/Bpp/Numeric/Random/RandomTools.h
+++ b/src/Bpp/Numeric/Random/RandomTools.h
@@ -180,7 +180,7 @@ namespace bpp
      * @author Sylvain Gaillard
      */
     template<class T>
-    static T pickOne(std::vector<T>& v, bool replace = false) throw (EmptyVectorException<T>) {
+    static T pickOne(std::vector<T>& v, bool replace = false) {
       if (v.empty())
         throw EmptyVectorException<T>("RandomTools::pickOne: input vector is empty", &v);
       size_t pos = RandomTools::giveIntRandomNumberBetweenZeroAndEntry<size_t>(v.size());
@@ -195,7 +195,7 @@ namespace bpp
     }
 
     template<class T>
-    static T pickOne(const std::vector<T>& v) throw (EmptyVectorException<T>) {
+    static T pickOne(const std::vector<T>& v) {
       if (v.empty())
         throw EmptyVectorException<T>("RandomTools::pickOne: input vector is empty", &v);
       size_t pos = RandomTools::giveIntRandomNumberBetweenZeroAndEntry<size_t>(v.size());
@@ -220,7 +220,7 @@ namespace bpp
      * @author Sylvain Gaillard
      */
     template<class T> 
-    static void getSample(const std::vector<T>& vin, std::vector<T>& vout, bool replace = false) throw (EmptyVectorException<T>, IndexOutOfBoundsException)
+    static void getSample(const std::vector<T>& vin, std::vector<T>& vout, bool replace = false)
     {
       if (vout.size() > vin.size() && !replace)
         throw IndexOutOfBoundsException("RandomTools::getSample: size exceeded v.size.", vout.size(), 0, vin.size());
@@ -247,7 +247,7 @@ namespace bpp
      * @author Julien Dutheil
      */
     template<class T>
-    static T pickOne(std::vector<T>& v, std::vector<double>& w, bool replace = false) throw (EmptyVectorException<T>) {
+    static T pickOne(std::vector<T>& v, std::vector<double>& w, bool replace = false) {
       if (v.empty())
         throw EmptyVectorException<T>("RandomTools::pickOne (with weight): input vector is empty", &v);
       //Compute cumulative sum of weights:
@@ -300,7 +300,7 @@ namespace bpp
      * @author Julien Dutheil
      */
    template<class T> 
-    static void getSample(const std::vector<T>& vin, const std::vector<double>& w, std::vector<T>& vout, bool replace = false) throw (EmptyVectorException<T>, IndexOutOfBoundsException)
+    static void getSample(const std::vector<T>& vin, const std::vector<double>& w, std::vector<T>& vout, bool replace = false)
     {
       if (vout.size() > vin.size() && !replace)
         throw IndexOutOfBoundsException("RandomTools::getSample (with weights): size exceeded v.size.", vout.size(), 0, vin.size());
@@ -451,7 +451,7 @@ namespace bpp
      * @throw Exception If alpha or beta is invalid (<0).
      *
      */
-    static double pGamma(double x, double alpha, double beta) throw (Exception)
+    static double pGamma(double x, double alpha, double beta)
     {
       if (alpha < 0) throw Exception("RandomTools::pGamma. Negative alpha is not allowed.");
       if (beta < 0) throw Exception("RandomTools::pGamma. Negative beta is not allowed.");
diff --git a/src/Bpp/Numeric/Stat/Mva/CorrespondenceAnalysis.cpp b/src/Bpp/Numeric/Stat/Mva/CorrespondenceAnalysis.cpp
index 83db931..749d3f6 100644
--- a/src/Bpp/Numeric/Stat/Mva/CorrespondenceAnalysis.cpp
+++ b/src/Bpp/Numeric/Stat/Mva/CorrespondenceAnalysis.cpp
@@ -48,7 +48,7 @@ using namespace std;
 CorrespondenceAnalysis::CorrespondenceAnalysis(
   const Matrix<double>& data,
   unsigned int nbAxes,
-  double tol, bool verbose) throw (Exception) :
+  double tol, bool verbose) :
   DualityDiagram(),
   n_()
 {
diff --git a/src/Bpp/Numeric/Stat/Mva/CorrespondenceAnalysis.h b/src/Bpp/Numeric/Stat/Mva/CorrespondenceAnalysis.h
index 8b2d205..af3dbcb 100644
--- a/src/Bpp/Numeric/Stat/Mva/CorrespondenceAnalysis.h
+++ b/src/Bpp/Numeric/Stat/Mva/CorrespondenceAnalysis.h
@@ -76,15 +76,14 @@ public:
     const Matrix<double>& data,
     unsigned int nbAxes,
     double tol = 0.0000001,
-    bool verbose = true)
-  throw (Exception);
+    bool verbose = true);
 
   virtual ~CorrespondenceAnalysis() {}
 
   CorrespondenceAnalysis* clone() const { return new CorrespondenceAnalysis(*this); }
 
 public:
-  double getSumOfAllValues() const throw (Exception) { return n_; }
+  double getSumOfAllValues() const { return n_; }
 };
 } // end of namespace bpp.
 
diff --git a/src/Bpp/Numeric/Stat/Mva/DualityDiagram.cpp b/src/Bpp/Numeric/Stat/Mva/DualityDiagram.cpp
index 0971a8a..5ca8149 100644
--- a/src/Bpp/Numeric/Stat/Mva/DualityDiagram.cpp
+++ b/src/Bpp/Numeric/Stat/Mva/DualityDiagram.cpp
@@ -52,7 +52,7 @@ DualityDiagram::DualityDiagram(
   const vector<double>& rowWeights,
   const vector<double>& colWeights,
   unsigned int nbAxes,
-  double tol, bool verbose) throw (Exception) :
+  double tol, bool verbose) :
   rowWeights_(rowWeights),
   colWeights_(colWeights),
   nbAxes_(nbAxes),
@@ -71,7 +71,7 @@ void DualityDiagram::check_(
   const Matrix<double>& matrix,
   const vector<double>& rowWeights,
   const vector<double>& colWeights,
-  unsigned int nbAxes) throw (Exception)
+  unsigned int nbAxes)
 {
   size_t rowNb = matrix.getNumberOfRows();
   size_t colNb = matrix.getNumberOfColumns();
@@ -102,7 +102,7 @@ void DualityDiagram::setData(
   const vector<double>& rowWeights,
   const vector<double>& colWeights,
   unsigned int nbAxes,
-  double tol, bool verbose) throw (Exception)
+  double tol, bool verbose)
 {
   check_(matrix, rowWeights, colWeights, verbose);
   rowWeights_ = rowWeights;
diff --git a/src/Bpp/Numeric/Stat/Mva/DualityDiagram.h b/src/Bpp/Numeric/Stat/Mva/DualityDiagram.h
index a9a872f..2d6ca44 100644
--- a/src/Bpp/Numeric/Stat/Mva/DualityDiagram.h
+++ b/src/Bpp/Numeric/Stat/Mva/DualityDiagram.h
@@ -102,7 +102,7 @@ public:
     const std::vector<double>& colWeights,
     unsigned int nbAxes,
     double tol = 0.0000001,
-    bool verbose = true) throw (Exception);
+    bool verbose = true);
 
   virtual ~DualityDiagram();
 
@@ -113,7 +113,7 @@ private:
       const Matrix<double>& matrix,
       const std::vector<double>& rowWeights,
       const std::vector<double>& colWeights,
-      unsigned int nbAxes) throw (Exception);
+      unsigned int nbAxes);
   void compute_(const Matrix<double>& matrix, double tol, bool verbose);
 
 public:
@@ -134,18 +134,18 @@ public:
       const std::vector<double>& colWeights,
       unsigned int nbAxes,
       double tol = 0.0000001,
-      bool verbose = true) throw (Exception);
+      bool verbose = true);
  
-  std::vector<double> computeVariancePercentagePerAxis() throw (Exception);
+  std::vector<double> computeVariancePercentagePerAxis();
   
-  size_t getNbOfKeptAxes() const throw (Exception) { return nbAxes_; }
-  const std::vector<double> getRowWeights() const throw (Exception) { return rowWeights_; }
-  const	std::vector<double> getColumnWeights() const throw (Exception) { return colWeights_; }	  
-  const std::vector<double>& getEigenValues() const throw (Exception) { return eigenValues_; }
-  const RowMatrix<double>& getRowCoordinates() const throw (Exception) { return rowCoord_; }
-  const RowMatrix<double>& getColCoordinates() const throw (Exception) { return colCoord_; }
-  const RowMatrix<double>& getPrincipalAxes() const throw (Exception) { return ppalAxes_; }
-  const RowMatrix<double>& getPrincipalComponents() const throw (Exception) { return ppalComponents_; }
+  size_t getNbOfKeptAxes() const { return nbAxes_; }
+  const std::vector<double> getRowWeights() const { return rowWeights_; }
+  const	std::vector<double> getColumnWeights() const { return colWeights_; }	  
+  const std::vector<double>& getEigenValues() const { return eigenValues_; }
+  const RowMatrix<double>& getRowCoordinates() const { return rowCoord_; }
+  const RowMatrix<double>& getColCoordinates() const { return colCoord_; }
+  const RowMatrix<double>& getPrincipalAxes() const { return ppalAxes_; }
+  const RowMatrix<double>& getPrincipalComponents() const { return ppalComponents_; }
 };
 
 } // end of namespace bpp.
diff --git a/src/Bpp/Numeric/Stat/Mva/PrincipalComponentAnalysis.cpp b/src/Bpp/Numeric/Stat/Mva/PrincipalComponentAnalysis.cpp
index 4a14f43..6a2c41c 100644
--- a/src/Bpp/Numeric/Stat/Mva/PrincipalComponentAnalysis.cpp
+++ b/src/Bpp/Numeric/Stat/Mva/PrincipalComponentAnalysis.cpp
@@ -55,7 +55,7 @@ PrincipalComponentAnalysis::PrincipalComponentAnalysis(
   bool centered,
   bool scaled,
   double tol,
-  bool verbose) throw (Exception) :
+  bool verbose) :
   DualityDiagram(),
   columnMeans_(),
   columnSd_()
@@ -85,7 +85,7 @@ PrincipalComponentAnalysis::PrincipalComponentAnalysis(
   bool centered,
   bool scaled,
   double tol,
-  bool verbose) throw (Exception) :
+  bool verbose) :
   DualityDiagram(),
   columnMeans_(),
   columnSd_()
@@ -117,7 +117,7 @@ PrincipalComponentAnalysis::PrincipalComponentAnalysis(
 
 /******************************************************************************/
 
-void PrincipalComponentAnalysis::center(Matrix<double>& matrix, const vector<double>& rowW) throw (Exception)
+void PrincipalComponentAnalysis::center(Matrix<double>& matrix, const vector<double>& rowW)
 {
   size_t nRow = matrix.getNumberOfRows();
   size_t nCol = matrix.getNumberOfColumns();
@@ -148,7 +148,7 @@ void PrincipalComponentAnalysis::center(Matrix<double>& matrix, const vector<dou
 
 /******************************************************************************/
 
-void PrincipalComponentAnalysis::scale(Matrix<double>& matrix, const vector<double>& rowW) throw (Exception)
+void PrincipalComponentAnalysis::scale(Matrix<double>& matrix, const vector<double>& rowW)
 {
   size_t nRow = matrix.getNumberOfRows();
   size_t nCol = matrix.getNumberOfColumns();
diff --git a/src/Bpp/Numeric/Stat/Mva/PrincipalComponentAnalysis.h b/src/Bpp/Numeric/Stat/Mva/PrincipalComponentAnalysis.h
index 6351f28..15ff923 100644
--- a/src/Bpp/Numeric/Stat/Mva/PrincipalComponentAnalysis.h
+++ b/src/Bpp/Numeric/Stat/Mva/PrincipalComponentAnalysis.h
@@ -83,8 +83,7 @@ public:
     bool centered = true,
     bool scaled = true,
     double tol = 0.0000001,
-    bool verbose = true)
-  throw (Exception);
+    bool verbose = true);
 
   /**
    * @brief Build a new PrincipalComponentAnalysis object and specify default row and column weights.
@@ -103,8 +102,7 @@ public:
     bool centered = true,
     bool scaled = true,
     double tol = 0.0000001,
-    bool verbose = true)
-  throw (Exception);
+    bool verbose = true);
 
   virtual ~PrincipalComponentAnalysis() {}
 
@@ -117,7 +115,7 @@ public:
    * @param matrix The input data (a Matrix) to center.
    * @param rowW A vector with row weights.
    */
-  static void center(Matrix<double>& matrix, const std::vector<double>& rowW) throw (Exception);
+  static void center(Matrix<double>& matrix, const std::vector<double>& rowW);
 
   /**
    * @brief This function allows to center an input matrix from its column means.
@@ -125,11 +123,11 @@ public:
    * @param matrix The input data (a Matrix) to center.
    * @param rowW A vector with row weights.
    */
-  static void scale(Matrix<double>& matrix, const std::vector<double>& rowW) throw (Exception);
+  static void scale(Matrix<double>& matrix, const std::vector<double>& rowW);
 
 public:
-  const std::vector<double>& getColumnMeans() const throw (Exception) { return columnMeans_; }
-  const std::vector<double>& getColumnSd() const throw (Exception) { return columnSd_; }
+  const std::vector<double>& getColumnMeans() const { return columnMeans_; }
+  const std::vector<double>& getColumnSd() const { return columnSd_; }
 };
 
 } // end of namespace bpp.
diff --git a/src/Bpp/Numeric/Table.h b/src/Bpp/Numeric/Table.h
index 1bbd2f8..e93225a 100644
--- a/src/Bpp/Numeric/Table.h
+++ b/src/Bpp/Numeric/Table.h
@@ -98,7 +98,7 @@ namespace bpp
      * @throw DuplicatedTableColumnNameException If colnames contains identical names.
      */
 
-    Table(const std::vector<std::string>& colNames) throw (DuplicatedTableColumnNameException) :
+    Table(const std::vector<std::string>& colNames) :
       nRow_(0),
       nCol_(colNames.size()),
       data_(colNames.size()),
@@ -178,7 +178,7 @@ namespace bpp
      * @throw IndexOutOfBoundsException If one of the index is greater or equal to the corresponding number of columns/rows.
      */
 
-    T& operator()(size_t rowIndex, size_t colIndex) throw (IndexOutOfBoundsException)
+    T& operator()(size_t rowIndex, size_t colIndex)
     {
       if (colIndex >= nCol_)
         throw IndexOutOfBoundsException("Table::operator(size_t, size_t).", colIndex, 0, nCol_ - 1);
@@ -194,7 +194,7 @@ namespace bpp
      * @throw IndexOutOfBoundsException If one of the index is greater or equal to the corresponding number of columns/rows.
      */
 
-    const T& operator()(size_t rowIndex, size_t colIndex) const throw (IndexOutOfBoundsException)
+    const T& operator()(size_t rowIndex, size_t colIndex) const
     {
       if (colIndex >= nCol_)
         throw IndexOutOfBoundsException("Table::operator(size_t, size_t).", colIndex, 0, nCol_ - 1);
@@ -213,7 +213,6 @@ namespace bpp
      */
 
     T& operator()(const std::string& rowName, const std::string& colName)
-      throw (NoTableRowNamesException, NoTableColumnNamesException, TableNameNotFoundException)
     {
       if (rowNames_.size() == 0)
         throw NoTableRowNamesException("Table::operator(const string &, const string &).");
@@ -241,7 +240,6 @@ namespace bpp
      * not match existing names.
      */
     const T& operator()(const std::string& rowName, const std::string& colName) const
-      throw (NoTableRowNamesException, NoTableColumnNamesException, TableNameNotFoundException)
     {
       if (rowNames_.size() == 0)
         throw NoTableRowNamesException("Table::operator(const string &, const string &).");
@@ -271,7 +269,6 @@ namespace bpp
      */
 
     T& operator()(const std::string& rowName, size_t colIndex)
-      throw (NoTableRowNamesException, TableNameNotFoundException, IndexOutOfBoundsException)
     {
       if (rowNames_.size() == 0)
         throw NoTableRowNamesException("Table::operator(const string &, size_t).");
@@ -299,7 +296,6 @@ namespace bpp
      */
 
     const T& operator()(const std::string& rowName, size_t colIndex) const
-      throw (NoTableRowNamesException, TableNameNotFoundException, IndexOutOfBoundsException)
     {
       if (rowNames_.size() == 0)
         throw NoTableRowNamesException("Table::operator(const string &, size_t).");
@@ -327,7 +323,6 @@ namespace bpp
      */
 
     T& operator()(size_t rowIndex, const std::string& colName)
-      throw (IndexOutOfBoundsException, NoTableColumnNamesException, TableNameNotFoundException)
     {
       if (colNames_.size() == 0)
         throw NoTableColumnNamesException("Table::operator(size_t, const string &).");
@@ -355,7 +350,6 @@ namespace bpp
      */
 
     const T& operator()(size_t rowIndex, const std::string& colName) const
-      throw (IndexOutOfBoundsException, NoTableColumnNamesException, TableNameNotFoundException)
     {
       if (colNames_.size() == 0)
         throw NoTableColumnNamesException("Table::operator(size_t, const string &).");
@@ -390,7 +384,7 @@ namespace bpp
      * @throw DimensionException If the number of names do not match the number of columns in the table.
      * @throw DuplicatedTableColumnNameException If names are not unique.
      */
-    void setColumnNames(const std::vector<std::string>& colNames) throw (DimensionException, DuplicatedTableColumnNameException)
+    void setColumnNames(const std::vector<std::string>& colNames)
     {
       if (!VectorTools::isUnique(colNames))
         throw DuplicatedTableColumnNameException("Table::setColumnNames(...). Column names must be unique.");
@@ -408,14 +402,14 @@ namespace bpp
      * @throw NoTableColumnNamesException If no column names are associated to this table.
      */
 
-    const std::vector<std::string>& getColumnNames() const throw (NoTableColumnNamesException)
+    const std::vector<std::string>& getColumnNames() const
     {
       if (colNames_.size() == 0)
         throw NoTableColumnNamesException("Table::getColumnNames().");
       return colNames_;
     }
 
-    std::vector<std::string>& getColumnNames() throw (NoTableColumnNamesException)
+    std::vector<std::string>& getColumnNames()
     {
       if (colNames_.size() == 0)
         throw NoTableColumnNamesException("Table::getColumnNames().");
@@ -430,7 +424,7 @@ namespace bpp
      * @throw NoTableColumnNamesException If no column names are associated to this table.
      * @throw IndexOutOfBoundsException If index is >= number of columns.
      */
-    std::string getColumnName(size_t index) const throw (NoTableColumnNamesException, IndexOutOfBoundsException)
+    std::string getColumnName(size_t index) const
     {
       if (colNames_.size() ==0)
         throw NoTableColumnNamesException("Table::getColumnName(size_t).");
@@ -476,7 +470,7 @@ namespace bpp
      * @throw NoTableColumnNamesException If no column names are associated to this table.
      * @throw TableColumnNameNotFoundException If colName do not match existing column names.
      */
-    std::vector<T>& getColumn(const std::string& colName) throw (NoTableColumnNamesException, TableColumnNameNotFoundException)
+    std::vector<T>& getColumn(const std::string& colName)
     {
       if (colNames_.size() == 0)
         throw NoTableColumnNamesException("Table::getColumn(const string &).");
@@ -497,7 +491,7 @@ namespace bpp
      * @throw NoTableColumnNamesException If no column names are associated to this table.
      * @throw TableColumnNameNotFoundException If colName do not match existing column names.
      */
-    const std::vector<T>& getColumn(const std::string& colName) const throw (NoTableColumnNamesException, TableColumnNameNotFoundException)
+    const std::vector<T>& getColumn(const std::string& colName) const
     {
       if (colNames_.size() == 0)
         throw NoTableColumnNamesException("Table::getColumn(const string &).");
@@ -538,7 +532,7 @@ namespace bpp
      * @param index The index of the column.
      * @throw IndexOutOfBoundsException If index is >= number of columns.
      */
-    void deleteColumn(size_t index) throw (IndexOutOfBoundsException)
+    void deleteColumn(size_t index)
     {
       if (index >= nCol_)
         throw IndexOutOfBoundsException("Table::deleteColumn(size_t).", index, 0, nCol_ - 1);
@@ -555,7 +549,7 @@ namespace bpp
  * @throw NoTableColumnNamesException If no column names are associated to this table.
  * @throw TableColumnNameNotFoundException If colName do not match existing column names.
  */
-    void deleteColumn(const std::string& colName) throw (NoTableColumnNamesException, TableColumnNameNotFoundException)
+    void deleteColumn(const std::string& colName)
     {
       if ((colNames_.size()==0))
         throw NoTableColumnNamesException("Table::deleteColumn(const string &).");
@@ -582,12 +576,12 @@ namespace bpp
      * @throw TableColumnNamesException If the table has row names.
      */
 
-    void addColumn(const std::vector<T>& newColumn, int pos=-1) throw (DimensionException, TableColumnNamesException)
+    void addColumn(const std::vector<T>& newColumn, int pos=-1)
     {
       if (pos>(int)nCol_)
         throw DimensionException("Table::addColumn.", pos, nCol_);
       if (pos==-1)
-        pos=nCol_;
+        pos=(int)nCol_;
 
       if (colNames_.size())
         throw TableColumnNamesException("Table::addColumn. Table has column names.");
@@ -609,7 +603,7 @@ namespace bpp
      * @throw DuplicatedTableColumnNameException If colName is already used.
      */
 
-    void addColumn(const std::string& colName, const std::vector<T>& newColumn, int pos=-1) throw (DimensionException, NoTableColumnNamesException, DuplicatedTableColumnNameException)
+    void addColumn(const std::string& colName, const std::vector<T>& newColumn, int pos=-1)
     {
       if (pos>(int)nCol_)
         throw DimensionException("Table::addColumn.", pos, nCol_);
@@ -636,7 +630,7 @@ namespace bpp
     /**
      * @brief Add a new column
      *
-     * @param stream the input stream
+     * @param st the input sting
      * @param sep The row delimiter
      * @param pos       The position optional (default : nb cols)
      * @param rowCol the indice of row where colnames are, starting
@@ -648,19 +642,19 @@ namespace bpp
       if (pos>(int)nCol_)
         throw DimensionException("Table::addColumn.", pos, nCol_);
       if (pos==-1)
-        pos=nCol_;
+        pos=(int)nCol_;
 
       StringTokenizer stok(st, sep, false, true);
       std::vector<std::string> row(stok.getTokens().begin(), stok.getTokens().end());
 
       if (row.size()!=nRow_+(rowCol>=0)?1:0)
-        throw BadIntegerException("Table::addColumn. Bad number of rows: ", row.size());
+        throw BadIntegerException("Table::addColumn. Bad number of rows: ", (int)row.size());
 
       std::vector<T> newColumn;
       
       for (size_t i=0; i<row.size(); i++)
       {
-        if (i==rowCol)
+        if ((int)i==rowCol)
         {
           std::string colName=row[i];
           if (find(colNames_.begin(), colNames_.end(), colName) != colNames_.end())
@@ -691,9 +685,9 @@ namespace bpp
      * @throw TableColumnNamesException If the table has row names.
      */
     
-    void setColumn(const std::vector<T>& newColumn, size_t pos) throw (DimensionException, TableColumnNamesException)
+    void setColumn(const std::vector<T>& newColumn, size_t pos)
     {
-      if (pos>=(int)nCol_)
+      if (pos>=nCol_)
         throw DimensionException("Table::setColumn.", pos, nCol_);
 
       if (newColumn.size() != nRow_)
@@ -712,7 +706,7 @@ namespace bpp
      * @throw NoTableColumnNamesException If the table does not have row names.
      * @throw DuplicatedTableColumnNameException If colName is already used.
      */
-    void setColumn(const std::string& colName, const std::vector<T>& newColumn, size_t pos) throw (DimensionException, NoTableColumnNamesException, DuplicatedTableColumnNameException)
+    void setColumn(const std::string& colName, const std::vector<T>& newColumn, size_t pos)
     {
       if (pos>=nCol_)
         throw DimensionException("Table::setColumn.", pos, nCol_);
@@ -751,7 +745,7 @@ namespace bpp
      * @throw DimensionException If the number of names do not match the number of rows in the table.
      * @throw DuplicatedTableRowNameException If names are not unique.
      */
-    void setRowNames(const std::vector<std::string>& rowNames) throw (DimensionException, DuplicatedTableRowNameException)
+    void setRowNames(const std::vector<std::string>& rowNames)
     { 
       if (!VectorTools::isUnique(rowNames))
       {
@@ -773,14 +767,14 @@ namespace bpp
      * @throw NoTableRowNamesException If no row names are associated to this table.
      */
     
-    std::vector<std::string> getRowNames() throw (NoTableRowNamesException)
+    std::vector<std::string> getRowNames()
     {
       if (rowNames_.size() == 0)
         throw NoTableRowNamesException("Table::getRowNames().");
       return rowNames_;
     }
 
-    const std::vector<std::string>& getRowNames() const throw (NoTableRowNamesException)
+    const std::vector<std::string>& getRowNames() const
     {
       if (rowNames_.size() == 0)
         throw NoTableRowNamesException("Table::getRowNames().");
@@ -815,7 +809,7 @@ namespace bpp
      * @throw NoTableRowNamesException If no row names are associated to this table.
      * @throw IndexOutOfBoundsException If index is >= number of rows.
      */
-    std::string getRowName(size_t index) const throw (NoTableRowNamesException, IndexOutOfBoundsException)
+    std::string getRowName(size_t index) const
     {
       if (rowNames_.size() == 0)
         throw NoTableRowNamesException("Table::getRowName(size_t).");
@@ -835,7 +829,7 @@ namespace bpp
      * @param index The index of the row.
      * @throw IndexOutOfBoundsException If index is >= number of rows.
      */
-    std::vector<T> getRow(size_t index) const throw (IndexOutOfBoundsException)
+    std::vector<T> getRow(size_t index) const
     {
       if (index >= nRow_)
         throw IndexOutOfBoundsException("Table::getRow(size_t).", index, 0, nRow_ - 1);
@@ -854,7 +848,7 @@ namespace bpp
      * @throw NoTableRowNamesException If no row names are associated to this table.
      * @throw TableRowNameNotFoundException If rowName do not match existing row names.
      */
-    std::vector<T> getRow(const std::string& rowName) const throw (NoTableRowNamesException, TableRowNameNotFoundException)
+    std::vector<T> getRow(const std::string& rowName) const
     {
       if ((rowNames_.size()==0))
         throw NoTableRowNamesException("Table::getRow(const string &).");
@@ -881,7 +875,7 @@ namespace bpp
      * @param index The index of the row.
      * @throw IndexOutOfBoundsException If index is >= number of row.
      */
-    void deleteRow(size_t index) throw (IndexOutOfBoundsException)
+    void deleteRow(size_t index)
     {
       for (size_t j = 0; j < nCol_; j++)
       {
@@ -903,7 +897,7 @@ namespace bpp
      * @throw IndexOutOfBoundsException If index is >= number of row.
      */
     
-    void deleteRows(size_t index, size_t len) throw (IndexOutOfBoundsException)
+    void deleteRows(size_t index, size_t len)
     {
       for (size_t j = 0; j < nCol_; j++)
       {
@@ -925,7 +919,7 @@ namespace bpp
      * @throw NoTableRowNamesException If no row names are associated to this table.
      * @throw TableRowNameNotFoundException If rowName do not match existing column names.
      */
-    void deleteRow(const std::string& rowName) throw (NoTableRowNamesException, TableRowNameNotFoundException)
+    void deleteRow(const std::string& rowName)
     {
       if ((rowNames_.size()==0))
         throw NoTableRowNamesException("Table::deleteRow(const string &).");
@@ -1009,7 +1003,7 @@ namespace bpp
     /**
      * @brief Add a new row.
      *
-     * @param stream the input stream
+     * @param st the input string
      * @param sep The column delimiter
      * @param pos       The position optional (default : nb rows)
      * @param rowCol the indice of column where rownames are, starting
@@ -1021,19 +1015,19 @@ namespace bpp
       if (pos>(int)nRow_)
         throw DimensionException("Table::addRow.", pos, nRow_);
       if (pos==-1)
-        pos=nRow_;
+        pos=(int)nRow_;
 
       StringTokenizer stok(st, sep, false, true);
       std::vector<std::string> row(stok.getTokens().begin(), stok.getTokens().end());
 
       if (row.size()!=nCol_+(rowCol>=0)?1:0)
-        throw BadIntegerException("Table::addRow. Bad number of columns: ", row.size());
+        throw BadIntegerException("Table::addRow. Bad number of columns: ", (int)row.size());
 
       size_t id=0;
       
       for (size_t i=0; i<row.size(); i++)
       {
-        if (i==rowCol)
+        if ((int)i==rowCol)
         {
           std::string rowName=row[i];
           if (find(rowNames_.begin(), rowNames_.end(), rowName) != rowNames_.end())
@@ -1145,7 +1139,7 @@ namespace bpp
 
       bool frontNames=((byRow && data.hasRowNames()) || (!byRow && data.hasColumnNames()));
 
-      if (byRow && data.hasColumnNames() || (!byRow && data.hasRowNames()))
+      if ((byRow && data.hasColumnNames()) || (!byRow && data.hasRowNames()))
       { // Write header
         std::vector<std::string> names = (byRow?data.getColumnNames():data.getRowNames());
         
diff --git a/src/Bpp/Numeric/TableExceptions.h b/src/Bpp/Numeric/TableExceptions.h
index 51c586c..7be1958 100644
--- a/src/Bpp/Numeric/TableExceptions.h
+++ b/src/Bpp/Numeric/TableExceptions.h
@@ -65,7 +65,7 @@ namespace bpp
   public:
     TableNameNotFoundException(const std::string & text, const std::string & name) :
       Exception("TableNameNotFoundException: " + name + ". " + text), _name(name) {}
-    virtual ~TableNameNotFoundException() throw() {}
+    virtual ~TableNameNotFoundException() {}
 
   public:
     std::string getName() const { return _name; }		
@@ -80,7 +80,7 @@ namespace bpp
   public:
     TableRowNameNotFoundException(const std::string & text, const std::string & name) :
       TableNameNotFoundException("TableRowNameNotFoundException: " + name + ". " + text, name) {}
-    virtual ~TableRowNameNotFoundException() throw() {}
+    virtual ~TableRowNameNotFoundException() {}
   };
 
 /**
@@ -92,7 +92,7 @@ namespace bpp
   public:
     TableColumnNameNotFoundException(const std::string & text, const std::string & name) :
       TableNameNotFoundException("TableColumnNameNotFoundException: " + name + ". " + text, name) {}
-    virtual ~TableColumnNameNotFoundException() throw() {}
+    virtual ~TableColumnNameNotFoundException() {}
   };
 
 /**
@@ -105,7 +105,7 @@ namespace bpp
   public:
     NoTableRowNamesException(const std::string & text) :
       Exception("NoTableRowNamesException: "+text) {}
-    virtual ~NoTableRowNamesException() throw() {}
+    virtual ~NoTableRowNamesException() {}
   };
 
 /**
@@ -118,7 +118,7 @@ namespace bpp
   public:
     NoTableColumnNamesException(const std::string & text) :
       Exception("NoTableColumnNamesException: "+text) {}
-    virtual ~NoTableColumnNamesException() throw() {}
+    virtual ~NoTableColumnNamesException() {}
   };
 
 /**
@@ -130,7 +130,7 @@ namespace bpp
   public:
     TableRowNamesException(const std::string & text) :
       Exception("TableRowNamesException: "+text) {}
-    virtual ~TableRowNamesException() throw() {}
+    virtual ~TableRowNamesException() {}
   };
 
 /**
@@ -142,7 +142,7 @@ namespace bpp
   public:
     TableColumnNamesException(const std::string & text) :
       Exception("TableColumnNamesException: "+text) {}
-    virtual ~TableColumnNamesException() throw() {}
+    virtual ~TableColumnNamesException() {}
   };
 
 /**
@@ -154,7 +154,7 @@ namespace bpp
   public:
     DuplicatedTableRowNameException(const std::string & text) :
       Exception("DuplicatedTableRowNameException: "+text) {}
-    virtual ~DuplicatedTableRowNameException() throw() {}
+    virtual ~DuplicatedTableRowNameException() {}
   };
 
 /**
@@ -166,7 +166,7 @@ namespace bpp
   public:
     DuplicatedTableColumnNameException(const std::string & text) :
       Exception("DuplicatedTableColumnNameException: "+text) {}
-    virtual ~DuplicatedTableColumnNameException() throw() {}
+    virtual ~DuplicatedTableColumnNameException() {}
   };
 
 } //end of namespace bpp.
diff --git a/src/Bpp/Numeric/TransformedParameter.h b/src/Bpp/Numeric/TransformedParameter.h
index 88ae8e7..9f11c25 100644
--- a/src/Bpp/Numeric/TransformedParameter.h
+++ b/src/Bpp/Numeric/TransformedParameter.h
@@ -72,7 +72,7 @@ class TransformedParameter:
      * @param value Parameter value in original coordinates.
      * @throw ConstraintException if the value is not correct.
      */
-    virtual void setOriginalValue(double value) throw (ConstraintException) = 0;
+    virtual void setOriginalValue(double value) = 0;
 
     /**
      * @return The current value of the parameter in orignal coordinates.
@@ -84,14 +84,14 @@ class TransformedParameter:
      * @throw NotImplementedException if the transformation does not support derivation
      * or if the derivation was not implemented.
      */
-    virtual double getFirstOrderDerivative() const throw (NotImplementedException) = 0;
+    virtual double getFirstOrderDerivative() const = 0;
     
     /**
      * @return The second order derivative of the transformation at the original point.
      * @throw NotImplementedException if the transformation does not support derivation
      * or if the derivation was not implemented.
      */
-    virtual double getSecondOrderDerivative() const throw (NotImplementedException) = 0;
+    virtual double getSecondOrderDerivative() const = 0;
 };
 
 /**
@@ -144,7 +144,7 @@ class RTransformedParameter:
     RTransformedParameter* clone() const { return new RTransformedParameter(*this); }
 
   public:
-    void setOriginalValue(double value) throw (ConstraintException) 
+    void setOriginalValue(double value) 
     {
       if (positive_ ? value <= bound_ : value >= bound_) throw ConstraintException("RTransformedParameter::setValue", this, value);
       if (positive_  & (value < 1 + bound_)) setValue(log(scale_ * (value - bound_)));
@@ -164,7 +164,7 @@ class RTransformedParameter:
         else      return - x / scale_ - 1. + bound_;
     }
 
-    double getFirstOrderDerivative() const throw (NotImplementedException)
+    double getFirstOrderDerivative() const
     {
       double x = getValue();
       if (positive_)
@@ -175,7 +175,7 @@ class RTransformedParameter:
         else      return - 1. / scale_;
     }
 
-    double getSecondOrderDerivative() const throw (NotImplementedException)
+    double getSecondOrderDerivative() const
     {
       double x = getValue();
       if (positive_)
@@ -237,7 +237,7 @@ class IntervalTransformedParameter:
     IntervalTransformedParameter* clone() const { return new IntervalTransformedParameter(*this); }
 
   public:
-    void setOriginalValue(double value) throw (ConstraintException) 
+    void setOriginalValue(double value) 
     {
       if (value <= lowerBound_ || value >= upperBound_) throw ConstraintException("IntervalTransformedParameter::setValue", this, value);
       setValue(hyper_ ?
@@ -255,7 +255,7 @@ class IntervalTransformedParameter:
     }
 
 
-    double getFirstOrderDerivative() const throw (NotImplementedException)
+    double getFirstOrderDerivative() const
     {
       double x = getValue();
       double x2 = hyper_ ?
@@ -263,7 +263,7 @@ class IntervalTransformedParameter:
         (upperBound_ - lowerBound_) / (NumConstants::PI() * scale_ * (pow(x / scale_, 2) + 1.));
       return x2;
     }
-    double getSecondOrderDerivative() const throw (NotImplementedException)
+    double getSecondOrderDerivative() const
     {
       double x = getValue();
       double x2 = hyper_ ?
@@ -290,7 +290,7 @@ class PlaceboTransformedParameter:
     PlaceboTransformedParameter* clone() const { return new PlaceboTransformedParameter(*this); }
 
   public:
-    void setOriginalValue(double value) throw (ConstraintException) 
+    void setOriginalValue(double value) 
     {
       setValue(value);
     }
@@ -300,9 +300,9 @@ class PlaceboTransformedParameter:
       return getValue();
     }
     
-    double getFirstOrderDerivative() const throw (NotImplementedException) { return 1.; }
+    double getFirstOrderDerivative() const { return 1.; }
     
-    double getSecondOrderDerivative() const throw (NotImplementedException) { return 0.; }
+    double getSecondOrderDerivative() const { return 0.; }
 };
 
 
diff --git a/src/Bpp/Numeric/VectorExceptions.h b/src/Bpp/Numeric/VectorExceptions.h
index b3fe62a..d4e969b 100644
--- a/src/Bpp/Numeric/VectorExceptions.h
+++ b/src/Bpp/Numeric/VectorExceptions.h
@@ -1,155 +1,117 @@
 //
 // File: VectorExceptions.h
-// Created by: Julien Dutheil
-// Created on: 2003
+// Authors:
+//   Julien Dutheil
+//   Francois Gindraud (2017)
+// Created: 2003-06-26 00:00:00
+// Last modified: 2017-06-27
 //
 
 /*
-Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
-
-This software is a computer program whose purpose is to provide classes
-for numerical calculus.
-
-This software is governed by the CeCILL  license under French law and
-abiding by the rules of distribution of free software.  You can  use, 
-modify and/ or redistribute the software under the terms of the CeCILL
-license as circulated by CEA, CNRS and INRIA at the following URL
-"http://www.cecill.info". 
-
-As a counterpart to the access to the source code and  rights to copy,
-modify and redistribute granted by the license, users are provided only
-with a limited warranty  and the software's author,  the holder of the
-economic rights,  and the successive licensors  have only  limited
-liability. 
-
-In this respect, the user's attention is drawn to the risks associated
-with loading,  using,  modifying and/or developing or reproducing the
-software by the user in light of its specific status of free software,
-that may mean  that it is complicated to manipulate,  and  that  also
-therefore means  that it is reserved for developers  and  experienced
-professionals having in-depth computer knowledge. Users are therefore
-encouraged to load and test the software's suitability as regards their
-requirements in conditions enabling the security of their systems and/or 
-data to be ensured and,  more generally, to use and operate it in the 
-same conditions as regards security. 
-
-The fact that you are presently reading this means that you have had
-knowledge of the CeCILL license and that you accept its terms.
+  Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
+  
+  This software is a computer program whose purpose is to provide classes
+  for numerical calculus.
+  
+  This software is governed by the CeCILL license under French law and
+  abiding by the rules of distribution of free software. You can use,
+  modify and/ or redistribute the software under the terms of the CeCILL
+  license as circulated by CEA, CNRS and INRIA at the following URL
+  "http://www.cecill.info".
+  
+  As a counterpart to the access to the source code and rights to copy,
+  modify and redistribute granted by the license, users are provided only
+  with a limited warranty and the software's author, the holder of the
+  economic rights, and the successive licensors have only limited
+  liability.
+  
+  In this respect, the user's attention is drawn to the risks associated
+  with loading, using, modifying and/or developing or reproducing the
+  software by the user in light of its specific status of free software,
+  that may mean that it is complicated to manipulate, and that also
+  therefore means that it is reserved for developers and experienced
+  professionals having in-depth computer knowledge. Users are therefore
+  encouraged to load and test the software's suitability as regards their
+  requirements in conditions enabling the security of their systems and/or
+  data to be ensured and, more generally, to use and operate it in the
+  same conditions as regards security.
+  
+  The fact that you are presently reading this means that you have had
+  knowledge of the CeCILL license and that you accept its terms.
 */
 
-#ifndef _VECTOREXCEPTIONS_H_
-#define _VECTOREXCEPTIONS_H_
-
-#include "../Exceptions.h"
-#include "../Text/TextTools.h"
+#ifndef BPP_NUMERIC_VECTOREXCEPTIONS_H
+#define BPP_NUMERIC_VECTOREXCEPTIONS_H
 
-//From the STL/
 #include <string>
 #include <vector>
 
-namespace bpp
-{
-
-/**
- * @brief General Exception dealing with vectors.
- */
-template<class T>
-class VectorException :
-  public Exception
-{
-
-	protected:
-		const std::vector<T> * vect_;
-			
-	public:
-		VectorException(const std::string& text, const std::vector<T>* vect = 0) :
-			Exception("VectorException: " + text),
-			vect_(vect) {};
-
-    VectorException(const VectorException& ve): Exception(ve), vect_(ve.vect_) {}
-    VectorException& operator=(const VectorException& ve)
-    {
-      Exception::operator=(ve);
-      vect_ = ve.vect_;
-      return *this;
-    }
-	
-		virtual ~VectorException() throw () {};
-		
-	public:
-		virtual const std::vector<T>* getVector() const { return vect_; }
-};
-
-/**
- * @brief Exception thrown when an empty vector was found.
- */
-template<class T>
-class EmptyVectorException :
-  public VectorException<T>
-{
-
-	public:
-		EmptyVectorException(const std::string& text, const std::vector<T>* vect = 0) :
-			VectorException<T>("EmptyVectorException: " + text, vect) {};
-	
-		virtual ~EmptyVectorException() throw () {}
-};
-
-/**
- * @brief Exception thrown when a dimension problem occured.
- */
-class DimensionException :
-  public Exception
-{
-	private:
-		size_t dimension_;
-		size_t correctDimension_; 
-			
-	public:
-		DimensionException(const std::string& text, size_t dimension, size_t correctDimension) :
-		    Exception("DimensionException (found " + TextTools::toString(dimension) + ", should be " + TextTools::toString(correctDimension) + ") " + text),
-        dimension_(dimension),
-        correctDimension_(correctDimension) {};
-	
-		virtual ~DimensionException() throw () {}
-
-	public:
-		virtual size_t getDimension() const { return dimension_; }
-		virtual size_t getCorrectDimension() const { return correctDimension_; }
-};
+#include "../Exceptions.h"
 
-/**
- * @brief Exception thrown when a given element was not found in the vector.
- */
-template<class T> class ElementNotFoundException :
-  public VectorException<T>
+namespace bpp
 {
-
-	private:
-		const T* element_;
-			
-	public:
-		ElementNotFoundException(const std::string& text, const std::vector<T>* vect = 0, const T* element = 0) :
-			VectorException<T>("ElementNotFoundException: " + text, vect),
-			element_(element) {};
-
-    ElementNotFoundException(const ElementNotFoundException& enfe):
-      VectorException<T>(enfe), element_(enfe.element_) {}
-    
-    ElementNotFoundException& operator=(const ElementNotFoundException& enfe)
+  /// General Exception dealing with vectors.
+  template <class T>
+  class VectorException : public Exception
+  {
+  protected:
+    const std::vector<T>* vect_;
+
+  public:
+    VectorException(const std::string& text, const std::vector<T>* vect = nullptr)
+      : Exception("VectorException: " + text)
+      , vect_(vect){};
+    VectorException(const VectorException&) = default;
+    VectorException& operator=(const VectorException&) = default;
+
+    const std::vector<T>* getVector() const { return vect_; }
+  };
+
+  /// Exception thrown when an empty vector was found.
+  template <class T>
+  class EmptyVectorException : public VectorException<T>
+  {
+  public:
+    EmptyVectorException(const std::string& text, const std::vector<T>* vect = nullptr)
+      : VectorException<T>("EmptyVectorException: " + text, vect){};
+  };
+
+  /// Exception thrown when a dimension problem occured.
+  class DimensionException : public Exception
+  {
+  private:
+    std::size_t dimension_;
+    std::size_t correctDimension_;
+
+  public:
+    DimensionException(const std::string& text, size_t dimension, size_t correctDimension)
+      : Exception("DimensionException (found " + std::to_string(dimension) + ", should be " +
+                  std::to_string(correctDimension) + ") " + text)
+      , dimension_(dimension)
+      , correctDimension_(correctDimension){};
+
+    size_t getDimension() const { return dimension_; }
+    size_t getCorrectDimension() const { return correctDimension_; }
+  };
+
+  /// Exception thrown when a given element was not found in the vector.
+  template <class T>
+  class ElementNotFoundException : public VectorException<T>
+  {
+  private:
+    const T* element_;
+
+  public:
+    ElementNotFoundException(const std::string& text, const std::vector<T>* vect = nullptr, const T* element = nullptr)
+      : VectorException<T>("ElementNotFoundException: " + text, vect)
+      , element_(element)
     {
-      VectorException<T>::operator=(enfe);
-      element_ = enfe.element_;
-      return *this;
     }
+    ElementNotFoundException(const ElementNotFoundException&) = default;
+    ElementNotFoundException& operator=(const ElementNotFoundException&) = default;
 
-		virtual ~ElementNotFoundException() throw () {};
-		
-	public:
-		virtual const T* getElement() const { return element_; }
-};
-
-} //end of namespace bpp.
-
-#endif //_VECTOREXCEPTIONS_H_
+    const T* getElement() const { return element_; }
+  };
 
+} // end of namespace bpp.
+#endif // BPP_NUMERIC_VECTOREXCEPTIONS_H
diff --git a/src/Bpp/Numeric/VectorTools.h b/src/Bpp/Numeric/VectorTools.h
index 8bc62df..5a45edc 100644
--- a/src/Bpp/Numeric/VectorTools.h
+++ b/src/Bpp/Numeric/VectorTools.h
@@ -5,37 +5,37 @@
 //
 
 /*
-   Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
-
-   This software is a computer program whose purpose is to provide classes
-   for numerical calculus.
-
-   This software is governed by the CeCILL  license under French law and
-   abiding by the rules of distribution of free software.  You can  use,
-   modify and/ or redistribute the software under the terms of the CeCILL
-   license as circulated by CEA, CNRS and INRIA at the following URL
-   "http://www.cecill.info".
-
-   As a counterpart to the access to the source code and  rights to copy,
-   modify and redistribute granted by the license, users are provided only
-   with a limited warranty  and the software's author,  the holder of the
-   economic rights,  and the successive licensors  have only  limited
-   liability.
-
-   In this respect, the user's attention is drawn to the risks associated
-   with loading,  using,  modifying and/or developing or reproducing the
-   software by the user in light of its specific status of free software,
-   that may mean  that it is complicated to manipulate,  and  that  also
-   therefore means  that it is reserved for developers  and  experienced
-   professionals having in-depth computer knowledge. Users are therefore
-   encouraged to load and test the software's suitability as regards their
-   requirements in conditions enabling the security of their systems and/or
-   data to be ensured and,  more generally, to use and operate it in the
-   same conditions as regards security.
-
-   The fact that you are presently reading this means that you have had
-   knowledge of the CeCILL license and that you accept its terms.
- */
+  Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
+
+  This software is a computer program whose purpose is to provide classes
+  for numerical calculus.
+
+  This software is governed by the CeCILL  license under French law and
+  abiding by the rules of distribution of free software.  You can  use,
+  modify and/ or redistribute the software under the terms of the CeCILL
+  license as circulated by CEA, CNRS and INRIA at the following URL
+  "http://www.cecill.info".
+
+  As a counterpart to the access to the source code and  rights to copy,
+  modify and redistribute granted by the license, users are provided only
+  with a limited warranty  and the software's author,  the holder of the
+  economic rights,  and the successive licensors  have only  limited
+  liability.
+
+  In this respect, the user's attention is drawn to the risks associated
+  with loading,  using,  modifying and/or developing or reproducing the
+  software by the user in light of its specific status of free software,
+  that may mean  that it is complicated to manipulate,  and  that  also
+  therefore means  that it is reserved for developers  and  experienced
+  professionals having in-depth computer knowledge. Users are therefore
+  encouraged to load and test the software's suitability as regards their
+  requirements in conditions enabling the security of their systems and/or
+  data to be ensured and,  more generally, to use and operate it in the
+  same conditions as regards security.
+
+  The fact that you are presently reading this means that you have had
+  knowledge of the CeCILL license and that you accept its terms.
+*/
 
 #ifndef _VECTORTOOLS_H_
 #define _VECTORTOOLS_H_
@@ -56,1951 +56,1971 @@
 
 namespace bpp
 {
-typedef std::vector<std::complex<double> > Vcomplex;
-typedef std::vector<Vcomplex> VVcomplex;
-typedef std::vector<VVcomplex> VVVcomplex;
-
-typedef std::vector<std::complex<long double> > Vlcomplex;
-typedef std::vector<Vlcomplex> VVlcomplex;
-typedef std::vector<VVlcomplex> VVVlcomplex;
-
-typedef std::vector<double> Vdouble;
-typedef std::vector<Vdouble> VVdouble;
-typedef std::vector<VVdouble> VVVdouble;
-typedef std::vector<VVVdouble> VVVVdouble;
-
-typedef std::vector<long double> Vldouble;
-typedef std::vector<Vldouble> VVldouble;
-typedef std::vector<VVldouble> VVVldouble;
-typedef std::vector<VVVldouble> VVVVldouble;
-
-typedef std::vector<int> Vint;
-typedef std::vector<Vint> VVint;
-typedef std::vector<VVint> VVVint;
-typedef std::vector<VVVint> VVVVint;
-
-typedef std::vector<unsigned int> Vuint;
-typedef std::vector<Vint> VVuint;
-typedef std::vector<VVint> VVVuint;
-typedef std::vector<VVVint> VVVVuint;
+  typedef std::vector<std::complex<double> > Vcomplex;
+  typedef std::vector<Vcomplex> VVcomplex;
+  typedef std::vector<VVcomplex> VVVcomplex;
+
+  typedef std::vector<std::complex<long double> > Vlcomplex;
+  typedef std::vector<Vlcomplex> VVlcomplex;
+  typedef std::vector<VVlcomplex> VVVlcomplex;
+
+  typedef std::vector<double> Vdouble;
+  typedef std::vector<Vdouble> VVdouble;
+  typedef std::vector<VVdouble> VVVdouble;
+  typedef std::vector<VVVdouble> VVVVdouble;
+
+  typedef std::vector<long double> Vldouble;
+  typedef std::vector<Vldouble> VVldouble;
+  typedef std::vector<VVldouble> VVVldouble;
+  typedef std::vector<VVVldouble> VVVVldouble;
+
+  typedef std::vector<int> Vint;
+  typedef std::vector<Vint> VVint;
+  typedef std::vector<VVint> VVVint;
+  typedef std::vector<VVVint> VVVVint;
+
+  typedef std::vector<unsigned int> Vuint;
+  typedef std::vector<Vuint> VVuint;
+  typedef std::vector<VVuint> VVVuint;
+  typedef std::vector<VVVuint> VVVVuint;
 
 /**
  * @name Element-wise operations.
  * @{
  */
 
-template<class T>
-std::vector<T>  operator+(const std::vector<T>& v1, const std::vector<T>& v2) throw (DimensionException)
-{
-  size_t size;
-  if (v1.size() != v2.size())
-  {
-    throw DimensionException("VectorTools::operator+", v1.size(), v2.size());
-  }
-  else
-  {
-    size = v1.size();
-  }
-  std::vector<T> result(size);
-  for (size_t i = 0; i < size; i++)
+  template<class T>
+  std::vector<T>  operator+(const std::vector<T>& v1, const std::vector<T>& v2) throw (DimensionException)
   {
-    result[i] = v1[i] + v2[i];
+    size_t size;
+    if (v1.size() != v2.size())
+    {
+      throw DimensionException("VectorTools::operator+", v1.size(), v2.size());
+    }
+    else
+    {
+      size = v1.size();
+    }
+    std::vector<T> result(size);
+    for (size_t i = 0; i < size; i++)
+    {
+      result[i] = v1[i] + v2[i];
+    }
+    return result;
   }
-  return result;
-}
 
-template<class T>
-std::vector<T> operator-(const std::vector<T>& v1, const std::vector<T>& v2) throw (DimensionException)
-{
-  size_t size;
-  if (v1.size() != v2.size())
-  {
-    throw DimensionException("VectorTools::operator-", v1.size(), v2.size());
-  }
-  else
-  {
-    size = v1.size();
-  }
-  std::vector<T> result(size);
-  for (size_t i = 0; i < size; i++)
+  template<class T>
+  std::vector<T> operator-(const std::vector<T>& v1, const std::vector<T>& v2) throw (DimensionException)
   {
-    result[i] = v1[i] - v2[i];
+    size_t size;
+    if (v1.size() != v2.size())
+    {
+      throw DimensionException("VectorTools::operator-", v1.size(), v2.size());
+    }
+    else
+    {
+      size = v1.size();
+    }
+    std::vector<T> result(size);
+    for (size_t i = 0; i < size; i++)
+    {
+      result[i] = v1[i] - v2[i];
+    }
+    return result;
   }
-  return result;
-}
 
-template<class T>
-std::vector<T> operator*(const std::vector<T>& v1, const std::vector<T>& v2) throw (DimensionException)
-{
-  size_t size;
-  if (v1.size() != v2.size())
-  {
-    throw DimensionException("VectorTools::operator*", v1.size(), v2.size());
-  }
-  else
-  {
-    size = v1.size();
-  }
-  std::vector<T> result(size);
-  for (size_t i = 0; i < size; i++)
+  template<class T>
+  std::vector<T> operator*(const std::vector<T>& v1, const std::vector<T>& v2) throw (DimensionException)
   {
-    result[i] = v1[i] * v2[i];
+    size_t size;
+    if (v1.size() != v2.size())
+    {
+      throw DimensionException("VectorTools::operator*", v1.size(), v2.size());
+    }
+    else
+    {
+      size = v1.size();
+    }
+    std::vector<T> result(size);
+    for (size_t i = 0; i < size; i++)
+    {
+      result[i] = v1[i] * v2[i];
+    }
+    return result;
   }
-  return result;
-}
 
-template<class T>
-std::vector<T> operator/(const std::vector<T>& v1, const std::vector<T>& v2) throw (DimensionException)
-{
-  size_t size;
-  if (v1.size() != v2.size())
-  {
-    throw DimensionException("VectorTools::operator/", v1.size(), v2.size());
-  }
-  else
-  {
-    size = v1.size();
-  }
-  std::vector<T> result(size);
-  for (size_t i = 0; i < size; i++)
+  template<class T>
+  std::vector<T> operator/(const std::vector<T>& v1, const std::vector<T>& v2) throw (DimensionException)
   {
-    result[i] = v1[i] / v2[i];
+    size_t size;
+    if (v1.size() != v2.size())
+    {
+      throw DimensionException("VectorTools::operator/", v1.size(), v2.size());
+    }
+    else
+    {
+      size = v1.size();
+    }
+    std::vector<T> result(size);
+    for (size_t i = 0; i < size; i++)
+    {
+      result[i] = v1[i] / v2[i];
+    }
+    return result;
   }
-  return result;
-}
 
 
-template<class T, class C>
-std::vector<T> operator+(const std::vector<T>& v1, const C& c)
-{
-  std::vector<T> result(v1.size());
-  for (size_t i = 0; i < result.size(); i++)
+  template<class T, class C>
+  std::vector<T> operator+(const std::vector<T>& v1, const C& c)
   {
-    result[i] = v1[i] + c;
+    std::vector<T> result(v1.size());
+    for (size_t i = 0; i < result.size(); i++)
+    {
+      result[i] = v1[i] + c;
+    }
+    return result;
   }
-  return result;
-}
-template<class T, class C>
-std::vector<T> operator+(const C& c, const std::vector<T>& v1)
-{
-  std::vector<T> result(v1.size());
-  for (size_t i = 0; i < result.size(); i++)
+  template<class T, class C>
+  std::vector<T> operator+(const C& c, const std::vector<T>& v1)
   {
-    result[i] = c + v1[i];
+    std::vector<T> result(v1.size());
+    for (size_t i = 0; i < result.size(); i++)
+    {
+      result[i] = c + v1[i];
+    }
+    return result;
   }
-  return result;
-}
 
-template<class T, class C>
-std::vector<T> operator-(const std::vector<T>& v1, const C& c)
-{
-  std::vector<T> result(v1.size());
-  for (size_t i = 0; i < result.size(); i++)
+  template<class T, class C>
+  std::vector<T> operator-(const std::vector<T>& v1, const C& c)
   {
-    result[i] = v1[i] - c;
+    std::vector<T> result(v1.size());
+    for (size_t i = 0; i < result.size(); i++)
+    {
+      result[i] = v1[i] - c;
+    }
+    return result;
   }
-  return result;
-}
-template<class T, class C>
-std::vector<T> operator-(const C& c, const std::vector<T>& v1)
-{
-  std::vector<T> result(v1.size());
-  for (size_t i = 0; i < result.size(); i++)
+  template<class T, class C>
+  std::vector<T> operator-(const C& c, const std::vector<T>& v1)
   {
-    result[i] = c - v1[i];
+    std::vector<T> result(v1.size());
+    for (size_t i = 0; i < result.size(); i++)
+    {
+      result[i] = c - v1[i];
+    }
+    return result;
   }
-  return result;
-}
 
-template<class T, class C>
-std::vector<T> operator*(const std::vector<T>& v1, const C& c)
-{
-  std::vector<T> result(v1.size());
-  for (size_t i = 0; i < result.size(); i++)
+  template<class T, class C>
+  std::vector<T> operator*(const std::vector<T>& v1, const C& c)
   {
-    result[i] = v1[i] * c;
+    std::vector<T> result(v1.size());
+    for (size_t i = 0; i < result.size(); i++)
+    {
+      result[i] = v1[i] * c;
+    }
+    return result;
   }
-  return result;
-}
-template<class T, class C>
-std::vector<T> operator*(const C& c, const std::vector<T>& v1)
-{
-  std::vector<T> result(v1.size());
-  for (size_t i = 0; i < result.size(); i++)
+  template<class T, class C>
+  std::vector<T> operator*(const C& c, const std::vector<T>& v1)
   {
-    result[i] = c * v1[i];
+    std::vector<T> result(v1.size());
+    for (size_t i = 0; i < result.size(); i++)
+    {
+      result[i] = c * v1[i];
+    }
+    return result;
   }
-  return result;
-}
 
-template<class T, class C>
-std::vector<T> operator/(const std::vector<T>& v1, const C& c)
-{
-  std::vector<T> result(v1.size());
-  for (size_t i = 0; i < result.size(); i++)
+  template<class T, class C>
+  std::vector<T> operator/(const std::vector<T>& v1, const C& c)
   {
-    result[i] = v1[i] / c;
+    std::vector<T> result(v1.size());
+    for (size_t i = 0; i < result.size(); i++)
+    {
+      result[i] = v1[i] / c;
+    }
+    return result;
   }
-  return result;
-}
-template<class T, class C>
-std::vector<T> operator/(const C& c, const std::vector<T>& v1)
-{
-  std::vector<T> result(v1.size());
-  for (size_t i = 0; i < result.size(); i++)
+  template<class T, class C>
+  std::vector<T> operator/(const C& c, const std::vector<T>& v1)
   {
-    result[i] = c / v1[i];
+    std::vector<T> result(v1.size());
+    for (size_t i = 0; i < result.size(); i++)
+    {
+      result[i] = c / v1[i];
+    }
+    return result;
   }
-  return result;
-}
-
 
-template<class T>
-void operator+=(std::vector<T>& v1, const std::vector<T>& v2) throw (DimensionException)
-{
-  for (size_t i = 0; i < v1.size(); i++)
+  template<class T>
+  void operator+=(std::vector<T>& v1, const std::vector<T>& v2) throw (DimensionException)
   {
-    v1[i] += v2[i];
+    for (size_t i = 0; i < v1.size(); i++)
+    {
+      v1[i] += v2[i];
+    }
   }
-}
 
-template<class T>
-void operator-=(std::vector<T>& v1, const std::vector<T>& v2) throw (DimensionException)
-{
-  for (size_t i = 0; i < v1.size(); i++)
+  template<class T>
+  void operator-=(std::vector<T>& v1, const std::vector<T>& v2) throw (DimensionException)
   {
-    v1[i] -= v2[i];
+    for (size_t i = 0; i < v1.size(); i++)
+    {
+      v1[i] -= v2[i];
+    }
   }
-}
 
-template<class T>
-void operator*=(std::vector<T>& v1, const std::vector<T>& v2) throw (DimensionException)
-{
-  for (size_t i = 0; i < v1.size(); i++)
+  template<class T>
+  void operator*=(std::vector<T>& v1, const std::vector<T>& v2) throw (DimensionException)
   {
-    v1[i] *= v2[i];
+    for (size_t i = 0; i < v1.size(); i++)
+    {
+      v1[i] *= v2[i];
+    }
   }
-}
 
-template<class T>
-void operator/=(std::vector<T>& v1, const std::vector<T>& v2) throw (DimensionException)
-{
-  for (size_t i = 0; i < v1.size(); i++)
+  template<class T>
+  void operator/=(std::vector<T>& v1, const std::vector<T>& v2) throw (DimensionException)
   {
-    v1[i] /= v2[i];
+    for (size_t i = 0; i < v1.size(); i++)
+    {
+      v1[i] /= v2[i];
+    }
   }
-}
 
-template<class T, class C>
-void operator&=(std::vector<T>& v1, const C& c)
-{
-  for (size_t i = 0; i < v1.size(); i++)
+  template<class T, class C>
+  void operator&=(std::vector<T>& v1, const C& c)
   {
-    v1[i] = c;
+    for (auto & x : v1)
+    {
+      x = c;
+    }
   }
-}
 
-template<class T, class C>
-void operator+=(std::vector<T>& v1, const C& c)
-{
-  for (size_t i = 0; i < v1.size(); i++)
+  template<class T, class C>
+  void operator+=(std::vector<T>& v1, const C& c)
   {
-    v1[i] += c;
+    for (auto & x : v1)
+    {
+      x += c;
+    }
   }
-}
 
-template<class T, class C>
-void operator-=(std::vector<T>& v1, const C& c)
-{
-  for (size_t i = 0; i < v1.size(); i++)
+  template<class T, class C>
+  void operator-=(std::vector<T>& v1, const C& c)
   {
-    v1[i] -= c;
+    for (auto & x : v1)
+    {
+      x -= c;
+    }
   }
-}
 
-template<class T, class C>
-void operator*=(std::vector<T>& v1, const C& c)
-{
-  for (size_t i = 0; i < v1.size(); i++)
+  template<class T, class C>
+  void operator*=(std::vector<T>& v1, const C& c)
   {
-    v1[i] *= c;
+    for (auto & x :v1)
+    {
+      x *= c;
+    }
   }
-}
 
-template<class T, class C>
-void operator/=(std::vector<T>& v1, const C& c)
-{
-  for (size_t i = 0; i < v1.size(); i++)
+  template<class T, class C>
+  void operator/=(std::vector<T>& v1, const C& c)
   {
-    v1[i] /= c;
+    for (auto & x : v1)
+    {
+      x /= c;
+    }
   }
-}
+  
 /** @} */
 
 /******************************************************************************/
 
-class VectorTools
-{
-public:
-  VectorTools() {}
-  virtual ~VectorTools() {}
-
-public:
-  /**
-   * @name Matrix-like functions to resize arrays.
-   *
-   * @{
-   */
-  template<class T>
-  static void resize2(VVdouble& vv, size_t n1, size_t n2)
+  class VectorTools
   {
-    vv.resize(n1);
-    for (size_t i = 0; i < n1; i++) { vv[i].resize(n2); }
-  }
+  public:
+    VectorTools() {}
+    virtual ~VectorTools() {}
 
-  template<class T>
-  static void resize3(VVVdouble& vvv, size_t n1, size_t n2, size_t n3)
-  {
-    vvv.resize(n1);
-    for (size_t i = 0; i < n1; i++)
+  public:
+    /**
+     * @name Matrix-like functions to resize arrays.
+     *
+     * @{
+     */
+
+    static void resize2(VVdouble& vv, size_t n1, size_t n2)
     {
-      vvv[i].resize(n2);
-      for (size_t j = 0; j < n2; j++)
+      vv.resize(n1);
+      for (auto & x : vv) { x.resize(n2); }
+    }
+
+    static void resize3(VVVdouble& vvv, size_t n1, size_t n2, size_t n3)
+    {
+      vvv.resize(n1);
+      for (auto & vv : vvv)
       {
-        vvv[i][j].resize(n3);
+        vv.resize(n2);
+        for (auto & v : vv)
+        {
+          v.resize(n3);
+        }
       }
     }
-  }
 
-  static void resize4(VVVVdouble& vvvv, size_t n1, size_t n2, size_t n3, size_t n4)
-  {
-    vvvv.resize(n1);
-    for (size_t i = 0; i < n1; i++)
+    static void resize4(VVVVdouble& vvvv, size_t n1, size_t n2, size_t n3, size_t n4)
     {
-      vvvv[i].resize(n2);
-      for (size_t j = 0; j < n2; j++)
+      vvvv.resize(n1);
+      for (auto & vvv : vvvv)
       {
-        vvvv[i][j].resize(n3);
-        for (size_t k = 0; k < n3; k++)
+        vvv.resize(n2);
+        for (auto & vv : vvv)
         {
-          vvvv[i][j][k].resize(n4);
+          vv.resize(n3);
+          for (auto & v : vv)
+          {
+            v.resize(n4);
+          }
         }
       }
     }
-  }
-  /** @} */
+    
+    /** @} */
 
-  template<class T>
-  static void fill(std::vector<T>& v, T value)
-  {
-    for (typename std::vector<T>::iterator it = v.begin(); it < v.end(); it++)
+    template<class T>
+    static void fill(std::vector<T>& v, T value)
     {
-      *it = value;
+      for (typename std::vector<T>::iterator it = v.begin(); it < v.end(); it++)
+      {
+        *it = value;
+      }
     }
-  }
 
-  /**
-   * @brief Build a sequence std::vector.
-   *
-   * Build a std::vector from a value to another with a specified step.
-   * This works for numerical values for which additions, subtractions and division
-   * makes sens.
-   *
-   * @param from The begining.
-   * @param to The end.
-   * @param by The step.
-   * @return A std::vector containing the sequence.
-   */
-  template<class T>
-  static std::vector<T> seq(T from, T to, T by)
-  {
-    std::vector<T> v;
-    if (from < to)
+    /**
+     * @brief Build a sequence std::vector.
+     *
+     * Build a std::vector from a value to another with a specified step.
+     * This works for numerical values for which additions, subtractions and division
+     * makes sens.
+     *
+     * @param from The begining.
+     * @param to The end.
+     * @param by The step.
+     * @return A std::vector containing the sequence.
+     */
+    template<class T>
+    static std::vector<T> seq(T from, T to, T by)
+    {
+      std::vector<T> v;
+      if (from < to)
+      {
+        // for (T i = from ; i <= to ; i += by) {           // Not good for double, 'to'
+        for (T i = from; i <= to + (by / 100); i += by)
+        { // must be a little bit larger
+          v.push_back(i);
+        }
+      }
+      else
+      {
+        for (T i = from; i >= to - (by / 100); i -= by)
+        {
+          v.push_back(i);
+        }
+      }
+      return v;
+    }
+
+    /**
+     * @brief Send the position of the first occurence of 'which'.
+     *
+     * Comparisons are performed using the == operator.
+     * Maximum complexity: O(v.size()).
+     *
+     * @param v The std::vector to search.
+     * @param which The element to search.
+     * @return The position of which in v.
+     */
+    template<class T>
+    static size_t which(const std::vector<T>& v, const T& which) throw (ElementNotFoundException<T> )
+    {
+      for (size_t i = 0; i < v.size(); i++)
+      {
+        if (v[i] == which) return i;
+      }
+      throw ElementNotFoundException<T>("VectorTools::which.", &v, &which);
+    }
+
+    /**
+     * @brief Send the positions of all occurences of 'which'.
+     *
+     * Comparisons are performed using the == operator.
+     * Complexity: O(v.size()).
+     *
+     * @param v The std::vector to search.
+     * @param which The element to search.
+     * @return A std::vector containing the positions of which in v.
+     */
+    template<class T>
+    static std::vector<size_t> whichAll(const std::vector<T>& v, const T& which) throw (ElementNotFoundException<T> )
+    {
+      std::vector<size_t> w;
+      for (size_t i = 0; i < v.size(); i++)
+      {
+        if (v[i] == which) w.push_back(i);
+      }
+      if (w.size())
+        return w;
+      throw ElementNotFoundException<T>("VectorTools::whichAll.", &v, &which);
+    }
+
+    /**
+     * @brief Send a new std::vector with unique elements.
+     *
+     * The input std::vector is copied, and the copy is sorted using QuickSort algorithm.
+     * A one-pass loop then look for duplicates and copy unique element to a result std::vector.
+     * The output std::vector is hence sorted.
+     *
+     * If v is empty, it is passed 'as is' in return (after being copied).
+     *
+     * @param v the std::vector to parse.
+     */
+    template<class T>
+    static std::vector<T> unique(const std::vector<T>& v)
+    {
+      if (v.size() == 0) return v;
+      std::vector<T> sortedV(v.begin(), v.end());
+      sort(sortedV.begin(), sortedV.end());
+      std::vector<T> uniq;
+      uniq.push_back(sortedV[0]);
+      for (size_t i = 1; i < sortedV.size(); i++)
+      {
+        if (sortedV[i] != sortedV[i - 1]) uniq.push_back(sortedV[i]);
+      }
+      return uniq;
+    }
+
+    /**
+     * @brief Tell if the std::vector as unique elements.
+     *
+     * The input std::vector is copied, and the copy is sorted using QuickSort algorithm.
+     * A one-pass loop then look for duplicates.
+     *
+     * If v is empty, the method returns 'true'.
+     *
+     * @param v the std::vector to parse.
+     */
+    template<class T>
+    static bool isUnique(const std::vector<T>& v)
+    {
+      if (v.size() == 0) return true;
+      std::vector<T> sortedV(v.begin(), v.end());
+      sort(sortedV.begin(), sortedV.end());
+      for (size_t i = 1; i < sortedV.size(); i++)
+      {
+        if (sortedV[i] == sortedV[i - 1]) return false;
+      }
+      return true;
+    }
+
+    /**
+     * @author Laurent Gueguen
+     * @param v1 the std::vector of elements,
+     * @param v2 the std::vector of the selected positions
+     * @return the std::vector of the selected elements, in the order of the
+     *  required positions
+     */
+    template<class T>
+    static std::vector<T> extract(const std::vector<T>& v1, const std::vector<int>& v2)
     {
-      // for (T i = from ; i <= to ; i += by) {           // Not good for double, 'to'
-      for (T i = from; i <= to + (by / 100); i += by)
-      { // must be a little bit larger
-        v.push_back(i);
+      std::vector<T> v(v2.size());
+      for (size_t i = 0; i < v2.size(); i++)
+      {
+        v[i] = v1[v2[i]];
       }
+      return v;
     }
-    else
+
+    /**
+     * @brief Count each element of a std::vector.
+     *
+     * @return A map with keys = unique std::vector values and values = count for each std::vector value.
+     * @param v the std::vector to parse.
+     */
+    template<class T>
+    static std::map<T, size_t> countValues(const std::vector<T>& v)
     {
-      for (T i = from; i >= to - (by / 100); i -= by)
+      std::map<T, size_t> c;
+      for (auto x : v)
       {
-        v.push_back(i);
+        c[x]++;
       }
+      return c;
+    }
+
+    /**
+     * @brief Get the break points for a given number of classes.
+     *
+     * Given a std::vector of values, return the values that cut the range of values
+     * in a given number of classes.
+     *
+     * @param v The std::vector to parse.
+     * @param n The expected number of classes.
+     * @return a std::vector of size = n + 1 containing the breaking points.
+     */
+    static std::vector<double> breaks(const std::vector<double>& v, unsigned int n);
+
+    /**
+     * @brief Get the optimal class number following Scott's method.
+     *
+     * Use Scott's (1979) method to compute the optimal class number for histogram.
+     *
+     * Scott, D.W. (1979) On optimal and data-based histograms. Biometrika, 66, 605¿610.
+     *
+     * @param v The std::vector to parse.
+     * @return The number of classes.
+     */
+    template<class T>
+    static size_t nclassScott(const std::vector<T>& v)
+    {
+      std::vector<T> r1 = VectorTools::range(v);
+      T r = r1[1] - r1[0];
+      double n = v.size();
+      double h = 3.5 * VectorTools::sd<T, double>(v) * std::pow(n, -1. / 3);
+      return (size_t) ceil(r / h);
+    }
+
+    /**
+     * @return The product of all elements in a std::vector.
+     * @param v1 A std::vector.
+     */
+    template<class T>
+    static T prod(const std::vector<T>& v1)
+    {
+      T p = 1;
+      for (auto x : v1)
+        p *= x; 
+      return p;
+    }
+
+    /**
+     * @return The cumulative product of all elements in a std::vector.
+     * @param v1 A std::vector.
+     * @author Julien Dutheil
+     */
+    template<class T>
+    static std::vector<T> cumProd(const std::vector<T>& v1)
+    {
+      std::vector<T> p(v1.size());
+      if (v1.size() == 0) return p;
+      p[0] = v1[0];
+      for (size_t i = 1; i < v1.size(); i++) { p[i] = v1[i] * p[i - 1]; }
+      return p;
+    }
+
+    /**
+     * @return The sum of all elements in a std::vector.
+     * @param v1 A std::vector.
+     */
+    template<class T>
+    static T sum(const std::vector<T>& v1)
+    {
+      T s = 0;
+      for (auto x : v1) { s += x; }
+      return s;
+    }
+
+    /**
+     * @return The cumulative sum of all elements in a std::vector.
+     * @param v1 A std::vector.
+     * @author Julien Dutheil
+     */
+    template<class T>
+    static std::vector<T> cumSum(const std::vector<T>& v1)
+    {
+      std::vector<T> s(v1.size());
+      if (v1.size() == 0) return s;
+      s[0] = v1[0];
+      for (size_t i = 1; i < v1.size(); i++) { s[i] = v1[i] + s[i - 1]; }
+      return s;
+    }
+
+    /**
+     * @author Laurent Gueguen
+     * @return Log-normalize std::vector v1, ie add a constant to the elements of v
+     *  such that @f$\sum_i(\exp(v_i)) = 1 at f$.
+     * @param v std::vector.
+     */
+    template<class T>
+    static void logNorm(std::vector<T>& v)
+    {
+      T M = max(v);
+      T x = std::exp(v[0] - M);
+      for (size_t i = 1; i < v.size(); i++)
+      {
+        x += std::exp(v[i] - M);
+      }
+      v -= M + std::log(x);
     }
-    return v;
-  }
 
-  /**
-   * @brief Send the position of the first occurence of 'which'.
-   *
-   * Comparisons are performed using the == operator.
-   * Maximum complexity: O(v.size()).
-   *
-   * @param v The std::vector to search.
-   * @param which The element to search.
-   * @return The position of which in v.
-   */
-  template<class T>
-  static size_t which(const std::vector<T>& v, const T& which) throw (ElementNotFoundException<T> )
-  {
-    for (size_t i = 0; i < v.size(); i++)
+    /**
+     * @author Laurent Gueguen
+     * @return From std::vector v1, return @f$\log(\sum_i(\exp(v1_i)))@f$.
+     * @param v1 a std::vector.
+     */
+    template<class T>
+    static T logSumExp(const std::vector<T>& v1)
     {
-      if (v[i] == which) return i;
+      T M = max(v1);
+      if (std::isinf(M))
+        return M;
+    
+      T x = std::exp(v1[0] - M);
+      for (size_t i = 1; i < v1.size(); i++)
+      {
+        x += std::exp(v1[i] - M);
+      }
+      return std::log(x) + M;
+    }
+
+    /**
+     * @author Laurent Gueguen
+     * @return From std::vector v1, return @f$\log(\sum_i(v2_i * \exp(v1_i)))@f$.
+     * @param v1 a std::vector.
+     * @param v2 another std::vector.
+     */
+    template<class T>
+    static T logSumExp(const std::vector<T>& v1, const std::vector<T>& v2)
+    {
+      size_t size;
+      if (v1.size() != v2.size())
+        throw DimensionException("VectorTools::logsumexp", v1.size(), v2.size());
+      else
+        size = v1.size();
+
+      T M = max(v1);
+      if (std::isinf(M))
+        throw BadNumberException("VectorTools::logSumExp", M);
+    
+      T x = v2[0] * std::exp(v1[0] - M);
+      for (size_t i = 1; i < size; i++)
+      {
+        x += v2[i] * std::exp(v1[i] - M);
+      }
+      return std::log(x) + M;
     }
-    throw ElementNotFoundException<T>("VectorTools::which.", &v, &which);
-  }
 
-  /**
-   * @brief Send the positions of all occurences of 'which'.
-   *
-   * Comparisons are performed using the == operator.
-   * Complexity: O(v.size()).
-   *
-   * @param v The std::vector to search.
-   * @param which The element to search.
-   * @return A std::vector containing the positions of which in v.
-   */
-  template<class T>
-  static std::vector<size_t> whichAll(const std::vector<T>& v, const T& which) throw (ElementNotFoundException<T> )
-  {
-    std::vector<size_t> w;
-    for (size_t i = 0; i < v.size(); i++)
+    /**
+     * @author Laurent Gueguen
+     * @return From std::vector v1, return @f$\log(\textrm{mean}_i(\exp(v1_i)))@f$.
+     * @param v1 a std::vector.
+     */
+    template<class T>
+    static T logMeanExp(const std::vector<T>& v1)
     {
-      if (v[i] == which) w.push_back(i);
+      T M = max(v1);
+      if (std::isinf(M))
+        return M;
+
+      T x = std::exp(v1[0] - M);
+      for (size_t i = 1; i < v1.size(); i++)
+      {
+        x += std::exp(v1[i] - M);
+      }
+      return std::log(x) + M - std::log(v1.size());
     }
-    if (w.size())
-      return w;
-    throw ElementNotFoundException<T>("VectorTools::whichAll.", &v, &which);
-  }
 
-  /**
-   * @brief Send a new std::vector with unique elements.
-   *
-   * The input std::vector is copied, and the copy is sorted using QuickSort algorithm.
-   * A one-pass loop then look for duplicates and copy unique element to a result std::vector.
-   * The output std::vector is hence sorted.
-   *
-   * If v is empty, it is passed 'as is' in return (after being copied).
-   *
-   * @param v the std::vector to parse.
-   */
-  template<class T>
-  static std::vector<T> unique(const std::vector<T>& v)
-  {
-    if (v.size() == 0) return v;
-    std::vector<T> sortedV(v.begin(), v.end());
-    sort(sortedV.begin(), sortedV.end());
-    std::vector<T> uniq;
-    uniq.push_back(sortedV[0]);
-    for (size_t i = 1; i < sortedV.size(); i++)
+
+    /**
+     * @author Laurent Gueguen
+     * @return From std::vector v1, return @f$\sum_i(\exp(v1_i))@f$.
+     * @param v1 a std::vector.
+     */
+    template<class T>
+    static T sumExp(const std::vector<T>& v1)
     {
-      if (sortedV[i] != sortedV[i - 1]) uniq.push_back(sortedV[i]);
+      T M = max(v1);
+      if (std::isinf(M))
+        return (M<0?0:M);
+
+      T x = std::exp(v1[0] - M);
+      for (size_t i = 1; i < v1.size(); i++)
+      {
+        x += std::exp(v1[i] - M);
+      }
+      return x * std::exp(M);
+    }
+
+    /**
+     * @author Laurent Gueguen
+     * @return From std::vector v1, return @f$\sum_i(v2_i * \exp(v1_i))@f$.
+     * @param v1 a std::vector.
+     * @param v2 another std::vector.
+     */
+    template<class T>
+    static T sumExp(const std::vector<T>& v1, const std::vector<T>& v2)
+    {
+      size_t size;
+      if (v1.size() != v2.size())
+        throw DimensionException("VectorTools::sumExp", v1.size(), v2.size());
+      else
+        size = v1.size();
+
+      T M = max(v1);
+      if (std::isinf(M))
+        throw BadNumberException("VectorTools::sumExp", M);
+
+      T x = v2[0] * std::exp(v1[0] - M);
+      for (size_t i = 1; i < size; i++)
+      {
+        x += v2[i] * std::exp(v1[i] - M);
+      }
+      return x * std::exp(M);
     }
-    return uniq;
-  }
 
-  /**
-   * @brief Tell if the std::vector as unique elements.
-   *
-   * The input std::vector is copied, and the copy is sorted using QuickSort algorithm.
-   * A one-pass loop then look for duplicates.
-   *
-   * If v is empty, the method returns 'true'.
-   *
-   * @param v the std::vector to parse.
-   */
-  template<class T>
-  static bool isUnique(const std::vector<T>& v)
-  {
-    if (v.size() == 0) return true;
-    std::vector<T> sortedV(v.begin(), v.end());
-    sort(sortedV.begin(), sortedV.end());
-    for (size_t i = 1; i < sortedV.size(); i++)
+    /**
+     * @name These methods apply the corresponding function to each element
+     * and return the result in a new std::vector.
+     *
+     * @{
+     */
+  
+    template<class T>
+    static std::vector<T> log(const std::vector<T>& v1)
     {
-      if (sortedV[i] == sortedV[i - 1]) return false;
+      std::vector<T> v2(v1.size());
+      for (size_t i = 0; i < v2.size(); i++) { v2[i] = VectorTools::log(v1[i]); }
+      return v2;
     }
-    return true;
-  }
 
-  /**
-   * @author Laurent Gueguen
-   * @param v1 the std::vector of elements,
-   * @param v2 the std::vector of the selected positions
-   * @return the std::vector of the selected elements, in the order of the
-   *  required positions
-   */
-  template<class T>
-  static std::vector<T> extract(const std::vector<T>& v1, const std::vector<int>& v2)
-  {
-    std::vector<T> v(v2.size());
-    for (size_t i = 0; i < v2.size(); i++)
+    template<class T>
+    static double log(const T& x)
     {
-      v[i] = v1[v2[i]];
+      return std::log(x);
+    }
+  
+    template<class T>
+    static std::vector<double> log(const std::vector<T>& v1, double base)
+    {
+      std::vector<double> v2(v1.size());
+      for (size_t i = 0; i < v2.size(); i++) { v2[i] = std::log(v1[i]) / std::log(base); }
+      return v2;
     }
-    return v;
-  }
 
-  /**
-   * @brief Count each element of a std::vector.
-   *
-   * @return A map with keys = unique std::vector values and values = count for each std::vector value.
-   * @param v the std::vector to parse.
-   */
-  template<class T>
-  static std::map<T, size_t> countValues(const std::vector<T>& v)
-  {
-    std::map<T, size_t> c;
-    for (size_t i = 0; i < v.size(); i++)
+    template<class T>
+    static double exp(const T& x)
     {
-      c[v[i]]++;
+      return std::exp(x);
     }
-    return c;
-  }
 
-  /**
-   * @brief Get the break points for a given number of classes.
-   *
-   * Given a std::vector of values, return the values that cut the range of values
-   * in a given number of classes.
-   *
-   * @param v The std::vector to parse.
-   * @param n The expected number of classes.
-   * @return a std::vector of size = n + 1 containing the breaking points.
-   */
-  static std::vector<double> breaks(const std::vector<double>& v, unsigned int n);
-
-  /**
-   * @brief Get the optimal class number following Scott's method.
-   *
-   * Use Scott's (1979) method to compute the optimal class number for histogram.
-   *
-   * Scott, D.W. (1979) On optimal and data-based histograms. Biometrika, 66, 605¿610.
-   *
-   * @param v The std::vector to parse.
-   * @return The number of classes.
-   */
-  template<class T>
-  static size_t nclassScott(const std::vector<T>& v)
-  {
-    std::vector<T> r1 = VectorTools::range(v);
-    T r = r1[1] - r1[0];
-    double n = v.size();
-    double h = 3.5 * VectorTools::sd<T, double>(v) * std::pow(n, -1. / 3);
-    return (size_t) ceil(r / h);
-  }
+    template<class T>
+    static std::vector<T> exp(const std::vector<T>& v1)
+    {
+      std::vector<T> v2(v1.size());
+      for (size_t i = 0; i < v2.size(); i++) { v2[i] = VectorTools::exp(v1[i]); }
+      return v2;
+    }
 
-  /**
-   * @return The product of all elements in a std::vector.
-   * @param v1 A std::vector.
-   */
-  template<class T>
-  static T prod(const std::vector<T>& v1)
-  {
-    T p = 1;
-    for (size_t i = 0; i < v1.size(); i++) { p *= v1[i]; }
-    return p;
-  }
+    template<class T>
+    static std::vector<double> cos(const std::vector<T>& v1)
+    {
+      std::vector<double> v2(v1.size());
+      for (size_t i = 0; i < v2.size(); i++) { v2[i] = std::cos(v1[i]); }
+      return v2;
+    }
 
-  /**
-   * @return The cumulative product of all elements in a std::vector.
-   * @param v1 A std::vector.
-   * @author Julien Dutheil
-   */
-  template<class T>
-  static std::vector<T> cumProd(const std::vector<T>& v1)
-  {
-    std::vector<T> p(v1.size());
-    if (v1.size() == 0) return p;
-    p[0] = v1[0];
-    for (size_t i = 1; i < v1.size(); i++) { p[i] = v1[i] * p[i - 1]; }
-    return p;
-  }
+    template<class T>
+    static std::vector<double> sin(const std::vector<T>& v1)
+    {
+      std::vector<double> v2(v1.size());
+      for (size_t i = 0; i < v2.size(); i++) { v2[i] = std::sin(v1[i]); }
+      return v2;
+    }
 
-  /**
-   * @return The sum of all elements in a std::vector.
-   * @param v1 A std::vector.
-   */
-  template<class T>
-  static T sum(const std::vector<T>& v1)
-  {
-    T s = 0;
-    for (size_t i = 0; i < v1.size(); i++) { s += v1[i]; }
-    return s;
-  }
+    template<class T>
+    static std::vector<double> log10(const std::vector<T>& v1)
+    {
+      std::vector<double> v2(v1.size());
+      for (size_t i = 0; i < v1.size(); i++) { v2[i] = std::log10(v1[i]); }
+      return v2;
+    }
 
-  /**
-   * @return The cumulative sum of all elements in a std::vector.
-   * @param v1 A std::vector.
-   * @author Julien Dutheil
-   */
-  template<class T>
-  static std::vector<T> cumSum(const std::vector<T>& v1)
-  {
-    std::vector<T> s(v1.size());
-    if (v1.size() == 0) return s;
-    s[0] = v1[0];
-    for (size_t i = 1; i < v1.size(); i++) { s[i] = v1[i] + s[i - 1]; }
-    return s;
-  }
+    template<class T>
+    static std::vector<T> fact(const std::vector<T>& v1)
+    {
+      std::vector<T> v2(v1.size());
+      for (size_t i = 0; i < v1.size(); i++) { v2[i] = NumTools::fact<T>(v1[i]); }
+      return v2;
+    }
 
-  /**
-   * @author Laurent Gueguen
-   * @return Log-normalize std::vector v1, ie add a constant to the elements of v
-   *  such that @f$\sum_i(\exp(v_i)) = 1 at f$.
-   * @param v std::vector.
-   */
-  template<class T>
-  static void logNorm(std::vector<T>& v)
-  {
-    T M = max(v);
-    T x = std::exp(v[0] - M);
-    for (size_t i = 1; i < v.size(); i++)
+    template<class T>
+    static std::vector<T> sqr(const std::vector<T>& v1)
     {
-      x += std::exp(v[i] - M);
+      std::vector<T> v2(v1.size());
+      for (size_t i = 0; i < v1.size(); i++) { v2[i] = NumTools::sqr<T>(v1[i]); }
+      return v2;
     }
-    v -= M + std::log(x);
-  }
 
-  /**
-   * @author Laurent Gueguen
-   * @return From std::vector v1, return @f$\log(\sum_i(\exp(v1_i)))@f$.
-   * @param v1 a std::vector.
-   */
-  template<class T>
-  static T logSumExp(const std::vector<T>& v1)
-  {
-    T M = max(v1);
-    if (std::isinf(M))
-      return M;
-    
-    T x = std::exp(v1[0] - M);
-    for (size_t i = 1; i < v1.size(); i++)
+    template<class T>
+    static std::vector<T> pow(const std::vector<T>& v1, T& b)
     {
-      x += std::exp(v1[i] - M);
+      std::vector<T> v2(v1.size());
+      for (size_t i = 0; i < v1.size(); i++) { v2[i] = std::pow(v1[i], b); }
+      return v2;
     }
-    return std::log(x) + M;
-  }
+    /** @} */
 
-  /**
-   * @author Laurent Gueguen
-   * @return From std::vector v1, return @f$\log(\sum_i(v2_i * \exp(v1_i)))@f$.
-   * @param v1 a std::vector.
-   * @param v2 another std::vector.
-   */
-  template<class T>
-  static T logSumExp(const std::vector<T>& v1, const std::vector<T>& v2)
-  {
-    size_t size;
-    if (v1.size() != v2.size())
-      throw DimensionException("VectorTools::logsumexp", v1.size(), v2.size());
-    else
-      size = v1.size();
-
-    T M = max(v1);
-    if (std::isinf(M))
-      throw BadNumberException("VectorTools::logSumExp", M);
-    
-    T x = v2[0] * std::exp(v1[0] - M);
-    for (size_t i = 1; i < size; i++)
-    {
-      x += v2[i] * std::exp(v1[i] - M);
-    }
-    return std::log(x) + M;
-  }
-
-  /**
-   * @author Laurent Gueguen
-   * @return From std::vector v1, return @f$\log(\textrm{mean}_i(\exp(v1_i)))@f$.
-   * @param v1 a std::vector.
-   */
-  template<class T>
-  static T logMeanExp(const std::vector<T>& v1)
-  {
-    T M = max(v1);
-    if (std::isinf(M))
-      return M;
-
-    T x = std::exp(v1[0] - M);
-    for (size_t i = 1; i < v1.size(); i++)
+    /**
+     * @brief Concatenate a std::vector after converting to string.
+     *
+     * @param v The std::vector to concatenate.
+     * @param delim A string which is used to separate the values (default is " ").
+     */
+    template<class T>
+    static std::string paste(const std::vector<T>& v, const std::string& delim = " ")
     {
-      x += std::exp(v1[i] - M);
-    }
-    return std::log(x) + M - std::log(v1.size());
-  }
-
-
-  /**
-   * @author Laurent Gueguen
-   * @return From std::vector v1, return @f$\sum_i(\exp(v1_i))@f$.
-   * @param v1 a std::vector.
-   */
-  template<class T>
-  static T sumExp(const std::vector<T>& v1)
-  {
-    T M = max(v1);
-    if (std::isinf(M))
-      return (M<0?0:M);
-
-    T x = std::exp(v1[0] - M);
-    for (size_t i = 1; i < v1.size(); i++)
-    {
-      x += std::exp(v1[i] - M);
-    }
-    return x * std::exp(M);
-  }
-
-  /**
-   * @author Laurent Gueguen
-   * @return From std::vector v1, return @f$\sum_i(v2_i * \exp(v1_i))@f$.
-   * @param v1 a std::vector.
-   * @param v2 another std::vector.
-   */
-  template<class T>
-  static T sumExp(const std::vector<T>& v1, const std::vector<T>& v2)
-  {
-    size_t size;
-    if (v1.size() != v2.size())
-      throw DimensionException("VectorTools::sumExp", v1.size(), v2.size());
-    else
-      size = v1.size();
-
-    T M = max(v1);
-    if (std::isinf(M))
-      throw BadNumberException("VectorTools::sumExp", M);
-
-    T x = v2[0] * std::exp(v1[0] - M);
-    for (size_t i = 1; i < size; i++)
-    {
-      x += v2[i] * std::exp(v1[i] - M);
+      std::ostringstream out;
+      out.precision(12);
+      for (size_t i = 0; i < v.size(); i++)
+      {
+        out << v[i];
+        if (i < v.size() - 1)
+          out << delim;
+      }
+      return out.str();
     }
-    return x * std::exp(M);
-  }
-
-  /**
-   * @name These methods apply the corresponding function to each element
-   * and return the result in a new std::vector.
-   *
-   * @{
-   */
-  
-  template<class T>
-  static std::vector<T> log(const std::vector<T>& v1)
-  {
-    std::vector<T> v2(v1.size());
-    for (size_t i = 0; i < v2.size(); i++) { v2[i] = VectorTools::log(v1[i]); }
-    return v2;
-  }
-
-  template<class T>
-  static double log(const T& x)
-  {
-    return std::log(x);
-  }
-  
-  template<class T>
-  static std::vector<double> log(const std::vector<T>& v1, double base)
-  {
-    std::vector<double> v2(v1.size());
-    for (size_t i = 0; i < v2.size(); i++) { v2[i] = std::log(v1[i]) / std::log(base); }
-    return v2;
-  }
-
-  template<class T>
-  static double exp(const T& x)
-  {
-    return std::exp(x);
-  }
-
-  template<class T>
-  static std::vector<T> exp(const std::vector<T>& v1)
-  {
-    std::vector<T> v2(v1.size());
-    for (size_t i = 0; i < v2.size(); i++) { v2[i] = VectorTools::exp(v1[i]); }
-    return v2;
-  }
-
-  template<class T>
-  static std::vector<double> cos(const std::vector<T>& v1)
-  {
-    std::vector<double> v2(v1.size());
-    for (size_t i = 0; i < v2.size(); i++) { v2[i] = std::cos(v1[i]); }
-    return v2;
-  }
-
-  template<class T>
-  static std::vector<double> sin(const std::vector<T>& v1)
-  {
-    std::vector<double> v2(v1.size());
-    for (size_t i = 0; i < v2.size(); i++) { v2[i] = std::sin(v1[i]); }
-    return v2;
-  }
-
-  template<class T>
-  static std::vector<double> log10(const std::vector<T>& v1)
-  {
-    std::vector<double> v2(v1.size());
-    for (size_t i = 0; i < v1.size(); i++) { v2[i] = std::log10(v1[i]); }
-    return v2;
-  }
 
-  template<class T>
-  static std::vector<T> fact(const std::vector<T>& v1)
-  {
-    std::vector<T> v2(v1.size());
-    for (size_t i = 0; i < v1.size(); i++) { v2[i] = NumTools::fact<T>(v1[i]); }
-    return v2;
-  }
-
-  template<class T>
-  static std::vector<T> sqr(const std::vector<T>& v1)
-  {
-    std::vector<T> v2(v1.size());
-    for (size_t i = 0; i < v1.size(); i++) { v2[i] = NumTools::sqr<T>(v1[i]); }
-    return v2;
-  }
-
-  template<class T>
-  static std::vector<T> pow(const std::vector<T>& v1, T& b)
-  {
-    std::vector<T> v2(v1.size());
-    for (size_t i = 0; i < v1.size(); i++) { v2[i] = std::pow(v1[i], b); }
-    return v2;
-  }
-  /** @} */
-
-  /**
-   * @brief Concatenate a std::vector after converting to string.
-   *
-   * @param v The std::vector to concatenate.
-   * @param delim A string which is used to separate the values (default is " ").
-   */
-  template<class T>
-  static std::string paste(const std::vector<T>& v, const std::string& delim = " ")
-  {
-    std::ostringstream out;
-    out.precision(12);
-    for (size_t i = 0; i < v.size(); i++)
+    /**
+     * @brief Print a std::vector to a stream.
+     * @param v1 A std::vector.
+     * @param out A stream.
+     * @param delim A string which is used to separate the values (default is " ").
+     */
+    template<class T>
+    static void print(const std::vector<T>& v1, OutputStream& out = * ApplicationTools::message, const std::string& delim = " ")
     {
-      out << v[i];
-      if (i < v.size() - 1)
-        out << delim;
+      for (size_t i = 0; i < v1.size(); i++)
+      {
+        out << v1[i];
+        if (i < v1.size() - 1)
+          out << delim;
+      }
+      out.endLine();
     }
-    return out.str();
-  }
 
-  /**
-   * @brief Print a std::vector to a stream.
-   * @param v1 A std::vector.
-   * @param out A stream.
-   * @param delim A string which is used to separate the values (default is " ").
-   */
-  template<class T>
-  static void print(const std::vector<T>& v1, OutputStream& out = * ApplicationTools::message, const std::string& delim = " ")
-  {
-    for (size_t i = 0; i < v1.size(); i++)
+    template<class T>
+    static void printRange(const std::vector<T>& v1, OutputStream& out = * ApplicationTools::message, const std::string& delim = ",", const std::string& rangeDelim = "-")
     {
-      out << v1[i];
-      if (i < v1.size() - 1)
-        out << delim;
-    }
-    out.endLine();
-  }
-
-  template<class T>
-  static void printRange(const std::vector<T>& v1, OutputStream& out = * ApplicationTools::message, const std::string& delim = ",", const std::string& rangeDelim = "-")
-  {
-    size_t vs=v1.size();
+      size_t vs=v1.size();
     
-    for (size_t i = 0; i < vs; i++)
-    {
-      out << v1[i];
-      size_t j=i+1;
+      for (size_t i = 0; i < vs; i++)
+      {
+        out << v1[i];
+        size_t j=i+1;
       
-      while (j<vs)
-        if (v1[j]==v1[j-1]+1)
-          j++;
-        else
-          break;
+        while (j<vs)
+          if (v1[j]==v1[j-1]+1)
+            j++;
+          else
+            break;
       
-      if (j>i+2)
-        out << rangeDelim << v1[j-1];
-      i=j-1;
-      if (i<vs-1)
-        out << delim;
+        if (j>i+2)
+          out << rangeDelim << v1[j-1];
+        i=j-1;
+        if (i<vs-1)
+          out << delim;
+      }
     }
-  }
 
 
-  /**
-   * @brief Print a std::vector to a stream in R format
-   * @param v1 A std::vector.
-   * @param variableName the variable name (default "x").
-   * @param out A stream (default cout).
-   */
-  template<class T>
-  static void printForR(const std::vector<T>& v1, std::string variableName = "x", std::ostream& out = std::cout)
-  {
-    out.precision(12);
-    out << variableName << "<-c(";
-    for (size_t i = 0; i < v1.size(); i++)
-    {
-      out << v1[i];
-      if (i < v1.size() - 1)
-        out << ", ";
-    }
-    out << ")" << std::endl;
-  }
 
-  /**
-   * @return The scalar product of two std::vectors.
-   * @param v1 First std::vector.
-   * @param v2 Second std::vector.
-   * @throw DimensionException If the two std::vector do not have the same length.
-   */
-  template<class InputType, class OutputType>
-  static OutputType scalar(const std::vector<InputType>& v1, const std::vector<InputType>& v2) throw (DimensionException)
-  {
-    if (v1.size() != v2.size())
-    {
-      throw DimensionException("VectorTools::scalar", v1.size(), v2.size());
-    }
-    OutputType result = 0;
-    for (size_t i = 0; i < v1.size(); i++)
+    /**
+     * @brief Print a std::vector to a stream in R format
+     * @param v1 A std::vector.
+     * @param variableName the variable name (default "x").
+     * @param out A stream (default cout).
+     */
+    template<class T>
+    static void printForR(const std::vector<T>& v1, std::string variableName = "x", std::ostream& out = std::cout)
     {
-      result += v1[i] * v2[i];
-    }
-    return result;
-  }
-  /**
-   * This dt product correspond to the dot product <v1,v2> in the space defined by
-   * @f[
-   * M =
-   * \begin{pmatrix}
-   * w_1 & \ldots & \\
-   * \vdots & w_2  & \ldots\\
-   *        & \vdots & \ddots\\
-   * \end{pmatrix}
-   * @f]
-   * @return The "weighted" scalar product of two std::vectors.
-   * @param v1 First std::vector.
-   * @param v2 Second std::vector.
-   * @param w A std::vector of weights.
-   * @throw DimensionException If the two std::vector do not have the same length or do not match the length of the weights.
-   */
-  template<class InputType, class OutputType>
-  static OutputType scalar(const std::vector<InputType>& v1, const std::vector<InputType>& v2, const std::vector<InputType>& w) throw (DimensionException)
-  {
-    if (v1.size() != w.size())
-    {
-      throw DimensionException("VectorTools::scalar", v1.size(), w.size());
-    }
-    if (v2.size() != w.size())
-    {
-      throw DimensionException("VectorTools::scalar", v2.size(), w.size());
-    }
-    OutputType result = 0;
-    for (size_t i = 0; i < v1.size(); i++)
-    {
-      result += v1[i] * v2[i] * w[i];
-    }
-    return result;
-  }
-
-  /**
-   * @return The scalar Kronecker product of two std::vectors.
-   * @param v1 First std::vector.
-   * @param v2 Second std::vector.
-   * @throw DimensionException If the two std::vector do not have the same length.
-   */
-  template<class T>
-  static std::vector<T> kroneckerMult(const std::vector<T>& v1, const std::vector<T>& v2) throw (DimensionException)
-  {
-    size_t n1 = v1.size();
-    size_t n2 = v2.size();
-    std::vector<T> v3(n1 * n2);
-    for (size_t i = 0; i < n1; i++)
-    {
-      T v1i = v1[i];
-      for (size_t j = 0; j < n2; j++)
+      out.precision(12);
+      out << variableName << "<-c(";
+      for (size_t i = 0; i < v1.size(); i++)
       {
-        v3[i * n2 + j] = v1i * v2[j];
+        out << v1[i];
+        if (i < v1.size() - 1)
+          out << ", ";
       }
+      out << ")" << std::endl;
     }
-    return v3;
-  }
 
-  /**
-   * @return The norm of a std::vector (@f$\sqrt{\sum_i^n x_i^2}@f$).
-   * @param v1 A std::vector.
-   */
-  template<class InputType, class OutputType>
-  static OutputType norm(const std::vector<InputType>& v1)
-  {
-    OutputType result = 0;
-    for (size_t i = 0; i < v1.size(); i++)
+    /**
+     * @return The scalar product of two std::vectors.
+     * @param v1 First std::vector.
+     * @param v2 Second std::vector.
+     * @throw DimensionException If the two std::vector do not have the same length.
+     */
+    template<class InputType, class OutputType>
+    static OutputType scalar(const std::vector<InputType>& v1, const std::vector<InputType>& v2) throw (DimensionException)
     {
-      result += v1[i] * v1[i];
-    }
-    return sqrt(result);
-  }
-
-  /**
-   * @return The "weighted" norm of a std::vector (@f$\sqrt{\sum_i^n x_i^2}@f$).
-   * @param v1 A std::vector.
-   * @param w A std::vector of weights.
-   * @throw DimensionException If v1 and w do not have the same length.
-   * @see scalar.
-   */
-  template<class InputType, class OutputType>
-  static OutputType norm(const std::vector<InputType>& v1, const std::vector<InputType>& w) throw (DimensionException)
-  {
-    if (v1.size() != w.size())
-    {
-      throw DimensionException("VectorTools::norm", v1.size(), w.size());
-    }
-    OutputType result = 0;
-    for (size_t i = 0; i < v1.size(); i++)
-    {
-      result += v1[i] * v1[i] * w[i];
-    }
-    return sqrt(result);
-  }
-
-  /**
-   * @return The cosinus of the angle of two std::vectors.
-   * @param v1 First std::vector.
-   * @param v2 Second std::vector.
-   * @throw DimensionException If the two std::vector do not have the same length.
-   */
-  template<class InputType, class OutputType>
-  static OutputType cos(const std::vector<InputType>& v1, const std::vector<InputType>& v2) throw (DimensionException)
-  {
-    return scalar<InputType, OutputType>(v1, v2)
-           / (norm<InputType, OutputType>(v1) * norm<InputType, OutputType>(v2));
-  }
-
-  /**
-   * @return The weighted cosinus of the angle of two std::vectors.
-   * @param v1 First std::vector.
-   * @param v2 Second std::vector.
-   * @param w A std::vector of weights.
-   * @throw DimensionException If the two std::vector do not have the same length.
-   */
-  template<class InputType, class OutputType>
-  static OutputType cos(const std::vector<InputType>& v1, const std::vector<InputType>& v2, const std::vector<InputType>& w) throw (DimensionException)
-  {
-    return scalar<InputType, OutputType>(v1, v2, w)
-           / (norm<InputType, OutputType>(v1, w) * norm<InputType, OutputType>(v2, w));
-  }
-
-  /**
-   * @name Extrema.
-   *
-   * @{
-   */
-
-  /**
-   * @brief Template function to get the minimum value of a std::vector.
-   *
-   * The < operator must be defined for the specified class.
-   *
-   * @param v The input std::vector.
-   * @return The minimum value in the std::vector.
-   * @throw EmptyVectorException If the input std::vector is empty.
-   */
-  template<class T>
-  static T min(const std::vector<T>& v) throw (EmptyVectorException<T> )
-  {
-    if (v.size() == 0) throw EmptyVectorException<T>("VectorTools::min()", &v);
-    T mini = v[0];
-    for (size_t i = 1; i < v.size(); i++)
-    {
-      if (v[i] < mini) mini = v[i];
-    }
-    return mini;
-  }
-
-  /**
-   * @brief Template function to get the maximum value of a std::vector.
-   *
-   * The > operator must be defined for the specified class.
-   *
-   * @param v The input std::vector.
-   * @return The maximum value in the std::vector.
-   * @throw EmptyVectorException If the input std::vector is empty.
-   */
-  template<class T>
-  static T max(const std::vector<T>& v) throw (EmptyVectorException<T> )
-  {
-    if (v.size() == 0) throw EmptyVectorException<T>("VectorTools::max()", &v);
-    T maxi = v[0];
-    for (size_t i = 1; i < v.size(); i++)
-    {
-      if (v[i] > maxi) maxi = v[i];
-    }
-    return maxi;
-  }
-
-  /**
-   * @brief Template function to get the index of the maximum value of a std::vector.
-   *
-   * The > operator must be defined for the specified class.
-   * The position sent is the first one matching the maximum value.
-   *
-   * @param v The input std::vector.
-   * @return The position of the maximum value in the std::vector.
-   * @throw EmptyVectorException If the input std::vector is empty.
-   */
-  template<class T>
-  static size_t whichMax(const std::vector<T>& v) throw (EmptyVectorException<T> )
-  {
-    if (v.size() == 0) throw EmptyVectorException<T>("VectorFuntions::whichMax()", &v);
-    T maxi = v[0];
-    size_t pos = 0;
-    for (size_t i = 1; i < v.size(); i++)
-    {
-      if (v[i] > maxi)
+      if (v1.size() != v2.size())
       {
-        maxi = v[i];
-        pos = i;
+        throw DimensionException("VectorTools::scalar", v1.size(), v2.size());
       }
-    }
-    return pos;
-  }
-
-  /**
-   * @brief Template function to get the index of the minimum value of a std::vector.
-   *
-   * The < operator must be defined for the specified class.
-   * The position sent is the first one matching the maximum value.
-   *
-   * @param v The input std::vector.
-   * @return The position of the minimum value in the std::vector.
-   * @throw EmptyVectorException If the input std::vector is empty.
-   */
-  template<class T>
-  static size_t whichMin(const std::vector<T>& v) throw (EmptyVectorException<T> )
-  {
-    if (v.size() == 0) throw EmptyVectorException<T>("VectorTools::whichMin()", &v);
-    T mini = v[0];
-    size_t pos = 0;
-    for (size_t i = 1; i < v.size(); i++)
-    {
-      if (v[i] < mini)
+      OutputType result = 0;
+      for (size_t i = 0; i < v1.size(); i++)
+      {
+        result += v1[i] * v2[i];
+      }
+      return result;
+    }
+    /**
+     * This dt product correspond to the dot product <v1,v2> in the space defined by
+     * @f[
+     * M =
+     * \begin{pmatrix}
+     * w_1 & \ldots & \\
+     * \vdots & w_2  & \ldots\\
+     *        & \vdots & \ddots\\
+     * \end{pmatrix}
+     * @f]
+     * @return The "weighted" scalar product of two std::vectors.
+     * @param v1 First std::vector.
+     * @param v2 Second std::vector.
+     * @param w A std::vector of weights.
+     * @throw DimensionException If the two std::vector do not have the same length or do not match the length of the weights.
+     */
+    template<class InputType, class OutputType>
+    static OutputType scalar(const std::vector<InputType>& v1, const std::vector<InputType>& v2, const std::vector<InputType>& w) throw (DimensionException)
+    {
+      if (v1.size() != w.size())
+      {
+        throw DimensionException("VectorTools::scalar", v1.size(), w.size());
+      }
+      if (v2.size() != w.size())
+      {
+        throw DimensionException("VectorTools::scalar", v2.size(), w.size());
+      }
+      OutputType result = 0;
+      for (size_t i = 0; i < v1.size(); i++)
+      {
+        result += v1[i] * v2[i] * w[i];
+      }
+      return result;
+    }
+
+    /**
+     * @return The scalar Kronecker product of two std::vectors.
+     * @param v1 First std::vector.
+     * @param v2 Second std::vector.
+     * @throw DimensionException If the two std::vector do not have the same length.
+     */
+    template<class T>
+    static std::vector<T> kroneckerMult(const std::vector<T>& v1, const std::vector<T>& v2) throw (DimensionException)
+    {
+      size_t n1 = v1.size();
+      size_t n2 = v2.size();
+      std::vector<T> v3(n1 * n2);
+      for (size_t i = 0; i < n1; i++)
       {
-        mini = v[i];
-        pos = i;
+        T v1i = v1[i];
+        for (size_t j = 0; j < n2; j++)
+        {
+          v3[i * n2 + j] = v1i * v2[j];
+        }
       }
+      return v3;
     }
-    return pos;
-  }
 
-  /**
-   * @brief Template function to get the indices of the maximum value of a std::vector.
-   *
-   * The > and == operator must be defined for the specified class.
-   * All positions matching the maximum value are returned.
-   *
-   * @param v The input std::vector.
-   * @return A vector of positions matching the maximum value in the std::vector.
-   * @throw EmptyVectorException If the input std::vector is empty.
-   */
-  template<class T>
-  static std::vector<size_t> whichMaxAll(const std::vector<T>& v) throw (EmptyVectorException<T> )
-  {
-    if (v.size() == 0) throw EmptyVectorException<T>("VectorFuntions::whichMaxAll()", &v);
-    T maxi = max(v);
-    std::vector<size_t> pos;
-    for (size_t i = 0; i < v.size(); i++)
+    /**
+     * @return The norm of a std::vector (@f$\sqrt{\sum_i^n x_i^2}@f$).
+     * @param v1 A std::vector.
+     */
+    template<class InputType, class OutputType>
+    static OutputType norm(const std::vector<InputType>& v1)
     {
-      if (v[i] == maxi)
+      OutputType result = 0;
+      for (size_t i = 0; i < v1.size(); i++)
       {
-        pos.push_back(i);
+        result += v1[i] * v1[i];
       }
+      return sqrt(result);
     }
-    return pos;
-  }
 
-  /**
-   * @brief Template function to get the indices of the minimum value of a std::vector.
-   *
-   * The < and == operator must be defined for the specified class.
-   * All positions matching the maximum value are returned.
-   *
-   * @param v The input std::vector.
-   * @return A vector of positions matching the minimum value in the std::vector.
-   * @throw EmptyVectorException If the input std::vector is empty.
-   */
-  template<class T>
-  static std::vector<size_t> whichMinAll(const std::vector<T>& v) throw (EmptyVectorException<T> )
-  {
-    if (v.size() == 0) throw EmptyVectorException<T>("VectorFuntions::whichMinAll()", &v);
-    T mini = min(v);
-    std::vector<size_t> pos;
-    for (size_t i = 0; i < v.size(); i++)
+    /**
+     * @return The "weighted" norm of a std::vector (@f$\sqrt{\sum_i^n x_i^2}@f$).
+     * @param v1 A std::vector.
+     * @param w A std::vector of weights.
+     * @throw DimensionException If v1 and w do not have the same length.
+     * @see scalar.
+     */
+    template<class InputType, class OutputType>
+    static OutputType norm(const std::vector<InputType>& v1, const std::vector<InputType>& w) throw (DimensionException)
     {
-      if (v[i] == mini)
+      if (v1.size() != w.size())
+      {
+        throw DimensionException("VectorTools::norm", v1.size(), w.size());
+      }
+      OutputType result = 0;
+      for (size_t i = 0; i < v1.size(); i++)
+      {
+        result += v1[i] * v1[i] * w[i];
+      }
+      return sqrt(result);
+    }
+
+    /**
+     * @return The cosinus of the angle of two std::vectors.
+     * @param v1 First std::vector.
+     * @param v2 Second std::vector.
+     * @throw DimensionException If the two std::vector do not have the same length.
+     */
+    template<class InputType, class OutputType>
+    static OutputType cos(const std::vector<InputType>& v1, const std::vector<InputType>& v2) throw (DimensionException)
+    {
+      return scalar<InputType, OutputType>(v1, v2)
+        / (norm<InputType, OutputType>(v1) * norm<InputType, OutputType>(v2));
+    }
+
+    /**
+     * @return The weighted cosinus of the angle of two std::vectors.
+     * @param v1 First std::vector.
+     * @param v2 Second std::vector.
+     * @param w A std::vector of weights.
+     * @throw DimensionException If the two std::vector do not have the same length.
+     */
+    template<class InputType, class OutputType>
+    static OutputType cos(const std::vector<InputType>& v1, const std::vector<InputType>& v2, const std::vector<InputType>& w) throw (DimensionException)
+    {
+      return scalar<InputType, OutputType>(v1, v2, w)
+        / (norm<InputType, OutputType>(v1, w) * norm<InputType, OutputType>(v2, w));
+    }
+
+    /**
+     * @name Extrema.
+     *
+     * @{
+     */
+
+    /**
+     * @brief Template function to get the minimum value of a std::vector.
+     *
+     * The < operator must be defined for the specified class.
+     *
+     * @param v The input std::vector.
+     * @return The minimum value in the std::vector.
+     * @throw EmptyVectorException If the input std::vector is empty.
+     */
+    template<class T>
+    static T min(const std::vector<T>& v) throw (EmptyVectorException<T> )
+    {
+      if (v.size() == 0) throw EmptyVectorException<T>("VectorTools::min()", &v);
+      T mini = v[0];
+      for (size_t i = 1; i < v.size(); i++)
+      {
+        if (v[i] < mini) mini = v[i];
+      }
+      return mini;
+    }
+
+    /**
+     * @brief Template function to get the maximum value of a std::vector.
+     *
+     * The > operator must be defined for the specified class.
+     *
+     * @param v The input std::vector.
+     * @return The maximum value in the std::vector.
+     * @throw EmptyVectorException If the input std::vector is empty.
+     */
+    template<class T>
+    static T max(const std::vector<T>& v) throw (EmptyVectorException<T> )
+    {
+      if (v.size() == 0) throw EmptyVectorException<T>("VectorTools::max()", &v);
+      T maxi = v[0];
+      for (size_t i = 1; i < v.size(); i++)
+      {
+        if (v[i] > maxi) maxi = v[i];
+      }
+      return maxi;
+    }
+
+    /**
+     * @brief Template function to get the index of the maximum value of a std::vector.
+     *
+     * The > operator must be defined for the specified class.
+     * The position sent is the first one matching the maximum value.
+     *
+     * @param v The input std::vector.
+     * @return The position of the maximum value in the std::vector.
+     * @throw EmptyVectorException If the input std::vector is empty.
+     */
+    template<class T>
+    static size_t whichMax(const std::vector<T>& v) throw (EmptyVectorException<T> )
+    {
+      if (v.size() == 0) throw EmptyVectorException<T>("VectorFuntions::whichMax()", &v);
+      T maxi = v[0];
+      size_t pos = 0;
+      for (size_t i = 1; i < v.size(); i++)
+      {
+        if (v[i] > maxi)
+        {
+          maxi = v[i];
+          pos = i;
+        }
+      }
+      return pos;
+    }
+
+    /**
+     * @brief Template function to get the index of the minimum value of a std::vector.
+     *
+     * The < operator must be defined for the specified class.
+     * The position sent is the first one matching the maximum value.
+     *
+     * @param v The input std::vector.
+     * @return The position of the minimum value in the std::vector.
+     * @throw EmptyVectorException If the input std::vector is empty.
+     */
+    template<class T>
+    static size_t whichMin(const std::vector<T>& v) throw (EmptyVectorException<T> )
+    {
+      if (v.size() == 0) throw EmptyVectorException<T>("VectorTools::whichMin()", &v);
+      T mini = v[0];
+      size_t pos = 0;
+      for (size_t i = 1; i < v.size(); i++)
+      {
+        if (v[i] < mini)
+        {
+          mini = v[i];
+          pos = i;
+        }
+      }
+      return pos;
+    }
+
+    /**
+     * @brief Template function to get the indices of the maximum value of a std::vector.
+     *
+     * The > and == operator must be defined for the specified class.
+     * All positions matching the maximum value are returned.
+     *
+     * @param v The input std::vector.
+     * @return A vector of positions matching the maximum value in the std::vector.
+     * @throw EmptyVectorException If the input std::vector is empty.
+     */
+    template<class T>
+    static std::vector<size_t> whichMaxAll(const std::vector<T>& v) throw (EmptyVectorException<T> )
+    {
+      if (v.size() == 0) throw EmptyVectorException<T>("VectorFuntions::whichMaxAll()", &v);
+      T maxi = max(v);
+      std::vector<size_t> pos;
+      for (size_t i = 0; i < v.size(); i++)
+      {
+        if (v[i] == maxi)
+        {
+          pos.push_back(i);
+        }
+      }
+      return pos;
+    }
+
+    /**
+     * @brief Template function to get the indices of the minimum value of a std::vector.
+     *
+     * The < and == operator must be defined for the specified class.
+     * All positions matching the maximum value are returned.
+     *
+     * @param v The input std::vector.
+     * @return A vector of positions matching the minimum value in the std::vector.
+     * @throw EmptyVectorException If the input std::vector is empty.
+     */
+    template<class T>
+    static std::vector<size_t> whichMinAll(const std::vector<T>& v) throw (EmptyVectorException<T> )
+    {
+      if (v.size() == 0) throw EmptyVectorException<T>("VectorFuntions::whichMinAll()", &v);
+      T mini = min(v);
+      std::vector<size_t> pos;
+      for (size_t i = 0; i < v.size(); i++)
       {
-        pos.push_back(i);
+        if (v[i] == mini)
+        {
+          pos.push_back(i);
+        }
       }
+      return pos;
+    }
+
+
+    /**
+     * @brief Template function to get both extrema of a std::vector.
+     *
+     * Both < and > operators must be defined for the specified class.
+     *
+     * @param v The input std::vector.
+     * @return A std::vector of size 2 which values are min(v) and max(v).
+     * throw EmptyVectorException If the input std::vector is empty.
+     */
+    template<class T>
+    static std::vector<T> range(const std::vector<T>& v) throw (EmptyVectorException<T> )
+    {
+      if (v.size() == 0)
+        throw EmptyVectorException<T>("VectorTools::range()", &v);
+      std::vector<T> r(2);
+      r[0] = r[1] = v[0];
+      for (size_t i = 1; i < v.size(); i++)
+      {
+        if (v[i] < r[0]) r[0] = v[i];
+        if (v[i] > r[1]) r[1] = v[i];
+      }
+      return r;
+    }
+
+  private:
+    template<class T> class order_Cmp_
+    {
+      const std::vector<T>& values_;
+
+    public:
+      order_Cmp_(const std::vector<T>& v) : values_(v) {}
+      bool operator()(size_t a, size_t b) { return values_[a] < values_[b]; }
+    };
+
+  public:
+    /**
+     * @brief Template function to get the order of elements in the input vector.
+     *
+     * This function is equivalent to the R 'order' function. It will sort elements by increasing size, so that [0] in the resulting outptu vector is the indice of the minimum element in the input vector, [1] is the second minimum, etc.
+     *
+     * @param v The input std::vector.
+     * @return Vector with sorted positions, according to input vector.
+     * throw EmptyVectorException If the input std::vector is empty.
+     */
+    template<class T>
+    static std::vector<size_t> order(const std::vector<T>& v) throw (EmptyVectorException<T> )
+    {
+      if (v.size() == 0)
+        throw EmptyVectorException<T>("VectorTools::sort()", &v);
+      // Private inner class:
+      std::vector<size_t> index(v.size());
+      for (size_t i = 0; i < index.size(); ++i)
+      {
+        index[i] = i;
+      }
+      sort(index.begin(), index.end(), order_Cmp_<T>(v));
+      return index;
     }
-    return pos;
-  }
 
+    /** @} */
 
-  /**
-   * @brief Template function to get both extrema of a std::vector.
-   *
-   * Both < and > operators must be defined for the specified class.
-   *
-   * @param v The input std::vector.
-   * @return A std::vector of size 2 which values are min(v) and max(v).
-   * throw EmptyVectorException If the input std::vector is empty.
-   */
-  template<class T>
-  static std::vector<T> range(const std::vector<T>& v) throw (EmptyVectorException<T> )
-  {
-    if (v.size() == 0)
-      throw EmptyVectorException<T>("VectorTools::range()", &v);
-    std::vector<T> r(2);
-    r[0] = r[1] = v[0];
-    for (size_t i = 1; i < v.size(); i++)
+    /**
+     * @brief Template function to get the absolute value of all elements of a std::vector.
+     *
+     *
+     * @param v The input std::vector.
+     * @return A vector with all absolute values.
+     */
+    template<class T>
+    static std::vector<T> abs(const std::vector<T>& v) throw (EmptyVectorException<T> )
     {
-      if (v[i] < r[0]) r[0] = v[i];
-      if (v[i] > r[1]) r[1] = v[i];
+      std::vector<T> vabs(v.size());
+      for (size_t i = 0; i < v.size(); i++)
+      {
+        vabs[i] = std::abs(v[i]);
+      }
+      return vabs;
     }
-    return r;
-  }
-
-private:
-  template<class T> class order_Cmp_
-  {
-    const std::vector<T>& values_;
 
-public:
-    order_Cmp_(const std::vector<T>& v) : values_(v) {}
-    bool operator()(size_t a, size_t b) { return values_[a] < values_[b]; }
-  };
-
-public:
-  /**
-   * @brief Template function to get the order of elements in the input vector.
-   *
-   * This function is equivalent to the R 'order' function. It will sort elements by increasing size, so that [0] in the resulting outptu vector is the indice of the minimum element in the input vector, [1] is the second minimum, etc.
-   *
-   * @param v The input std::vector.
-   * @return Vector with sorted positions, according to input vector.
-   * throw EmptyVectorException If the input std::vector is empty.
-   */
-  template<class T>
-  static std::vector<size_t> order(const std::vector<T>& v) throw (EmptyVectorException<T> )
-  {
-    if (v.size() == 0)
-      throw EmptyVectorException<T>("VectorTools::sort()", &v);
-    // Private inner class:
-    std::vector<size_t> index(v.size());
-    for (size_t i = 0; i < index.size(); ++i)
+    /**
+     * @return The mean value of the std::vector.
+     * @param v1 A std::vector.
+     */
+    template<class InputType, class OutputType>
+    static OutputType mean(const std::vector<InputType>& v1)
     {
-      index[i] = i;
+      return (OutputType)sum<InputType>(v1) / (OutputType)v1.size();
     }
-    sort(index.begin(), index.end(), order_Cmp_<T>(v));
-    return index;
-  }
-
-  /** @} */
-
-  /**
-   * @brief Template function to get the absolute value of all elements of a std::vector.
-   *
-   *
-   * @param v The input std::vector.
-   * @return A vector with all absolute values.
-   */
-  template<class T>
-  static std::vector<T> abs(const std::vector<T>& v) throw (EmptyVectorException<T> )
-  {
-    std::vector<T> vabs(v.size());
-    for (size_t i = 1; i < v.size(); i++)
+    /**
+     * @return The weighted mean value of the std::vector.
+     * @param v1 A std::vector.
+     * @param w A std::vector of weights.
+     * @param normalizeWeights Tell if weights should be normalized so that they sum to 1.
+     */
+    template<class InputType, class OutputType>
+    static OutputType mean(const std::vector<InputType>& v1, const std::vector<InputType>& w, bool normalizeWeights = true)
     {
-      vabs[i] = std::abs(v[i]);
+      if (normalizeWeights)
+      {
+        std::vector<InputType> wn = w / sum(w);
+        return scalar<InputType, OutputType>(v1, wn);
+      }
+      else
+      {
+        return scalar<InputType, OutputType>(v1, w);
+      }
     }
-    return vabs;
-  }
 
-  /**
-   * @return The mean value of the std::vector.
-   * @param v1 A std::vector.
-   */
-  template<class InputType, class OutputType>
-  static OutputType mean(const std::vector<InputType>& v1)
-  {
-    return (OutputType)sum<InputType>(v1) / (OutputType)v1.size();
-  }
-  /**
-   * @return The weighted mean value of the std::vector.
-   * @param v1 A std::vector.
-   * @param w A std::vector of weights.
-   * @param normalizeWeights Tell if weights should be normalized so that they sum to 1.
-   */
-  template<class InputType, class OutputType>
-  static OutputType mean(const std::vector<InputType>& v1, const std::vector<InputType>& w, bool normalizeWeights = true)
-  {
-    if (normalizeWeights)
+    /**
+     * @return The median value of the std::vector.
+     * @param v1 A std::vector.
+     */
+    template<class InputType>
+    static InputType median(std::vector<InputType>& v1)
     {
-      std::vector<InputType> wn = w / sum(w);
-      return scalar<InputType, OutputType>(v1, wn);
-    }
-    else
-    {
-      return scalar<InputType, OutputType>(v1, w);
+      InputType med = 0;
+      if (v1.size() == 0) return med;
+      if (v1.size() == 1) return v1[0];
+      sort(v1.begin(), v1.end());
+      size_t i = v1.size() / 2;
+      if (v1.size() % 2 == 0)
+      {
+        // Vector size is pair
+        med = double((v1[i - 1] + v1[i]) / 2);
+      }
+      else
+      {
+        // Vector size is impair
+        med = v1[i];
+      }
+      return med;
     }
-  }
 
-  /**
-   * @return The median value of the std::vector.
-   * @param v1 A std::vector.
-   */
-  template<class InputType>
-  static InputType median(std::vector<InputType>& v1)
-  {
-    InputType med = 0;
-    if (v1.size() == 0) return med;
-    if (v1.size() == 1) return v1[0];
-    sort(v1.begin(), v1.end());
-    size_t i = v1.size() / 2;
-    if (v1.size() % 2 == 0)
+    /**
+     * @brief Set the mean of a std::vector to be 0.
+     *
+     * @return A std::vector with mean 0.
+     * @param v1 A std::vector.
+     */
+    template<class InputType, class OutputType>
+    static std::vector<OutputType> center(const std::vector<InputType>& v1)
     {
-      // Vector size is pair
-      med = double((v1[i - 1] + v1[i]) / 2);
-    }
-    else
-    {
-      // Vector size is impair
-      med = v1[i];
+      OutputType m = mean<InputType, OutputType>(v1);
+      std::vector<OutputType> v(v1.size());
+      for (size_t i = 0; i < v1.size(); i++)
+      {
+        v[i] = (OutputType)v1[i] - m;
+      }
+      return v;
+    }
+    /**
+     * @brief Set the weighted mean of a std::vector to be 0.
+     *
+     * @return A std::vector with mean 0.
+     * @param v1 A std::vector.
+     * @param w A std::vector of weights.
+     * @param normalizeWeights Tell if weights should be normalized so that they sum to 1.
+     */
+    template<class InputType, class OutputType>
+    static std::vector<OutputType> center(const std::vector<InputType>& v1, const std::vector<InputType>& w, bool normalizeWeights = true)
+    {
+      OutputType m = mean<InputType, OutputType>(v1, w, normalizeWeights);
+      std::vector<OutputType> v(v1.size());
+      for (size_t i = 0; i < v1.size(); i++)
+      {
+        v[i] = (OutputType)v1[i] - m;
+      }
+      return v;
+    }
+
+    /**
+     * @return The covariance of two std::vectors.
+     * @param v1 First std::vector.
+     * @param v2 Second std::vector.
+     * @param unbiased Tell if an unbiased estimate must be computed.
+     * @throw DimensionException If the two std::vector do not have the same length.
+     */
+    template<class InputType, class OutputType>
+    static OutputType cov(const std::vector<InputType>& v1, const std::vector<InputType>& v2, bool unbiased = true) throw (DimensionException)
+    {
+      OutputType n = (OutputType)v1.size();
+      OutputType x =  scalar<InputType, OutputType>(
+        center<InputType, OutputType>(v1),
+        center<InputType, OutputType>(v2)
+        ) / n;
+      if (unbiased) x = x * n / (n - 1);
+      return x;
     }
-    return med;
-  }
 
-  /**
-   * @brief Set the mean of a std::vector to be 0.
-   *
-   * @return A std::vector with mean 0.
-   * @param v1 A std::vector.
-   */
-  template<class InputType, class OutputType>
-  static std::vector<OutputType> center(const std::vector<InputType>& v1)
-  {
-    OutputType m = mean<InputType, OutputType>(v1);
-    std::vector<OutputType> v(v1.size());
-    for (size_t i = 0; i < v1.size(); i++)
-    {
-      v[i] = (OutputType)v1[i] - m;
+    /**
+     * @return The weighted covariance of two std::vectors.
+     * To have a population estimate you have to multiply by \f$\frac{n}{n-1}\f$.
+     * @param v1 First std::vector.
+     * @param v2 Second std::vector.
+     * @param w A std::vector of weights.
+     * @param unbiased Tell if an unbiased estimate must be computed.
+     * @param normalizeWeights Tell if weights should be normalized so that they sum to 1.
+     * @throw DimensionException If the two std::vector do not have the same length.
+     */
+    template<class InputType, class OutputType>
+    static OutputType cov(const std::vector<InputType>& v1, const std::vector<InputType>& v2, const std::vector<InputType>& w, bool unbiased = true, bool normalizeWeights = true) throw (DimensionException)
+    {
+      if (normalizeWeights)
+      {
+        std::vector<InputType> wn = w / sum(w);
+        OutputType x = scalar<InputType, OutputType>(
+          center<InputType, OutputType>(v1, wn, false),
+          center<InputType, OutputType>(v2, wn, false),
+          wn
+          );
+        if (unbiased)
+        {
+          x = x / (1 - sum(sqr<double>(wn)));
+        }
+        return x;
+      }
+      else
+      {
+        OutputType x = scalar<InputType, OutputType>(
+          center<InputType, OutputType>(v1, w, false),
+          center<InputType, OutputType>(v2, w, false),
+          w
+          );
+        if (unbiased)
+        {
+          x = x / (1 - sum(sqr(w)));
+        }
+        return x;
+      }
     }
-    return v;
-  }
-  /**
-   * @brief Set the weighted mean of a std::vector to be 0.
-   *
-   * @return A std::vector with mean 0.
-   * @param v1 A std::vector.
-   * @param w A std::vector of weights.
-   * @param normalizeWeights Tell if weights should be normalized so that they sum to 1.
-   */
-  template<class InputType, class OutputType>
-  static std::vector<OutputType> center(const std::vector<InputType>& v1, const std::vector<InputType>& w, bool normalizeWeights = true)
-  {
-    OutputType m = mean<InputType, OutputType>(v1, w, normalizeWeights);
-    std::vector<OutputType> v(v1.size());
-    for (size_t i = 0; i < v1.size(); i++)
-    {
-      v[i] = (OutputType)v1[i] - m;
+    /**
+     * @return The variance of the std::vector.
+     * @param v1 The sample std::vector.
+     * @param unbiased Tell if an unbiased estimate must be computed.
+     */
+    template<class InputType, class OutputType>
+    static OutputType var(const std::vector<InputType>& v1, bool unbiased = true)
+    {
+      return cov<InputType, OutputType>(v1, v1, unbiased);
+    }
+    /**
+     * @return The weighted variance of the std::vector.
+     * @param v1 The sample std::vector.
+     * @param w A std::vector of weights.
+     * @param unbiased Tell if an unbiased estimate must be computed.
+     * @param normalizeWeights Tell if weights should be normalized so that they sum to 1.
+     * @throw DimensionException If v1 and w do not have the same length.
+     */
+    template<class InputType, class OutputType>
+    static OutputType var(const std::vector<InputType>& v1, const std::vector<InputType>& w, bool unbiased = true, bool normalizeWeights = true) throw (DimensionException)
+    {
+      return cov<InputType, OutputType>(v1, v1, w, unbiased, normalizeWeights);
+    }
+
+    /**
+     * @return The standard deviation of the std::vector.
+     * @param v1 The sample std::vector.
+     * @param unbiased Tell if an unbiased estimate must be computed.
+     */
+    template<class InputType, class OutputType>
+    static OutputType sd(const std::vector<InputType>& v1, bool unbiased = true)
+    {
+      return sqrt(var<InputType, OutputType>(v1, unbiased));
+    }
+
+    /**
+     * @return The weighted standard deviation of the std::vector.
+     * @param v1 The sample std::vector.
+     * @param w A std::vector of weights.
+     * @param unbiased Tell if an unbiased estimate must be computed.
+     * @param normalizeWeights Tell if weights should be normalized so that they sum to 1.
+     * @throw DimensionException If v1 and w do not have the same length.
+     */
+    template<class InputType, class OutputType>
+    static OutputType sd(const std::vector<InputType>& v1, const std::vector<InputType>& w, bool unbiased = true, bool normalizeWeights = true) throw (DimensionException)
+    {
+      return sqrt(var<InputType, OutputType>(v1, w, unbiased, normalizeWeights));
+    }
+
+    /**
+     * @return The Pearson correlation coefficient of two std::vectors.
+     * @param v1 First std::vector.
+     * @param v2 Second std::vector.
+     * @throw DimensionException If the two std::vector do not have the same length.
+     */
+    template<class InputType, class OutputType>
+    static OutputType cor(const std::vector<InputType>& v1, const std::vector<InputType>& v2) throw (DimensionException)
+    {
+      return cov<InputType, OutputType>(v1, v2)
+        / ( sd<InputType, OutputType>(v1) * sd<InputType, OutputType>(v2) );
+    }
+
+    /**
+     * @return The weighted Pearson correlation coefficient of two std::vectors.
+     * @param v1 First std::vector.
+     * @param v2 Second std::vector.
+     * @param w A std::vector of weights.
+     * @param normalizeWeights Tell if weights should be normalized so that they sum to 1.
+     * @throw DimensionException If the two std::vector do not have the same length.
+     */
+    template<class InputType, class OutputType>
+    static OutputType cor(const std::vector<InputType>& v1, const std::vector<InputType>& v2, const std::vector<InputType>& w, bool normalizeWeights = true) throw (DimensionException)
+    {
+      if (normalizeWeights)
+      {
+        std::vector<InputType> wn = w / sum(w);
+        return cov<InputType, OutputType>(v1, v2, wn, false, false)
+          / ( sd<InputType, OutputType>(v1, wn, false, false) * sd<InputType, OutputType>(v2, wn, false, false) );
+      }
+      else
+      {
+        return cov<InputType, OutputType>(v1, v2, w, false, false)
+          / ( sd<InputType, OutputType>(v1, w, false, false) * sd<InputType, OutputType>(v2, w, false, false) );
+      }
     }
-    return v;
-  }
-
-  /**
-   * @return The covariance of two std::vectors.
-   * @param v1 First std::vector.
-   * @param v2 Second std::vector.
-   * @param unbiased Tell if an unbiased estimate must be computed.
-   * @throw DimensionException If the two std::vector do not have the same length.
-   */
-  template<class InputType, class OutputType>
-  static OutputType cov(const std::vector<InputType>& v1, const std::vector<InputType>& v2, bool unbiased = true) throw (DimensionException)
-  {
-    OutputType n = (OutputType)v1.size();
-    OutputType x =  scalar<InputType, OutputType>(
-      center<InputType, OutputType>(v1),
-      center<InputType, OutputType>(v2)
-      ) / n;
-    if (unbiased) x = x * n / (n - 1);
-    return x;
-  }
 
-  /**
-   * @return The weighted covariance of two std::vectors.
-   * To have a population estimate you have to multiply by \f$\frac{n}{n-1}\f$.
-   * @param v1 First std::vector.
-   * @param v2 Second std::vector.
-   * @param w A std::vector of weights.
-   * @param unbiased Tell if an unbiased estimate must be computed.
-   * @param normalizeWeights Tell if weights should be normalized so that they sum to 1.
-   * @throw DimensionException If the two std::vector do not have the same length.
-   */
-  template<class InputType, class OutputType>
-  static OutputType cov(const std::vector<InputType>& v1, const std::vector<InputType>& v2, const std::vector<InputType>& w, bool unbiased = true, bool normalizeWeights = true) throw (DimensionException)
-  {
-    if (normalizeWeights)
-    {
-      std::vector<InputType> wn = w / sum(w);
-      OutputType x = scalar<InputType, OutputType>(
-        center<InputType, OutputType>(v1, wn, false),
-        center<InputType, OutputType>(v2, wn, false),
-        wn
-        );
-      if (unbiased)
+    /**
+     * @return Compute the Shannon entropy indice of a vector of frequencies.
+     *
+     * The elements of the vector should contain frequencies
+     * of each modality of the variable and sum to one. This verification is left to the user
+     * though.
+     *
+     * @author Julien Dutheil
+     * @see shannonDiscrete for computing the shannon indice of a sample, discrete version.
+     * @see shannonContinuous for computing the shannon indice of a sample, continuous version.
+     *
+     * @param v The input std::vector.
+     * @param base The base of the logarithm to use.
+     */
+    template<class InputType, class OutputType>
+    static OutputType shannon(const std::vector<InputType>& v, double base = 2.7182818)
+    {
+      OutputType s = 0;
+      for (auto x : v)
       {
-        x = x / (1 - sum(sqr<double>(wn)));
+        if (x > 0)
+          s += static_cast<OutputType>(x * std::log(x) / std::log(base));
       }
-      return x;
-    }
-    else
-    {
-      OutputType x = scalar<InputType, OutputType>(
-        center<InputType, OutputType>(v1, w, false),
-        center<InputType, OutputType>(v2, w, false),
-        w
-        );
-      if (unbiased)
+      return -s;
+    }
+
+    /**
+     * @return Compute the Shannon entropy indice of a vector.
+     *
+     * This is the discrete version. The vector is supposed to be a finite sample from
+     * a discrete distribution. The counts of each observed state are computed and used
+     * to compute the discrete entropy.
+     *
+     * @author Julien Dutheil
+     * @see shannonContinuous for the continuous version.
+     * @see shannon for direct computation from frequencies.
+     *
+     * @param v The input std::vector.
+     * @param base The base of the logarithm to use.
+     */
+    template<class InputType, class OutputType>
+    static OutputType shannonDiscrete(const std::vector<InputType>& v, double base = 2.7182818)
+    {
+      std::map<InputType, double> counts;
+      for (auto x : v)
       {
-        x = x / (1 - sum(sqr(w)));
+        counts[x]++;
       }
-      return x;
+      OutputType s = 0;
+      double n = static_cast<double>(v.size());
+      for (auto& it : counts)
+      {
+        s += static_cast<OutputType>((it.second / n) * std::log(it.second / n) / std::log(base));
+      }
+      return -s;
+    }
+
+    /**
+     * @return Compute mutual information index from two samples from discrete variables.
+     *
+     * This is the discrete version. Each vector is supposed to be a finite sample from
+     * a discrete distribution. The counts of each (joint) observed state are computed
+     * and used to compute the discrete mutual information.
+     *
+     * @author Julien Dutheil
+     * @see miContinuous.
+     *
+     * @param v1 The first input vector.
+     * @param v2 The second input vector.
+     * @param base The base of the logarithm to use.
+     * @throw DimensionException if the two vectors do not have the same lengths.
+     */
+    template<class InputType, class OutputType>
+    static OutputType miDiscrete(const std::vector<InputType>& v1, const std::vector<InputType>& v2, double base = 2.7182818) throw (DimensionException)
+    {
+      if (v1.size() != v2.size())
+        throw DimensionException("VectorTools::miDiscrete. The two samples must have the same length.", v2.size(), v1.size());
+      std::map<InputType, double> counts1;
+      std::map<InputType, double> counts2;
+      std::map<InputType, std::map<InputType, double> > counts12;
+      for (size_t i = 0; i < v1.size(); i++)
+      {
+        counts1[v1[i]]++;
+        counts2[v2[i]]++;
+        counts12[v1[i]][v2[i]]++;
+      }
+      OutputType s = 0;
+      double n = static_cast<double>(v1.size());
+      for (auto& it1 : counts12)
+      {
+        for (auto& it2 : it1.second)
+        {
+          s += static_cast<OutputType>((it2.second / n) * std::log(it2.second * n / (counts1[it1.first] * counts2[it2.first])) / std::log(base));
+        }
+      }
+      return s;
+    }
+
+    /**
+     * @return Compute the Shannon entropy indice of a sample from a continuous variable.
+     *
+     * This is the continuous version. The vector is supposed to be a finite sample from
+     * a continuous distribution. The density is of the distribution is estimated using
+     * a kernel method, and is used to compute the continuous entropy.
+     *
+     * Reference: Ivan Kojadinovic (2004) _Computational Statistics & Data Analysis_, 46:269-294
+     *
+     * @author Julien Dutheil
+     * @see shannon For the discrete version.
+     *
+     * @param v The input std::vector.
+     * @param base The base of the logarithm to use.
+     */
+    template<class InputType, class OutputType>
+    static OutputType shannonContinuous(const std::vector<InputType>& v, double base = 2.7182818)
+    {
+      LinearMatrix<InputType> m(1, v.size());
+      for (size_t i = 0; i < v.size(); i++)
+      {
+        m(0, i) = v[i];
+      }
+      AdaptiveKernelDensityEstimation kd(m);
+      OutputType s = 0;
+      std::vector<double> x(1);
+      for (auto it : v)
+      {
+        x[0] = static_cast<double>(it);
+        s += static_cast<OutputType>(std::log(kd.kDensity(x)) / std::log(base));
+      }
+      return -s / static_cast<double>(v.size());
+    }
+
+    /**
+     * @return Compute mutual information index from two samples from continuous variables.
+     *
+     * This is the continuous version. Each vector is supposed to be a finite sample from
+     * a continuous distribution. The density is of the distribution is estimated using
+     * a kernel method, as well as the joint density, and are used to compute the continuous
+     * mutual information.
+     *
+     * Reference: Ivan Kojadinovic (2004) _Computational Statistics & Data Analysis_, 46:269-294
+     *
+     * @author Julien Dutheil
+     * @see miDiscrete For the discrete version.
+     * @warning This function is experimental. Notably, bad kernel density estimates may lead to negative MI :(
+     *
+     * @param v1 The first input vector.
+     * @param v2 The second input vector.
+     * @param base The base of the logarithm to use.
+     * @throw DimensionException if the two vectors do not have the same lengths.
+     */
+    template<class InputType, class OutputType>
+    static OutputType miContinuous(const std::vector<InputType>& v1, const std::vector<InputType>& v2, double base = 2.7182818) throw (DimensionException)
+    {
+      if (v1.size() != v2.size())
+        throw DimensionException("VectorTools::miContinuous. The two samples must have the same length.", v2.size(), v1.size());
+      LinearMatrix<InputType> m1(1, v1.size());
+      LinearMatrix<InputType> m2(1, v2.size());
+      LinearMatrix<InputType> m12(2, v1.size());
+      for (size_t i = 0; i < v1.size(); i++)
+      {
+        m1(0, i) = m12(0, i) = v1[i];
+        m2(0, i) = m12(1, i) = v2[i];
+      }
+      AdaptiveKernelDensityEstimation kd1(m1);
+      AdaptiveKernelDensityEstimation kd2(m2);
+      AdaptiveKernelDensityEstimation kd12(m12);
+      OutputType s = 0;
+      std::vector<double> x1(1);
+      std::vector<double> x2(1);
+      std::vector<double> x12(2);
+      for (size_t i = 0; i < v1.size(); i++)
+      {
+        x1[0] = x12[0] = static_cast<double>(v1[i]);
+        x2[0] = x12[1] = static_cast<double>(v2[i]);
+        s += static_cast<OutputType>(std::log(kd12.kDensity(x12) / (kd1.kDensity(x1) * kd2.kDensity(x2))) / std::log(base));
+      }
+      return s / static_cast<double>(v1.size());
+    }
+
+    /**
+     * @return 'true' if the two std::vectors contains the same elements, whatever their order in the container.
+     * @param v1 First std::vector.
+     * @param v2 Second std::vector.
+     */
+    template<class T>
+    static bool haveSameElements(const std::vector<T>& v1, const std::vector<T>& v2)
+    {
+      std::vector<T> u1(v1);
+      std::vector<T> u2(v2);
+      if (u1.size() != u2.size()) return false;
+      std::sort(u1.begin(), u1.end());
+      std::sort(u2.begin(), u2.end());
+      return u1 == u2;
+    }
+
+    /**
+     * @return 'true' if the two std::vectors contains the same elements, <b>in the same frequency</b>, whatever their order in the container.
+     *
+     * @warning The two input std::vectors will be sorted.
+     *
+     * @param v1 First std::vector.
+     * @param v2 Second std::vector.
+     */
+    template<class T>
+    static bool haveSameElements(std::vector<T>& v1, std::vector<T>& v2)
+    {
+      if (v1.size() != v2.size()) return false;
+      std::sort(v1.begin(), v1.end());
+      std::sort(v2.begin(), v2.end());
+      return v1 == v2;
+    }
+
+    /**
+     * @return 'true' if a the input std::vector contains the given element.
+     * @param vec The std::vector to check.
+     * @param el The element to look for.
+     */
+    template<class T>
+    static bool contains(const std::vector<T>& vec, T el)
+    {
+      for (auto it : vec)
+      {
+        if (it == el) return true;
+      }
+      return false;
     }
-  }
-  /**
-   * @return The variance of the std::vector.
-   * @param v1 The sample std::vector.
-   * @param unbiased Tell if an unbiased estimate must be computed.
-   */
-  template<class InputType, class OutputType>
-  static OutputType var(const std::vector<InputType>& v1, bool unbiased = true)
-  {
-    return cov<InputType, OutputType>(v1, v1, unbiased);
-  }
-  /**
-   * @return The weighted variance of the std::vector.
-   * @param v1 The sample std::vector.
-   * @param w A std::vector of weights.
-   * @param unbiased Tell if an unbiased estimate must be computed.
-   * @param normalizeWeights Tell if weights should be normalized so that they sum to 1.
-   * @throw DimensionException If v1 and w do not have the same length.
-   */
-  template<class InputType, class OutputType>
-  static OutputType var(const std::vector<InputType>& v1, const std::vector<InputType>& w, bool unbiased = true, bool normalizeWeights = true) throw (DimensionException)
-  {
-    return cov<InputType, OutputType>(v1, v1, w, unbiased, normalizeWeights);
-  }
-
-  /**
-   * @return The standard deviation of the std::vector.
-   * @param v1 The sample std::vector.
-   * @param unbiased Tell if an unbiased estimate must be computed.
-   */
-  template<class InputType, class OutputType>
-  static OutputType sd(const std::vector<InputType>& v1, bool unbiased = true)
-  {
-    return sqrt(var<InputType, OutputType>(v1, unbiased));
-  }
-
-  /**
-   * @return The weighted standard deviation of the std::vector.
-   * @param v1 The sample std::vector.
-   * @param w A std::vector of weights.
-   * @param unbiased Tell if an unbiased estimate must be computed.
-   * @param normalizeWeights Tell if weights should be normalized so that they sum to 1.
-   * @throw DimensionException If v1 and w do not have the same length.
-   */
-  template<class InputType, class OutputType>
-  static OutputType sd(const std::vector<InputType>& v1, const std::vector<InputType>& w, bool unbiased = true, bool normalizeWeights = true) throw (DimensionException)
-  {
-    return sqrt(var<InputType, OutputType>(v1, w, unbiased, normalizeWeights));
-  }
-
-  /**
-   * @return The Pearson correlation coefficient of two std::vectors.
-   * @param v1 First std::vector.
-   * @param v2 Second std::vector.
-   * @throw DimensionException If the two std::vector do not have the same length.
-   */
-  template<class InputType, class OutputType>
-  static OutputType cor(const std::vector<InputType>& v1, const std::vector<InputType>& v2) throw (DimensionException)
-  {
-    return cov<InputType, OutputType>(v1, v2)
-           / ( sd<InputType, OutputType>(v1) * sd<InputType, OutputType>(v2) );
-  }
 
-  /**
-   * @return The weighted Pearson correlation coefficient of two std::vectors.
-   * @param v1 First std::vector.
-   * @param v2 Second std::vector.
-   * @param w A std::vector of weights.
-   * @param normalizeWeights Tell if weights should be normalized so that they sum to 1.
-   * @throw DimensionException If the two std::vector do not have the same length.
-   */
-  template<class InputType, class OutputType>
-  static OutputType cor(const std::vector<InputType>& v1, const std::vector<InputType>& v2, const std::vector<InputType>& w, bool normalizeWeights = true) throw (DimensionException)
-  {
-    if (normalizeWeights)
-    {
-      std::vector<InputType> wn = w / sum(w);
-      return cov<InputType, OutputType>(v1, v2, wn, false, false)
-             / ( sd<InputType, OutputType>(v1, wn, false, false) * sd<InputType, OutputType>(v2, wn, false, false) );
-    }
-    else
+    template<class T, class U>
+    static bool contains(const std::vector<T>& vec, U el)
     {
-      return cov<InputType, OutputType>(v1, v2, w, false, false)
-             / ( sd<InputType, OutputType>(v1, w, false, false) * sd<InputType, OutputType>(v2, w, false, false) );
+      for (auto it : vec)
+      {
+        if (it == (T)el) return true;
+      }
+      return false;
+    }
+
+    /**
+     * @return 'true' if a the first std::vector contains all elements of the second std::vector.
+     *
+     * @warning The two input std::vectors will be sorted.
+     *
+     * @param v1 The first std::vector to check.
+     * @param v2 The second std::vector to check.
+     */
+    template<class T>
+    static bool containsAll(std::vector<T>& v1, std::vector<T>& v2)
+    {
+      std::sort(v1.begin(), v1.end());
+      std::sort(v2.begin(), v2.end());
+      size_t j = 0;
+      for (size_t i = 0; i < v2.size(); i++)
+      {
+        if (i > 0 && v2[i] == v2[i - 1]) continue;
+        while (j < v1.size() - 1 && v1[j] < v2[i]) j++;
+        if (v1[j] != v2[i]) return false;
+      }
+      return true;
     }
-  }
 
-  /**
-   * @return Compute the Shannon entropy indice of a vector of frequencies.
-   *
-   * The elements of the vector should contain frequencies
-   * of each modality of the variable and sum to one. This verification is left to the user
-   * though.
-   *
-   * @author Julien Dutheil
-   * @see shannonDiscrete for computing the shannon indice of a sample, discrete version.
-   * @see shannonContinuous for computing the shannon indice of a sample, continuous version.
-   *
-   * @param v The input std::vector.
-   * @param base The base of the logarithm to use.
-   */
-  template<class InputType, class OutputType>
-  static OutputType shannon(const std::vector<InputType>& v, double base = 2.7182818)
-  {
-    OutputType s = 0;
-    for (size_t i = 0; i < v.size(); i++)
+    /**
+     * @return A std::vector which is the union of two std::vectors passed as input.
+     * Duplicate element will be removed.
+     * @param vec1 Vector 1.
+     * @param vec2 Vector 2.
+     */
+    template<class T>
+    static std::vector<T> vectorUnion(const std::vector<T>& vec1, const std::vector<T>& vec2)
     {
-      if (v[i] > 0) s += static_cast<OutputType>(v[i] * std::log(v[i]) / std::log(base));
+      std::vector<T> unionEl = vec1;
+      for (auto it : vec2)
+      {
+        if (!contains(unionEl, it))
+          unionEl.push_back(it);
+      }
+      return unionEl;
     }
-    return -s;
-  }
 
-  /**
-   * @return Compute the Shannon entropy indice of a vector.
-   *
-   * This is the discrete version. The vector is supposed to be a finite sample from
-   * a discrete distribution. The counts of each observed state are computed and used
-   * to compute the discrete entropy.
-   *
-   * @author Julien Dutheil
-   * @see shannonContinuous for the continuous version.
-   * @see shannon for direct computation from frequencies.
-   *
-   * @param v The input std::vector.
-   * @param base The base of the logarithm to use.
-   */
-  template<class InputType, class OutputType>
-  static OutputType shannonDiscrete(const std::vector<InputType>& v, double base = 2.7182818)
-  {
-    std::map<InputType, double> counts;
-    for (size_t i = 0; i < v.size(); i++)
-    {
-      counts[v[i]]++;
-    }
-    OutputType s = 0;
-    double n = static_cast<double>(v.size());
-    for (typename std::map<InputType, double>::iterator it = counts.begin(); it != counts.end(); it++)
+    /**
+     * @return A std::vector which is the union of all std::vectors passed as input.
+     * Duplicate element will be removed.
+     * @param vecElementL A std::vector of std::vectors.
+     */
+    template<class T>
+    static std::vector<T> vectorUnion(const std::vector< std::vector<T> >& vecElementL)
     {
-      s += static_cast<OutputType>((it->second / n) * std::log(it->second / n) / std::log(base));
+      std::vector<T> unionEl;
+      for (auto it : vecElementL)
+      {
+        for (auto it2 : it)
+        {
+          if (!contains(unionEl, it2))
+            unionEl.push_back(it2);
+        }
+      }
+      return unionEl;
     }
-    return -s;
-  }
 
-  /**
-   * @return Compute mutual information index from two samples from discrete variables.
-   *
-   * This is the discrete version. Each vector is supposed to be a finite sample from
-   * a discrete distribution. The counts of each (joint) observed state are computed
-   * and used to compute the discrete mutual information.
-   *
-   * @author Julien Dutheil
-   * @see miContinuous.
-   *
-   * @param v1 The first input vector.
-   * @param v2 The second input vector.
-   * @param base The base of the logarithm to use.
-   * @throw DimensionException if the two vectors do not have the same lengths.
-   */
-  template<class InputType, class OutputType>
-  static OutputType miDiscrete(const std::vector<InputType>& v1, const std::vector<InputType>& v2, double base = 2.7182818) throw (DimensionException)
-  {
-    if (v1.size() != v2.size())
-      throw DimensionException("VectorTools::miDiscrete. The two samples must have the same length.", v2.size(), v1.size());
-    std::map<InputType, double> counts1;
-    std::map<InputType, double> counts2;
-    std::map<InputType, std::map<InputType, double> > counts12;
-    for (size_t i = 0; i < v1.size(); i++)
+    /**
+     * @return A std::vector which is the intersection of two std::vectors passed as input.
+     * @param vec1 Vector 1.
+     * @param vec2 Vector 2.
+     */
+    template<class T>
+    static std::vector<T> vectorIntersection(const std::vector<T>& vec1, const std::vector<T>& vec2)
     {
-      counts1[v1[i]]++;
-      counts2[v2[i]]++;
-      counts12[v1[i]][v2[i]]++;
-    }
-    OutputType s = 0;
-    double n = static_cast<double>(v1.size());
-    for (typename std::map<InputType, std::map<InputType, double> >::iterator it1 = counts12.begin(); it1 != counts12.end(); it1++)
-    {
-      for (typename std::map<InputType, double>::iterator it2 = it1->second.begin(); it2 != it1->second.end(); it2++)
+      std::vector<T> interEl;
+      for (auto it : vec1)
       {
-        s += static_cast<OutputType>((it2->second / n) * std::log(it2->second * n / (counts1[it1->first] * counts2[it2->first])) / std::log(base));
+        if (contains(vec2, it)) interEl.push_back(it);
       }
+      return interEl;
     }
-    return s;
-  }
 
-  /**
-   * @return Compute the Shannon entropy indice of a sample from a continuous variable.
-   *
-   * This is the continuous version. The vector is supposed to be a finite sample from
-   * a continuous distribution. The density is of the distribution is estimated using
-   * a kernel method, and is used to compute the continuous entropy.
-   *
-   * Reference: Ivan Kojadinovic (2004) _Computational Statistics & Data Analysis_, 46:269-294
-   *
-   * @author Julien Dutheil
-   * @see shannon For the discrete version.
-   *
-   * @param v The input std::vector.
-   * @param base The base of the logarithm to use.
-   */
-  template<class InputType, class OutputType>
-  static OutputType shannonContinuous(const std::vector<InputType>& v, double base = 2.7182818)
-  {
-    LinearMatrix<InputType> m(1, v.size());
-    for (size_t i = 0; i < v.size(); i++)
-    {
-      m(0, i) = v[i];
-    }
-    AdaptiveKernelDensityEstimation kd(m);
-    OutputType s = 0;
-    std::vector<double> x(1);
-    for (size_t i = 0; i < v.size(); i++)
+    template<class T, class U>
+    static std::vector<T> vectorIntersection(const std::vector<T>& vec1, const std::vector<U>& vec2)
     {
-      x[0] = static_cast<double>(v[i]);
-      s += static_cast<OutputType>(std::log(kd.kDensity(x)) / std::log(base));
+      std::vector<T> interEl;
+      for (auto it : vec1)
+      {
+        if (contains(vec2, it)) interEl.push_back(it);
+      }
+      return interEl;
     }
-    return -s / static_cast<double>(v.size());
-  }
 
-  /**
-   * @return Compute mutual information index from two samples from continuous variables.
-   *
-   * This is the continuous version. Each vector is supposed to be a finite sample from
-   * a continuous distribution. The density is of the distribution is estimated using
-   * a kernel method, as well as the joint density, and are used to compute the continuous
-   * mutual information.
-   *
-   * Reference: Ivan Kojadinovic (2004) _Computational Statistics & Data Analysis_, 46:269-294
-   *
-   * @author Julien Dutheil
-   * @see miDiscrete For the discrete version.
-   * @warning This function is experimental. Notably, bad kernel density estimates may lead to negative MI :(
-   *
-   * @param v1 The first input vector.
-   * @param v2 The second input vector.
-   * @param base The base of the logarithm to use.
-   * @throw DimensionException if the two vectors do not have the same lengths.
-   */
-  template<class InputType, class OutputType>
-  static OutputType miContinuous(const std::vector<InputType>& v1, const std::vector<InputType>& v2, double base = 2.7182818) throw (DimensionException)
-  {
-    if (v1.size() != v2.size())
-      throw DimensionException("VectorTools::miContinuous. The two samples must have the same length.", v2.size(), v1.size());
-    LinearMatrix<InputType> m1(1, v1.size());
-    LinearMatrix<InputType> m2(1, v2.size());
-    LinearMatrix<InputType> m12(2, v1.size());
-    for (size_t i = 0; i < v1.size(); i++)
+    /**
+     * @return A std::vector which is the intersection of all std::vectors passed as input.
+     * @param vecElementL A std::vector of std::vectors.
+     */
+    template<class T>
+    static std::vector<T> vectorIntersection(const std::vector< std::vector<T> >& vecElementL)
     {
-      m1(0, i) = m12(0, i) = v1[i];
-      m2(0, i) = m12(1, i) = v2[i];
-    }
-    AdaptiveKernelDensityEstimation kd1(m1);
-    AdaptiveKernelDensityEstimation kd2(m2);
-    AdaptiveKernelDensityEstimation kd12(m12);
-    OutputType s = 0;
-    std::vector<double> x1(1);
-    std::vector<double> x2(1);
-    std::vector<double> x12(2);
-    for (size_t i = 0; i < v1.size(); i++)
-    {
-      x1[0] = x12[0] = static_cast<double>(v1[i]);
-      x2[0] = x12[1] = static_cast<double>(v2[i]);
-      s += static_cast<OutputType>(std::log(kd12.kDensity(x12) / (kd1.kDensity(x1) * kd2.kDensity(x2))) / std::log(base));
+      if (vecElementL.size() == 1) return vecElementL[0];
+      std::vector<T> interEl;
+      if (vecElementL.size() == 0) return interEl;
+      for (auto it : vecElementL[0])
+      {
+        bool test = true;
+        for (size_t j = 1; test && j < vecElementL.size(); j++)
+        {
+          if (!contains(vecElementL[j], it)) test = false;
+        }
+        if (test) interEl.push_back(it);
+      }
+      return interEl;
     }
-    return s / static_cast<double>(v1.size());
-  }
-
-  /**
-   * @return 'true' if the two std::vectors contains the same elements, whatever their order in the container.
-   * @param v1 First std::vector.
-   * @param v2 Second std::vector.
-   */
-  template<class T>
-  static bool haveSameElements(const std::vector<T>& v1, const std::vector<T>& v2)
-  {
-    std::vector<T> u1(v1);
-    std::vector<T> u2(v2);
-    if (u1.size() != u2.size()) return false;
-    std::sort(u1.begin(), u1.end());
-    std::sort(u2.begin(), u2.end());
-    return u1 == u2;
-  }
 
-  /**
-   * @return 'true' if the two std::vectors contains the same elements, <b>in the same frequency</b>, whatever their order in the container.
-   *
-   * @warning The two input std::vectors will be sorted.
-   *
-   * @param v1 First std::vector.
-   * @param v2 Second std::vector.
-   */
-  template<class T>
-  static bool haveSameElements(std::vector<T>& v1, std::vector<T>& v2)
-  {
-    if (v1.size() != v2.size()) return false;
-    std::sort(v1.begin(), v1.end());
-    std::sort(v2.begin(), v2.end());
-    return v1 == v2;
-  }
-
-  /**
-   * @return 'true' if a the input std::vector contains the given element.
-   * @param vec The std::vector to check.
-   * @param el The element to look for.
-   */
-  template<class T>
-  static bool contains(const std::vector<T>& vec, T el)
-  {
-    for (size_t i = 0; i < vec.size(); i++)
+    /**
+     * @brief Append the content of a std::vector to another one.
+     * @param vec1 Vector 1.
+     * @param vec2 Vector 2.
+     */
+    template<class T>
+    static void append(std::vector<T>& vec1, const std::vector<T>& vec2)
     {
-      if (vec[i] == el) return true;
+      vec1.insert(vec1.end(), vec2.begin(), vec2.end());
     }
-    return false;
-  }
 
-  /**
-   * @return 'true' if a the first std::vector contains all elements of the second std::vector.
-   *
-   * @warning The two input std::vectors will be sorted.
-   *
-   * @param v1 The first std::vector to check.
-   * @param v2 The second std::vector to check.
-   */
-  template<class T>
-  static bool containsAll(std::vector<T>& v1, std::vector<T>& v2)
-  {
-    std::sort(v1.begin(), v1.end());
-    std::sort(v2.begin(), v2.end());
-    size_t j = 0;
-    for (size_t i = 0; i < v2.size(); i++)
+    /**
+     * @brief Prepend the content of a std::vector to another one.
+     * @param vec1 Vector 1.
+     * @param vec2 Vector 2.
+     */
+    template<class T>
+    static void prepend(std::vector<T>& vec1, const std::vector<T>& vec2)
     {
-      if (i > 0 && v2[i] == v2[i - 1]) continue;
-      while (j < v1.size() - 1 && v1[j] < v2[i]) j++;
-      if (v1[j] != v2[i]) return false;
+      vec1.insert(vec1.begin(), vec2.begin(), vec2.end());
     }
-    return true;
-  }
 
-  /**
-   * @return A std::vector which is the union of two std::vectors passed as input.
-   * Duplicate element will be removed.
-   * @param vec1 Vector 1.
-   * @param vec2 Vector 2.
-   */
-  template<class T>
-  static std::vector<T> vectorUnion(const std::vector<T>& vec1, const std::vector<T>& vec2)
-  {
-    std::vector<T> unionEl = vec1;
-    for (size_t j = 0; j < vec2.size(); j++)
-    {
-      if (!contains(unionEl, vec2[j]))
-        unionEl.push_back(vec2[j]);
-    }
-    return unionEl;
-  }
 
-  /**
-   * @return A std::vector which is the union of all std::vectors passed as input.
-   * Duplicate element will be removed.
-   * @param vecElementL A std::vector of std::vectors.
-   */
-  template<class T>
-  static std::vector<T> vectorUnion(const std::vector< std::vector<T> >& vecElementL)
-  {
-    std::vector<T> unionEl;
-    for (size_t i = 0; i < vecElementL.size(); i++)
+    /**
+     * @return A single std::vector made of the concatenation of the std::vectors passed as input.
+     * @param vecElementL A std::vector of std::vectors.
+     */
+    template<class T>
+    static std::vector<T> append(const std::vector< std::vector<T> >& vecElementL)
     {
-      for (size_t j = 0; j < vecElementL[i].size(); j++)
+      if (vecElementL.size() == 1) return vecElementL[0];
+      std::vector<T> v;
+      if (vecElementL.size() == 0) return v;
+      for (auto it : vecElementL[0])
       {
-        if (!contains(unionEl, vecElementL[i][j]))
-          unionEl.push_back(vecElementL[i][j]);
+        v.push_back(it);
       }
+      return v;
     }
-    return unionEl;
-  }
-
-  /**
-   * @return A std::vector which is the intersection of two std::vectors passed as input.
-   * @param vec1 Vector 1.
-   * @param vec2 Vector 2.
-   */
-  template<class T>
-  static std::vector<T> vectorIntersection(const std::vector<T>& vec1, const std::vector<T>& vec2)
-  {
-    std::vector<T> interEl;
-    for (size_t i = 0; i < vec1.size(); i++)
-    {
-      if (contains(vec2, vec1[i])) interEl.push_back(vec1[i]);
-    }
-    return interEl;
-  }
 
-  /**
-   * @return A std::vector which is the intersection of all std::vectors passed as input.
-   * @param vecElementL A std::vector of std::vectors.
-   */
-  template<class T>
-  static std::vector<T> vectorIntersection(const std::vector< std::vector<T> >& vecElementL)
-  {
-    if (vecElementL.size() == 1) return vecElementL[0];
-    std::vector<T> interEl;
-    if (vecElementL.size() == 0) return interEl;
-    for (size_t i = 0; i < vecElementL[0].size(); i++)
+    /**
+     * @brief Extend the content of a std::vector with another one. Only the elements not present in the first vector will be added.
+     * @param vec1 Vector 1.
+     * @param vec2 Vector 2.
+     */
+    template<class T>
+    static void extend(std::vector<T>& vec1, const std::vector<T>& vec2)
     {
-      bool test = true;
-      for (size_t j = 1; test && j < vecElementL.size(); j++)
+      for (auto it : vec2)
       {
-        if (!contains(vecElementL[j], vecElementL[0][i])) test = false;
+        if (!contains(vec1, it))
+          vec1.push_back(it);
       }
-      if (test) interEl.push_back(vecElementL[0][i]);
-    }
-    return interEl;
-  }
-
-  /**
-   * @brief Append the content of a std::vector to another one.
-   * @param vec1 Vector 1.
-   * @param vec2 Vector 2.
-   */
-  template<class T>
-  static void append(std::vector<T>& vec1, const std::vector<T>& vec2)
-  {
-    vec1.insert(vec1.end(), vec2.begin(), vec2.end());
-    // for(size_t i = 0; i < vec2.size(); i++)
-    // {
-    //  vec1.push_back(vec2[i]);
-    // }
-  }
-
-  /**
-   * @brief Prepend the content of a std::vector to another one.
-   * @param vec1 Vector 1.
-   * @param vec2 Vector 2.
-   */
-  template<class T>
-  static void prepend(std::vector<T>& vec1, const std::vector<T>& vec2)
-  {
-    vec1.insert(vec1.begin(), vec2.begin(), vec2.end());
-  }
-
-
-  /**
-   * @return A single std::vector made of the concatenation of the std::vectors passed as input.
-   * @param vecElementL A std::vector of std::vectors.
-   */
-  template<class T>
-  static std::vector<T> append(const std::vector< std::vector<T> >& vecElementL)
-  {
-    if (vecElementL.size() == 1) return vecElementL[0];
-    std::vector<T> v;
-    if (vecElementL.size() == 0) return v;
-    for (size_t i = 0; i < vecElementL[0].size(); i++)
-    {
-      v.push_back(vecElementL[0][i]);
-    }
-    return v;
-  }
-
-  /**
-   * @brief Extend the content of a std::vector with another one. Only the elements not present in the first vector will be added.
-   * @param vec1 Vector 1.
-   * @param vec2 Vector 2.
-   */
-  template<class T>
-  static void extend(std::vector<T>& vec1, const std::vector<T>& vec2)
-  {
-    for (size_t i = 0; i < vec2.size(); i++)
-    {
-      if (!contains(vec1, vec2[i]))
-        vec1.push_back(vec2[i]);
-    }
-  }
-
-  /**
-   * @return A single std::vector made of the repetion of the std::vectors passed as input.
-   * @param vec A std::vector.
-   * @param n the number of repetitions
-   */
-  template<class T>
-  static std::vector<T> rep(const std::vector<T>& vec, size_t n)
-  {
-    if (n == 1) return vec;
-    std::vector<T> v;
-    if (n == 0) return v;
-    v.resize(vec.size() * n);
-    for (size_t i = 0; i < v.size(); i++)
-    {
-      v[i] = vec[i % vec.size()];
     }
-    return v;
-  }
 
-  /**
-   * @brief This function returns the difference of two std::vectors.
-   *
-   * @warning The two input std::vectors will be sorted. As a consequence, the output std::vector will be also sorted.
-   *
-   * @param v1 First std::vector.
-   * @param v2 Second std::vector.
-   * @param v3 A std::vector to be populated with all elements in v1 that are not found in v2.
-   */
-  template<class T>
-  static void diff(std::vector<T>& v1, std::vector<T>& v2, std::vector<T>& v3)
-  {
-    if (v2.size() == 0) append(v3, v1);
-    std::sort(v1.begin(), v1.end());
-    std::sort(v2.begin(), v2.end());
-    size_t j = 0;
-    for (size_t i = 0; i < v1.size(); i++)
+    /**
+     * @return A single std::vector made of the repetion of the std::vectors passed as input.
+     * @param vec A std::vector.
+     * @param n the number of repetitions
+     */
+    template<class T>
+    static std::vector<T> rep(const std::vector<T>& vec, size_t n)
     {
-      if (i > 0 && v1[i] == v1[i - 1]) continue;
-      while (j < v2.size() - 1 && v2[j] < v1[i]) j++;
-      if (v2[j] != v1[i]) v3.push_back(v1[i]);
+      if (n == 1) return vec;
+      std::vector<T> v;
+      if (n == 0) return v;
+      v.resize(vec.size() * n);
+      for (size_t i = 0; i < v.size(); i++)
+      {
+        v[i] = vec[i % vec.size()];
+      }
+      return v;
+    }
+
+    /**
+     * @brief This function returns the difference of two std::vectors.
+     *
+     * @warning The two input std::vectors will be sorted. As a consequence, the output std::vector will be also sorted.
+     *
+     * @param v1 First std::vector.
+     * @param v2 Second std::vector.
+     * @param v3 A std::vector to be populated with all elements in v1 that are not found in v2.
+     */
+    template<class T>
+    static void diff(std::vector<T>& v1, std::vector<T>& v2, std::vector<T>& v3)
+    {
+      if (v2.size() == 0) append(v3, v1);
+      std::sort(v1.begin(), v1.end());
+      std::sort(v2.begin(), v2.end());
+      size_t j = 0;
+      for (size_t i = 0; i < v1.size(); i++)
+      {
+        if (i > 0 && v1[i] == v1[i - 1]) continue;
+        while (j < v2.size() - 1 && v2[j] < v1[i]) j++;
+        if (v2[j] != v1[i]) v3.push_back(v1[i]);
+      }
     }
-  }
 
-  /**
-   * @brief Test function.
-   * @return true if all tests are passed.
-   */
-  static bool test();
-};
+    /**
+     * @brief Test function.
+     * @return true if all tests are passed.
+     */
+    static bool test();
+  };
 } // end of namespace bpp.
 
 #endif  // _VECTORTOOLS_H_
diff --git a/src/Bpp/Text/KeyvalTools.cpp b/src/Bpp/Text/KeyvalTools.cpp
index d6fe39b..e069466 100644
--- a/src/Bpp/Text/KeyvalTools.cpp
+++ b/src/Bpp/Text/KeyvalTools.cpp
@@ -46,7 +46,7 @@ knowledge of the CeCILL license and that you accept its terms.
 using namespace bpp;
 using namespace std;
 
-void KeyvalTools::singleKeyval(const std::string& desc, std::string& key, std::string& val, const std::string& split) throw (KeyvalException)
+void KeyvalTools::singleKeyval(const std::string& desc, std::string& key, std::string& val, const std::string& split)
 {
   string::size_type i = desc.find(split);
   if (i == string::npos)
@@ -55,7 +55,7 @@ void KeyvalTools::singleKeyval(const std::string& desc, std::string& key, std::s
   val = desc.substr(i+1);
 }
 
-void KeyvalTools::multipleKeyvals(const std::string& desc, std::map<std::string,std::string>& keyvals, const std::string& split, bool nested) throw (KeyvalException)
+void KeyvalTools::multipleKeyvals(const std::string& desc, std::map<std::string,std::string>& keyvals, const std::string& split, bool nested)
 {
   unique_ptr<StringTokenizer> st;
   if (nested)
@@ -95,7 +95,7 @@ void KeyvalTools::multipleKeyvals(const std::string& desc, std::map<std::string,
   }
 }
 
-std::string KeyvalTools::changeKeyvals(const std::string& desc, const std::map<std::string, std::string>& newkeyvals, const std::string& split, bool nested) throw (KeyvalException)
+std::string KeyvalTools::changeKeyvals(const std::string& desc, const std::map<std::string, std::string>& newkeyvals, const std::string& split, bool nested)
 {
   string::size_type begin = desc.find_first_of("(");
   string::size_type end = desc.find_last_of(")");
@@ -169,7 +169,7 @@ std::string KeyvalTools::changeKeyvals(const std::string& desc, const std::map<s
   return newDesc;
 }
 
-void KeyvalTools::parseProcedure(const std::string& desc, std::string& name, std::map<std::string, std::string>& args) throw (KeyvalException)
+void KeyvalTools::parseProcedure(const std::string& desc, std::string& name, std::map<std::string, std::string>& args)
 {
   string::size_type begin = desc.find_first_of("(");
   string::size_type end = desc.find_last_of(")");
diff --git a/src/Bpp/Text/KeyvalTools.h b/src/Bpp/Text/KeyvalTools.h
index e5100c2..31d9a6d 100644
--- a/src/Bpp/Text/KeyvalTools.h
+++ b/src/Bpp/Text/KeyvalTools.h
@@ -88,7 +88,7 @@ class KeyvalTools
      * @throw KeyvalException If the syntax describing the keyval is not correct.
      */
 
-  static void singleKeyval(const std::string& desc, std::string& key, std::string& val, const std::string& split = "=") throw (KeyvalException);
+  static void singleKeyval(const std::string& desc, std::string& key, std::string& val, const std::string& split = "=");
     
     /**
      * @brief Split a string into several keys and corresponding values (General purpose function).
@@ -100,7 +100,7 @@ class KeyvalTools
      * @throw KeyvalException If the syntax describing the keyval is not correct.
      */
   
-    static void multipleKeyvals(const std::string& desc, std::map<std::string, std::string>& keyvals, const std::string& split = ",", bool nested = true) throw (KeyvalException);
+    static void multipleKeyvals(const std::string& desc, std::map<std::string, std::string>& keyvals, const std::string& split = ",", bool nested = true);
 
   /**
    * @brief Change several keys to new corresponding values (General
@@ -119,7 +119,7 @@ class KeyvalTools
    * @throw KeyvalException If the syntax describing the keyval is not correct.
    */
   
-  static std::string changeKeyvals(const std::string& desc, const std::map<std::string, std::string>& newkeyvals, const std::string& split = ",", bool nested = true) throw (KeyvalException);
+  static std::string changeKeyvals(const std::string& desc, const std::map<std::string, std::string>& newkeyvals, const std::string& split = ",", bool nested = true);
 
     /**
      * @brief Parse (not recursively) a procedure string.
@@ -129,7 +129,7 @@ class KeyvalTools
      * @param args [out] Fills a map with all keys and values for parameters.
      * @throw KeyvalException If the description is invalid (one parenthesis is missing for instance).
      */
-    static void parseProcedure(const std::string& desc, std::string& name, std::map<std::string, std::string>& args) throw (KeyvalException);
+    static void parseProcedure(const std::string& desc, std::string& name, std::map<std::string, std::string>& args);
 };
 
 } //End of namespace bpp.
diff --git a/src/Bpp/Text/NestedStringTokenizer.cpp b/src/Bpp/Text/NestedStringTokenizer.cpp
index b51b7e5..4a51930 100644
--- a/src/Bpp/Text/NestedStringTokenizer.cpp
+++ b/src/Bpp/Text/NestedStringTokenizer.cpp
@@ -47,8 +47,7 @@ using namespace bpp;
 
 using namespace std;
 
-NestedStringTokenizer::NestedStringTokenizer(const std::string& s, const std::string& open, const std::string& end, const std::string& delimiters, bool solid)
-  throw (Exception):
+NestedStringTokenizer::NestedStringTokenizer(const std::string& s, const std::string& open, const std::string& end, const std::string& delimiters, bool solid):
   StringTokenizer()
 {
   int blocks = 0;
@@ -145,7 +144,7 @@ NestedStringTokenizer::NestedStringTokenizer(const std::string& s, const std::st
   }
 }
 
-const std::string& NestedStringTokenizer::nextToken() throw (Exception)
+const std::string& NestedStringTokenizer::nextToken()
 {
   if (!hasMoreToken()) throw Exception("No more token in nested tokenizer.");
   return tokens_[currentPosition_++];
diff --git a/src/Bpp/Text/NestedStringTokenizer.h b/src/Bpp/Text/NestedStringTokenizer.h
index 9ba5f8b..d101ccf 100644
--- a/src/Bpp/Text/NestedStringTokenizer.h
+++ b/src/Bpp/Text/NestedStringTokenizer.h
@@ -70,7 +70,7 @@ namespace bpp
      * @param delimiters Chars that must be considered as delimiters.
      * @param solid      If true, delimiters is considered as a single bloc delimiter.
      */
-    NestedStringTokenizer(const std::string& s, const std::string& open, const std::string& end, const std::string& delimiters = " \t\n\f\r", bool solid = false) throw (Exception);
+    NestedStringTokenizer(const std::string& s, const std::string& open, const std::string& end, const std::string& delimiters = " \t\n\f\r", bool solid = false);
 		
     virtual ~NestedStringTokenizer() {}
 	
@@ -82,7 +82,7 @@ namespace bpp
      *
      * @return The next token if there is one.
      */
-    const std::string& nextToken() throw (Exception);
+    const std::string& nextToken();
 
 
     /**
diff --git a/src/Bpp/Text/StringTokenizer.h b/src/Bpp/Text/StringTokenizer.h
index 374a9a2..ee736c3 100644
--- a/src/Bpp/Text/StringTokenizer.h
+++ b/src/Bpp/Text/StringTokenizer.h
@@ -91,7 +91,7 @@ namespace bpp
      *
      * @return The next token if there is one.
      */
-    const std::string& nextToken() throw (Exception)
+    const std::string& nextToken()
     {
       if (!hasMoreToken()) throw Exception("No more token in tokenizer.");
       return tokens_[currentPosition_++];
diff --git a/src/Bpp/Text/TextTools.cpp b/src/Bpp/Text/TextTools.cpp
index 1afb81b..6b06a21 100644
--- a/src/Bpp/Text/TextTools.cpp
+++ b/src/Bpp/Text/TextTools.cpp
@@ -1,522 +1,472 @@
 //
 // File: TextTools.cpp
-// Created by: Julien Dutheil
-// Created on: Fri Aug  8 12:57:50 2003
+// Authors:
+//   Julien Dutheil
+//   Francois Gindraud (2017)
+// Created: 2003-08-08 12:57:50
+// Last modified: 2017-06-27
 //
 
 /*
-   Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
-
-   This software is a computer program whose purpose is to provide utilitary
-   classes. This file belongs to the Bio++ Project.
-
-   This software is governed by the CeCILL  license under French law and
-   abiding by the rules of distribution of free software.  You can  use,
-   modify and/ or redistribute the software under the terms of the CeCILL
-   license as circulated by CEA, CNRS and INRIA at the following URL
-   "http://www.cecill.info".
-
-   As a counterpart to the access to the source code and  rights to copy,
-   modify and redistribute granted by the license, users are provided only
-   with a limited warranty  and the software's author,  the holder of the
-   economic rights,  and the successive licensors  have only  limited
-   liability.
-
-   In this respect, the user's attention is drawn to the risks associated
-   with loading,  using,  modifying and/or developing or reproducing the
-   software by the user in light of its specific status of free software,
-   that may mean  that it is complicated to manipulate,  and  that  also
-   therefore means  that it is reserved for developers  and  experienced
-   professionals having in-depth computer knowledge. Users are therefore
-   encouraged to load and test the software's suitability as regards their
-   requirements in conditions enabling the security of their systems and/or
-   data to be ensured and,  more generally, to use and operate it in the
-   same conditions as regards security.
-
-   The fact that you are presently reading this means that you have had
-   knowledge of the CeCILL license and that you accept its terms.
- */
+  Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
+  
+  This software is a computer program whose purpose is to provide utilitary
+  classes. This file belongs to the Bio++ Project.
+  
+  This software is governed by the CeCILL license under French law and
+  abiding by the rules of distribution of free software. You can use,
+  modify and/ or redistribute the software under the terms of the CeCILL
+  license as circulated by CEA, CNRS and INRIA at the following URL
+  "http://www.cecill.info".
+  
+  As a counterpart to the access to the source code and rights to copy,
+  modify and redistribute granted by the license, users are provided only
+  with a limited warranty and the software's author, the holder of the
+  economic rights, and the successive licensors have only limited
+  liability.
+  
+  In this respect, the user's attention is drawn to the risks associated
+  with loading, using, modifying and/or developing or reproducing the
+  software by the user in light of its specific status of free software,
+  that may mean that it is complicated to manipulate, and that also
+  therefore means that it is reserved for developers and experienced
+  professionals having in-depth computer knowledge. Users are therefore
+  encouraged to load and test the software's suitability as regards their
+  requirements in conditions enabling the security of their systems and/or
+  data to be ensured and, more generally, to use and operate it in the
+  same conditions as regards security.
+  
+  The fact that you are presently reading this means that you have had
+  knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#include <algorithm>
+#include <cctype>
+#include <iterator>
+#include <vector>
 
-#include "TextTools.h"
 #include "../Exceptions.h"
+#include "../Numeric/IntegerTools.h"
+#include "TextTools.h"
 
-using namespace bpp;
-
-#include <ctype.h>
-#include <sstream>
-#include <iomanip>
-
-using namespace std;
-
-/******************************************************************************/
-
-bool TextTools::isEmpty(const std::string& s)
-{
-  for (unsigned int i = 0; i < s.size(); i++)
-  {
-    char c = s[i];
-    if (c != ' ' && c != '\n' && c != '\t')
-      return false;
-  }
-  return true;
-}
-
-/******************************************************************************/
-
-std::string TextTools::toUpper(const std::string& s)
-{
-  string result = "";
-  for (size_t i = 0; i < s.size(); i++)
-  {
-    result += static_cast<char>(toupper(static_cast<int>(s[i])));
-  }
-  return result;
-}
-
-/******************************************************************************/
-
-std::string TextTools::toLower(const std::string& s)
+namespace bpp
 {
-  string result = "";
-  for (size_t i = 0; i < s.size(); i++)
+  namespace TextTools
   {
-    result += static_cast<char>(tolower(static_cast<int>(s[i])));
-  }
-  return result;
-}
-
-/******************************************************************************/
-
-bool TextTools::isWhiteSpaceCharacter(char c)
-{
-  return (c == ' ')
-         || (c == '\t')
-         || (c == '\n')
-         || (c == '\r')
-         || (c == '\f');
-}
-
-/******************************************************************************/
+    /******************************************************************************/
 
-std::string TextTools::removeWhiteSpaces(const std::string& s)
-{
-  // Copy sequence
-  string st (s);
-
-  // For all sequence's characters
-  for (unsigned int i = 0; i < st.size(); i++)
-  {
-    if (isWhiteSpaceCharacter(st[i]))
+    bool isEmpty(const std::string& s)
     {
-      st.erase(st.begin() + i); // Remove character
-      i--;
+      return std::all_of(s.begin(), s.end(), [](char c) { return std::isspace(c); });
     }
-  }
-
-  // Send result
-  return st;
-}
-
-/******************************************************************************/
-
-std::string TextTools::removeFirstWhiteSpaces(const std::string& s)
-{
-  // Copy sequence
-  string st (s);
-
-  while (st.size() > 0 && isWhiteSpaceCharacter(st[0]))
-  {
-    st.erase(st.begin());
-  }
 
-  // Send result
-  return st;
-}
+    /******************************************************************************/
 
-/******************************************************************************/
+    std::string toUpper(const std::string& s)
+    {
+      std::string result;
+      result.reserve(s.size());
+      std::transform(s.begin(), s.end(), std::back_inserter(result), [](char c) { return std::toupper(c); });
+      return result;
+    }
 
-std::string TextTools::removeLastWhiteSpaces(const std::string& s)
-{
-  // Copy sequence
-  string st (s);
+    /******************************************************************************/
 
-  while (st.size() > 0 && isWhiteSpaceCharacter(st[st.size() - 1]))
-  {
-    st.erase(st.end() - 1);
-  }
+    std::string toLower(const std::string& s)
+    {
+      std::string result;
+      result.reserve(s.size());
+      std::transform(s.begin(), s.end(), std::back_inserter(result), [](char c) { return std::tolower(c); });
+      return result;
+    }
 
-  // Send result
-  return st;
-}
+    /******************************************************************************/
 
-/******************************************************************************/
+    bool isWhiteSpaceCharacter(char c) { return std::isspace(c); }
 
-std::string TextTools::removeSurroundingWhiteSpaces(const std::string& s)
-{
-  return removeFirstWhiteSpaces(removeLastWhiteSpaces(s));
-}
+    /******************************************************************************/
 
-/******************************************************************************/
+    std::string removeWhiteSpaces(const std::string& s)
+    {
+      // Only copy non whitespace chars in new string
+      std::string result;
+      std::remove_copy_if(s.begin(), s.end(), std::back_inserter(result), [](char c) { return std::isspace(c); });
+      return result;
+    }
 
-bool TextTools::isNewLineCharacter(char c)
-{
-  return (c == '\n')
-         || (c == '\r');
-}
+    /******************************************************************************/
 
-/******************************************************************************/
+    std::string removeFirstWhiteSpaces(const std::string& s)
+    {
+      // Copy s from first non whitespace to end.
+      return std::string(std::find_if(s.begin(), s.end(), [](char c) { return !std::isspace(c); }), s.end());
+    }
 
-std::string TextTools::removeNewLines(const std::string& s)
-{
-  // Copy string
-  string st (s);
+    /******************************************************************************/
 
-  // For all string's characters
-  for (unsigned int i = 0; i < st.size(); i++)
-  {
-    if (isNewLineCharacter(st[i]))
+    std::string removeLastWhiteSpaces(const std::string& s)
     {
-      st.erase(st.begin() + i); // Remove character
-      i--;
+      // Copy s from start to last non whitespace char
+      auto lastNonWhitespace = std::find_if(s.rbegin(), s.rend(), [](char c) { return !std::isspace(c); });
+      return std::string(s.begin(), lastNonWhitespace.base());
     }
-  }
-
-  // Send result
-  return st;
-}
 
-/******************************************************************************/
+    /******************************************************************************/
 
-std::string TextTools::removeLastNewLines(const std::string& s)
-{
-  // Copy string
-  string st (s);
+    std::string removeSurroundingWhiteSpaces(const std::string& s)
+    {
+      // Copy s from first non-whitespace to last non-whitespace
+      auto isNotWhitespace = [](char c) { return !std::isspace(c); };
+      auto firstNonWhitespace = std::find_if(s.begin(), s.end(), isNotWhitespace);
+      auto lastNonWhitespace = std::find_if(
+        s.rbegin(), std::reverse_iterator<std::string::const_iterator>(firstNonWhitespace), isNotWhitespace);
+      return std::string(firstNonWhitespace, lastNonWhitespace.base());
+    }
 
-  while (st.size() > 0 && isNewLineCharacter(st[st.size() - 1]))
-  {
-    st.erase(st.end() - 1);
-  }
+    /******************************************************************************/
 
-  // Send result
-  return st;
-}
+    bool isNewLineCharacter(char c) { return (c == '\n') || (c == '\r'); }
 
-/******************************************************************************/
+    /******************************************************************************/
 
-bool TextTools::isDecimalNumber(char c)
-{
-  if (c == '0' || c == '1' || c == '2' || c == '3' || c == '4'
-      || c == '5' || c == '6' || c == '7' || c == '8' || c == '9')
-    return true;
-  else
-    return false;
-}
+    std::string removeNewLines(const std::string& s)
+    {
+      // Only copy non newline chars in new string
+      std::string result;
+      std::remove_copy_if(s.begin(), s.end(), std::back_inserter(result), [](char c) { return isNewLineCharacter(c); });
+      return result;
+    }
 
-/******************************************************************************/
+    /******************************************************************************/
 
-bool TextTools::isDecimalNumber(const std::string& s, char dec, char scientificNotation)
-{
-  if (isEmpty(s))
-    return false;
-              
-  size_t sepCount = 0;
-  size_t sciCount = 0;
-  size_t i = 0;
-  if (s[0] == '-') i = 1;
-  for (; i < s.size(); ++i)
-  {
-    char c = s[i];
-    if (c == dec)
-      sepCount++;
-    else if (c == scientificNotation) {
-      sciCount++;
-      if (i == s.size() - 1) return false; //Must be sthg after scientific notation.
-      c = s[i + 1];
-      if (c == '-' || c == '+') i++;
-      if (i == s.size() - 1) return false; //Must be sthg after scientific notation.
-      if (sepCount == 0) sepCount = 1; //We do not want any dec in the exponent.
-    } else if (!isDecimalNumber(c))
-      return false;
-    if (sepCount > 1 || sciCount > 1)
-      return false;
-  }
-  return true;
-}
-
-/******************************************************************************/
-
-bool TextTools::isDecimalInteger(const std::string& s, char scientificNotation)
-{
-  if (isEmpty(s))
-    return false;
-              
-  size_t sciCount = 0;
-  size_t i = 0;
-  if (s[0] == '-') i = 1;
-  for (; i < s.size(); ++i)
-  {
-    char c = s[i];
-    if (c == scientificNotation) {
-      sciCount++;
-      if (i == s.size() - 1) return false; //Must be sthg after scientific notation.
-      c = s[i + 1];
-      if (c == '-') return false; //Not an integer then!
-      if (c == '+') i++;
-      if (i == s.size() - 1) return false; //Must be sthg after scientific notation.
-    } else if (!isDecimalNumber(c))
-      return false;
-    if (sciCount > 1)
-      return false;
-  }
-  return true;
-}
-
-/******************************************************************************/
-
-std::string TextTools::toString(int i)
-{
-  ostringstream oss;
-  oss << i;
-  return oss.str();
-}
+    std::string removeLastNewLines(const std::string& s)
+    {
+      // Copy s from start to last non newline char
+      auto lastNonNewline = std::find_if(s.rbegin(), s.rend(), [](char c) { return !isNewLineCharacter(c); });
+      return std::string(s.begin(), lastNonNewline.base());
+    }
 
-/******************************************************************************/
+    /******************************************************************************/
 
-std::string TextTools::toString(char c)
-{
-  ostringstream oss;
-  oss << c;
-  return oss.str();
-}
+    bool isDecimalNumber(char c) { return std::isdigit(c); }
 
-/******************************************************************************/
+    /******************************************************************************/
 
-std::string TextTools::toString(double d, int precision)
-{
-  ostringstream oss;
-  oss << setprecision(precision) << d;
-  return oss.str();
-}
+    bool isDecimalNumber(const std::string& s, char dec, char scientificNotation)
+    {
+      if (isEmpty(s))
+        return false;
+
+      std::size_t sepCount = 0;
+      std::size_t sciCount = 0;
+      std::size_t i = 0;
+      if (s[0] == '-')
+        i = 1;
+      for (; i < s.size(); ++i)
+      {
+        char c = s[i];
+        if (c == dec)
+          sepCount++;
+        else if (c == scientificNotation)
+        {
+          sciCount++;
+          if (i == s.size() - 1)
+            return false; // Must be sthg after scientific notation.
+          c = s[i + 1];
+          if (c == '-' || c == '+')
+            i++;
+          if (i == s.size() - 1)
+            return false; // Must be sthg after scientific notation.
+          if (sepCount == 0)
+            sepCount = 1; // We do not want any dec in the exponent.
+        }
+        else if (!isDecimalNumber(c))
+          return false;
+        if (sepCount > 1 || sciCount > 1)
+          return false;
+      }
+      return true;
+    }
 
-/******************************************************************************/
+    /******************************************************************************/
 
-int TextTools::toInt(const std::string& s, char scientificNotation)
-{
-  if (!isDecimalInteger(s, scientificNotation)) throw Exception("TextTools::toInt(). Invalid number specification: " + s);
-  istringstream iss(s);
-  int i;
-  iss >> i;
-  return i;
-}
+    bool isDecimalInteger(const std::string& s, char scientificNotation)
+    {
+      if (isEmpty(s))
+        return false;
+
+      std::size_t sciCount = 0;
+      std::size_t i = 0;
+      if (s[0] == '-')
+        i = 1;
+      for (; i < s.size(); ++i)
+      {
+        char c = s[i];
+        if (c == scientificNotation)
+        {
+          sciCount++;
+          if (i == s.size() - 1)
+            return false; // Must be sthg after scientific notation.
+          c = s[i + 1];
+          if (c == '-')
+            return false; // Not an integer then!
+          if (c == '+')
+            i++;
+          if (i == s.size() - 1)
+            return false; // Must be sthg after scientific notation.
+        }
+        else if (!isDecimalNumber(c))
+          return false;
+        if (sciCount > 1)
+          return false;
+      }
+      return true;
+    }
 
-/******************************************************************************/
+    /******************************************************************************/
 
-double TextTools::toDouble(const std::string& s, char dec, char scientificNotation)
-{
-  if (!isDecimalNumber(s, dec, scientificNotation)) throw Exception("TextTools::toDouble(). Invalid number specification: " + s);
-  istringstream iss(s);
-  double d;
-  iss >> d;
-  return d;
-}
+    int toInt(const std::string& s, char scientificNotation)
+    {
+      if (!isDecimalInteger(s, scientificNotation))
+        throw Exception("TextTools::toInt(). Invalid number specification: " + s);
+      return fromString<int>(s);
+    }
 
-/******************************************************************************/
+    /******************************************************************************/
 
-std::string TextTools::resizeRight(const std::string& s, size_t newSize, char fill)
-{
-  if (s.size() > newSize)
-    return s.substr(0, newSize);
-  else
-    return s + std::string(newSize - s.size(), fill);
-}
+    double toDouble(const std::string& s, char dec, char scientificNotation)
+    {
+      if (!isDecimalNumber(s, dec, scientificNotation))
+        throw Exception("TextTools::toDouble(). Invalid number specification: " + s);
+      return fromString<double>(s);
+    }
 
-/******************************************************************************/
+    /******************************************************************************/
 
-std::string TextTools::resizeLeft(const std::string& s, size_t newSize, char fill)
-{
-  if (s.size() > newSize)
-    return s.substr(s.size() - newSize);
-  else
-    return string(newSize - s.size(), fill) + s;
-}
+    std::string resizeRight(const std::string& s, std::size_t newSize, char fill)
+    {
+      std::string result;
+      result.reserve(newSize);
+      if (newSize > s.size())
+      {
+        std::copy(s.begin(), s.end(), std::back_inserter(result));
+        std::fill_n(std::back_inserter(result), newSize - s.size(), fill);
+      }
+      else
+      {
+        std::copy_n(s.begin(), newSize, std::back_inserter(result));
+      }
+      return result;
+    }
 
-/******************************************************************************/
+    /******************************************************************************/
 
-std::vector<std::string> TextTools::split(const std::string& s, size_t n)
-{
-  vector<string> v;
-  string tmp = s;
-  while (tmp.size() > n)
-  {
-    v.push_back(tmp.substr(0, n));
-    tmp = tmp.substr(n);
-  }
-  v.push_back(tmp);
-  return v;
-}
+    std::string resizeLeft(const std::string& s, std::size_t newSize, char fill)
+    {
+      std::string result;
+      result.reserve(newSize);
+      if (newSize > s.size())
+      {
+        std::fill_n(std::back_inserter(result), newSize - s.size(), fill);
+        std::copy(s.begin(), s.end(), std::back_inserter(result));
+      }
+      else
+      {
+        using diff_type = typename std::iterator_traits<decltype(s.begin())>::difference_type;
+        std::copy(s.begin() + static_cast<diff_type>(s.size() - newSize), s.end(), std::back_inserter(result));
+      }
+      return result;
+    }
 
-/******************************************************************************/
+    /******************************************************************************/
 
-std::string TextTools::removeSubstrings(const std::string& s, char blockBeginning, char blockEnding)
-{
-  string t = "";
-  int blockCount = 0;
-  size_t begPos = 0;
-  for (size_t i = 0; i < s.size(); i++)
-  {
-    char current = s[i];
-    if (current == blockBeginning)
+    std::vector<std::string> split(const std::string& s, std::size_t n)
     {
-      blockCount++;
-      t += s.substr(begPos, i - begPos);
+      using diff_type = typename std::iterator_traits<decltype(s.begin())>::difference_type;
+      std::vector<std::string> v;
+      auto nbChunks = IntegerTools::divideUp(s.size(), n);
+      v.reserve(nbChunks);
+      // Copy chunks by chunks, and add the last incomplete one if s.size () % n != 0
+      auto nbCopiedChunks = IntegerTools::divideDown(s.size(), n);
+      for (std::size_t i = 0; i < nbCopiedChunks; ++i)
+        v.emplace_back(s.begin() + static_cast<diff_type>(i * n), s.begin() + static_cast<diff_type>((i + 1) * n));
+      if (v.size() < nbChunks)
+        v.emplace_back(s.begin() + static_cast<diff_type>(v.size() * n), s.end());
+      return v;
     }
-    else if (current == blockEnding)
+
+    /******************************************************************************/
+
+    std::string removeSubstrings(const std::string& s, char blockBeginning, char blockEnding)
     {
-      blockCount--;
-      if (blockCount == 0)
+      std::string result;
+      std::size_t blockDepth = 0;
+      for (std::size_t i = 0; i < s.size(); ++i)
       {
-        begPos = i + 1;
+        auto c = s[i];
+        if (c == blockBeginning)
+        {
+          blockDepth++;
+        }
+        else if (c == blockEnding)
+        {
+          if (blockDepth == 0)
+            throw Exception(
+              std::string("TextTools::removeSubstrings(): unmatched block closing character at position ") +
+              std::to_string(i));
+          blockDepth--;
+        }
+        else if (blockDepth == 0)
+        {
+          result += c;
+        }
       }
-      else if (blockCount < 0)
-        throw Exception("TextTools::removeSubstrings(). " +
-                        string("Ending block character without corresponding beginning one at position ") + toString((int)i) + ".");
+      return result;
     }
-  }
-  t += s.substr(begPos);
-  return t;
-}
 
-/******************************************************************************/
+    /******************************************************************************/
 
-std::string TextTools::removeSubstrings(const std::string& s, char blockBeginning, char blockEnding, std::vector<string>& exceptionsBeginning, std::vector<string>& exceptionsEnding)
-{
-  string t = "";
-  int blockCount = 0;
-  size_t begPos = 0;
-  for (size_t i = 0; i < s.size(); i++)
-  {
-    char current = s[i];
-    if (current == blockBeginning)
+    std::string removeSubstrings(const std::string& s,
+                                 char blockBeginning,
+                                 char blockEnding,
+                                 std::vector<std::string>& exceptionsBeginning,
+                                 std::vector<std::string>& exceptionsEnding)
     {
-      bool except = false;
-      for (size_t j = 0; j < exceptionsBeginning.size(); j++)
+      // TODO didn't upgrade... move to a parser like system ? it is very specific...
+      std::string t;
+      int blockCount = 0;
+      std::size_t begPos = 0;
+      for (std::size_t i = 0; i < s.size(); i++)
       {
-        size_t pos = exceptionsBeginning[j].find(blockBeginning);
-        if (pos != string::npos) {
-          size_t left = i - pos;
-          size_t right = i + exceptionsBeginning[j].length() - pos;
-          if ((right < s.length() - 1) && (hasSubstring (s.substr(left, right), exceptionsBeginning[j])))
+        char current = s[i];
+        if (current == blockBeginning)
+        {
+          bool except = false;
+          for (std::size_t j = 0; j < exceptionsBeginning.size(); j++)
           {
-            except = true;
-            break;
+            std::size_t pos = exceptionsBeginning[j].find(blockBeginning);
+            if (pos != std::string::npos)
+            {
+              std::size_t left = i - pos;
+              std::size_t right = i + exceptionsBeginning[j].length() - pos;
+              if ((right < s.length() - 1) && (hasSubstring(s.substr(left, right), exceptionsBeginning[j])))
+              {
+                except = true;
+                break;
+              }
+            }
+          }
+          if (!except)
+          {
+            blockCount++;
+            t += s.substr(begPos, i - begPos);
           }
         }
-      }
-      if (!except)
-      {
-        blockCount++;
-        t += s.substr(begPos, i - begPos);
-      }
-    }
-    else if ( (current == blockEnding) && (blockCount > 0) )
-    {
-      for (size_t j = 0; j < exceptionsEnding.size(); j++)
-      {
-        size_t pos = exceptionsEnding[j].find(blockEnding);
-        if (pos != string::npos) {
-          size_t left = i - pos;
-          size_t right = i + exceptionsEnding[j].length() - pos;
-          if ((right < s.length() - 1 ) && (hasSubstring (s.substr(left, right), exceptionsEnding[j])))
+        else if ((current == blockEnding) && (blockCount > 0))
+        {
+          for (std::size_t j = 0; j < exceptionsEnding.size(); j++)
           {
-            break;
+            std::size_t pos = exceptionsEnding[j].find(blockEnding);
+            if (pos != std::string::npos)
+            {
+              std::size_t left = i - pos;
+              std::size_t right = i + exceptionsEnding[j].length() - pos;
+              if ((right < s.length() - 1) && (hasSubstring(s.substr(left, right), exceptionsEnding[j])))
+              {
+                break;
+              }
+            }
           }
+          blockCount--;
+          if (blockCount == 0)
+          {
+            begPos = i + 1;
+          }
+          else if (blockCount < 0)
+            throw Exception("TextTools::removeSubstrings(). " +
+                            std::string("Ending block character without corresponding beginning one at position ") +
+                            toString((int)i) + ".");
         }
       }
-      blockCount--;
-      if (blockCount == 0)
-      {
-        begPos = i + 1;
-      }
-      else if (blockCount < 0)
-        throw Exception("TextTools::removeSubstrings(). " +
-                        string("Ending block character without corresponding beginning one at position ") + toString((int)i) + ".");
+      t += s.substr(begPos);
+      return t;
     }
-  }
-  t += s.substr(begPos);
-  return t;
-}
-
-/******************************************************************************/
 
-std::string TextTools::removeChar(const std::string& s, char c)
-{
-  // Copy sequence
-  string st(s);
+    /******************************************************************************/
 
-  // For all sequence's characters
-  for (unsigned int i = 0; i < st.size(); i++)
-  {
-    if (st[i] == c)
+    std::string removeChar(const std::string& s, char c)
     {
-      st.erase(st.begin() + i); // Remove character
-      i--;
+      std::string result;
+      std::remove_copy(s.begin(), s.end(), std::back_inserter(result), c);
+      return result;
     }
-  }
 
-  // Send result
-  return st;
-}
+    /******************************************************************************/
 
-/******************************************************************************/
+    std::size_t count(const std::string& s, const std::string& pattern)
+    {
+      std::size_t count = 0;
+      auto it = std::search(s.begin(), s.end(), pattern.begin(), pattern.end());
+      while (it != s.end())
+      {
+        count++;
+        it = std::search(it + 1, s.end(), pattern.begin(), pattern.end());
+      }
+      return count;
+    }
 
-unsigned int TextTools::count(const std::string& s, const std::string& pattern)
-{
-  unsigned int count = 0;
-  string::size_type index = s.find(pattern);
-  while (index != string::npos)
-  {
-    count++;
-    index = s.find(pattern, index + 1);
-  }
-  return count;
-}
+    /******************************************************************************/
 
-/******************************************************************************/
+    bool startsWith(const std::string& s, const std::string& pattern)
+    {
+      if (s.size() < pattern.size())
+        return false;
+      return std::equal(pattern.begin(), pattern.end(), s.begin());
+    }
 
-bool TextTools::endsWith(const std::string& s, const std::string& pattern)
-{
-  if (s.size() < pattern.size())
-    return false;
-  return s.substr(s.size() - pattern.size()) == pattern;
-}
+    /******************************************************************************/
 
-/******************************************************************************/
+    bool endsWith(const std::string& s, const std::string& pattern)
+    {
+      if (s.size() < pattern.size())
+        return false;
+      return std::equal(pattern.rbegin(), pattern.rend(), s.rbegin());
+    }
 
-bool TextTools::hasSubstring(const std::string& s, const std::string& pattern)
-{
-  if (s.size() < pattern.size())
-    return false;
-  for (size_t i = 0; i < s.size() - pattern.size() + 1; ++i)
-  {
-    if (s.substr(i, pattern.size()) == pattern)
-      return true;
-  }
-  return false;
-}
+    /******************************************************************************/
 
-/******************************************************************************/
+    bool hasSubstring(const std::string& s, const std::string& pattern)
+    {
+      return std::search(s.begin(), s.end(), pattern.begin(), pattern.end()) != s.end();
+    }
 
-void TextTools::replaceAll(std::string& target, const std::string& query, const std::string& replacement)
-{
-  if (query.empty())
-    return;
-  size_t pos = target.find(query);
-  while (pos != string::npos) {
-    target.replace(pos, query.length(), replacement);
-    pos += replacement.length(); //We prevent recursivity! 
-    pos = target.find(query, pos);
-  }
-}
-
-/******************************************************************************/
+    /******************************************************************************/
+
+    void replaceAll(std::string& target, const std::string& query, const std::string& replacement)
+    {
+      using diff_type = typename std::iterator_traits<decltype(target.begin())>::difference_type;
+      if (query.empty())
+        return;
+      std::string result;
+      auto it = target.begin();
+      while (it != target.end())
+      {
+        // Find next start of pattern, copy s up to there, then append replacement, and move search after pattern.
+        auto nextPattern = std::search(it, target.end(), query.begin(), query.end());
+        std::copy(it, nextPattern, std::back_inserter(result));
+        if (nextPattern != target.end())
+        {
+          result += replacement;
+          it = nextPattern + static_cast<diff_type>(query.size());
+        }
+        else
+        {
+          it = nextPattern;
+        }
+      }
+      target = std::move(result);
+    }
 
+    /******************************************************************************/
+  } // namespace TextTools
+} // namespace bpp
diff --git a/src/Bpp/Text/TextTools.h b/src/Bpp/Text/TextTools.h
index ac4a295..51c669a 100644
--- a/src/Bpp/Text/TextTools.h
+++ b/src/Bpp/Text/TextTools.h
@@ -1,217 +1,181 @@
 //
 // File: TextTools.h
-// Created by: Julien Dutheil
-// Created on: Fri Aug  8 12:57:50 2003
+// Authors:
+//   Julien Dutheil
+//   Francois Gindraud (2017)
+// Created: 2003-08-08 12:57:50
+// Last modified: 2017-06-26
 //
 
 /*
   Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
-
+  
   This software is a computer program whose purpose is to provide basal and
   utilitary classes. This file belongs to the Bio++ Project.
-
-  This software is governed by the CeCILL  license under French law and
-  abiding by the rules of distribution of free software.  You can  use, 
+  
+  This software is governed by the CeCILL license under French law and
+  abiding by the rules of distribution of free software. You can use,
   modify and/ or redistribute the software under the terms of the CeCILL
   license as circulated by CEA, CNRS and INRIA at the following URL
-  "http://www.cecill.info". 
-
-  As a counterpart to the access to the source code and  rights to copy,
+  "http://www.cecill.info".
+  
+  As a counterpart to the access to the source code and rights to copy,
   modify and redistribute granted by the license, users are provided only
-  with a limited warranty  and the software's author,  the holder of the
-  economic rights,  and the successive licensors  have only  limited
-  liability. 
-
+  with a limited warranty and the software's author, the holder of the
+  economic rights, and the successive licensors have only limited
+  liability.
+  
   In this respect, the user's attention is drawn to the risks associated
-  with loading,  using,  modifying and/or developing or reproducing the
+  with loading, using, modifying and/or developing or reproducing the
   software by the user in light of its specific status of free software,
-  that may mean  that it is complicated to manipulate,  and  that  also
-  therefore means  that it is reserved for developers  and  experienced
+  that may mean that it is complicated to manipulate, and that also
+  therefore means that it is reserved for developers and experienced
   professionals having in-depth computer knowledge. Users are therefore
   encouraged to load and test the software's suitability as regards their
-  requirements in conditions enabling the security of their systems and/or 
-  data to be ensured and,  more generally, to use and operate it in the 
-  same conditions as regards security. 
-
+  requirements in conditions enabling the security of their systems and/or
+  data to be ensured and, more generally, to use and operate it in the
+  same conditions as regards security.
+  
   The fact that you are presently reading this means that you have had
   knowledge of the CeCILL license and that you accept its terms.
 */
 
-#ifndef _TEXTTOOLS_H_
-#define _TEXTTOOLS_H_
+#ifndef BPP_TEXT_TEXTTOOLS_H
+#define BPP_TEXT_TEXTTOOLS_H
 
-// From the STL:
+#include <iomanip>
+#include <sstream>
 #include <string>
 #include <vector>
-#include <sstream>
-#include <iomanip>
 
 namespace bpp
 {
 
-  /**
-   * @brief Some utilitary functions that work on strings.
-   */
-  class TextTools
+  /// Some utilitary functions that work on strings.
+  namespace TextTools
   {
-  public:
-
-    /**
-     * @brief Tell if a string is empty.
-     *
+    /** @brief Tell if a string is empty.
      * A string is considered to be 'empty' if it is only made of white
      * spaces.
-     *
      * @param s The string to check.
      * @return True if the string has only white characters.
      */
-    static bool isEmpty(const std::string& s);
+    bool isEmpty(const std::string& s);
 
-    /**
-     * @brief Make the string uppercase.
-     *
+    /** @brief Make the string uppercase.
      * @param s The string to analyse.
      * @return A copy of the string with all chars uppercase.
      */
-    static std::string toUpper(const std::string& s);
+    std::string toUpper(const std::string& s);
 
-    /**
-     * @brief Make the string lowercase.
-     *
+    /** @brief Make the string lowercase.
      * @param s The string to analyse.
      * @return A copy of the string with all chars lowercase.
      */
-    static std::string toLower(const std::string& s);
+    std::string toLower(const std::string& s);
 
-    /**
-     * @brief Tell if a character is a white space or not.
-     *
+    /** @brief Tell if a character is a white space or not.
      * @param c The character to check.
-     * @return True if c is one of the following: ' ', '\\t', '\\n', '\\r' or '\\f'.
+     * @return True if c is one of the following: ' ', '\\t', '\\n', '\\r', '\\f', '\\v'.
      */
-    static bool isWhiteSpaceCharacter(char c);
+    bool isWhiteSpaceCharacter(char c);
 
-    /**
-     * @brief Remove all white spaces characters in a string.
-     *
+    /** @brief Remove all white spaces characters in a string.
      * @param s The string to parse.
      * @return A copy of 's' without white spaces characters.
      */
-    static std::string removeWhiteSpaces (const std::string& s);
+    std::string removeWhiteSpaces(const std::string& s);
 
-    /**
-     * @brief Remove all white spaces characters at the beginning of a string.
-     *
+    /** @brief Remove all white spaces characters at the beginning of a string.
      * @param s The string to parse.
      * @return A copy of 's' beginning with the first non-white character.
      */
-    static std::string removeFirstWhiteSpaces (const std::string& s);
+    std::string removeFirstWhiteSpaces(const std::string& s);
 
-    /**
-     * @brief Remove all white spaces characters at the end of a string.
-     *
+    /** @brief Remove all white spaces characters at the end of a string.
      * @param s The string to parse.
      * @return A copy of 's' ending with the last non-white character.
      */
-    static std::string removeLastWhiteSpaces (const std::string& s);
+    std::string removeLastWhiteSpaces(const std::string& s);
 
-    /**
-     * @brief Remove all white spaces characters at the beginning and the end of a string.
-     *
+    /** @brief Remove all white spaces characters at the beginning and the end of a string.
      * @param s The string to parse.
-     * @return A copy of 's' beginning with the first non-white character
-     * and ending with the last one.
+     * @return A copy of 's' beginning with the first non-white character and ending with the last one.
      */
-    static std::string removeSurroundingWhiteSpaces(const std::string& s);
+    std::string removeSurroundingWhiteSpaces(const std::string& s);
 
-    /**
-     * @brief Tell if a character is a new line character or not.
-     *
+    /** @brief Tell if a character is a new line character or not.
      * @param c The character to check.
      * @return True if c is one of the following: '\\n' or '\\r'.
      */
-    static bool isNewLineCharacter(char c);
+    bool isNewLineCharacter(char c);
 
-    /**
-     * @brief Remove all new line characters in a string.
-     *
+    /** @brief Remove all new line characters in a string.
      * @param s The string to parse.
      * @return A copy of 's' without new line characters.
      */
-    static std::string removeNewLines (const std::string& s);
+    std::string removeNewLines(const std::string& s);
 
-    /**
-     * @brief Remove all new line characters at the end of a string.
-     *
+    /** @brief Remove all new line characters at the end of a string.
      * @param s The string to parse.
      * @return A copy of 's' ending with the last non-new line character.
      */
-    static std::string removeLastNewLines(const std::string& s);
+    std::string removeLastNewLines(const std::string& s);
 
-    /**
-     * @brief Tell is a given character describes a decimal number.
-     *
+    /** @brief Tell is a given character describes a decimal number.
      * @param c The character to check.
      * @return true if the given character is the reprensentation of a decimal number.
      */
-    static bool isDecimalNumber(char c);
+    bool isDecimalNumber(char c);
 
-    /**
-     * @brief Tell is a given character string describes a decimal number.
-     *
-     * NB: for now, this parser will not recognize thousands delimiters, and not the scientific notation neither.
+    /** @brief Tell is a given character string describes a decimal number.
+     * FIXME : for now, this parser will not recognize thousands delimiters, and not the scientific notation neither.
      * @param s The string to parse.
      * @param dec The decimal separator.
      * @param scientificNotation character to use for scientific notation (typically 'e' or 'E').
      * @return true if the given string is the representation of a decimal number.
      */
-    static bool isDecimalNumber(const std::string& s, char dec = '.', char scientificNotation = 'e');
+    bool isDecimalNumber(const std::string& s, char dec = '.', char scientificNotation = 'e');
 
-    /**
-     * @brief Tell is a given character string describes a decimal integer.
-     *
-     * NB: for now, this parser will not recognize thousands delimiters, and not the scientific notation neither.
+    /** @brief Tell is a given character string describes a decimal integer.
+     * FIXME: for now, this parser will not recognize thousands delimiters, and not the scientific notation neither.
      * @param s The string to parse.
      * @param scientificNotation character to use for scientific notation (typically 'e' or 'E').
      * @return true if the given string is the representation of a decimal integer.
      */
-    static bool isDecimalInteger(const std::string& s, char scientificNotation = 'e');
+    bool isDecimalInteger(const std::string& s, char scientificNotation = 'e');
 
-    /**
-     * @brief General template method to convert to a string.
-     *
+    /** @brief General template method to convert to a string.
      * @param t The object to convert.
      * @return A string equal to t.
      */
-    template<class T> static std::string toString(T t)
+    template <class T>
+    std::string toString(T t)
     {
       std::ostringstream oss;
       oss << t;
       return oss.str();
     }
 
-    /**
-     * @brief Template string conversion.
-     * 
+    /** @brief Template string conversion.
      * @param t The object to convert.
      * @param precision To use (for numbers).
      * @return A string equal to t.
      */
-    template<class T>
-    static std::string toString(T t, int precision)
+    template <class T>
+    std::string toString(T t, int precision)
     {
       std::ostringstream oss;
       oss << std::setprecision(precision) << t;
       return oss.str();
     }
 
-    /**
-     * @brief General template method to convert from string.
-     *
+    /** @brief General template method to convert from string.
      * @param s The string to convert.
      * @return An object from string t.
      */
-    template<class T> static T fromString(const std::string& s)
+    template <class T>
+    T fromString(const std::string& s)
     {
       std::istringstream iss(s);
       T obj;
@@ -219,60 +183,29 @@ namespace bpp
       return obj;
     }
 
-    /**
-     * @brief Convert from int to string.
-     *
-     * @param i The integer to convert.
-     * @return A string equal to i.
-     */
-    static std::string toString(int i);
-
-    /**
-     * @brief Convert from char to string.
-     *
-     * @param c The character to convert.
-     * @return A string equal to c.
-     */
-    static std::string toString(char c);
-
-    /**
-     * @brief Convert from double to string.
-     *
-     * @param d The double to convert.
-     * @param precision To use (for numbers).
-     * @return A string equal to d.
-     */
-    static std::string toString(double d, int precision = 6);
-
-    /**
-     * @brief Convert from string to int.
-     *
+    /** @brief Convert from string to int.
      * @param s The string to parse.
      * @param scientificNotation character to use for scientific notation (typically 'e' or 'E').
      * @return The integer corresponding to s.
      * @throw Exception if the string does not specify a valid number.
      */
-    static int toInt(const std::string& s, char scientificNotation = 'e');
+    int toInt(const std::string& s, char scientificNotation = 'e');
 
-    /**
-     * @brief Convert from string to double.
-     *
+    /** @brief Convert from string to double.
      * @param s The string to parse.
      * @param dec The decimal separator.
      * @param scientificNotation character to use for scientific notation (typically 'e' or 'E').
      * @return The double corresponding to s.
      * @throw Exception if the string does not specify a valid number.
      */
-    static double toDouble(const std::string& s, char dec = '.', char scientificNotation = 'e');
+    double toDouble(const std::string& s, char dec = '.', char scientificNotation = 'e');
 
-    /**
-     * @brief Template to string conversion.
-     * 
+    /** @brief Template to string conversion.
      * @param s The string to parse.
      * @return An object of class R corresponding to s.
      */
-    template<class T>
-    static T to(const std::string& s)
+    template <class T>
+    T to(const std::string& s)
     {
       std::istringstream iss(s);
       T t;
@@ -280,64 +213,51 @@ namespace bpp
       return t;
     }
 
-    /**
-     * @brief Send a string of size 'newSize', which is a copy of 's' truncated or
+    /** @brief Send a string of size 'newSize', which is a copy of 's' truncated or
      * filled with character 'fill' at the end.
-     *
      * @param s       The string to parse.
      * @param newSize The new string size.
      * @param fill    The character to use to fill the string id length < newSize.
      * @return A string of size newsize which is a copy from the left of s.
      */
 
-    static std::string resizeRight(const std::string& s, size_t newSize, char fill = ' ');
+    std::string resizeRight(const std::string& s, size_t newSize, char fill = ' ');
 
-    /**
-     * @brief Send a string of size 'newSize', which is a copy of 's' truncated or
+    /** @brief Send a string of size 'newSize', which is a copy of 's' truncated or
      * filled with character 'fill' at the beginning.
-     *
      * @param s       The string to parse.
      * @param newSize The new string size.
      * @param fill    The character to use to fill the string id length < newSize.
      * @return A string of size newsize which is a copy from the right of s.
      */
-    static std::string resizeLeft(const std::string& s, size_t newSize, char fill = ' ');
+    std::string resizeLeft(const std::string& s, size_t newSize, char fill = ' ');
 
-    /**
-     * @brief Split a string into parts of size 'n'.
-     *
+    /** @brief Split a string into parts of size 'n'.
      * The last part may contain < n chars.
-     *
      * @param s The string to parse.
      * @param n The number of tokens.
      * @return A vector of strings with all tokens.
      */
-    static std::vector<std::string> split(const std::string& s, size_t n);
+    std::vector<std::string> split(const std::string& s, size_t n);
 
-    /**
-     * @brief Remove substrings from a string.
-     *
+    /** @brief Remove substrings from a string.
      * All substrings beginning with blockBeginning
      * and ending with blockEnding will be removed.
      * Nesting blocks are allowed, the most extern block will be removed.
-     *
      * @param s The string to parse.
      * @param blockBeginning The character specifying the beginning of each block.
      * @param blockEnding    The character specifying the end of each block.
      * @return The string with all blocks removed.
      * @throw Exception If some blocks are not well formed.
      */
-    static std::string removeSubstrings(const std::string& s, char blockBeginning, char blockEnding);
-  
-    /**
-     * @brief Remove substrings from a string, unless they match some specific substrings.
-     *
+    std::string removeSubstrings(const std::string& s, char blockBeginning, char blockEnding);
+
+    /** @brief Remove substrings from a string, unless they match some specific substrings.
      * All substrings beginning with blockBeginning
      * and ending with blockEnding will be removed, except if they begin with 
      * a string included in the vector exceptionsBeginning or end with a string
      * included in the vector exceptionsEnding.
      * Nesting blocks are allowed, the most extern block will be removed.
-     *
      * @param s The string to parse.
      * @param blockBeginning The character specifying the beginning of each block.
      * @param blockEnding    The character specifying the end of each block.
@@ -346,8 +266,10 @@ namespace bpp
      * @return The string with all blocks removed.
      * @throw Exception If some blocks are not well formed.
      */
-    static std::string removeSubstrings(const std::string& s, char blockBeginning, char blockEnding, std::vector<std::string>& exceptionsBeginning, std::vector<std::string>& exceptionsEnding);
-  
+    std::string removeSubstrings(const std::string& s, char blockBeginning, char blockEnding,
+                                 std::vector<std::string>& exceptionsBeginning,
+                                 std::vector<std::string>& exceptionsEnding);
+
     /**
     * @brief Remove all occurences of a character in a string.
     *
@@ -355,7 +277,7 @@ namespace bpp
     * @param c The character to remove.
     * @return The string with all specified chars removed.
     */
-    static std::string removeChar(const std::string& s, char c);
+    std::string removeChar(const std::string& s, char c);
 
     /**
      * @brief Count the occurences of a given pattern in a string.
@@ -364,7 +286,7 @@ namespace bpp
      * @param pattern The pattern to use (this is a mere string, not a regexp!).
      * @return The number of occurences of 'pattern' in 's'.
      */
-    static unsigned int count(const std::string& s, const std::string& pattern);
+    std::size_t count(const std::string& s, const std::string& pattern);
 
     /**
      * @brief Tell is a string begins with a certain motif.
@@ -373,13 +295,7 @@ namespace bpp
      * @param pattern The pattern to use (this is a mere string, not a regexp!).
      * @return true/false
      */
-
-    static bool startsWith(const std::string& s, const std::string& pattern)
-    {
-      if (s.size() < pattern.size())
-        return false;
-      return s.substr(0, pattern.size()) == pattern;
-    }
+    bool startsWith(const std::string& s, const std::string& pattern);
 
     /**
      * @brief Tell is a string ends with a certain motif.
@@ -388,7 +304,7 @@ namespace bpp
      * @param pattern The pattern to use (this is a mere string, not a regexp!).
      * @return true/false
      */
-    static bool endsWith(const std::string& s, const std::string& pattern);
+    bool endsWith(const std::string& s, const std::string& pattern);
 
     /**
      * @brief Tell is a string contains a certain motif.
@@ -397,7 +313,7 @@ namespace bpp
      * @param pattern The pattern to use (this is a mere string, not a regexp!).
      * @return true/false
      */
-    static bool hasSubstring(const std::string& s, const std::string& pattern);
+    bool hasSubstring(const std::string& s, const std::string& pattern);
 
     /**
      * @brief Replacement of all non-overlapping occurrences of a certain motif in a string.
@@ -406,11 +322,8 @@ namespace bpp
      * @param query The motif to look for
      * @param replacement The replacement string
      */
-    static void replaceAll(std::string& target, const std::string& query, const std::string& replacement);
-     
-  };
-
-} //end of namespace bpp.
-
-#endif	//_TEXTTOOLS_H_
+    void replaceAll(std::string& target, const std::string& query, const std::string& replacement);
 
+  } // namespace TextTools
+} // namespace bpp
+#endif // BPP_TEXT_TEXTTOOLS_H
diff --git a/src/Bpp/Utils/AttributesTools.cpp b/src/Bpp/Utils/AttributesTools.cpp
index 11e8915..48d8850 100644
--- a/src/Bpp/Utils/AttributesTools.cpp
+++ b/src/Bpp/Utils/AttributesTools.cpp
@@ -174,7 +174,6 @@ void AttributesTools::resolveVariables(
   char varCode,
   char varBeg,
   char varEnd)
-throw (Exception)
 {
   // Now resolve any variable:
   for (map<string, string>::iterator it = am.begin(); it != am.end(); it++)
@@ -241,7 +240,7 @@ std::string AttributesTools::removeComments(
 
 /******************************************************************************/
 
-std::map<std::string, std::string> AttributesTools::parseOptions(int args, char** argv) throw (Exception)
+std::map<std::string, std::string> AttributesTools::parseOptions(int args, char** argv)
 {
   // Get the parameters from command line:
   map<string, string> cmdParams = AttributesTools::getAttributesMap(
diff --git a/src/Bpp/Utils/AttributesTools.h b/src/Bpp/Utils/AttributesTools.h
index a73c0b4..5942b33 100644
--- a/src/Bpp/Utils/AttributesTools.h
+++ b/src/Bpp/Utils/AttributesTools.h
@@ -217,7 +217,7 @@ public:
   static void resolveVariables(std::map<std::string, std::string>& am,
                                char varCode = '$',
                                char varBeg = '(',
-                               char varEnd = ')') throw (Exception);
+                               char varEnd = ')');
 
   /**
    * @brief Global function that reads all parameters from command line and files,
@@ -228,7 +228,7 @@ public:
    * @return An attributes map.
    * @throw Exception in case an option file is not found.
    */
-  static std::map<std::string, std::string> parseOptions(int args, char** argv) throw (Exception);
+  static std::map<std::string, std::string> parseOptions(int args, char** argv);
 
 private:
   /**
diff --git a/test/PolynomialFunction.h b/test/PolynomialFunction.h
index 7030015..85be08b 100644
--- a/test/PolynomialFunction.h
+++ b/test/PolynomialFunction.h
@@ -65,12 +65,11 @@ class PolynomialFunction1:
     PolynomialFunction1* clone() const { return new PolynomialFunction1(*this); }
  
   public:
-    void setParameters(const ParameterList& pl) 
-        throw (ParameterNotFoundException, ConstraintException, Exception)
+    void setParameters(const ParameterList& pl)
     {
       matchParametersValues(pl);
     }
-    double getValue() const throw (Exception) { return fval_; }
+    double getValue() const { return fval_; }
  
     void fireParameterChanged(const ParameterList& pl) {
       double x = getParameterValue("x");
@@ -97,8 +96,7 @@ class PolynomialFunction1Der1:
     PolynomialFunction1Der1* clone() const { return new PolynomialFunction1Der1(*this); }
  
   public:
-    void setParameters(const ParameterList& pl) 
-        throw (ParameterNotFoundException, ConstraintException, Exception)
+    void setParameters(const ParameterList& pl)
     {
       matchParametersValues(pl);
     }
@@ -118,7 +116,7 @@ class PolynomialFunction1Der1:
     void enableFirstOrderDerivatives(bool yn) { compFirstDer_ = yn; }
     bool enableFirstOrderDerivatives() const { return compFirstDer_; }
 
-    double getFirstOrderDerivative(const std::string& variable) const throw (Exception) {
+    double getFirstOrderDerivative(const std::string& variable) const {
       if (!compFirstDer_)
         throw Exception("PolynomialFunction1Der1::getFirstOrderDerivative. First order derivatives are not computed.");
       return firstDer_[variable];
diff --git a/test/doctest.h b/test/doctest.h
new file mode 100644
index 0000000..32e753f
--- /dev/null
+++ b/test/doctest.h
@@ -0,0 +1,3488 @@
+// ======================================================================
+// == DO NOT MODIFY THIS FILE BY HAND - IT IS AUTO GENERATED BY CMAKE! ==
+// ======================================================================
+//
+// doctest.h - the lightest feature-rich C++ single-header testing framework for unit tests and TDD
+//
+// Copyright (c) 2016 Viktor Kirilov
+//
+// Distributed under the MIT Software License
+// See accompanying file LICENSE.txt or copy at
+// https://opensource.org/licenses/MIT
+//
+// The documentation can be found at the library's page:
+// https://github.com/onqtam/doctest/blob/master/doc/markdown/readme.md
+//
+// =================================================================================================
+// =================================================================================================
+// =================================================================================================
+//
+// The library is heavily influenced by Catch - https://github.com/philsquared/Catch
+// which uses the Boost Software License - Version 1.0
+// see here - https://github.com/philsquared/Catch/blob/master/LICENSE_1_0.txt
+//
+// The concept of subcases (sections in Catch) and expression decomposition are from there.
+// Some parts of the code are taken directly:
+// - stringification - the detection of "ostream& operator<<(ostream&, const T&)" and StringMaker<>
+// - the Approx() helper class for floating point comparison
+// - colors in the console
+// - breaking into a debugger
+//
+// The expression decomposing templates are taken from lest - https://github.com/martinmoene/lest
+// which uses the Boost Software License - Version 1.0
+// see here - https://github.com/martinmoene/lest/blob/master/LICENSE_1_0.txt
+//
+// =================================================================================================
+// =================================================================================================
+// =================================================================================================
+
+// Suppress this globally (without push/pop) - there is no way to silence it in the
+// expression decomposition macros _Pragma() in macros doesn't work for the c++ front-end of g++
+// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55578
+// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69543
+// Also the warning is completely worthless nowadays - http://stackoverflow.com/questions/14016993
+#if defined(__GNUC__) && !defined(__clang__)
+#pragma GCC diagnostic ignored "-Waggregate-return"
+#endif
+
+#if defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunknown-pragmas"
+#pragma clang diagnostic ignored "-Wpadded"
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wshorten-64-to-32"
+#pragma clang diagnostic ignored "-Wunused-local-typedef"
+#endif // __clang__
+
+#if defined(__GNUC__) && !defined(__clang__)
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 6)
+#pragma GCC diagnostic push
+#endif // > gcc 4.6
+#pragma GCC diagnostic ignored "-Wunknown-pragmas"
+#pragma GCC diagnostic ignored "-Weffc++"
+#pragma GCC diagnostic ignored "-Wstrict-overflow"
+#pragma GCC diagnostic ignored "-Wmissing-declarations"
+#pragma GCC diagnostic ignored "-Winline"
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 6)
+#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
+#endif // > gcc 4.6
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 7)
+#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
+#endif // > gcc 4.7
+#if __GNUC__ > 5 || (__GNUC__ == 5 && __GNUC_MINOR__ > 3)
+#pragma GCC diagnostic ignored "-Wuseless-cast"
+#endif // > gcc 5.3
+#endif // __GNUC__
+
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable : 4996) // The compiler encountered a deprecated declaration
+#pragma warning(disable : 4706) // assignment within conditional expression
+#pragma warning(disable : 4512) // 'class' : assignment operator could not be generated
+#pragma warning(disable : 4127) // conditional expression is constant
+#endif                          // _MSC_VER
+
+#ifndef DOCTEST_LIBRARY_INCLUDED
+#define DOCTEST_LIBRARY_INCLUDED
+
+#define DOCTEST_VERSION_MAJOR 1
+#define DOCTEST_VERSION_MINOR 1
+#define DOCTEST_VERSION_PATCH 4
+#define DOCTEST_VERSION_STR "1.1.4"
+
+#define DOCTEST_VERSION                                                                            \
+    (DOCTEST_VERSION_MAJOR * 10000 + DOCTEST_VERSION_MINOR * 100 + DOCTEST_VERSION_PATCH)
+
+// =================================================================================================
+// == MODERN C++ FEATURE DETECTION =================================================================
+// =================================================================================================
+
+#if __cplusplus >= 201103L
+#ifndef DOCTEST_CONFIG_WITH_NULLPTR
+#define DOCTEST_CONFIG_WITH_NULLPTR
+#endif // DOCTEST_CONFIG_WITH_NULLPTR
+#ifndef DOCTEST_CONFIG_WITH_LONG_LONG
+#define DOCTEST_CONFIG_WITH_LONG_LONG
+#endif // DOCTEST_CONFIG_WITH_LONG_LONG
+#ifndef DOCTEST_CONFIG_WITH_STATIC_ASSERT
+#define DOCTEST_CONFIG_WITH_STATIC_ASSERT
+#endif // DOCTEST_CONFIG_WITH_STATIC_ASSERT
+#endif // __cplusplus >= 201103L
+
+// nullptr
+
+#ifndef DOCTEST_CONFIG_WITH_NULLPTR
+#ifdef __clang__
+#if __has_feature(cxx_nullptr)
+#define DOCTEST_CONFIG_WITH_NULLPTR
+#endif // __has_feature(cxx_nullptr)
+#endif // __clang__
+
+#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ >= 6 && defined(__GXX_EXPERIMENTAL_CXX0X__)
+#define DOCTEST_CONFIG_WITH_NULLPTR
+#endif // __GNUC__
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1600) // MSVC 2010
+#define DOCTEST_CONFIG_WITH_NULLPTR
+#endif // _MSC_VER
+#endif // DOCTEST_CONFIG_WITH_NULLPTR
+
+#if defined(DOCTEST_CONFIG_NO_NULLPTR) && defined(DOCTEST_CONFIG_WITH_NULLPTR)
+#undef DOCTEST_CONFIG_WITH_NULLPTR
+#endif // DOCTEST_CONFIG_NO_NULLPTR
+
+// long long
+
+#ifndef DOCTEST_CONFIG_WITH_LONG_LONG
+#if !defined(DOCTEST_CONFIG_WITH_LONG_LONG) && defined(_MSC_VER) && (_MSC_VER >= 1400)
+#define DOCTEST_CONFIG_WITH_LONG_LONG
+#endif // _MSC_VER
+#endif // DOCTEST_CONFIG_WITH_LONG_LONG
+
+#if defined(DOCTEST_CONFIG_NO_LONG_LONG) && defined(DOCTEST_CONFIG_WITH_LONG_LONG)
+#undef DOCTEST_CONFIG_WITH_LONG_LONG
+#endif // DOCTEST_CONFIG_NO_LONG_LONG
+
+// static_assert
+
+#ifndef DOCTEST_CONFIG_WITH_STATIC_ASSERT
+#ifdef __clang__
+#if __has_feature(cxx_static_assert)
+#define DOCTEST_CONFIG_WITH_STATIC_ASSERT
+#endif // __has_feature(cxx_static_assert)
+#endif // __clang__
+
+#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ >= 3 && defined(__GXX_EXPERIMENTAL_CXX0X__)
+#define DOCTEST_CONFIG_WITH_STATIC_ASSERT
+#endif // __GNUC__
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1600) // MSVC 2010
+#define DOCTEST_CONFIG_WITH_STATIC_ASSERT
+#endif // _MSC_VER
+#endif // DOCTEST_CONFIG_WITH_STATIC_ASSERT
+
+#if defined(DOCTEST_CONFIG_NO_STATIC_ASSERT) && defined(DOCTEST_CONFIG_WITH_STATIC_ASSERT)
+#undef DOCTEST_CONFIG_WITH_STATIC_ASSERT
+#endif // DOCTEST_CONFIG_NO_STATIC_ASSERT
+
+#if defined(DOCTEST_CONFIG_WITH_NULLPTR) || defined(DOCTEST_CONFIG_WITH_LONG_LONG) ||              \
+        defined(DOCTEST_CONFIG_WITH_STATIC_ASSERT)
+#define DOCTEST_NO_CPP11_COMPAT
+#endif // c++11 stuff
+
+#if defined(__clang__) && defined(DOCTEST_NO_CPP11_COMPAT)
+#pragma clang diagnostic ignored "-Wc++98-compat"
+#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
+#endif // __clang__ && DOCTEST_NO_CPP11_COMPAT
+
+#ifndef DOCTEST_CONFIG_NO_EXCEPTIONS
+#if defined(__GNUC__) && !defined(__EXCEPTIONS)
+#define DOCTEST_CONFIG_NO_EXCEPTIONS
+#endif // clang and gcc
+// in MSVC _HAS_EXCEPTIONS is defined in a header instead of as a project define
+// so we can't do the automatic detection for MSVC without including some header
+#endif // DOCTEST_CONFIG_NO_EXCEPTIONS
+
+#ifdef DOCTEST_CONFIG_NO_EXCEPTIONS_BUT_WITH_ALL_ASSERTS
+#ifndef DOCTEST_CONFIG_NO_EXCEPTIONS
+#define DOCTEST_CONFIG_NO_EXCEPTIONS
+#endif // DOCTEST_CONFIG_NO_EXCEPTIONS
+#endif // DOCTEST_CONFIG_NO_EXCEPTIONS_BUT_WITH_ALL_ASSERTS
+
+#if defined(DOCTEST_CONFIG_NO_EXCEPTIONS) && !defined(DOCTEST_CONFIG_NO_TRY_CATCH_IN_ASSERTS)
+#define DOCTEST_CONFIG_NO_TRY_CATCH_IN_ASSERTS
+#endif // DOCTEST_CONFIG_NO_EXCEPTIONS && !DOCTEST_CONFIG_NO_TRY_CATCH_IN_ASSERTS
+
+// =================================================================================================
+// == MODERN C++ FEATURE DETECTION END =============================================================
+// =================================================================================================
+
+// internal macros for string concatenation and anonymous variable name generation
+#define DOCTEST_CAT_IMPL(s1, s2) s1##s2
+#define DOCTEST_CAT(s1, s2) DOCTEST_CAT_IMPL(s1, s2)
+#ifdef __COUNTER__ // not standard and may be missing for some compilers
+#define DOCTEST_ANONYMOUS(x) DOCTEST_CAT(x, __COUNTER__)
+#else // __COUNTER__
+#define DOCTEST_ANONYMOUS(x) DOCTEST_CAT(x, __LINE__)
+#endif // __COUNTER__
+
+// macro for making a string out of an identifier
+#define DOCTEST_TOSTR_IMPL(x) #x
+#define DOCTEST_TOSTR(x) DOCTEST_TOSTR_IMPL(x)
+
+// for concatenating literals and making the result a string
+#define DOCTEST_STR_CONCAT_TOSTR(s1, s2) DOCTEST_TOSTR(s1) DOCTEST_TOSTR(s2)
+
+// counts the number of elements in a C string
+#define DOCTEST_COUNTOF(x) (sizeof(x) / sizeof(x[0]))
+
+#ifndef DOCTEST_CONFIG_ASSERTION_PARAMETERS_BY_VALUE
+#define DOCTEST_REF_WRAP(x) x&
+#else // DOCTEST_CONFIG_ASSERTION_PARAMETERS_BY_VALUE
+#define DOCTEST_REF_WRAP(x) x
+#endif // DOCTEST_CONFIG_ASSERTION_PARAMETERS_BY_VALUE
+
+// not using __APPLE__ because... this is how Catch does it
+#if defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
+#define DOCTEST_PLATFORM_MAC
+#elif defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+#define DOCTEST_PLATFORM_IPHONE
+#elif defined(_WIN32) || defined(_MSC_VER)
+#define DOCTEST_PLATFORM_WINDOWS
+#else
+#define DOCTEST_PLATFORM_LINUX
+#endif
+
+#define DOCTEST_GCS() (*doctest::detail::getTestsContextState())
+
+// should probably take a look at https://github.com/scottt/debugbreak
+#ifdef DOCTEST_PLATFORM_MAC
+// The following code snippet based on:
+// http://cocoawithlove.com/2008/03/break-into-debugger.html
+#if defined(__ppc64__) || defined(__ppc__)
+#define DOCTEST_BREAK_INTO_DEBUGGER()                                                              \
+    __asm__("li r0, 20\nsc\nnop\nli r0, 37\nli r4, 2\nsc\nnop\n" : : : "memory", "r0", "r3", "r4")
+#else // __ppc64__ || __ppc__
+#define DOCTEST_BREAK_INTO_DEBUGGER() __asm__("int $3\n" : :)
+#endif // __ppc64__ || __ppc__
+#elif defined(_MSC_VER)
+#define DOCTEST_BREAK_INTO_DEBUGGER() __debugbreak()
+#elif defined(__MINGW32__)
+extern "C" __declspec(dllimport) void __stdcall DebugBreak();
+#define DOCTEST_BREAK_INTO_DEBUGGER() ::DebugBreak()
+#else // linux
+#define DOCTEST_BREAK_INTO_DEBUGGER() ((void)0)
+#endif // linux
+
+#define DOCTEST_BREAK_INTO_DEBUGGER_CHECKED()                                                      \
+    if(doctest::detail::isDebuggerActive() && !DOCTEST_GCS().no_breaks)                            \
+        DOCTEST_BREAK_INTO_DEBUGGER();
+
+#ifdef __clang__
+// to detect if libc++ is being used with clang (the _LIBCPP_VERSION identifier)
+#include <ciso646>
+#endif // __clang__
+
+#ifdef _LIBCPP_VERSION
+// not forward declaring ostream for libc++ because I had some problems (inline namespaces vs c++98)
+// so the <iosfwd> header is used - also it is very light and doesn't drag a ton of stuff
+#include <iosfwd>
+#else // _LIBCPP_VERSION
+#ifndef DOCTEST_CONFIG_USE_IOSFWD
+namespace std
+{
+template <class charT>
+struct char_traits;
+template <>
+struct char_traits<char>;
+template <class charT, class traits>
+class basic_ostream;
+typedef basic_ostream<char, char_traits<char> > ostream;
+}
+#else // DOCTEST_CONFIG_USE_IOSFWD
+#include <iosfwd>
+#endif // DOCTEST_CONFIG_USE_IOSFWD
+#endif // _LIBCPP_VERSION
+
+// static assert macro - because of the c++98 support requires that the message is an
+// identifier (no spaces and not a C string) - example without quotes: I_am_a_message
+// taken from here: http://stackoverflow.com/a/1980156/3162383
+#ifdef DOCTEST_CONFIG_WITH_STATIC_ASSERT
+#define DOCTEST_STATIC_ASSERT(expression, message) static_assert(expression, #message)
+#else // DOCTEST_CONFIG_WITH_STATIC_ASSERT
+#define DOCTEST_STATIC_ASSERT(expression, message)                                                 \
+    struct DOCTEST_CAT(__static_assertion_at_line_, __LINE__)                                      \
+    {                                                                                              \
+        doctest::detail::static_assert_impl::StaticAssertion<static_cast<bool>((expression))>      \
+                DOCTEST_CAT(DOCTEST_CAT(DOCTEST_CAT(STATIC_ASSERTION_FAILED_AT_LINE_, __LINE__),   \
+                                        _),                                                        \
+                            message);                                                              \
+    };                                                                                             \
+    typedef doctest::detail::static_assert_impl::StaticAssertionTest<sizeof(                       \
+            DOCTEST_CAT(__static_assertion_at_line_, __LINE__))>                                   \
+            DOCTEST_CAT(__static_assertion_test_at_line_, __LINE__)
+#endif // DOCTEST_CONFIG_WITH_STATIC_ASSERT
+
+#ifdef DOCTEST_CONFIG_WITH_NULLPTR
+#ifdef _LIBCPP_VERSION
+#include <cstddef>
+#else  // _LIBCPP_VERSION
+namespace std
+{ typedef decltype(nullptr) nullptr_t; }
+#endif // _LIBCPP_VERSION
+#endif // DOCTEST_CONFIG_WITH_NULLPTR
+
+namespace doctest
+{
+class String
+{
+    char* m_str;
+
+    void copy(const String& other);
+
+public:
+    String(const char* in = "");
+    String(const String& other);
+    ~String();
+
+    String& operator=(const String& other);
+
+    String operator+(const String& other) const;
+    String& operator+=(const String& other);
+
+    char& operator[](unsigned pos) { return m_str[pos]; }
+    const char& operator[](unsigned pos) const { return m_str[pos]; }
+
+    char*       c_str() { return m_str; }
+    const char* c_str() const { return m_str; }
+
+    unsigned size() const;
+    unsigned length() const;
+
+    int compare(const char* other, bool no_case = false) const;
+    int compare(const String& other, bool no_case = false) const;
+};
+
+// clang-format off
+inline bool operator==(const String& lhs, const String& rhs) { return lhs.compare(rhs) == 0; }
+inline bool operator!=(const String& lhs, const String& rhs) { return lhs.compare(rhs) != 0; }
+inline bool operator< (const String& lhs, const String& rhs) { return lhs.compare(rhs) < 0; }
+inline bool operator> (const String& lhs, const String& rhs) { return lhs.compare(rhs) > 0; }
+inline bool operator<=(const String& lhs, const String& rhs) { return (lhs != rhs) ? lhs.compare(rhs) < 0 : true; }
+inline bool operator>=(const String& lhs, const String& rhs) { return (lhs != rhs) ? lhs.compare(rhs) > 0 : true; }
+// clang-format on
+
+std::ostream& operator<<(std::ostream& stream, const String& in);
+
+namespace detail
+{
+#ifndef DOCTEST_CONFIG_WITH_STATIC_ASSERT
+    namespace static_assert_impl
+    {
+        template <bool>
+        struct StaticAssertion;
+
+        template <>
+        struct StaticAssertion<true>
+        {};
+
+        template <int i>
+        struct StaticAssertionTest
+        {};
+    }  // namespace static_assert_impl
+#endif // DOCTEST_CONFIG_WITH_STATIC_ASSERT
+
+    template <typename T>
+    struct deferred_false
+    { static const bool value = false; };
+
+    namespace has_insertion_operator_impl
+    {
+        typedef char no;
+        typedef char yes[2];
+
+        struct any_t
+        {
+            template <typename T>
+            any_t(const DOCTEST_REF_WRAP(T));
+        };
+
+        yes& testStreamable(std::ostream&);
+        no   testStreamable(no);
+
+        no operator<<(const std::ostream&, const any_t&);
+
+        template <typename T>
+        struct has_insertion_operator
+        {
+            static std::ostream& s;
+            static const DOCTEST_REF_WRAP(T) t;
+            static const bool value = sizeof(testStreamable(s << t)) == sizeof(yes);
+        };
+    } // namespace has_insertion_operator_impl
+
+    template <typename T>
+    struct has_insertion_operator : has_insertion_operator_impl::has_insertion_operator<T>
+    {};
+
+    std::ostream* createStream();
+    String        getStreamResult(std::ostream*);
+    void          freeStream(std::ostream*);
+
+    template <bool C>
+    struct StringMakerBase
+    {
+        template <typename T>
+        static String convert(const DOCTEST_REF_WRAP(T)) {
+            return "{?}";
+        }
+    };
+
+    template <>
+    struct StringMakerBase<true>
+    {
+        template <typename T>
+        static String convert(const DOCTEST_REF_WRAP(T) in) {
+            std::ostream* stream = createStream();
+            *stream << in;
+            String result = getStreamResult(stream);
+            freeStream(stream);
+            return result;
+        }
+    };
+
+    String rawMemoryToString(const void* object, unsigned size);
+
+    template <typename T>
+    String rawMemoryToString(const DOCTEST_REF_WRAP(T) object) {
+        return rawMemoryToString(&object, sizeof(object));
+    }
+} // namespace detail
+
+template <typename T>
+struct StringMaker : detail::StringMakerBase<detail::has_insertion_operator<T>::value>
+{};
+
+template <typename T>
+struct StringMaker<T*>
+{
+    template <typename U>
+    static String convert(U* p) {
+        if(!p)
+            return "NULL";
+        else
+            return detail::rawMemoryToString(p);
+    }
+};
+
+template <typename R, typename C>
+struct StringMaker<R C::*>
+{
+    static String convert(R C::*p) {
+        if(!p)
+            return "NULL";
+        else
+            return detail::rawMemoryToString(p);
+    }
+};
+
+template <typename T>
+String toString(const DOCTEST_REF_WRAP(T) value) {
+    return StringMaker<T>::convert(value);
+}
+
+#ifdef DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING
+String toString(char* in);
+String toString(const char* in);
+#endif // DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING
+String toString(bool in);
+String toString(float in);
+String toString(double in);
+String toString(double long in);
+
+String toString(char in);
+String toString(char unsigned in);
+String toString(int short in);
+String toString(int short unsigned in);
+String toString(int in);
+String toString(int unsigned in);
+String toString(int long in);
+String toString(int long unsigned in);
+
+#ifdef DOCTEST_CONFIG_WITH_LONG_LONG
+String toString(int long long in);
+String toString(int long long unsigned in);
+#endif // DOCTEST_CONFIG_WITH_LONG_LONG
+
+#ifdef DOCTEST_CONFIG_WITH_NULLPTR
+String toString(std::nullptr_t in);
+#endif // DOCTEST_CONFIG_WITH_NULLPTR
+
+class Approx
+{
+public:
+    explicit Approx(double value);
+
+    Approx(Approx const& other)
+            : m_epsilon(other.m_epsilon)
+            , m_scale(other.m_scale)
+            , m_value(other.m_value) {}
+
+    Approx operator()(double value) {
+        Approx approx(value);
+        approx.epsilon(m_epsilon);
+        approx.scale(m_scale);
+        return approx;
+    }
+
+    friend bool operator==(double lhs, Approx const& rhs);
+    friend bool operator==(Approx const& lhs, double rhs) { return operator==(rhs, lhs); }
+    friend bool operator!=(double lhs, Approx const& rhs) { return !operator==(lhs, rhs); }
+    friend bool operator!=(Approx const& lhs, double rhs) { return !operator==(rhs, lhs); }
+
+    Approx& epsilon(double newEpsilon) {
+        m_epsilon = newEpsilon;
+        return *this;
+    }
+
+    Approx& scale(double newScale) {
+        m_scale = newScale;
+        return *this;
+    }
+
+    String toString() const;
+
+private:
+    double m_epsilon;
+    double m_scale;
+    double m_value;
+};
+
+template <>
+inline String toString<Approx>(const DOCTEST_REF_WRAP(Approx) value) {
+    return value.toString();
+}
+
+#if !defined(DOCTEST_CONFIG_DISABLE)
+
+namespace detail
+{
+    // the function type this library works with
+    typedef void (*funcType)(void);
+
+    namespace assertType
+    {
+        enum Enum
+        {
+            // macro traits
+
+            is_warn    = 1,
+            is_check   = 2,
+            is_require = 4,
+
+            is_throws    = 8,
+            is_throws_as = 16,
+            is_nothrow   = 32,
+
+            is_fast  = 64, // not checked anywhere - used just to distinguish the types
+            is_false = 128,
+            is_unary = 256,
+
+            is_eq = 512,
+            is_ne = 1024,
+
+            is_lt = 2048,
+            is_gt = 4096,
+
+            is_ge = 8192,
+            is_le = 16384,
+
+            // macro types
+
+            DT_WARN    = is_warn,
+            DT_CHECK   = is_check,
+            DT_REQUIRE = is_require,
+
+            DT_WARN_FALSE    = is_false | is_warn,
+            DT_CHECK_FALSE   = is_false | is_check,
+            DT_REQUIRE_FALSE = is_false | is_require,
+
+            DT_WARN_THROWS    = is_throws | is_warn,
+            DT_CHECK_THROWS   = is_throws | is_check,
+            DT_REQUIRE_THROWS = is_throws | is_require,
+
+            DT_WARN_THROWS_AS    = is_throws_as | is_warn,
+            DT_CHECK_THROWS_AS   = is_throws_as | is_check,
+            DT_REQUIRE_THROWS_AS = is_throws_as | is_require,
+
+            DT_WARN_NOTHROW    = is_nothrow | is_warn,
+            DT_CHECK_NOTHROW   = is_nothrow | is_check,
+            DT_REQUIRE_NOTHROW = is_nothrow | is_require,
+
+            DT_WARN_EQ    = is_eq | is_warn,
+            DT_CHECK_EQ   = is_eq | is_check,
+            DT_REQUIRE_EQ = is_eq | is_require,
+
+            DT_WARN_NE    = is_ne | is_warn,
+            DT_CHECK_NE   = is_ne | is_check,
+            DT_REQUIRE_NE = is_ne | is_require,
+
+            DT_WARN_GT    = is_gt | is_warn,
+            DT_CHECK_GT   = is_gt | is_check,
+            DT_REQUIRE_GT = is_gt | is_require,
+
+            DT_WARN_LT    = is_lt | is_warn,
+            DT_CHECK_LT   = is_lt | is_check,
+            DT_REQUIRE_LT = is_lt | is_require,
+
+            DT_WARN_GE    = is_ge | is_warn,
+            DT_CHECK_GE   = is_ge | is_check,
+            DT_REQUIRE_GE = is_ge | is_require,
+
+            DT_WARN_LE    = is_le | is_warn,
+            DT_CHECK_LE   = is_le | is_check,
+            DT_REQUIRE_LE = is_le | is_require,
+
+            DT_WARN_UNARY    = is_unary | is_warn,
+            DT_CHECK_UNARY   = is_unary | is_check,
+            DT_REQUIRE_UNARY = is_unary | is_require,
+
+            DT_WARN_UNARY_FALSE    = is_false | is_unary | is_warn,
+            DT_CHECK_UNARY_FALSE   = is_false | is_unary | is_check,
+            DT_REQUIRE_UNARY_FALSE = is_false | is_unary | is_require,
+
+            DT_FAST_WARN_EQ    = is_fast | is_eq | is_warn,
+            DT_FAST_CHECK_EQ   = is_fast | is_eq | is_check,
+            DT_FAST_REQUIRE_EQ = is_fast | is_eq | is_require,
+
+            DT_FAST_WARN_NE    = is_fast | is_ne | is_warn,
+            DT_FAST_CHECK_NE   = is_fast | is_ne | is_check,
+            DT_FAST_REQUIRE_NE = is_fast | is_ne | is_require,
+
+            DT_FAST_WARN_GT    = is_fast | is_gt | is_warn,
+            DT_FAST_CHECK_GT   = is_fast | is_gt | is_check,
+            DT_FAST_REQUIRE_GT = is_fast | is_gt | is_require,
+
+            DT_FAST_WARN_LT    = is_fast | is_lt | is_warn,
+            DT_FAST_CHECK_LT   = is_fast | is_lt | is_check,
+            DT_FAST_REQUIRE_LT = is_fast | is_lt | is_require,
+
+            DT_FAST_WARN_GE    = is_fast | is_ge | is_warn,
+            DT_FAST_CHECK_GE   = is_fast | is_ge | is_check,
+            DT_FAST_REQUIRE_GE = is_fast | is_ge | is_require,
+
+            DT_FAST_WARN_LE    = is_fast | is_le | is_warn,
+            DT_FAST_CHECK_LE   = is_fast | is_le | is_check,
+            DT_FAST_REQUIRE_LE = is_fast | is_le | is_require,
+
+            DT_FAST_WARN_UNARY    = is_fast | is_unary | is_warn,
+            DT_FAST_CHECK_UNARY   = is_fast | is_unary | is_check,
+            DT_FAST_REQUIRE_UNARY = is_fast | is_unary | is_require,
+
+            DT_FAST_WARN_UNARY_FALSE    = is_fast | is_false | is_unary | is_warn,
+            DT_FAST_CHECK_UNARY_FALSE   = is_fast | is_false | is_unary | is_check,
+            DT_FAST_REQUIRE_UNARY_FALSE = is_fast | is_false | is_unary | is_require
+        };
+    } // namespace assertType
+
+    const char* getAssertString(assertType::Enum val);
+
+    // clang-format off
+    template<class T>               struct decay_array       { typedef T type; };
+    template<class T, unsigned N>   struct decay_array<T[N]> { typedef T* type; };
+    template<class T>               struct decay_array<T[]>  { typedef T* type; };
+
+    template<class T>   struct not_char_pointer              { enum { value = true }; };
+    template<>          struct not_char_pointer<char*>       { enum { value = false }; };
+    template<>          struct not_char_pointer<const char*> { enum { value = false }; };
+
+    template<class T> struct can_use_op : not_char_pointer<typename decay_array<T>::type> {};
+
+    template<bool, class = void> struct enable_if {};
+    template<class T> struct enable_if<true, T> { typedef T type; };
+    // clang-format on
+
+    struct TestFailureException
+    {};
+
+    bool checkIfShouldThrow(assertType::Enum assert_type);
+    void fastAssertThrowIfFlagSet(int flags);
+    void throwException();
+    bool always_false();
+
+    // a struct defining a registered test callback
+    struct TestData
+    {
+        // not used for determining uniqueness
+        const char* m_suite; // the test suite in which the test was added
+        const char* m_name;  // name of the test function
+        funcType    m_f;     // a function pointer to the test function
+
+        // fields by which uniqueness of test cases shall be determined
+        const char* m_file; // the file in which the test was registered
+        unsigned    m_line; // the line where the test was registered
+
+        TestData(const char* suite, const char* name, funcType f, const char* file, unsigned line)
+                : m_suite(suite)
+                , m_name(name)
+                , m_f(f)
+                , m_file(file)
+                , m_line(line) {}
+
+        bool operator<(const TestData& other) const;
+    };
+
+    struct SubcaseSignature
+    {
+        const char* m_name;
+        const char* m_file;
+        int         m_line;
+
+        SubcaseSignature(const char* name, const char* file, int line)
+                : m_name(name)
+                , m_file(file)
+                , m_line(line) {}
+
+        bool operator<(const SubcaseSignature& other) const;
+    };
+
+    struct Subcase
+    {
+        SubcaseSignature m_signature;
+        bool             m_entered;
+
+        Subcase(const char* name, const char* file, int line);
+        Subcase(const Subcase& other);
+        ~Subcase();
+
+        operator bool() const { return m_entered; }
+    };
+
+    template <typename L, typename R>
+    String stringifyBinaryExpr(const DOCTEST_REF_WRAP(L) lhs, const char* op,
+                               const DOCTEST_REF_WRAP(R) rhs) {
+        return toString(lhs) + op + toString(rhs);
+    }
+
+    struct Result
+    {
+        bool   m_passed;
+        String m_decomposition;
+
+// to fix gcc 4.7 "-Winline" warnings
+#if defined(__GNUC__) && !defined(__clang__)
+        __attribute__((noinline))
+#endif
+        ~Result() {
+        }
+
+        Result(bool passed = false, const String& decomposition = String())
+                : m_passed(passed)
+                , m_decomposition(decomposition) {}
+
+        Result(const Result& other)
+                : m_passed(other.m_passed)
+                , m_decomposition(other.m_decomposition) {}
+
+// to fix gcc 4.7 "-Winline" warnings
+#if defined(__GNUC__) && !defined(__clang__)
+        __attribute__((noinline))
+#endif
+        Result&
+        operator=(const Result& other) {
+            m_passed        = other.m_passed;
+            m_decomposition = other.m_decomposition;
+
+            return *this;
+        }
+
+        operator bool() { return !m_passed; }
+
+        void invert() { m_passed = !m_passed; }
+
+        // clang-format off
+        // forbidding some expressions based on this table: http://en.cppreference.com/w/cpp/language/operator_precedence
+        template <typename R> Result operator&  (const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison); return Result(); }
+        template <typename R> Result operator^  (const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison); return Result(); }
+        template <typename R> Result operator|  (const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison); return Result(); }
+        template <typename R> Result operator&& (const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison); return Result(); }
+        template <typename R> Result operator|| (const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison); return Result(); }
+        template <typename R> Result operator== (const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison); return Result(); }
+        template <typename R> Result operator!= (const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison); return Result(); }
+        template <typename R> Result operator<  (const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison); return Result(); }
+        template <typename R> Result operator>  (const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison); return Result(); }
+        template <typename R> Result operator<= (const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison); return Result(); }
+        template <typename R> Result operator>= (const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison); return Result(); }
+        template <typename R> Result operator=  (const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison); return Result(); }
+        template <typename R> Result operator+= (const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison); return Result(); }
+        template <typename R> Result operator-= (const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison); return Result(); }
+        template <typename R> Result operator*= (const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison); return Result(); }
+        template <typename R> Result operator/= (const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison); return Result(); }
+        template <typename R> Result operator%= (const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison); return Result(); }
+        template <typename R> Result operator<<=(const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison); return Result(); }
+        template <typename R> Result operator>>=(const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison); return Result(); }
+        template <typename R> Result operator&= (const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison); return Result(); }
+        template <typename R> Result operator^= (const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison); return Result(); }
+        template <typename R> Result operator|= (const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison); return Result(); }
+        // clang-format on
+    };
+
+#ifndef DOCTEST_CONFIG_NO_COMPARISON_WARNING_SUPPRESSION
+
+#if defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wsign-conversion"
+#pragma clang diagnostic ignored "-Wsign-compare"
+#pragma clang diagnostic ignored "-Wdouble-promotion"
+//#pragma clang diagnostic ignored "-Wconversion"
+//#pragma clang diagnostic ignored "-Wfloat-equal"
+#endif // __clang__
+
+#if defined(__GNUC__) && !defined(__clang__)
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 6)
+#pragma GCC diagnostic push
+#endif // > gcc 4.6
+#pragma GCC diagnostic ignored "-Wsign-conversion"
+#pragma GCC diagnostic ignored "-Wsign-compare"
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 5)
+#pragma GCC diagnostic ignored "-Wdouble-promotion"
+#endif // > gcc 4.5
+//#pragma GCC diagnostic ignored "-Wconversion"
+//#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif // __GNUC__
+
+#ifdef _MSC_VER
+#pragma warning(push)
+// http://stackoverflow.com/questions/39479163 what's the difference between C4018 and C4389
+#pragma warning(disable : 4389) // 'operator' : signed/unsigned mismatch
+#pragma warning(disable : 4018) // 'expression' : signed/unsigned mismatch
+//#pragma warning(disable : 4805) // 'operation' : unsafe mix of type 'type' and type 'type' in operation
+#endif // _MSC_VER
+
+#endif // DOCTEST_CONFIG_NO_COMPARISON_WARNING_SUPPRESSION
+
+// clang-format off
+#ifndef DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING
+#define DOCTEST_COMPARISON_RETURN_TYPE bool
+#else // DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING
+#define DOCTEST_COMPARISON_RETURN_TYPE typename enable_if<can_use_op<L>::value || can_use_op<R>::value, bool>::type
+    inline bool eq(const char* lhs, const char* rhs) { return String(lhs) == String(rhs); }
+    inline bool ne(const char* lhs, const char* rhs) { return String(lhs) != String(rhs); }
+    inline bool lt(const char* lhs, const char* rhs) { return String(lhs) <  String(rhs); }
+    inline bool gt(const char* lhs, const char* rhs) { return String(lhs) >  String(rhs); }
+    inline bool le(const char* lhs, const char* rhs) { return String(lhs) <= String(rhs); }
+    inline bool ge(const char* lhs, const char* rhs) { return String(lhs) >= String(rhs); }
+#endif // DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING
+
+    template <typename L, typename R> DOCTEST_COMPARISON_RETURN_TYPE eq(const DOCTEST_REF_WRAP(L) lhs, const DOCTEST_REF_WRAP(R) rhs) { return lhs == rhs; }
+    template <typename L, typename R> DOCTEST_COMPARISON_RETURN_TYPE ne(const DOCTEST_REF_WRAP(L) lhs, const DOCTEST_REF_WRAP(R) rhs) { return lhs != rhs; }
+    template <typename L, typename R> DOCTEST_COMPARISON_RETURN_TYPE lt(const DOCTEST_REF_WRAP(L) lhs, const DOCTEST_REF_WRAP(R) rhs) { return lhs <  rhs; }
+    template <typename L, typename R> DOCTEST_COMPARISON_RETURN_TYPE gt(const DOCTEST_REF_WRAP(L) lhs, const DOCTEST_REF_WRAP(R) rhs) { return lhs >  rhs; }
+    template <typename L, typename R> DOCTEST_COMPARISON_RETURN_TYPE le(const DOCTEST_REF_WRAP(L) lhs, const DOCTEST_REF_WRAP(R) rhs) { return lhs <= rhs; }
+    template <typename L, typename R> DOCTEST_COMPARISON_RETURN_TYPE ge(const DOCTEST_REF_WRAP(L) lhs, const DOCTEST_REF_WRAP(R) rhs) { return lhs >= rhs; }
+    // clang-format on
+
+    template <typename L>
+    struct Expression_lhs
+    {
+        L lhs;
+
+        Expression_lhs(L in)
+                : lhs(in) {}
+
+        Expression_lhs(const Expression_lhs& other)
+                : lhs(other.lhs) {}
+
+        operator Result() { return Result(!!lhs, toString(lhs)); }
+
+// clang-format off
+#ifndef DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING
+        template <typename R> Result operator==(const DOCTEST_REF_WRAP(R) rhs) { return Result(lhs == rhs, stringifyBinaryExpr(lhs, " == ", rhs)); }
+        template <typename R> Result operator!=(const DOCTEST_REF_WRAP(R) rhs) { return Result(lhs != rhs, stringifyBinaryExpr(lhs, " != ", rhs)); }
+        template <typename R> Result operator< (const DOCTEST_REF_WRAP(R) rhs) { return Result(lhs <  rhs, stringifyBinaryExpr(lhs, " < " , rhs)); }
+        template <typename R> Result operator<=(const DOCTEST_REF_WRAP(R) rhs) { return Result(lhs <= rhs, stringifyBinaryExpr(lhs, " <= ", rhs)); }
+        template <typename R> Result operator> (const DOCTEST_REF_WRAP(R) rhs) { return Result(lhs >  rhs, stringifyBinaryExpr(lhs, " > " , rhs)); }
+        template <typename R> Result operator>=(const DOCTEST_REF_WRAP(R) rhs) { return Result(lhs >= rhs, stringifyBinaryExpr(lhs, " >= ", rhs)); }
+#else  // DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING
+        template <typename R> Result operator==(const DOCTEST_REF_WRAP(R) rhs) { return Result(eq(lhs, rhs), stringifyBinaryExpr(lhs, " == ", rhs)); }
+        template <typename R> Result operator!=(const DOCTEST_REF_WRAP(R) rhs) { return Result(ne(lhs, rhs), stringifyBinaryExpr(lhs, " != ", rhs)); }
+        template <typename R> Result operator< (const DOCTEST_REF_WRAP(R) rhs) { return Result(lt(lhs, rhs), stringifyBinaryExpr(lhs, " < " , rhs)); }
+        template <typename R> Result operator<=(const DOCTEST_REF_WRAP(R) rhs) { return Result(le(lhs, rhs), stringifyBinaryExpr(lhs, " <= ", rhs)); }
+        template <typename R> Result operator> (const DOCTEST_REF_WRAP(R) rhs) { return Result(gt(lhs, rhs), stringifyBinaryExpr(lhs, " > " , rhs)); }
+        template <typename R> Result operator>=(const DOCTEST_REF_WRAP(R) rhs) { return Result(ge(lhs, rhs), stringifyBinaryExpr(lhs, " >= ", rhs)); }
+#endif // DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING
+        // clang-format on
+
+        // clang-format off
+        // forbidding some expressions based on this table: http://en.cppreference.com/w/cpp/language/operator_precedence
+        template <typename R> int operator&  (const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison); return int(); }
+        template <typename R> int operator^  (const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison); return int(); }
+        template <typename R> int operator|  (const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison); return int(); }
+        template <typename R> int operator&& (const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison); return int(); }
+        template <typename R> int operator|| (const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison); return int(); }
+        template <typename R> int operator=  (const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison); return int(); }
+        template <typename R> int operator+= (const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison); return int(); }
+        template <typename R> int operator-= (const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison); return int(); }
+        template <typename R> int operator*= (const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison); return int(); }
+        template <typename R> int operator/= (const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison); return int(); }
+        template <typename R> int operator%= (const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison); return int(); }
+        template <typename R> int operator<<=(const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison); return int(); }
+        template <typename R> int operator>>=(const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison); return int(); }
+        template <typename R> int operator&= (const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison); return int(); }
+        template <typename R> int operator^= (const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison); return int(); }
+        template <typename R> int operator|= (const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison); return int(); }
+        // these 2 are unfortunate because they should be allowed - they have higher precedence over the comparisons, but the
+        // ExpressionDecomposer class uses the left shift operator to capture the left operand of the binary expression...
+        template <typename R> int operator<< (const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Please_Surround_The_Left_Shift_Operation_With_Parenthesis); return int(); }
+        template <typename R> int operator>> (const R&) { DOCTEST_STATIC_ASSERT(deferred_false<R>::value, Please_Surround_The_Right_Shift_Operation_With_Parenthesis); return int(); }
+        // clang-format on
+    };
+
+#ifndef DOCTEST_CONFIG_NO_COMPARISON_WARNING_SUPPRESSION
+
+#if defined(__clang__)
+#pragma clang diagnostic pop
+#endif // __clang__
+
+#if defined(__GNUC__) && !defined(__clang__)
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 6)
+#pragma GCC diagnostic pop
+#endif // > gcc 4.6
+#endif // __GNUC__
+
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif // _MSC_VER
+
+#endif // DOCTEST_CONFIG_NO_COMPARISON_WARNING_SUPPRESSION
+
+    struct ExpressionDecomposer
+    {
+        template <typename L>
+        Expression_lhs<const DOCTEST_REF_WRAP(L)> operator<<(const DOCTEST_REF_WRAP(L) operand) {
+            return Expression_lhs<const DOCTEST_REF_WRAP(L)>(operand);
+        }
+    };
+
+    // forward declarations of functions used by the macros
+    int regTest(void (*f)(void), unsigned line, const char* file, const char* name);
+    int setTestSuiteName(const char* name);
+
+    void addFailedAssert(assertType::Enum assert_type);
+
+    void logTestStart(const char* name, const char* file, unsigned line);
+    void logTestEnd();
+
+    void logTestCrashed();
+    void logTestException(const char* what);
+
+    void logAssert(bool passed, const char* decomposition, bool threw, const char* expr,
+                   assertType::Enum assert_type, const char* file, int line);
+
+    void logAssertThrows(bool threw, const char* expr, assertType::Enum assert_type,
+                         const char* file, int line);
+
+    void logAssertThrowsAs(bool threw, bool threw_as, const char* as, const char* expr,
+                           assertType::Enum assert_type, const char* file, int line);
+
+    void logAssertNothrow(bool threw, const char* expr, assertType::Enum assert_type,
+                          const char* file, int line);
+
+    bool isDebuggerActive();
+    void writeToDebugConsole(const String&);
+
+    struct TestAccessibleContextState
+    {
+        bool            success;   // include successful assertions in output
+        bool            no_throw;  // to skip exceptions-related assertion macros
+        bool            no_breaks; // to not break into the debugger
+        const TestData* currentTest;
+        bool            hasLoggedCurrentTestStart;
+        int             numAssertionsForCurrentTestcase;
+    };
+
+    struct ContextState;
+
+    TestAccessibleContextState* getTestsContextState();
+
+    namespace binaryAssertComparison
+    {
+        enum Enum
+        {
+            eq = 0,
+            ne,
+            gt,
+            lt,
+            ge,
+            le
+        };
+    } // namespace binaryAssertComparison
+
+    // clang-format off
+    template <int, class L, class R> struct RelationalComparator     { bool operator()(const DOCTEST_REF_WRAP(L),     const DOCTEST_REF_WRAP(R)    ) const { return false;        } };
+    template <class L, class R> struct RelationalComparator<0, L, R> { bool operator()(const DOCTEST_REF_WRAP(L) lhs, const DOCTEST_REF_WRAP(R) rhs) const { return eq(lhs, rhs); } };
+    template <class L, class R> struct RelationalComparator<1, L, R> { bool operator()(const DOCTEST_REF_WRAP(L) lhs, const DOCTEST_REF_WRAP(R) rhs) const { return ne(lhs, rhs); } };
+    template <class L, class R> struct RelationalComparator<2, L, R> { bool operator()(const DOCTEST_REF_WRAP(L) lhs, const DOCTEST_REF_WRAP(R) rhs) const { return gt(lhs, rhs); } };
+    template <class L, class R> struct RelationalComparator<3, L, R> { bool operator()(const DOCTEST_REF_WRAP(L) lhs, const DOCTEST_REF_WRAP(R) rhs) const { return lt(lhs, rhs); } };
+    template <class L, class R> struct RelationalComparator<4, L, R> { bool operator()(const DOCTEST_REF_WRAP(L) lhs, const DOCTEST_REF_WRAP(R) rhs) const { return ge(lhs, rhs); } };
+    template <class L, class R> struct RelationalComparator<5, L, R> { bool operator()(const DOCTEST_REF_WRAP(L) lhs, const DOCTEST_REF_WRAP(R) rhs) const { return le(lhs, rhs); } };
+    // clang-format on
+
+    struct ResultBuilder
+    {
+        assertType::Enum m_assert_type;
+        const char*      m_file;
+        int              m_line;
+        const char*      m_expr;
+        const char*      m_exception_type;
+
+        Result m_result;
+        bool   m_threw;
+        bool   m_threw_as;
+        bool   m_failed;
+
+        ResultBuilder(assertType::Enum assert_type, const char* file, int line, const char* expr,
+                      const char* exception_type = "");
+
+// to fix gcc 4.7 "-Winline" warnings
+#if defined(__GNUC__) && !defined(__clang__)
+        __attribute__((noinline))
+#endif
+        ~ResultBuilder() {
+        }
+
+        void setResult(const Result& res) { m_result = res; }
+
+        template <int comparison, typename L, typename R>
+        void          binary_assert(const DOCTEST_REF_WRAP(L) lhs, const DOCTEST_REF_WRAP(R) rhs) {
+            m_result.m_passed        = RelationalComparator<comparison, L, R>()(lhs, rhs);
+            m_result.m_decomposition = stringifyBinaryExpr(lhs, ", ", rhs);
+        }
+
+        template <typename L>
+        void unary_assert(const DOCTEST_REF_WRAP(L) val) {
+            m_result.m_passed        = !!val;
+            m_result.m_decomposition = toString(val);
+        }
+
+        bool log();
+        void react() const;
+    };
+
+    namespace assertAction
+    {
+        enum Enum
+        {
+            nothing     = 0,
+            dbgbreak    = 1,
+            shouldthrow = 2
+        };
+    } // namespace assertAction
+
+    template <int comparison, typename L, typename R>
+    int fast_binary_assert(assertType::Enum assert_type, const char* file, int line,
+                           const char* lhs_str, const char* rhs_str, const DOCTEST_REF_WRAP(L) lhs,
+                           const DOCTEST_REF_WRAP(R) rhs) {
+        String        expr     = String(lhs_str) + ", " + rhs_str;
+        const char*   expr_str = expr.c_str();
+        ResultBuilder rb(assert_type, file, line, expr_str);
+
+        rb.m_result.m_passed        = RelationalComparator<comparison, L, R>()(lhs, rhs);
+        rb.m_result.m_decomposition = stringifyBinaryExpr(lhs, ", ", rhs);
+
+        int res = 0;
+
+        if(rb.log())
+            res |= assertAction::dbgbreak;
+
+        if(rb.m_failed && checkIfShouldThrow(assert_type))
+            res |= assertAction::shouldthrow;
+
+#ifdef DOCTEST_CONFIG_SUPER_FAST_ASSERTS
+        // #########################################################################################
+        // IF THE DEBUGGER BREAKS HERE - GO 1 LEVEL UP IN THE CALLSTACK TO SEE THE FAILING ASSERTION
+        // THIS IS THE EFFECT OF HAVING 'DOCTEST_CONFIG_SUPER_FAST_ASSERTS' DEFINED
+        // #########################################################################################
+        if(res & assertAction::dbgbreak)
+            DOCTEST_BREAK_INTO_DEBUGGER();
+        fastAssertThrowIfFlagSet(res);
+#endif // DOCTEST_CONFIG_SUPER_FAST_ASSERTS
+
+        return res;
+    }
+
+    template <typename L>
+    int fast_unary_assert(assertType::Enum assert_type, const char* file, int line,
+                          const char* val_str, const DOCTEST_REF_WRAP(L) val) {
+        ResultBuilder rb(assert_type, file, line, val_str);
+
+        rb.m_result.m_passed        = !!val;
+        rb.m_result.m_decomposition = toString(val);
+
+        int res = 0;
+
+        if(rb.log())
+            res |= assertAction::dbgbreak;
+
+        if(rb.m_failed && checkIfShouldThrow(assert_type))
+            res |= assertAction::shouldthrow;
+
+#ifdef DOCTEST_CONFIG_SUPER_FAST_ASSERTS
+        // #########################################################################################
+        // IF THE DEBUGGER BREAKS HERE - GO 1 LEVEL UP IN THE CALLSTACK TO SEE THE FAILING ASSERTION
+        // THIS IS THE EFFECT OF HAVING 'DOCTEST_CONFIG_SUPER_FAST_ASSERTS' DEFINED
+        // #########################################################################################
+        if(res & assertAction::dbgbreak)
+            DOCTEST_BREAK_INTO_DEBUGGER();
+        fastAssertThrowIfFlagSet(res);
+#endif // DOCTEST_CONFIG_SUPER_FAST_ASSERTS
+
+        return res;
+    }
+} // namespace detail
+
+#endif // DOCTEST_CONFIG_DISABLE
+
+class Context
+{
+#if !defined(DOCTEST_CONFIG_DISABLE)
+    detail::ContextState* p;
+
+    void parseArgs(int argc, const char* const* argv, bool withDefaults = false);
+
+#endif // DOCTEST_CONFIG_DISABLE
+
+public:
+    Context(int argc = 0, const char* const* argv = 0);
+
+// to fix gcc 4.7 "-Winline" warnings
+#if defined(__GNUC__) && !defined(__clang__)
+    __attribute__((noinline))
+#endif
+    ~Context();
+
+    void applyCommandLine(int argc, const char* const* argv);
+
+    void addFilter(const char* filter, const char* value);
+    void clearFilters();
+    void setOption(const char* option, int value);
+    void setOption(const char* option, const char* value);
+
+    bool shouldExit();
+
+    int run();
+};
+
+} // namespace doctest
+
+// if registering is not disabled
+#if !defined(DOCTEST_CONFIG_DISABLE)
+
+// registers the test by initializing a dummy var with a function
+#if defined(__GNUC__) && !defined(__clang__)
+#define DOCTEST_REGISTER_FUNCTION(f, name)                                                         \
+    static int DOCTEST_ANONYMOUS(_DOCTEST_ANON_VAR_) __attribute__((unused)) =                     \
+            doctest::detail::regTest(f, __LINE__, __FILE__, name);
+#elif defined(__clang__)
+#define DOCTEST_REGISTER_FUNCTION(f, name)                                                         \
+    _Pragma("clang diagnostic push")                                                               \
+            _Pragma("clang diagnostic ignored \"-Wglobal-constructors\"") static int               \
+                    DOCTEST_ANONYMOUS(_DOCTEST_ANON_VAR_) =                                        \
+                            doctest::detail::regTest(f, __LINE__, __FILE__, name);                 \
+    _Pragma("clang diagnostic pop")
+#else // MSVC
+#define DOCTEST_REGISTER_FUNCTION(f, name)                                                         \
+    static int DOCTEST_ANONYMOUS(_DOCTEST_ANON_VAR_) =                                             \
+            doctest::detail::regTest(f, __LINE__, __FILE__, name);
+#endif // MSVC
+
+#define DOCTEST_IMPLEMENT_FIXTURE(der, base, func, name)                                           \
+    namespace                                                                                      \
+    {                                                                                              \
+        struct der : base                                                                          \
+        { void f(); };                                                                             \
+        static void func() {                                                                       \
+            der v;                                                                                 \
+            v.f();                                                                                 \
+        }                                                                                          \
+        DOCTEST_REGISTER_FUNCTION(func, name)                                                      \
+    }                                                                                              \
+    inline void der::f()
+
+#define DOCTEST_CREATE_AND_REGISTER_FUNCTION(f, name)                                              \
+    static void f();                                                                               \
+    DOCTEST_REGISTER_FUNCTION(f, name)                                                             \
+    static void f()
+
+// for registering tests
+#define DOCTEST_TEST_CASE(name)                                                                    \
+    DOCTEST_CREATE_AND_REGISTER_FUNCTION(DOCTEST_ANONYMOUS(_DOCTEST_ANON_FUNC_), name)
+
+// for registering tests with a fixture
+#define DOCTEST_TEST_CASE_FIXTURE(c, name)                                                         \
+    DOCTEST_IMPLEMENT_FIXTURE(DOCTEST_ANONYMOUS(_DOCTEST_ANON_CLASS_), c,                          \
+                              DOCTEST_ANONYMOUS(_DOCTEST_ANON_FUNC_), name)
+
+// for subcases
+#if defined(__GNUC__)
+#define DOCTEST_SUBCASE(name)                                                                      \
+    if(const doctest::detail::Subcase & DOCTEST_ANONYMOUS(_DOCTEST_ANON_SUBCASE_)                  \
+                                                __attribute__((unused)) =                          \
+               doctest::detail::Subcase(name, __FILE__, __LINE__))
+#else // __GNUC__
+#define DOCTEST_SUBCASE(name)                                                                      \
+    if(const doctest::detail::Subcase & DOCTEST_ANONYMOUS(_DOCTEST_ANON_SUBCASE_) =                \
+               doctest::detail::Subcase(name, __FILE__, __LINE__))
+#endif // __GNUC__
+
+// for starting a testsuite block
+#if defined(__GNUC__) && !defined(__clang__)
+#define DOCTEST_TEST_SUITE(name)                                                                   \
+    static int DOCTEST_ANONYMOUS(_DOCTEST_ANON_VAR_) __attribute__((unused)) =                     \
+            doctest::detail::setTestSuiteName(name);                                               \
+    typedef int DOCTEST_ANONYMOUS(_DOCTEST_ANON_FOR_SEMICOLON_)
+#elif defined(__clang__)
+#define DOCTEST_TEST_SUITE(name)                                                                   \
+    _Pragma("clang diagnostic push")                                                               \
+            _Pragma("clang diagnostic ignored \"-Wglobal-constructors\"") static int               \
+                    DOCTEST_ANONYMOUS(_DOCTEST_ANON_VAR_) =                                        \
+                            doctest::detail::setTestSuiteName(name);                               \
+    _Pragma("clang diagnostic pop") typedef int DOCTEST_ANONYMOUS(_DOCTEST_ANON_FOR_SEMICOLON_)
+#else // MSVC
+#define DOCTEST_TEST_SUITE(name)                                                                   \
+    static int  DOCTEST_ANONYMOUS(_DOCTEST_ANON_VAR_) = doctest::detail::setTestSuiteName(name);   \
+    typedef int DOCTEST_ANONYMOUS(_DOCTEST_ANON_FOR_SEMICOLON_)
+#endif // MSVC
+
+// for ending a testsuite block
+#if defined(__GNUC__) && !defined(__clang__)
+#define DOCTEST_TEST_SUITE_END                                                                     \
+    static int DOCTEST_ANONYMOUS(_DOCTEST_ANON_VAR_) __attribute__((unused)) =                     \
+            doctest::detail::setTestSuiteName("");                                                 \
+    typedef int DOCTEST_ANONYMOUS(_DOCTEST_ANON_FOR_SEMICOLON_)
+#elif defined(__clang__)
+#define DOCTEST_TEST_SUITE_END                                                                                                 \
+    _Pragma("clang diagnostic push")                                                                                           \
+            _Pragma("clang diagnostic ignored \"-Wglobal-constructors\"") static int                                           \
+                                                DOCTEST_ANONYMOUS(_DOCTEST_ANON_VAR_) = doctest::detail::setTestSuiteName(""); \
+    _Pragma("clang diagnostic pop") typedef int DOCTEST_ANONYMOUS(_DOCTEST_ANON_FOR_SEMICOLON_)
+#else // MSVC
+#define DOCTEST_TEST_SUITE_END                                                                     \
+    static int  DOCTEST_ANONYMOUS(_DOCTEST_ANON_VAR_) = doctest::detail::setTestSuiteName("");     \
+    typedef int DOCTEST_ANONYMOUS(_DOCTEST_ANON_FOR_SEMICOLON_)
+#endif // MSVC
+
+#define DOCTEST_ASSERT_LOG_AND_REACT(rb)                                                           \
+    if(rb.log())                                                                                   \
+        DOCTEST_BREAK_INTO_DEBUGGER();                                                             \
+    rb.react()
+
+#ifdef DOCTEST_CONFIG_NO_TRY_CATCH_IN_ASSERTS
+#define DOCTEST_WRAP_IN_TRY(x) x;
+#else // DOCTEST_CONFIG_NO_TRY_CATCH_IN_ASSERTS
+#define DOCTEST_WRAP_IN_TRY(x)                                                                     \
+    try {                                                                                          \
+        x;                                                                                         \
+    } catch(...) { _DOCTEST_RB.m_threw = true; }
+#endif // DOCTEST_CONFIG_NO_TRY_CATCH_IN_ASSERTS
+
+#define DOCTEST_ASSERT_IMPLEMENT(expr, assert_type)                                                \
+    doctest::detail::ResultBuilder _DOCTEST_RB(doctest::detail::assertType::assert_type, __FILE__, \
+                                               __LINE__, #expr);                                   \
+    DOCTEST_WRAP_IN_TRY(_DOCTEST_RB.setResult(doctest::detail::ExpressionDecomposer() << expr))    \
+    DOCTEST_ASSERT_LOG_AND_REACT(_DOCTEST_RB);
+
+#if defined(__clang__)
+#define DOCTEST_ASSERT_PROXY(expr, assert_type)                                                    \
+    do {                                                                                           \
+        _Pragma("clang diagnostic push")                                                           \
+                _Pragma("clang diagnostic ignored \"-Woverloaded-shift-op-parentheses\"")          \
+                        DOCTEST_ASSERT_IMPLEMENT(expr, assert_type)                                \
+                                _Pragma("clang diagnostic pop")                                    \
+    } while(doctest::detail::always_false())
+#else // __clang__
+#define DOCTEST_ASSERT_PROXY(expr, assert_type)                                                    \
+    do {                                                                                           \
+        DOCTEST_ASSERT_IMPLEMENT(expr, assert_type)                                                \
+    } while(doctest::detail::always_false())
+#endif // __clang__
+
+#define DOCTEST_WARN(expr) DOCTEST_ASSERT_PROXY(expr, DT_WARN)
+#define DOCTEST_CHECK(expr) DOCTEST_ASSERT_PROXY(expr, DT_CHECK)
+#define DOCTEST_REQUIRE(expr) DOCTEST_ASSERT_PROXY(expr, DT_REQUIRE)
+
+#define DOCTEST_WARN_FALSE(expr) DOCTEST_ASSERT_PROXY(expr, DT_WARN_FALSE)
+#define DOCTEST_CHECK_FALSE(expr) DOCTEST_ASSERT_PROXY(expr, DT_CHECK_FALSE)
+#define DOCTEST_REQUIRE_FALSE(expr) DOCTEST_ASSERT_PROXY(expr, DT_REQUIRE_FALSE)
+
+#define DOCTEST_ASSERT_THROWS(expr, assert_type)                                                   \
+    do {                                                                                           \
+        if(!DOCTEST_GCS().no_throw) {                                                              \
+            doctest::detail::ResultBuilder _DOCTEST_RB(doctest::detail::assertType::assert_type,   \
+                                                       __FILE__, __LINE__, #expr);                 \
+            try {                                                                                  \
+                expr;                                                                              \
+            } catch(...) { _DOCTEST_RB.m_threw = true; }                                           \
+            DOCTEST_ASSERT_LOG_AND_REACT(_DOCTEST_RB);                                             \
+        }                                                                                          \
+    } while(doctest::detail::always_false())
+
+#define DOCTEST_ASSERT_THROWS_AS(expr, as, assert_type)                                            \
+    do {                                                                                           \
+        if(!DOCTEST_GCS().no_throw) {                                                              \
+            doctest::detail::ResultBuilder _DOCTEST_RB(doctest::detail::assertType::assert_type,   \
+                                                       __FILE__, __LINE__, #expr, #as);            \
+            try {                                                                                  \
+                expr;                                                                              \
+            } catch(as) {                                                                          \
+                _DOCTEST_RB.m_threw    = true;                                                     \
+                _DOCTEST_RB.m_threw_as = true;                                                     \
+            } catch(...) { _DOCTEST_RB.m_threw = true; }                                           \
+            DOCTEST_ASSERT_LOG_AND_REACT(_DOCTEST_RB);                                             \
+        }                                                                                          \
+    } while(doctest::detail::always_false())
+
+#define DOCTEST_ASSERT_NOTHROW(expr, assert_type)                                                  \
+    do {                                                                                           \
+        if(!DOCTEST_GCS().no_throw) {                                                              \
+            doctest::detail::ResultBuilder _DOCTEST_RB(doctest::detail::assertType::assert_type,   \
+                                                       __FILE__, __LINE__, #expr);                 \
+            try {                                                                                  \
+                expr;                                                                              \
+            } catch(...) { _DOCTEST_RB.m_threw = true; }                                           \
+            DOCTEST_ASSERT_LOG_AND_REACT(_DOCTEST_RB);                                             \
+        }                                                                                          \
+    } while(doctest::detail::always_false())
+
+#define DOCTEST_WARN_THROWS(expr) DOCTEST_ASSERT_THROWS(expr, DT_WARN_THROWS)
+#define DOCTEST_CHECK_THROWS(expr) DOCTEST_ASSERT_THROWS(expr, DT_CHECK_THROWS)
+#define DOCTEST_REQUIRE_THROWS(expr) DOCTEST_ASSERT_THROWS(expr, DT_REQUIRE_THROWS)
+
+#define DOCTEST_WARN_THROWS_AS(expr, ex) DOCTEST_ASSERT_THROWS_AS(expr, ex, DT_WARN_THROWS_AS)
+#define DOCTEST_CHECK_THROWS_AS(expr, ex) DOCTEST_ASSERT_THROWS_AS(expr, ex, DT_CHECK_THROWS_AS)
+#define DOCTEST_REQUIRE_THROWS_AS(expr, ex) DOCTEST_ASSERT_THROWS_AS(expr, ex, DT_REQUIRE_THROWS_AS)
+
+#define DOCTEST_WARN_NOTHROW(expr) DOCTEST_ASSERT_NOTHROW(expr, DT_WARN_NOTHROW)
+#define DOCTEST_CHECK_NOTHROW(expr) DOCTEST_ASSERT_NOTHROW(expr, DT_CHECK_NOTHROW)
+#define DOCTEST_REQUIRE_NOTHROW(expr) DOCTEST_ASSERT_NOTHROW(expr, DT_REQUIRE_NOTHROW)
+
+#define DOCTEST_BINARY_ASSERT(assert_type, lhs, rhs, comp)                                         \
+    do {                                                                                           \
+        doctest::detail::ResultBuilder _DOCTEST_RB(doctest::detail::assertType::assert_type,       \
+                                                   __FILE__, __LINE__, #lhs ", " #rhs);            \
+        DOCTEST_WRAP_IN_TRY(                                                                       \
+                _DOCTEST_RB.binary_assert<doctest::detail::binaryAssertComparison::comp>(lhs,      \
+                                                                                         rhs))     \
+        DOCTEST_ASSERT_LOG_AND_REACT(_DOCTEST_RB);                                                 \
+    } while(doctest::detail::always_false())
+
+#define DOCTEST_UNARY_ASSERT(assert_type, val)                                                     \
+    do {                                                                                           \
+        doctest::detail::ResultBuilder _DOCTEST_RB(doctest::detail::assertType::assert_type,       \
+                                                   __FILE__, __LINE__, #val);                      \
+        DOCTEST_WRAP_IN_TRY(_DOCTEST_RB.unary_assert(val))                                         \
+        DOCTEST_ASSERT_LOG_AND_REACT(_DOCTEST_RB);                                                 \
+    } while(doctest::detail::always_false())
+
+#define DOCTEST_WARN_EQ(lhs, rhs) DOCTEST_BINARY_ASSERT(DT_WARN_EQ, lhs, rhs, eq)
+#define DOCTEST_CHECK_EQ(lhs, rhs) DOCTEST_BINARY_ASSERT(DT_CHECK_EQ, lhs, rhs, eq)
+#define DOCTEST_REQUIRE_EQ(lhs, rhs) DOCTEST_BINARY_ASSERT(DT_REQUIRE_EQ, lhs, rhs, eq)
+#define DOCTEST_WARN_NE(lhs, rhs) DOCTEST_BINARY_ASSERT(DT_WARN_NE, lhs, rhs, ne)
+#define DOCTEST_CHECK_NE(lhs, rhs) DOCTEST_BINARY_ASSERT(DT_CHECK_NE, lhs, rhs, ne)
+#define DOCTEST_REQUIRE_NE(lhs, rhs) DOCTEST_BINARY_ASSERT(DT_REQUIRE_NE, lhs, rhs, ne)
+#define DOCTEST_WARN_GT(lhs, rhs) DOCTEST_BINARY_ASSERT(DT_WARN_GT, lhs, rhs, gt)
+#define DOCTEST_CHECK_GT(lhs, rhs) DOCTEST_BINARY_ASSERT(DT_CHECK_GT, lhs, rhs, gt)
+#define DOCTEST_REQUIRE_GT(lhs, rhs) DOCTEST_BINARY_ASSERT(DT_REQUIRE_GT, lhs, rhs, gt)
+#define DOCTEST_WARN_LT(lhs, rhs) DOCTEST_BINARY_ASSERT(DT_WARN_LT, lhs, rhs, lt)
+#define DOCTEST_CHECK_LT(lhs, rhs) DOCTEST_BINARY_ASSERT(DT_CHECK_LT, lhs, rhs, lt)
+#define DOCTEST_REQUIRE_LT(lhs, rhs) DOCTEST_BINARY_ASSERT(DT_REQUIRE_LT, lhs, rhs, lt)
+#define DOCTEST_WARN_GE(lhs, rhs) DOCTEST_BINARY_ASSERT(DT_WARN_GE, lhs, rhs, ge)
+#define DOCTEST_CHECK_GE(lhs, rhs) DOCTEST_BINARY_ASSERT(DT_CHECK_GE, lhs, rhs, ge)
+#define DOCTEST_REQUIRE_GE(lhs, rhs) DOCTEST_BINARY_ASSERT(DT_REQUIRE_GE, lhs, rhs, ge)
+#define DOCTEST_WARN_LE(lhs, rhs) DOCTEST_BINARY_ASSERT(DT_WARN_LE, lhs, rhs, le)
+#define DOCTEST_CHECK_LE(lhs, rhs) DOCTEST_BINARY_ASSERT(DT_CHECK_LE, lhs, rhs, le)
+#define DOCTEST_REQUIRE_LE(lhs, rhs) DOCTEST_BINARY_ASSERT(DT_REQUIRE_LE, lhs, rhs, le)
+
+#define DOCTEST_WARN_UNARY(v) DOCTEST_UNARY_ASSERT(DT_WARN_UNARY, v)
+#define DOCTEST_CHECK_UNARY(v) DOCTEST_UNARY_ASSERT(DT_CHECK_UNARY, v)
+#define DOCTEST_REQUIRE_UNARY(v) DOCTEST_UNARY_ASSERT(DT_REQUIRE_UNARY, v)
+#define DOCTEST_WARN_UNARY_FALSE(v) DOCTEST_UNARY_ASSERT(DT_WARN_UNARY_FALSE, v)
+#define DOCTEST_CHECK_UNARY_FALSE(v) DOCTEST_UNARY_ASSERT(DT_CHECK_UNARY_FALSE, v)
+#define DOCTEST_REQUIRE_UNARY_FALSE(v) DOCTEST_UNARY_ASSERT(DT_REQUIRE_UNARY_FALSE, v)
+
+#ifndef DOCTEST_CONFIG_SUPER_FAST_ASSERTS
+
+#define DOCTEST_FAST_BINARY_ASSERT(assert_type, lhs, rhs, comparison)                              \
+    do {                                                                                           \
+        int _DOCTEST_FAST_RES = doctest::detail::fast_binary_assert<                               \
+                doctest::detail::binaryAssertComparison::comparison>(                              \
+                doctest::detail::assertType::assert_type, __FILE__, __LINE__, #lhs, #rhs, lhs,     \
+                rhs);                                                                              \
+        if(_DOCTEST_FAST_RES & doctest::detail::assertAction::dbgbreak)                            \
+            DOCTEST_BREAK_INTO_DEBUGGER();                                                         \
+        doctest::detail::fastAssertThrowIfFlagSet(_DOCTEST_FAST_RES);                              \
+    } while(doctest::detail::always_false())
+
+#define DOCTEST_FAST_UNARY_ASSERT(assert_type, val)                                                \
+    do {                                                                                           \
+        int _DOCTEST_FAST_RES = doctest::detail::fast_unary_assert(                                \
+                doctest::detail::assertType::assert_type, __FILE__, __LINE__, #val, val);          \
+        if(_DOCTEST_FAST_RES & doctest::detail::assertAction::dbgbreak)                            \
+            DOCTEST_BREAK_INTO_DEBUGGER();                                                         \
+        doctest::detail::fastAssertThrowIfFlagSet(_DOCTEST_FAST_RES);                              \
+    } while(doctest::detail::always_false())
+
+#else // DOCTEST_CONFIG_SUPER_FAST_ASSERTS
+
+#define DOCTEST_FAST_BINARY_ASSERT(assert_type, lhs, rhs, comparison)                              \
+    doctest::detail::fast_binary_assert<doctest::detail::binaryAssertComparison::comparison>(      \
+            doctest::detail::assertType::assert_type, __FILE__, __LINE__, #lhs, #rhs, lhs, rhs)
+
+#define DOCTEST_FAST_UNARY_ASSERT(assert_type, val)                                                \
+    doctest::detail::fast_unary_assert(doctest::detail::assertType::assert_type, __FILE__,         \
+                                       __LINE__, #val, val)
+
+#endif // DOCTEST_CONFIG_SUPER_FAST_ASSERTS
+
+#define DOCTEST_FAST_WARN_EQ(l, r) DOCTEST_FAST_BINARY_ASSERT(DT_FAST_WARN_EQ, l, r, eq)
+#define DOCTEST_FAST_CHECK_EQ(l, r) DOCTEST_FAST_BINARY_ASSERT(DT_FAST_CHECK_EQ, l, r, eq)
+#define DOCTEST_FAST_REQUIRE_EQ(l, r) DOCTEST_FAST_BINARY_ASSERT(DT_FAST_REQUIRE_EQ, l, r, eq)
+#define DOCTEST_FAST_WARN_NE(l, r) DOCTEST_FAST_BINARY_ASSERT(DT_FAST_WARN_NE, l, r, ne)
+#define DOCTEST_FAST_CHECK_NE(l, r) DOCTEST_FAST_BINARY_ASSERT(DT_FAST_CHECK_NE, l, r, ne)
+#define DOCTEST_FAST_REQUIRE_NE(l, r) DOCTEST_FAST_BINARY_ASSERT(DT_FAST_REQUIRE_NE, l, r, ne)
+#define DOCTEST_FAST_WARN_GT(l, r) DOCTEST_FAST_BINARY_ASSERT(DT_FAST_WARN_GT, l, r, gt)
+#define DOCTEST_FAST_CHECK_GT(l, r) DOCTEST_FAST_BINARY_ASSERT(DT_FAST_CHECK_GT, l, r, gt)
+#define DOCTEST_FAST_REQUIRE_GT(l, r) DOCTEST_FAST_BINARY_ASSERT(DT_FAST_REQUIRE_GT, l, r, gt)
+#define DOCTEST_FAST_WARN_LT(l, r) DOCTEST_FAST_BINARY_ASSERT(DT_FAST_WARN_LT, l, r, lt)
+#define DOCTEST_FAST_CHECK_LT(l, r) DOCTEST_FAST_BINARY_ASSERT(DT_FAST_CHECK_LT, l, r, lt)
+#define DOCTEST_FAST_REQUIRE_LT(l, r) DOCTEST_FAST_BINARY_ASSERT(DT_FAST_REQUIRE_LT, l, r, lt)
+#define DOCTEST_FAST_WARN_GE(l, r) DOCTEST_FAST_BINARY_ASSERT(DT_FAST_WARN_GE, l, r, ge)
+#define DOCTEST_FAST_CHECK_GE(l, r) DOCTEST_FAST_BINARY_ASSERT(DT_FAST_CHECK_GE, l, r, ge)
+#define DOCTEST_FAST_REQUIRE_GE(l, r) DOCTEST_FAST_BINARY_ASSERT(DT_FAST_REQUIRE_GE, l, r, ge)
+#define DOCTEST_FAST_WARN_LE(l, r) DOCTEST_FAST_BINARY_ASSERT(DT_FAST_WARN_LE, l, r, le)
+#define DOCTEST_FAST_CHECK_LE(l, r) DOCTEST_FAST_BINARY_ASSERT(DT_FAST_CHECK_LE, l, r, le)
+#define DOCTEST_FAST_REQUIRE_LE(l, r) DOCTEST_FAST_BINARY_ASSERT(DT_FAST_REQUIRE_LE, l, r, le)
+
+#define DOCTEST_FAST_WARN_UNARY(v) DOCTEST_FAST_UNARY_ASSERT(DT_FAST_WARN_UNARY, v)
+#define DOCTEST_FAST_CHECK_UNARY(v) DOCTEST_FAST_UNARY_ASSERT(DT_FAST_CHECK_UNARY, v)
+#define DOCTEST_FAST_REQUIRE_UNARY(v) DOCTEST_FAST_UNARY_ASSERT(DT_FAST_REQUIRE_UNARY, v)
+#define DOCTEST_FAST_WARN_UNARY_FALSE(v) DOCTEST_FAST_UNARY_ASSERT(DT_FAST_WARN_UNARY_FALSE, v)
+#define DOCTEST_FAST_CHECK_UNARY_FALSE(v) DOCTEST_FAST_UNARY_ASSERT(DT_FAST_CHECK_UNARY_FALSE, v)
+#define DOCTEST_FAST_REQUIRE_UNARY_FALSE(v)                                                        \
+    DOCTEST_FAST_UNARY_ASSERT(DT_FAST_REQUIRE_UNARY_FALSE, v)
+
+#ifdef DOCTEST_CONFIG_NO_EXCEPTIONS
+
+#undef DOCTEST_WARN_THROWS
+#undef DOCTEST_CHECK_THROWS
+#undef DOCTEST_REQUIRE_THROWS
+#undef DOCTEST_WARN_THROWS_AS
+#undef DOCTEST_CHECK_THROWS_AS
+#undef DOCTEST_REQUIRE_THROWS_AS
+#undef DOCTEST_WARN_NOTHROW
+#undef DOCTEST_CHECK_NOTHROW
+#undef DOCTEST_REQUIRE_NOTHROW
+
+#ifdef DOCTEST_CONFIG_NO_EXCEPTIONS_BUT_WITH_ALL_ASSERTS
+
+#define DOCTEST_WARN_THROWS(expr) ((void)0)
+#define DOCTEST_WARN_THROWS_AS(expr, ex) ((void)0)
+#define DOCTEST_WARN_NOTHROW(expr) ((void)0)
+#define DOCTEST_CHECK_THROWS(expr) ((void)0)
+#define DOCTEST_CHECK_THROWS_AS(expr, ex) ((void)0)
+#define DOCTEST_CHECK_NOTHROW(expr) ((void)0)
+#define DOCTEST_REQUIRE_THROWS(expr) ((void)0)
+#define DOCTEST_REQUIRE_THROWS_AS(expr, ex) ((void)0)
+#define DOCTEST_REQUIRE_NOTHROW(expr) ((void)0)
+
+#else // DOCTEST_CONFIG_NO_EXCEPTIONS_BUT_WITH_ALL_ASSERTS
+
+#undef DOCTEST_REQUIRE
+#undef DOCTEST_REQUIRE_FALSE
+#undef DOCTEST_REQUIRE_EQ
+#undef DOCTEST_REQUIRE_NE
+#undef DOCTEST_REQUIRE_GT
+#undef DOCTEST_REQUIRE_LT
+#undef DOCTEST_REQUIRE_GE
+#undef DOCTEST_REQUIRE_LE
+#undef DOCTEST_REQUIRE_UNARY
+#undef DOCTEST_REQUIRE_UNARY_FALSE
+#undef DOCTEST_FAST_REQUIRE_EQ
+#undef DOCTEST_FAST_REQUIRE_NE
+#undef DOCTEST_FAST_REQUIRE_GT
+#undef DOCTEST_FAST_REQUIRE_LT
+#undef DOCTEST_FAST_REQUIRE_GE
+#undef DOCTEST_FAST_REQUIRE_LE
+#undef DOCTEST_FAST_REQUIRE_UNARY
+#undef DOCTEST_FAST_REQUIRE_UNARY_FALSE
+
+#endif // DOCTEST_CONFIG_NO_EXCEPTIONS_BUT_WITH_ALL_ASSERTS
+
+#endif // DOCTEST_CONFIG_NO_EXCEPTIONS
+
+// =================================================================================================
+// == WHAT FOLLOWS IS VERSIONS OF THE MACROS THAT DO NOT DO ANY REGISTERING!                      ==
+// == THIS CAN BE ENABLED BY DEFINING DOCTEST_CONFIG_DISABLE GLOBALLY!                            ==
+// =================================================================================================
+#else // DOCTEST_CONFIG_DISABLE
+
+#define DOCTEST_IMPLEMENT_FIXTURE(der, base, func, name)                                           \
+    namespace                                                                                      \
+    {                                                                                              \
+        template <typename T>                                                                      \
+        struct der : base                                                                          \
+        { void f(); };                                                                             \
+    }                                                                                              \
+    template <typename T>                                                                          \
+    inline void der<T>::f()
+
+#define DOCTEST_CREATE_AND_REGISTER_FUNCTION(f, name)                                              \
+    template <typename T>                                                                          \
+    static inline void f()
+
+// for registering tests
+#define DOCTEST_TEST_CASE(name)                                                                    \
+    DOCTEST_CREATE_AND_REGISTER_FUNCTION(DOCTEST_ANONYMOUS(_DOCTEST_ANON_FUNC_), name)
+
+// for registering tests with a fixture
+#define DOCTEST_TEST_CASE_FIXTURE(x, name)                                                         \
+    DOCTEST_IMPLEMENT_FIXTURE(DOCTEST_ANONYMOUS(_DOCTEST_ANON_CLASS_), x,                          \
+                              DOCTEST_ANONYMOUS(_DOCTEST_ANON_FUNC_), name)
+
+// for subcases
+#define DOCTEST_SUBCASE(name)
+
+// for starting a testsuite block
+#define DOCTEST_TEST_SUITE(name) typedef int DOCTEST_ANONYMOUS(_DOCTEST_ANON_FOR_SEMICOLON_)
+
+// for ending a testsuite block
+#define DOCTEST_TEST_SUITE_END typedef int DOCTEST_ANONYMOUS(_DOCTEST_ANON_FOR_SEMICOLON_)
+
+#define DOCTEST_WARN(expr) ((void)0)
+#define DOCTEST_WARN_FALSE(expr) ((void)0)
+#define DOCTEST_WARN_THROWS(expr) ((void)0)
+#define DOCTEST_WARN_THROWS_AS(expr, ex) ((void)0)
+#define DOCTEST_WARN_NOTHROW(expr) ((void)0)
+#define DOCTEST_CHECK(expr) ((void)0)
+#define DOCTEST_CHECK_FALSE(expr) ((void)0)
+#define DOCTEST_CHECK_THROWS(expr) ((void)0)
+#define DOCTEST_CHECK_THROWS_AS(expr, ex) ((void)0)
+#define DOCTEST_CHECK_NOTHROW(expr) ((void)0)
+#define DOCTEST_REQUIRE(expr) ((void)0)
+#define DOCTEST_REQUIRE_FALSE(expr) ((void)0)
+#define DOCTEST_REQUIRE_THROWS(expr) ((void)0)
+#define DOCTEST_REQUIRE_THROWS_AS(expr, ex) ((void)0)
+#define DOCTEST_REQUIRE_NOTHROW(expr) ((void)0)
+
+#define DOCTEST_WARN_EQ(lhs, rhs) ((void)0)
+#define DOCTEST_CHECK_EQ(lhs, rhs) ((void)0)
+#define DOCTEST_REQUIRE_EQ(lhs, rhs) ((void)0)
+#define DOCTEST_WARN_NE(lhs, rhs) ((void)0)
+#define DOCTEST_CHECK_NE(lhs, rhs) ((void)0)
+#define DOCTEST_REQUIRE_NE(lhs, rhs) ((void)0)
+#define DOCTEST_WARN_GT(lhs, rhs) ((void)0)
+#define DOCTEST_CHECK_GT(lhs, rhs) ((void)0)
+#define DOCTEST_REQUIRE_GT(lhs, rhs) ((void)0)
+#define DOCTEST_WARN_LT(lhs, rhs) ((void)0)
+#define DOCTEST_CHECK_LT(lhs, rhs) ((void)0)
+#define DOCTEST_REQUIRE_LT(lhs, rhs) ((void)0)
+#define DOCTEST_WARN_GE(lhs, rhs) ((void)0)
+#define DOCTEST_CHECK_GE(lhs, rhs) ((void)0)
+#define DOCTEST_REQUIRE_GE(lhs, rhs) ((void)0)
+#define DOCTEST_WARN_LE(lhs, rhs) ((void)0)
+#define DOCTEST_CHECK_LE(lhs, rhs) ((void)0)
+#define DOCTEST_REQUIRE_LE(lhs, rhs) ((void)0)
+
+#define DOCTEST_WARN_UNARY(val) ((void)0)
+#define DOCTEST_CHECK_UNARY(val) ((void)0)
+#define DOCTEST_REQUIRE_UNARY(val) ((void)0)
+#define DOCTEST_WARN_UNARY_FALSE(val) ((void)0)
+#define DOCTEST_CHECK_UNARY_FALSE(val) ((void)0)
+#define DOCTEST_REQUIRE_UNARY_FALSE(val) ((void)0)
+
+#define DOCTEST_FAST_WARN_EQ(lhs, rhs) ((void)0)
+#define DOCTEST_FAST_CHECK_EQ(lhs, rhs) ((void)0)
+#define DOCTEST_FAST_REQUIRE_EQ(lhs, rhs) ((void)0)
+#define DOCTEST_FAST_WARN_NE(lhs, rhs) ((void)0)
+#define DOCTEST_FAST_CHECK_NE(lhs, rhs) ((void)0)
+#define DOCTEST_FAST_REQUIRE_NE(lhs, rhs) ((void)0)
+#define DOCTEST_FAST_WARN_GT(lhs, rhs) ((void)0)
+#define DOCTEST_FAST_CHECK_GT(lhs, rhs) ((void)0)
+#define DOCTEST_FAST_REQUIRE_GT(lhs, rhs) ((void)0)
+#define DOCTEST_FAST_WARN_LT(lhs, rhs) ((void)0)
+#define DOCTEST_FAST_CHECK_LT(lhs, rhs) ((void)0)
+#define DOCTEST_FAST_REQUIRE_LT(lhs, rhs) ((void)0)
+#define DOCTEST_FAST_WARN_GE(lhs, rhs) ((void)0)
+#define DOCTEST_FAST_CHECK_GE(lhs, rhs) ((void)0)
+#define DOCTEST_FAST_REQUIRE_GE(lhs, rhs) ((void)0)
+#define DOCTEST_FAST_WARN_LE(lhs, rhs) ((void)0)
+#define DOCTEST_FAST_CHECK_LE(lhs, rhs) ((void)0)
+#define DOCTEST_FAST_REQUIRE_LE(lhs, rhs) ((void)0)
+
+#define DOCTEST_FAST_WARN_UNARY(val) ((void)0)
+#define DOCTEST_FAST_CHECK_UNARY(val) ((void)0)
+#define DOCTEST_FAST_REQUIRE_UNARY(val) ((void)0)
+#define DOCTEST_FAST_WARN_UNARY_FALSE(val) ((void)0)
+#define DOCTEST_FAST_CHECK_UNARY_FALSE(val) ((void)0)
+#define DOCTEST_FAST_REQUIRE_UNARY_FALSE(val) ((void)0)
+
+#endif // DOCTEST_CONFIG_DISABLE
+
+// BDD style macros
+// clang-format off
+#define DOCTEST_SCENARIO(name)  TEST_CASE("  Scenario: " name)
+#define DOCTEST_GIVEN(name)     SUBCASE("   Given: " name)
+#define DOCTEST_WHEN(name)      SUBCASE("    When: " name)
+#define DOCTEST_AND_WHEN(name)  SUBCASE("And when: " name)
+#define DOCTEST_THEN(name)      SUBCASE("    Then: " name)
+#define DOCTEST_AND_THEN(name)  SUBCASE("     And: " name)
+// clang-format on
+
+// == SHORT VERSIONS OF THE MACROS
+#if !defined(DOCTEST_CONFIG_NO_SHORT_MACRO_NAMES)
+
+#define TEST_CASE DOCTEST_TEST_CASE
+#define TEST_CASE_FIXTURE DOCTEST_TEST_CASE_FIXTURE
+#define SUBCASE DOCTEST_SUBCASE
+#define TEST_SUITE DOCTEST_TEST_SUITE
+#define TEST_SUITE_END DOCTEST_TEST_SUITE_END
+#define WARN DOCTEST_WARN
+#define WARN_FALSE DOCTEST_WARN_FALSE
+#define WARN_THROWS DOCTEST_WARN_THROWS
+#define WARN_THROWS_AS DOCTEST_WARN_THROWS_AS
+#define WARN_NOTHROW DOCTEST_WARN_NOTHROW
+#define CHECK DOCTEST_CHECK
+#define CHECK_FALSE DOCTEST_CHECK_FALSE
+#define CHECK_THROWS DOCTEST_CHECK_THROWS
+#define CHECK_THROWS_AS DOCTEST_CHECK_THROWS_AS
+#define CHECK_NOTHROW DOCTEST_CHECK_NOTHROW
+#define REQUIRE DOCTEST_REQUIRE
+#define REQUIRE_FALSE DOCTEST_REQUIRE_FALSE
+#define REQUIRE_THROWS DOCTEST_REQUIRE_THROWS
+#define REQUIRE_THROWS_AS DOCTEST_REQUIRE_THROWS_AS
+#define REQUIRE_NOTHROW DOCTEST_REQUIRE_NOTHROW
+
+#define SCENARIO DOCTEST_SCENARIO
+#define GIVEN DOCTEST_GIVEN
+#define WHEN DOCTEST_WHEN
+#define AND_WHEN DOCTEST_AND_WHEN
+#define THEN DOCTEST_THEN
+#define AND_THEN DOCTEST_AND_THEN
+
+#define WARN_EQ DOCTEST_WARN_EQ
+#define CHECK_EQ DOCTEST_CHECK_EQ
+#define REQUIRE_EQ DOCTEST_REQUIRE_EQ
+#define WARN_NE DOCTEST_WARN_NE
+#define CHECK_NE DOCTEST_CHECK_NE
+#define REQUIRE_NE DOCTEST_REQUIRE_NE
+#define WARN_GT DOCTEST_WARN_GT
+#define CHECK_GT DOCTEST_CHECK_GT
+#define REQUIRE_GT DOCTEST_REQUIRE_GT
+#define WARN_LT DOCTEST_WARN_LT
+#define CHECK_LT DOCTEST_CHECK_LT
+#define REQUIRE_LT DOCTEST_REQUIRE_LT
+#define WARN_GE DOCTEST_WARN_GE
+#define CHECK_GE DOCTEST_CHECK_GE
+#define REQUIRE_GE DOCTEST_REQUIRE_GE
+#define WARN_LE DOCTEST_WARN_LE
+#define CHECK_LE DOCTEST_CHECK_LE
+#define REQUIRE_LE DOCTEST_REQUIRE_LE
+#define WARN_UNARY DOCTEST_WARN_UNARY
+#define CHECK_UNARY DOCTEST_CHECK_UNARY
+#define REQUIRE_UNARY DOCTEST_REQUIRE_UNARY
+#define WARN_UNARY_FALSE DOCTEST_WARN_UNARY_FALSE
+#define CHECK_UNARY_FALSE DOCTEST_CHECK_UNARY_FALSE
+#define REQUIRE_UNARY_FALSE DOCTEST_REQUIRE_UNARY_FALSE
+
+#define FAST_WARN_EQ DOCTEST_FAST_WARN_EQ
+#define FAST_CHECK_EQ DOCTEST_FAST_CHECK_EQ
+#define FAST_REQUIRE_EQ DOCTEST_FAST_REQUIRE_EQ
+#define FAST_WARN_NE DOCTEST_FAST_WARN_NE
+#define FAST_CHECK_NE DOCTEST_FAST_CHECK_NE
+#define FAST_REQUIRE_NE DOCTEST_FAST_REQUIRE_NE
+#define FAST_WARN_GT DOCTEST_FAST_WARN_GT
+#define FAST_CHECK_GT DOCTEST_FAST_CHECK_GT
+#define FAST_REQUIRE_GT DOCTEST_FAST_REQUIRE_GT
+#define FAST_WARN_LT DOCTEST_FAST_WARN_LT
+#define FAST_CHECK_LT DOCTEST_FAST_CHECK_LT
+#define FAST_REQUIRE_LT DOCTEST_FAST_REQUIRE_LT
+#define FAST_WARN_GE DOCTEST_FAST_WARN_GE
+#define FAST_CHECK_GE DOCTEST_FAST_CHECK_GE
+#define FAST_REQUIRE_GE DOCTEST_FAST_REQUIRE_GE
+#define FAST_WARN_LE DOCTEST_FAST_WARN_LE
+#define FAST_CHECK_LE DOCTEST_FAST_CHECK_LE
+#define FAST_REQUIRE_LE DOCTEST_FAST_REQUIRE_LE
+#define FAST_WARN_UNARY DOCTEST_FAST_WARN_UNARY
+#define FAST_CHECK_UNARY DOCTEST_FAST_CHECK_UNARY
+#define FAST_REQUIRE_UNARY DOCTEST_FAST_REQUIRE_UNARY
+#define FAST_WARN_UNARY_FALSE DOCTEST_FAST_WARN_UNARY_FALSE
+#define FAST_CHECK_UNARY_FALSE DOCTEST_FAST_CHECK_UNARY_FALSE
+#define FAST_REQUIRE_UNARY_FALSE DOCTEST_FAST_REQUIRE_UNARY_FALSE
+
+#endif // DOCTEST_CONFIG_NO_SHORT_MACRO_NAMES
+
+// this is here to clear the 'current test suite' for the current translation unit - at the top
+DOCTEST_TEST_SUITE_END();
+
+#endif // DOCTEST_LIBRARY_INCLUDED
+
+#if defined(__clang__)
+#pragma clang diagnostic pop
+#endif // __clang__
+
+#if defined(__GNUC__) && !defined(__clang__)
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 6)
+#pragma GCC diagnostic pop
+#endif // > gcc 4.6
+#endif // __GNUC__
+
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif // _MSC_VER
+
+#ifndef DOCTEST_SINGLE_HEADER
+#define DOCTEST_SINGLE_HEADER
+#endif // DOCTEST_SINGLE_HEADER
+
+#if defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunknown-pragmas"
+#pragma clang diagnostic ignored "-Wpadded"
+#pragma clang diagnostic ignored "-Wglobal-constructors"
+#pragma clang diagnostic ignored "-Wexit-time-destructors"
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wsign-conversion"
+#pragma clang diagnostic ignored "-Wshorten-64-to-32"
+#pragma clang diagnostic ignored "-Wmissing-variable-declarations"
+#pragma clang diagnostic ignored "-Wswitch"
+#pragma clang diagnostic ignored "-Wswitch-enum"
+#pragma clang diagnostic ignored "-Wcovered-switch-default"
+#pragma clang diagnostic ignored "-Wmissing-noreturn"
+#pragma clang diagnostic ignored "-Wunused-local-typedef"
+#endif // __clang__
+
+#if defined(__GNUC__) && !defined(__clang__)
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 6)
+#pragma GCC diagnostic push
+#endif // > gcc 4.6
+#pragma GCC diagnostic ignored "-Wunknown-pragmas"
+#pragma GCC diagnostic ignored "-Wconversion"
+#pragma GCC diagnostic ignored "-Weffc++"
+#pragma GCC diagnostic ignored "-Wsign-conversion"
+#pragma GCC diagnostic ignored "-Wstrict-overflow"
+#pragma GCC diagnostic ignored "-Wmissing-declarations"
+#pragma GCC diagnostic ignored "-Winline"
+#pragma GCC diagnostic ignored "-Wswitch"
+#pragma GCC diagnostic ignored "-Wswitch-enum"
+#pragma GCC diagnostic ignored "-Wswitch-default"
+#pragma GCC diagnostic ignored "-Wunsafe-loop-optimizations"
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 6)
+#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
+#endif // > gcc 4.6
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 7)
+#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
+#endif // > gcc 4.7
+#if __GNUC__ > 5 || (__GNUC__ == 5 && __GNUC_MINOR__ > 3)
+#pragma GCC diagnostic ignored "-Wuseless-cast"
+#endif // > gcc 5.3
+#endif // __GNUC__
+
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable : 4996) // The compiler encountered a deprecated declaration
+#pragma warning(disable : 4267) // 'var' : conversion from 'size_t' to 'type', possible loss of data
+#pragma warning(disable : 4706) // assignment within conditional expression
+#pragma warning(disable : 4512) // 'class' : assignment operator could not be generated
+#pragma warning(disable : 4127) // conditional expression is constant
+#pragma warning(disable : 4530) // C++ exception handler used, but unwind semantics are not enabled
+#pragma warning(disable : 4577) // 'noexcept' used with no exception handling mode specified
+#endif                          // _MSC_VER
+
+#if defined(DOCTEST_CONFIG_IMPLEMENT) || defined(DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN) ||            \
+        !defined(DOCTEST_SINGLE_HEADER)
+#ifndef DOCTEST_LIBRARY_IMPLEMENTATION
+#define DOCTEST_LIBRARY_IMPLEMENTATION
+
+#ifndef DOCTEST_SINGLE_HEADER
+#include "doctest_fwd.h"
+#endif // DOCTEST_SINGLE_HEADER
+
+#if defined(__clang__) && defined(DOCTEST_NO_CPP11_COMPAT)
+#pragma clang diagnostic ignored "-Wc++98-compat"
+#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
+#endif // __clang__ && DOCTEST_NO_CPP11_COMPAT
+
+// snprintf() not in the C++98 standard
+#ifdef _MSC_VER
+#define DOCTEST_SNPRINTF _snprintf
+#else
+#define DOCTEST_SNPRINTF snprintf
+#endif
+
+#define DOCTEST_LOG_START()                                                                        \
+    do {                                                                                           \
+        if(!DOCTEST_GCS().hasLoggedCurrentTestStart) {                                             \
+            doctest::detail::logTestStart(DOCTEST_GCS().currentTest->m_name,                       \
+                                          DOCTEST_GCS().currentTest->m_file,                       \
+                                          DOCTEST_GCS().currentTest->m_line);                      \
+            DOCTEST_GCS().hasLoggedCurrentTestStart = true;                                        \
+        }                                                                                          \
+    } while(doctest::detail::always_false())
+
+// required includes - will go only in one translation unit!
+#include <ctime>
+#include <cmath>
+// borland (Embarcadero) compiler requires math.h and not cmath - https://github.com/onqtam/doctest/pull/37
+#ifdef __BORLANDC__
+#include <math.h>
+#endif // __BORLANDC__
+#include <new>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <limits>
+#include <utility>
+#include <sstream>
+#include <iomanip>
+#include <vector>
+#include <set>
+#include <stdexcept>
+
+namespace doctest
+{
+namespace detail
+{
+    // not using std::strlen() because of valgrind errors when optimizations are turned on
+    // 'Invalid read of size 4' when the test suite len (with '\0') is not a multiple of 4
+    // for details see http://stackoverflow.com/questions/35671155
+    size_t my_strlen(const char* in) {
+        const char* temp = in;
+        while(temp && *temp)
+            ++temp;
+        return temp - in;
+    }
+
+    template <typename T>
+    T my_max(const T& lhs, const T& rhs) {
+        return lhs > rhs ? lhs : rhs;
+    }
+
+    // case insensitive strcmp
+    int stricmp(char const* a, char const* b) {
+        for(;; a++, b++) {
+            int d = tolower(*a) - tolower(*b);
+            if(d != 0 || !*a)
+                return d;
+        }
+    }
+
+    template <typename T>
+    String fpToString(T value, int precision) {
+        std::ostringstream oss;
+        oss << std::setprecision(precision) << std::fixed << value;
+        std::string d = oss.str();
+        size_t      i = d.find_last_not_of('0');
+        if(i != std::string::npos && i != d.size() - 1) {
+            if(d[i] == '.')
+                i++;
+            d = d.substr(0, i + 1);
+        }
+        return d.c_str();
+    }
+
+    struct Endianness
+    {
+        enum Arch
+        {
+            Big,
+            Little
+        };
+
+        static Arch which() {
+            union _
+            {
+                int  asInt;
+                char asChar[sizeof(int)];
+            } u;
+
+            u.asInt = 1;
+            return (u.asChar[sizeof(int) - 1] == 1) ? Big : Little;
+        }
+    };
+
+    String rawMemoryToString(const void* object, unsigned size) {
+        // Reverse order for little endian architectures
+        int i = 0, end = static_cast<int>(size), inc = 1;
+        if(Endianness::which() == Endianness::Little) {
+            i   = end - 1;
+            end = inc = -1;
+        }
+
+        unsigned char const* bytes = static_cast<unsigned char const*>(object);
+        std::ostringstream   os;
+        os << "0x" << std::setfill('0') << std::hex;
+        for(; i != end; i += inc)
+            os << std::setw(2) << static_cast<unsigned>(bytes[i]);
+        return os.str().c_str();
+    }
+
+    std::ostream* createStream() { return new std::ostringstream(); }
+    String getStreamResult(std::ostream* in) {
+        return static_cast<std::ostringstream*>(in)->str().c_str();
+    }
+    void freeStream(std::ostream* in) { delete in; }
+
+#ifndef DOCTEST_CONFIG_DISABLE
+
+    // this holds both parameters for the command line and runtime data for tests
+    struct ContextState : TestAccessibleContextState
+    {
+        // == parameters from the command line
+
+        std::vector<std::vector<String> > filters;
+
+        String   order_by;  // how tests should be ordered
+        unsigned rand_seed; // the seed for rand ordering
+
+        unsigned first; // the first (matching) test to be executed
+        unsigned last;  // the last (matching) test to be executed
+
+        int  abort_after;    // stop tests after this many failed assertions
+        bool case_sensitive; // if filtering should be case sensitive
+        bool exit;           // if the program should be exited after the tests are ran/whatever
+        bool no_exitcode;    // if the framework should return 0 as the exitcode
+        bool no_run;         // to not run the tests at all (can be done with an "*" exclude)
+        bool no_version;     // to not print the version of the framework
+        bool no_colors;      // if output to the console should be colorized
+        bool force_colors;   // forces the use of colors even when a tty cannot be detected
+        bool no_path_in_filenames; // if the path to files should be removed from the output
+
+        bool help;             // to print the help
+        bool version;          // to print the version
+        bool count;            // if only the count of matching tests is to be retreived
+        bool list_test_cases;  // to list all tests matching the filters
+        bool list_test_suites; // to list all suites matching the filters
+
+        // == data for the tests being ran
+
+        int numAssertions;
+        int numFailedAssertions;
+        int numFailedAssertionsForCurrentTestcase;
+
+        // stuff for subcases
+        std::set<SubcaseSignature> subcasesPassed;
+        std::set<int>              subcasesEnteredLevels;
+        std::vector<Subcase>       subcasesStack;
+        int                        subcasesCurrentLevel;
+        bool                       subcasesHasSkipped;
+
+        void resetRunData() {
+            numAssertions       = 0;
+            numFailedAssertions = 0;
+        }
+
+        ContextState()
+                : filters(6) // 6 different filters total
+        {
+            resetRunData();
+        }
+    };
+
+    ContextState*& getContextState();
+#endif // DOCTEST_CONFIG_DISABLE
+} // namespace detail
+
+String::String(const char* in)
+        : m_str(static_cast<char*>(malloc(detail::my_strlen(in) + 1))) {
+    if(in)
+        strcpy(m_str, in);
+    else
+        m_str[0] = '\0';
+}
+
+String::String(const String& other)
+        : m_str(0) {
+    copy(other);
+}
+
+void String::copy(const String& other) {
+    if(m_str)
+        free(m_str);
+    m_str = static_cast<char*>(malloc(detail::my_strlen(other.m_str) + 1));
+    strcpy(m_str, other.m_str);
+}
+
+String::~String() { free(m_str); }
+
+String& String::operator=(const String& other) {
+    if(this != &other)
+        copy(other);
+    return *this;
+}
+
+String String::operator+(const String& other) const { return String(m_str) += other; }
+
+String& String::operator+=(const String& other) {
+    using namespace detail;
+    if(other.m_str != 0) {
+        char* newStr = static_cast<char*>(malloc(my_strlen(m_str) + my_strlen(other.m_str) + 1));
+        strcpy(newStr, m_str);
+        strcpy(newStr + my_strlen(m_str), other.m_str);
+        free(m_str);
+        m_str = newStr;
+    }
+    return *this;
+}
+
+unsigned String::size() const { return m_str ? detail::my_strlen(m_str) : 0; }
+unsigned String::length() const { return size(); }
+
+int String::compare(const char* other, bool no_case) const {
+    if(no_case)
+        return detail::stricmp(m_str, other);
+    return strcmp(m_str, other);
+}
+
+int String::compare(const String& other, bool no_case) const {
+    if(no_case)
+        return detail::stricmp(m_str, other.m_str);
+    return strcmp(m_str, other.m_str);
+}
+
+std::ostream& operator<<(std::ostream& stream, const String& in) {
+    stream << in.c_str();
+    return stream;
+}
+
+Approx::Approx(double value)
+        : m_epsilon(static_cast<double>(std::numeric_limits<float>::epsilon()) * 100)
+        , m_scale(1.0)
+        , m_value(value) {}
+
+bool operator==(double lhs, Approx const& rhs) {
+    // Thanks to Richard Harris for his help refining this formula
+    return fabs(lhs - rhs.m_value) <
+           rhs.m_epsilon * (rhs.m_scale + detail::my_max(fabs(lhs), fabs(rhs.m_value)));
+}
+
+String Approx::toString() const { return String("Approx( ") + doctest::toString(m_value) + " )"; }
+
+#ifdef DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING
+String toString(char* in) { return toString(static_cast<const char*>(in)); }
+String toString(const char* in) { return String("\"") + (in ? in : "{null string}") + "\""; }
+#endif // DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING
+String toString(bool in) { return in ? "true" : "false"; }
+String toString(float in) { return detail::fpToString(in, 5) + "f"; }
+String toString(double in) { return detail::fpToString(in, 10); }
+String toString(double long in) { return detail::fpToString(in, 15); }
+
+String toString(char in) {
+    char buf[64];
+    sprintf(buf, "%d", in);
+    return buf;
+}
+
+String toString(char unsigned in) {
+    char buf[64];
+    sprintf(buf, "%ud", in);
+    return buf;
+}
+
+String toString(int short in) {
+    char buf[64];
+    sprintf(buf, "%d", in);
+    return buf;
+}
+
+String toString(int short unsigned in) {
+    char buf[64];
+    sprintf(buf, "%u", in);
+    return buf;
+}
+
+String toString(int in) {
+    char buf[64];
+    sprintf(buf, "%d", in);
+    return buf;
+}
+
+String toString(int unsigned in) {
+    char buf[64];
+    sprintf(buf, "%u", in);
+    return buf;
+}
+
+String toString(int long in) {
+    char buf[64];
+    sprintf(buf, "%ld", in);
+    return buf;
+}
+
+String toString(int long unsigned in) {
+    char buf[64];
+    sprintf(buf, "%lu", in);
+    return buf;
+}
+
+#ifdef DOCTEST_CONFIG_WITH_LONG_LONG
+String toString(int long long in) {
+    char buf[64];
+    sprintf(buf, "%lld", in);
+    return buf;
+}
+String toString(int long long unsigned in) {
+    char buf[64];
+    sprintf(buf, "%llu", in);
+    return buf;
+}
+#endif // DOCTEST_CONFIG_WITH_LONG_LONG
+
+#ifdef DOCTEST_CONFIG_WITH_NULLPTR
+String toString(std::nullptr_t) { return "nullptr"; }
+#endif // DOCTEST_CONFIG_WITH_NULLPTR
+
+} // namespace doctest
+
+#if defined(DOCTEST_CONFIG_DISABLE)
+namespace doctest
+{
+Context::Context(int, const char* const*) {}
+Context::~Context() {}
+void Context::applyCommandLine(int, const char* const*) {}
+void Context::addFilter(const char*, const char*) {}
+void Context::clearFilters() {}
+void Context::setOption(const char*, int) {}
+void Context::setOption(const char*, const char*) {}
+bool Context::shouldExit() { return false; }
+int  Context::run() { return 0; }
+} // namespace doctest
+#else // DOCTEST_CONFIG_DISABLE
+
+#if !defined(DOCTEST_CONFIG_COLORS_NONE)
+#if !defined(DOCTEST_CONFIG_COLORS_WINDOWS) && !defined(DOCTEST_CONFIG_COLORS_ANSI)
+#ifdef DOCTEST_PLATFORM_WINDOWS
+#define DOCTEST_CONFIG_COLORS_WINDOWS
+#else // linux
+#define DOCTEST_CONFIG_COLORS_ANSI
+#endif // platform
+#endif // DOCTEST_CONFIG_COLORS_WINDOWS && DOCTEST_CONFIG_COLORS_ANSI
+#endif // DOCTEST_CONFIG_COLORS_NONE
+
+#define DOCTEST_PRINTF_COLORED(buffer, color)                                                      \
+    do {                                                                                           \
+        if(buffer[0] != 0) {                                                                       \
+            doctest::detail::Color col(color);                                                     \
+            printf("%s", buffer);                                                                  \
+        }                                                                                          \
+    } while(doctest::detail::always_false())
+
+// the buffer size used for snprintf() calls
+#if !defined(DOCTEST_SNPRINTF_BUFFER_LENGTH)
+#define DOCTEST_SNPRINTF_BUFFER_LENGTH 1024
+#endif // DOCTEST_SNPRINTF_BUFFER_LENGTH
+
+#if defined(_MSC_VER) || defined(__MINGW32__)
+#if defined(_MSC_VER) && _MSC_VER >= 1700
+#define DOCTEST_WINDOWS_SAL_IN_OPT _In_opt_
+#else // _MSC_VER
+#define DOCTEST_WINDOWS_SAL_IN_OPT
+#endif // _MSC_VER
+extern "C" __declspec(dllimport) void __stdcall OutputDebugStringA(
+        DOCTEST_WINDOWS_SAL_IN_OPT const char*);
+extern "C" __declspec(dllimport) int __stdcall IsDebuggerPresent();
+#endif // _MSC_VER || __MINGW32__
+
+#ifdef DOCTEST_CONFIG_COLORS_ANSI
+#include <unistd.h>
+#endif // DOCTEST_CONFIG_COLORS_ANSI
+
+#ifdef DOCTEST_CONFIG_COLORS_WINDOWS
+
+// defines for a leaner windows.h
+#ifndef WIN32_MEAN_AND_LEAN
+#define WIN32_MEAN_AND_LEAN
+#endif // WIN32_MEAN_AND_LEAN
+#ifndef VC_EXTRA_LEAN
+#define VC_EXTRA_LEAN
+#endif // VC_EXTRA_LEAN
+#ifndef NOMINMAX
+#define NOMINMAX
+#endif // NOMINMAX
+
+// not sure what AfxWin.h is for - here I do what Catch does
+#ifdef __AFXDLL
+#include <AfxWin.h>
+#else
+#include <windows.h>
+#endif
+#include <io.h>
+
+#endif // DOCTEST_CONFIG_COLORS_WINDOWS
+
+namespace doctest
+{
+namespace detail
+{
+    bool TestData::operator<(const TestData& other) const {
+        if(m_line != other.m_line)
+            return m_line < other.m_line;
+        return strcmp(m_file, other.m_file) < 0;
+    }
+
+    const char* getAssertString(assertType::Enum val) {
+        switch(val) {
+            // clang-format off
+            case assertType::DT_WARN                    : return "WARN";
+            case assertType::DT_CHECK                   : return "CHECK";
+            case assertType::DT_REQUIRE                 : return "REQUIRE";
+
+            case assertType::DT_WARN_FALSE              : return "WARN_FALSE";
+            case assertType::DT_CHECK_FALSE             : return "CHECK_FALSE";
+            case assertType::DT_REQUIRE_FALSE           : return "REQUIRE_FALSE";
+
+            case assertType::DT_WARN_THROWS             : return "WARN_THROWS";
+            case assertType::DT_CHECK_THROWS            : return "CHECK_THROWS";
+            case assertType::DT_REQUIRE_THROWS          : return "REQUIRE_THROWS";
+
+            case assertType::DT_WARN_THROWS_AS          : return "WARN_THROWS_AS";
+            case assertType::DT_CHECK_THROWS_AS         : return "CHECK_THROWS_AS";
+            case assertType::DT_REQUIRE_THROWS_AS       : return "REQUIRE_THROWS_AS";
+
+            case assertType::DT_WARN_NOTHROW            : return "WARN_NOTHROW";
+            case assertType::DT_CHECK_NOTHROW           : return "CHECK_NOTHROW";
+            case assertType::DT_REQUIRE_NOTHROW         : return "REQUIRE_NOTHROW";
+
+            case assertType::DT_WARN_EQ                 : return "WARN_EQ";
+            case assertType::DT_CHECK_EQ                : return "CHECK_EQ";
+            case assertType::DT_REQUIRE_EQ              : return "REQUIRE_EQ";
+            case assertType::DT_WARN_NE                 : return "WARN_NE";
+            case assertType::DT_CHECK_NE                : return "CHECK_NE";
+            case assertType::DT_REQUIRE_NE              : return "REQUIRE_NE";
+            case assertType::DT_WARN_GT                 : return "WARN_GT";
+            case assertType::DT_CHECK_GT                : return "CHECK_GT";
+            case assertType::DT_REQUIRE_GT              : return "REQUIRE_GT";
+            case assertType::DT_WARN_LT                 : return "WARN_LT";
+            case assertType::DT_CHECK_LT                : return "CHECK_LT";
+            case assertType::DT_REQUIRE_LT              : return "REQUIRE_LT";
+            case assertType::DT_WARN_GE                 : return "WARN_GE";
+            case assertType::DT_CHECK_GE                : return "CHECK_GE";
+            case assertType::DT_REQUIRE_GE              : return "REQUIRE_GE";
+            case assertType::DT_WARN_LE                 : return "WARN_LE";
+            case assertType::DT_CHECK_LE                : return "CHECK_LE";
+            case assertType::DT_REQUIRE_LE              : return "REQUIRE_LE";
+
+            case assertType::DT_WARN_UNARY              : return "WARN_UNARY";
+            case assertType::DT_CHECK_UNARY             : return "CHECK_UNARY";
+            case assertType::DT_REQUIRE_UNARY           : return "REQUIRE_UNARY";
+            case assertType::DT_WARN_UNARY_FALSE        : return "WARN_UNARY_FALSE";
+            case assertType::DT_CHECK_UNARY_FALSE       : return "CHECK_UNARY_FALSE";
+            case assertType::DT_REQUIRE_UNARY_FALSE     : return "REQUIRE_UNARY_FALSE";
+
+            case assertType::DT_FAST_WARN_EQ            : return "FAST_WARN_EQ";
+            case assertType::DT_FAST_CHECK_EQ           : return "FAST_CHECK_EQ";
+            case assertType::DT_FAST_REQUIRE_EQ         : return "FAST_REQUIRE_EQ";
+            case assertType::DT_FAST_WARN_NE            : return "FAST_WARN_NE";
+            case assertType::DT_FAST_CHECK_NE           : return "FAST_CHECK_NE";
+            case assertType::DT_FAST_REQUIRE_NE         : return "FAST_REQUIRE_NE";
+            case assertType::DT_FAST_WARN_GT            : return "FAST_WARN_GT";
+            case assertType::DT_FAST_CHECK_GT           : return "FAST_CHECK_GT";
+            case assertType::DT_FAST_REQUIRE_GT         : return "FAST_REQUIRE_GT";
+            case assertType::DT_FAST_WARN_LT            : return "FAST_WARN_LT";
+            case assertType::DT_FAST_CHECK_LT           : return "FAST_CHECK_LT";
+            case assertType::DT_FAST_REQUIRE_LT         : return "FAST_REQUIRE_LT";
+            case assertType::DT_FAST_WARN_GE            : return "FAST_WARN_GE";
+            case assertType::DT_FAST_CHECK_GE           : return "FAST_CHECK_GE";
+            case assertType::DT_FAST_REQUIRE_GE         : return "FAST_REQUIRE_GE";
+            case assertType::DT_FAST_WARN_LE            : return "FAST_WARN_LE";
+            case assertType::DT_FAST_CHECK_LE           : return "FAST_CHECK_LE";
+            case assertType::DT_FAST_REQUIRE_LE         : return "FAST_REQUIRE_LE";
+
+            case assertType::DT_FAST_WARN_UNARY         : return "FAST_WARN_UNARY";
+            case assertType::DT_FAST_CHECK_UNARY        : return "FAST_CHECK_UNARY";
+            case assertType::DT_FAST_REQUIRE_UNARY      : return "FAST_REQUIRE_UNARY";
+            case assertType::DT_FAST_WARN_UNARY_FALSE   : return "FAST_WARN_UNARY_FALSE";
+            case assertType::DT_FAST_CHECK_UNARY_FALSE  : return "FAST_CHECK_UNARY_FALSE";
+            case assertType::DT_FAST_REQUIRE_UNARY_FALSE: return "FAST_REQUIRE_UNARY_FALSE";
+                // clang-format on
+        }
+        return "";
+    }
+
+    bool checkIfShouldThrow(assertType::Enum assert_type) {
+        if(assert_type & assertType::is_require)
+            return true;
+
+        if((assert_type & assertType::is_check) && getContextState()->abort_after > 0) {
+            if(getContextState()->numFailedAssertions >= getContextState()->abort_after)
+                return true;
+        }
+
+        return false;
+    }
+    void fastAssertThrowIfFlagSet(int flags) {
+        if(flags & assertAction::shouldthrow)
+            throwException();
+    }
+    void throwException() {
+#ifndef DOCTEST_CONFIG_NO_EXCEPTIONS
+        throw TestFailureException();
+#endif // DOCTEST_CONFIG_NO_EXCEPTIONS
+    }
+    bool always_false() { return false; }
+
+    // lowers ascii letters
+    char tolower(const char c) { return ((c >= 'A' && c <= 'Z') ? static_cast<char>(c + 32) : c); }
+
+    // matching of a string against a wildcard mask (case sensitivity configurable) taken from
+    // http://www.emoticode.net/c/simple-wildcard-string-compare-globbing-function.html
+    int wildcmp(const char* str, const char* wild, bool caseSensitive) {
+        const char* cp = 0;
+        const char* mp = 0;
+
+        // rolled my own tolower() to not include more headers
+        while((*str) && (*wild != '*')) {
+            if((caseSensitive ? (*wild != *str) : (tolower(*wild) != tolower(*str))) &&
+               (*wild != '?')) {
+                return 0;
+            }
+            wild++;
+            str++;
+        }
+
+        while(*str) {
+            if(*wild == '*') {
+                if(!*++wild) {
+                    return 1;
+                }
+                mp = wild;
+                cp = str + 1;
+            } else if((caseSensitive ? (*wild == *str) : (tolower(*wild) == tolower(*str))) ||
+                      (*wild == '?')) {
+                wild++;
+                str++;
+            } else {
+                wild = mp;
+                str  = cp++;
+            }
+        }
+
+        while(*wild == '*') {
+            wild++;
+        }
+        return !*wild;
+    }
+
+    //// C string hash function (djb2) - taken from http://www.cse.yorku.ca/~oz/hash.html
+    //unsigned hashStr(unsigned const char* str) {
+    //    unsigned long hash = 5381;
+    //    char          c;
+    //    while((c = *str++))
+    //        hash = ((hash << 5) + hash) + c; // hash * 33 + c
+    //    return hash;
+    //}
+
+    // checks if the name matches any of the filters (and can be configured what to do when empty)
+    int matchesAny(const char* name, std::vector<String> filters, int matchEmpty,
+                   bool caseSensitive) {
+        if(filters.size() == 0 && matchEmpty)
+            return 1;
+        for(unsigned i = 0; i < filters.size(); ++i)
+            if(wildcmp(name, filters[i].c_str(), caseSensitive))
+                return 1;
+        return 0;
+    }
+
+    // the current ContextState with which tests are being executed
+    ContextState*& getContextState() {
+        static ContextState* data = 0;
+        return data;
+    }
+
+    TestAccessibleContextState* getTestsContextState() { return getContextState(); }
+
+    bool SubcaseSignature::operator<(const SubcaseSignature& other) const {
+        if(m_line != other.m_line)
+            return m_line < other.m_line;
+        if(strcmp(m_file, other.m_file) != 0)
+            return strcmp(m_file, other.m_file) < 0;
+        return strcmp(m_name, other.m_name) < 0;
+    }
+
+    Subcase::Subcase(const char* name, const char* file, int line)
+            : m_signature(name, file, line)
+            , m_entered(false) {
+        ContextState* s = getContextState();
+
+        // if we have already completed it
+        if(s->subcasesPassed.count(m_signature) != 0)
+            return;
+
+        // if a Subcase on the same level has already been entered
+        if(s->subcasesEnteredLevels.count(s->subcasesCurrentLevel) != 0) {
+            s->subcasesHasSkipped = true;
+            return;
+        }
+
+        s->subcasesStack.push_back(*this);
+        if(s->hasLoggedCurrentTestStart)
+            logTestEnd();
+        s->hasLoggedCurrentTestStart = false;
+
+        s->subcasesEnteredLevels.insert(s->subcasesCurrentLevel++);
+        m_entered = true;
+    }
+
+    Subcase::Subcase(const Subcase& other)
+            : m_signature(other.m_signature.m_name, other.m_signature.m_file,
+                          other.m_signature.m_line)
+            , m_entered(other.m_entered) {}
+
+    Subcase::~Subcase() {
+        if(m_entered) {
+            ContextState* s = getContextState();
+
+            s->subcasesCurrentLevel--;
+            // only mark the subcase as passed if no subcases have been skipped
+            if(s->subcasesHasSkipped == false)
+                s->subcasesPassed.insert(m_signature);
+
+            if(s->subcasesStack.size() > 0)
+                s->subcasesStack.pop_back();
+            if(s->hasLoggedCurrentTestStart)
+                logTestEnd();
+            s->hasLoggedCurrentTestStart = false;
+        }
+    }
+
+    // for sorting tests by file/line
+    int fileOrderComparator(const void* a, const void* b) {
+        const TestData* lhs = *static_cast<TestData* const*>(a);
+        const TestData* rhs = *static_cast<TestData* const*>(b);
+#ifdef _MSC_VER
+        // this is needed because MSVC gives different case for drive letters
+        // for __FILE__ when evaluated in a header and a source file
+        int res = stricmp(lhs->m_file, rhs->m_file);
+#else  // _MSC_VER
+        int res = strcmp(lhs->m_file, rhs->m_file);
+#endif // _MSC_VER
+        if(res != 0)
+            return res;
+        return static_cast<int>(lhs->m_line - rhs->m_line);
+    }
+
+    // for sorting tests by suite/file/line
+    int suiteOrderComparator(const void* a, const void* b) {
+        const TestData* lhs = *static_cast<TestData* const*>(a);
+        const TestData* rhs = *static_cast<TestData* const*>(b);
+
+        int res = strcmp(lhs->m_suite, rhs->m_suite);
+        if(res != 0)
+            return res;
+        return fileOrderComparator(a, b);
+    }
+
+    // for sorting tests by name/suite/file/line
+    int nameOrderComparator(const void* a, const void* b) {
+        const TestData* lhs = *static_cast<TestData* const*>(a);
+        const TestData* rhs = *static_cast<TestData* const*>(b);
+
+        int res = strcmp(lhs->m_name, rhs->m_name);
+        if(res != 0)
+            return res;
+        return suiteOrderComparator(a, b);
+    }
+
+    // holds the current test suite
+    const char*& getCurrentTestSuite() {
+        static const char* data = 0;
+        return data;
+    }
+
+    // sets the current test suite
+    int setTestSuiteName(const char* name) {
+        getCurrentTestSuite() = name;
+        return 0;
+    }
+
+    // all the registered tests
+    std::set<TestData>& getRegisteredTests() {
+        static std::set<TestData> data;
+        return data;
+    }
+
+    // used by the macros for registering tests
+    int regTest(funcType f, unsigned line, const char* file, const char* name) {
+        getRegisteredTests().insert(TestData(getCurrentTestSuite(), name, f, file, line));
+        return 0;
+    }
+
+    struct Color
+    {
+        enum Code
+        {
+            None = 0,
+            White,
+            Red,
+            Green,
+            Blue,
+            Cyan,
+            Yellow,
+            Grey,
+
+            Bright = 0x10,
+
+            BrightRed   = Bright | Red,
+            BrightGreen = Bright | Green,
+            LightGrey   = Bright | Grey,
+            BrightWhite = Bright | White
+        };
+        Color(Code code) { use(code); }
+        ~Color() { use(None); }
+
+        void use(Code code);
+
+    private:
+        Color(Color const& other);
+    };
+
+    void Color::use(Code
+#ifndef DOCTEST_CONFIG_COLORS_NONE
+                            code
+#endif // DOCTEST_CONFIG_COLORS_NONE
+                    ) {
+        ContextState* p = getContextState();
+        if(p->no_colors)
+            return;
+#ifdef DOCTEST_CONFIG_COLORS_ANSI
+        if(isatty(STDOUT_FILENO) == false && p->force_colors == false)
+            return;
+
+        const char* col = "";
+        // clang-format off
+        switch(code) {
+            case Color::Red:         col = "[0;31m"; break;
+            case Color::Green:       col = "[0;32m"; break;
+            case Color::Blue:        col = "[0;34m"; break;
+            case Color::Cyan:        col = "[0;36m"; break;
+            case Color::Yellow:      col = "[0;33m"; break;
+            case Color::Grey:        col = "[1;30m"; break;
+            case Color::LightGrey:   col = "[0;37m"; break;
+            case Color::BrightRed:   col = "[1;31m"; break;
+            case Color::BrightGreen: col = "[1;32m"; break;
+            case Color::BrightWhite: col = "[1;37m"; break;
+            case Color::Bright: // invalid
+            case Color::None:
+            case Color::White:
+            default:                 col = "[0m";
+        }
+        // clang-format on
+        printf("\033%s", col);
+#endif // DOCTEST_CONFIG_COLORS_ANSI
+
+#ifdef DOCTEST_CONFIG_COLORS_WINDOWS
+        if(isatty(fileno(stdout)) == false && p->force_colors == false)
+            return;
+
+        static HANDLE stdoutHandle(GetStdHandle(STD_OUTPUT_HANDLE));
+        static WORD   originalForegroundAttributes;
+        static WORD   originalBackgroundAttributes;
+        static bool   attrsInitted = false;
+        if(!attrsInitted) {
+            attrsInitted = true;
+            CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
+            GetConsoleScreenBufferInfo(stdoutHandle, &csbiInfo);
+            originalForegroundAttributes =
+                    csbiInfo.wAttributes &
+                    ~(BACKGROUND_GREEN | BACKGROUND_RED | BACKGROUND_BLUE | BACKGROUND_INTENSITY);
+            originalBackgroundAttributes =
+                    csbiInfo.wAttributes &
+                    ~(FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_INTENSITY);
+        }
+
+#define DOCTEST_SET_ATTR(x) SetConsoleTextAttribute(stdoutHandle, x | originalBackgroundAttributes)
+
+        // clang-format off
+        switch (code) {
+            case Color::White:       DOCTEST_SET_ATTR(FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE); break;
+            case Color::Red:         DOCTEST_SET_ATTR(FOREGROUND_RED);                                      break;
+            case Color::Green:       DOCTEST_SET_ATTR(FOREGROUND_GREEN);                                    break;
+            case Color::Blue:        DOCTEST_SET_ATTR(FOREGROUND_BLUE);                                     break;
+            case Color::Cyan:        DOCTEST_SET_ATTR(FOREGROUND_BLUE | FOREGROUND_GREEN);                  break;
+            case Color::Yellow:      DOCTEST_SET_ATTR(FOREGROUND_RED | FOREGROUND_GREEN);                   break;
+            case Color::Grey:        DOCTEST_SET_ATTR(0);                                                   break;
+            case Color::LightGrey:   DOCTEST_SET_ATTR(FOREGROUND_INTENSITY);                                break;
+            case Color::BrightRed:   DOCTEST_SET_ATTR(FOREGROUND_INTENSITY | FOREGROUND_RED);               break;
+            case Color::BrightGreen: DOCTEST_SET_ATTR(FOREGROUND_INTENSITY | FOREGROUND_GREEN);             break;
+            case Color::BrightWhite: DOCTEST_SET_ATTR(FOREGROUND_INTENSITY | FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE); break;
+            case Color::None:
+            case Color::Bright: // invalid
+            default:                 DOCTEST_SET_ATTR(originalForegroundAttributes);
+        }
+// clang-format on
+#undef DOCTEST_SET_ATTR
+#endif // DOCTEST_CONFIG_COLORS_WINDOWS
+    }
+
+    // this is needed because MSVC does not permit mixing 2 exception handling schemes in a function
+    int callTestFunc(funcType f) {
+        int res = EXIT_SUCCESS;
+#ifndef DOCTEST_CONFIG_NO_EXCEPTIONS
+        try {
+#endif // DOCTEST_CONFIG_NO_EXCEPTIONS
+            f();
+            if(getContextState()->numFailedAssertionsForCurrentTestcase)
+                res = EXIT_FAILURE;
+#ifndef DOCTEST_CONFIG_NO_EXCEPTIONS
+        } catch(const TestFailureException&) {
+            res = EXIT_FAILURE;
+        } catch(const std::exception& e) {
+            DOCTEST_LOG_START();
+            logTestException(e.what());
+            res = EXIT_FAILURE;
+        } catch(...) {
+            DOCTEST_LOG_START();
+            logTestCrashed();
+            res = EXIT_FAILURE;
+        }
+#endif // DOCTEST_CONFIG_NO_EXCEPTIONS
+        return res;
+    }
+
+    // depending on the current options this will remove the path of filenames
+    const char* fileForOutput(const char* file) {
+        if(getContextState()->no_path_in_filenames) {
+            const char* back    = strrchr(file, '\\');
+            const char* forward = strrchr(file, '/');
+            if(back || forward) {
+                if(back > forward)
+                    forward = back;
+                return forward + 1;
+            }
+        }
+        return file;
+    }
+
+#ifdef DOCTEST_PLATFORM_MAC
+#include <sys/types.h>
+#include <unistd.h>
+#include <sys/sysctl.h>
+    // The following function is taken directly from the following technical note:
+    // http://developer.apple.com/library/mac/#qa/qa2004/qa1361.html
+    // Returns true if the current process is being debugged (either
+    // running under the debugger or has a debugger attached post facto).
+    bool isDebuggerActive() {
+        int               mib[4];
+        struct kinfo_proc info;
+        size_t            size;
+        // Initialize the flags so that, if sysctl fails for some bizarre
+        // reason, we get a predictable result.
+        info.kp_proc.p_flag = 0;
+        // Initialize mib, which tells sysctl the info we want, in this case
+        // we're looking for information about a specific process ID.
+        mib[0] = CTL_KERN;
+        mib[1] = KERN_PROC;
+        mib[2] = KERN_PROC_PID;
+        mib[3] = getpid();
+        // Call sysctl.
+        size = sizeof(info);
+        if(sysctl(mib, sizeof(mib) / sizeof(*mib), &info, &size, 0, 0) != 0) {
+            fprintf(stderr, "\n** Call to sysctl failed - unable to determine if debugger is "
+                            "active **\n\n");
+            return false;
+        }
+        // We're being debugged if the P_TRACED flag is set.
+        return ((info.kp_proc.p_flag & P_TRACED) != 0);
+    }
+#elif defined(_MSC_VER) || defined(__MINGW32__)
+    bool    isDebuggerActive() { return ::IsDebuggerPresent() != 0; }
+#else
+    bool isDebuggerActive() { return false; }
+#endif // Platform
+
+#ifdef DOCTEST_PLATFORM_WINDOWS
+    void myOutputDebugString(const String& text) { ::OutputDebugStringA(text.c_str()); }
+#else
+    // TODO: integration with XCode and other IDEs
+    void myOutputDebugString(const String&) {}
+#endif // Platform
+
+    const char* getSeparator() {
+        return "===============================================================================\n";
+    }
+
+    void printToDebugConsole(const String& text) {
+        if(isDebuggerActive())
+            myOutputDebugString(text.c_str());
+    }
+
+    void addFailedAssert(assertType::Enum assert_type) {
+        if((assert_type & assertType::is_warn) == 0) {
+            getContextState()->numFailedAssertionsForCurrentTestcase++;
+            getContextState()->numFailedAssertions++;
+        }
+    }
+
+    void logTestStart(const char* name, const char* file, unsigned line) {
+        const char* newLine = "\n";
+
+        char loc[DOCTEST_SNPRINTF_BUFFER_LENGTH];
+        DOCTEST_SNPRINTF(loc, DOCTEST_COUNTOF(loc), "%s(%d)\n", fileForOutput(file), line);
+
+        char msg[DOCTEST_SNPRINTF_BUFFER_LENGTH];
+        DOCTEST_SNPRINTF(msg, DOCTEST_COUNTOF(msg), "%s\n", name);
+
+        DOCTEST_PRINTF_COLORED(getSeparator(), Color::Yellow);
+        DOCTEST_PRINTF_COLORED(loc, Color::LightGrey);
+        DOCTEST_PRINTF_COLORED(msg, Color::None);
+
+        String                subcaseStuff  = "";
+        std::vector<Subcase>& subcasesStack = getContextState()->subcasesStack;
+        for(unsigned i = 0; i < subcasesStack.size(); ++i) {
+            char subcase[DOCTEST_SNPRINTF_BUFFER_LENGTH];
+            DOCTEST_SNPRINTF(subcase, DOCTEST_COUNTOF(loc), "  %s\n",
+                             subcasesStack[i].m_signature.m_name);
+            DOCTEST_PRINTF_COLORED(subcase, Color::None);
+            subcaseStuff += subcase;
+        }
+
+        DOCTEST_PRINTF_COLORED(newLine, Color::None);
+
+        printToDebugConsole(String(getSeparator()) + loc + msg + subcaseStuff.c_str() + newLine);
+    }
+
+    void logTestEnd() {}
+
+    void logTestCrashed() {
+        char msg[DOCTEST_SNPRINTF_BUFFER_LENGTH];
+
+        DOCTEST_SNPRINTF(msg, DOCTEST_COUNTOF(msg), "TEST CASE FAILED! (threw exception)\n\n");
+
+        DOCTEST_PRINTF_COLORED(msg, Color::Red);
+
+        printToDebugConsole(String(msg));
+    }
+
+    void logTestException(const char* what) {
+        char msg[DOCTEST_SNPRINTF_BUFFER_LENGTH];
+
+        DOCTEST_SNPRINTF(msg, DOCTEST_COUNTOF(msg), "TEST CASE FAILED! (threw exception: %s)\n\n",
+                         what);
+
+        DOCTEST_PRINTF_COLORED(msg, Color::Red);
+
+        printToDebugConsole(String(msg));
+    }
+
+    void logAssert(bool passed, const char* decomposition, bool threw, const char* expr,
+                   assertType::Enum assert_type, const char* file, int line) {
+        char loc[DOCTEST_SNPRINTF_BUFFER_LENGTH];
+        DOCTEST_SNPRINTF(loc, DOCTEST_COUNTOF(loc), "%s(%d)", fileForOutput(file), line);
+
+        char msg[DOCTEST_SNPRINTF_BUFFER_LENGTH];
+        if(passed)
+            DOCTEST_SNPRINTF(msg, DOCTEST_COUNTOF(msg), " PASSED!\n");
+        else
+            DOCTEST_SNPRINTF(msg, DOCTEST_COUNTOF(msg), " FAILED! %s\n",
+                             (threw ? "(threw exception)" : ""));
+
+        char info1[DOCTEST_SNPRINTF_BUFFER_LENGTH];
+        DOCTEST_SNPRINTF(info1, DOCTEST_COUNTOF(info1), "  %s( %s )\n",
+                         getAssertString(assert_type), expr);
+
+        char info2[DOCTEST_SNPRINTF_BUFFER_LENGTH];
+        char info3[DOCTEST_SNPRINTF_BUFFER_LENGTH];
+        info2[0] = 0;
+        info3[0] = 0;
+        if(!threw) {
+            DOCTEST_SNPRINTF(info2, DOCTEST_COUNTOF(info2), "with expansion:\n");
+            DOCTEST_SNPRINTF(info3, DOCTEST_COUNTOF(info3), "  %s( %s )\n",
+                             getAssertString(assert_type), decomposition);
+        }
+
+        DOCTEST_PRINTF_COLORED(loc, Color::LightGrey);
+        DOCTEST_PRINTF_COLORED(msg, passed ? Color::BrightGreen : Color::Red);
+        DOCTEST_PRINTF_COLORED(info1, Color::Cyan);
+        DOCTEST_PRINTF_COLORED(info2, Color::None);
+        DOCTEST_PRINTF_COLORED(info3, Color::Cyan);
+        DOCTEST_PRINTF_COLORED("\n", Color::None);
+
+        printToDebugConsole(String(loc) + msg + info1 + info2 + info3 + "\n");
+    }
+
+    void logAssertThrows(bool threw, const char* expr, assertType::Enum assert_type,
+                         const char* file, int line) {
+        char loc[DOCTEST_SNPRINTF_BUFFER_LENGTH];
+        DOCTEST_SNPRINTF(loc, DOCTEST_COUNTOF(loc), "%s(%d)", fileForOutput(file), line);
+
+        char msg[DOCTEST_SNPRINTF_BUFFER_LENGTH];
+        if(threw)
+            DOCTEST_SNPRINTF(msg, DOCTEST_COUNTOF(msg), " PASSED!\n");
+        else
+            DOCTEST_SNPRINTF(msg, DOCTEST_COUNTOF(msg), " FAILED!\n");
+
+        char info1[DOCTEST_SNPRINTF_BUFFER_LENGTH];
+        DOCTEST_SNPRINTF(info1, DOCTEST_COUNTOF(info1), "  %s( %s )\n\n",
+                         getAssertString(assert_type), expr);
+
+        DOCTEST_PRINTF_COLORED(loc, Color::LightGrey);
+        DOCTEST_PRINTF_COLORED(msg, threw ? Color::BrightGreen : Color::Red);
+        DOCTEST_PRINTF_COLORED(info1, Color::Cyan);
+
+        printToDebugConsole(String(loc) + msg + info1);
+    }
+
+    void logAssertThrowsAs(bool threw, bool threw_as, const char* as, const char* expr,
+                           assertType::Enum assert_type, const char* file, int line) {
+        char loc[DOCTEST_SNPRINTF_BUFFER_LENGTH];
+        DOCTEST_SNPRINTF(loc, DOCTEST_COUNTOF(loc), "%s(%d)", fileForOutput(file), line);
+
+        char msg[DOCTEST_SNPRINTF_BUFFER_LENGTH];
+        if(threw_as)
+            DOCTEST_SNPRINTF(msg, DOCTEST_COUNTOF(msg), " PASSED!\n");
+        else
+            DOCTEST_SNPRINTF(msg, DOCTEST_COUNTOF(msg), " FAILED! %s\n",
+                             (threw ? "(threw something else)" : "(didn't throw at all)"));
+
+        char info1[DOCTEST_SNPRINTF_BUFFER_LENGTH];
+        DOCTEST_SNPRINTF(info1, DOCTEST_COUNTOF(info1), "  %s( %s, %s )\n\n",
+                         getAssertString(assert_type), expr, as);
+
+        DOCTEST_PRINTF_COLORED(loc, Color::LightGrey);
+        DOCTEST_PRINTF_COLORED(msg, threw_as ? Color::BrightGreen : Color::Red);
+        DOCTEST_PRINTF_COLORED(info1, Color::Cyan);
+
+        printToDebugConsole(String(loc) + msg + info1);
+    }
+
+    void logAssertNothrow(bool threw, const char* expr, assertType::Enum assert_type,
+                          const char* file, int line) {
+        char loc[DOCTEST_SNPRINTF_BUFFER_LENGTH];
+        DOCTEST_SNPRINTF(loc, DOCTEST_COUNTOF(loc), "%s(%d)", fileForOutput(file), line);
+
+        char msg[DOCTEST_SNPRINTF_BUFFER_LENGTH];
+        if(!threw)
+            DOCTEST_SNPRINTF(msg, DOCTEST_COUNTOF(msg), " PASSED!\n");
+        else
+            DOCTEST_SNPRINTF(msg, DOCTEST_COUNTOF(msg), " FAILED!\n");
+
+        char info1[DOCTEST_SNPRINTF_BUFFER_LENGTH];
+        DOCTEST_SNPRINTF(info1, DOCTEST_COUNTOF(info1), "  %s( %s )\n\n",
+                         getAssertString(assert_type), expr);
+
+        DOCTEST_PRINTF_COLORED(loc, Color::LightGrey);
+        DOCTEST_PRINTF_COLORED(msg, !threw ? Color::BrightGreen : Color::Red);
+        DOCTEST_PRINTF_COLORED(info1, Color::Cyan);
+
+        printToDebugConsole(String(loc) + msg + info1);
+    }
+
+    ResultBuilder::ResultBuilder(assertType::Enum assert_type, const char* file, int line,
+                                 const char* expr, const char* exception_type)
+            : m_assert_type(assert_type)
+            , m_file(file)
+            , m_line(line)
+            , m_expr(expr)
+            , m_exception_type(exception_type)
+            , m_threw(false)
+            , m_threw_as(false)
+            , m_failed(false) {}
+
+    bool ResultBuilder::log() {
+        if((m_assert_type & assertType::is_warn) == 0)
+            DOCTEST_GCS().numAssertionsForCurrentTestcase++;
+
+        if(m_assert_type & assertType::is_false) {
+            m_result.invert();
+            m_failed = m_result;
+        } else if(m_assert_type & assertType::is_throws) {
+            m_failed = !m_threw;
+        } else if(m_assert_type & assertType::is_throws_as) {
+            m_failed = !m_threw_as;
+        } else if(m_assert_type & assertType::is_nothrow) {
+            m_failed = m_threw;
+        } else {
+            m_failed = m_result;
+        }
+
+        if(m_failed || DOCTEST_GCS().success) {
+            DOCTEST_LOG_START();
+
+            if(m_assert_type & assertType::is_throws) {
+                logAssertThrows(m_threw, m_expr, m_assert_type, m_file, m_line);
+            } else if(m_assert_type & assertType::is_throws_as) {
+                logAssertThrowsAs(m_threw, m_threw_as, m_exception_type, m_expr, m_assert_type,
+                                  m_file, m_line);
+            } else if(m_assert_type & assertType::is_nothrow) {
+                logAssertNothrow(m_threw, m_expr, m_assert_type, m_file, m_line);
+            } else {
+                logAssert(m_result.m_passed, m_result.m_decomposition.c_str(), m_threw, m_expr,
+                          m_assert_type, m_file, m_line);
+            }
+        }
+
+        if(m_failed) {
+            addFailedAssert(m_assert_type);
+            if(isDebuggerActive() && !DOCTEST_GCS().no_breaks)
+                return true; // should break into the debugger
+        }
+        return false;
+    }
+
+    void ResultBuilder::react() const {
+        if(m_failed && checkIfShouldThrow(m_assert_type))
+            throwException();
+    }
+
+    // the implementation of parseFlag()
+    bool parseFlagImpl(int argc, const char* const* argv, const char* pattern) {
+        for(int i = argc - 1; i >= 0; --i) {
+            const char* temp = strstr(argv[i], pattern);
+            if(temp && my_strlen(temp) == my_strlen(pattern)) {
+                // eliminate strings in which the chars before the option are not '-'
+                bool noBadCharsFound = true;
+                while(temp != argv[i]) {
+                    if(*--temp != '-') {
+                        noBadCharsFound = false;
+                        break;
+                    }
+                }
+                if(noBadCharsFound && argv[i][0] == '-')
+                    return true;
+            }
+        }
+        return false;
+    }
+
+    // locates a flag on the command line
+    bool parseFlag(int argc, const char* const* argv, const char* pattern) {
+#ifndef DOCTEST_CONFIG_NO_UNPREFIXED_OPTIONS
+        if(!parseFlagImpl(argc, argv, pattern))
+            return parseFlagImpl(argc, argv, pattern + 3); // 3 for "dt-"
+        return true;
+#else  // DOCTEST_CONFIG_NO_UNPREFIXED_OPTIONS
+        return parseFlagImpl(argc, argv, pattern);
+#endif // DOCTEST_CONFIG_NO_UNPREFIXED_OPTIONS
+    }
+
+    // the implementation of parseOption()
+    bool parseOptionImpl(int argc, const char* const* argv, const char* pattern, String& res) {
+        for(int i = argc - 1; i >= 0; --i) {
+            const char* temp = strstr(argv[i], pattern);
+            if(temp) {
+                // eliminate matches in which the chars before the option are not '-'
+                bool        noBadCharsFound = true;
+                const char* curr            = argv[i];
+                while(curr != temp) {
+                    if(*curr++ != '-') {
+                        noBadCharsFound = false;
+                        break;
+                    }
+                }
+                if(noBadCharsFound && argv[i][0] == '-') {
+                    temp += my_strlen(pattern);
+                    unsigned len = my_strlen(temp);
+                    if(len) {
+                        res = temp;
+                        return true;
+                    }
+                }
+            }
+        }
+        return false;
+    }
+
+    // parses an option and returns the string after the '=' character
+    bool parseOption(int argc, const char* const* argv, const char* pattern, String& res,
+                     const String& defaultVal = String()) {
+        res = defaultVal;
+#ifndef DOCTEST_CONFIG_NO_UNPREFIXED_OPTIONS
+        if(!parseOptionImpl(argc, argv, pattern, res))
+            return parseOptionImpl(argc, argv, pattern + 3, res); // 3 for "dt-"
+        return true;
+#else // DOCTEST_CONFIG_NO_UNPREFIXED_OPTIONS
+        return parseOptionImpl(argc, argv, pattern, res);
+#endif // DOCTEST_CONFIG_NO_UNPREFIXED_OPTIONS
+    }
+
+    // parses a comma separated list of words after a pattern in one of the arguments in argv
+    bool parseCommaSepArgs(int argc, const char* const* argv, const char* pattern,
+                           std::vector<String>& res) {
+        String filtersString;
+        if(parseOption(argc, argv, pattern, filtersString)) {
+            // tokenize with "," as a separator
+            char* pch = strtok(filtersString.c_str(), ","); // modifies the string
+            while(pch != 0) {
+                if(my_strlen(pch))
+                    res.push_back(pch);
+                pch = strtok(0, ","); // uses the strtok() internal state to go to the next token
+            }
+            return true;
+        }
+        return false;
+    }
+
+    enum optionType
+    {
+        option_bool,
+        option_int
+    };
+
+    // parses an int/bool option from the command line
+    bool parseIntOption(int argc, const char* const* argv, const char* pattern, optionType type,
+                        int& res) {
+        String parsedValue;
+        if(parseOption(argc, argv, pattern, parsedValue)) {
+            if(type == 0) {
+                // boolean
+                const char positive[][5] = {"1", "true", "on", "yes"};  // 5 - strlen("true") + 1
+                const char negative[][6] = {"0", "false", "off", "no"}; // 6 - strlen("false") + 1
+
+                // if the value matches any of the positive/negative possibilities
+                for(unsigned i = 0; i < 4; i++) {
+                    if(parsedValue.compare(positive[i], true) == 0) {
+                        res = 1;
+                        return true;
+                    }
+                    if(parsedValue.compare(negative[i], true) == 0) {
+                        res = 0;
+                        return true;
+                    }
+                }
+            } else {
+                // integer
+                int theInt = atoi(parsedValue.c_str());
+                if(theInt != 0) {
+                    res = theInt;
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
+    void printVersion() {
+        if(getContextState()->no_version == false) {
+            DOCTEST_PRINTF_COLORED("[doctest] ", Color::Cyan);
+            printf("doctest version is \"%s\"\n", DOCTEST_VERSION_STR);
+        }
+    }
+
+    void printHelp() {
+        printVersion();
+        DOCTEST_PRINTF_COLORED("[doctest]\n", Color::Cyan);
+        DOCTEST_PRINTF_COLORED("[doctest] ", Color::Cyan);
+        printf("boolean values: \"1/on/yes/true\" or \"0/off/no/false\"\n");
+        DOCTEST_PRINTF_COLORED("[doctest] ", Color::Cyan);
+        printf("filter  values: \"str1,str2,str3\" (comma separated strings)\n");
+        DOCTEST_PRINTF_COLORED("[doctest]\n", Color::Cyan);
+        DOCTEST_PRINTF_COLORED("[doctest] ", Color::Cyan);
+        printf("filters use wildcards for matching strings\n");
+        DOCTEST_PRINTF_COLORED("[doctest] ", Color::Cyan);
+        printf("something passes a filter if any of the strings in a filter matches\n");
+        DOCTEST_PRINTF_COLORED("[doctest]\n", Color::Cyan);
+        DOCTEST_PRINTF_COLORED("[doctest] ", Color::Cyan);
+        printf("ALL FLAGS, OPTIONS AND FILTERS ALSO AVAILABLE WITH A \"dt-\" PREFIX!!!\n");
+        DOCTEST_PRINTF_COLORED("[doctest]\n", Color::Cyan);
+        DOCTEST_PRINTF_COLORED("[doctest] ", Color::Cyan);
+        printf("Query flags - the program quits after them. Available:\n\n");
+        printf(" -?,   --help, -h                      prints this message\n");
+        printf(" -v,   --version                       prints the version\n");
+        printf(" -c,   --count                         prints the number of matching tests\n");
+        printf(" -ltc, --list-test-cases               lists all matching tests by name\n");
+        printf(" -lts, --list-test-suites              lists all matching test suites\n\n");
+        // ==================================================================================== << 79
+        DOCTEST_PRINTF_COLORED("[doctest] ", Color::Cyan);
+        printf("The available <int>/<string> options/filters are:\n\n");
+        printf(" -tc,  --test-case=<filters>           filters     tests by their name\n");
+        printf(" -tce, --test-case-exclude=<filters>   filters OUT tests by their name\n");
+        printf(" -sf,  --source-file=<filters>         filters     tests by their file\n");
+        printf(" -sfe, --source-file-exclude=<filters> filters OUT tests by their file\n");
+        printf(" -ts,  --test-suite=<filters>          filters     tests by their test suite\n");
+        printf(" -tse, --test-suite-exclude=<filters>  filters OUT tests by their test suite\n");
+        printf(" -ob,  --order-by=<string>             how the tests should be ordered\n");
+        printf("                                       <string> - by [file/suite/name/rand]\n");
+        printf(" -rs,  --rand-seed=<int>               seed for random ordering\n");
+        printf(" -f,   --first=<int>                   the first test passing the filters to\n");
+        printf("                                       execute - for range-based execution\n");
+        printf(" -l,   --last=<int>                    the last test passing the filters to\n");
+        printf("                                       execute - for range-based execution\n");
+        printf(" -aa,  --abort-after=<int>             stop after <int> failed assertions\n\n");
+        DOCTEST_PRINTF_COLORED("[doctest] ", Color::Cyan);
+        printf("Bool options - can be used like flags and true is assumed. Available:\n\n");
+        printf(" -s,   --success=<bool>                include successful assertions in output\n");
+        printf(" -cs,  --case-sensitive=<bool>         filters being treated as case sensitive\n");
+        printf(" -e,   --exit=<bool>                   exits after the tests finish\n");
+        printf(" -nt,  --no-throw=<bool>               skips exceptions-related assert checks\n");
+        printf(" -ne,  --no-exitcode=<bool>            returns (or exits) always with success\n");
+        printf(" -nr,  --no-run=<bool>                 skips all runtime doctest operations\n");
+        printf(" -nv,  --no-version=<bool>             omit the framework version in the output\n");
+        printf(" -nc,  --no-colors=<bool>              disables colors in output\n");
+        printf(" -fc,  --force-colors=<bool>           use colors even when not in a tty\n");
+        printf(" -nb,  --no-breaks=<bool>              disables breakpoints in debuggers\n");
+        printf(" -npf, --no-path-filenames=<bool>      only filenames and no paths in output\n\n");
+        // ==================================================================================== << 79
+
+        DOCTEST_PRINTF_COLORED("[doctest] ", Color::Cyan);
+        printf("for more information visit the project documentation\n\n");
+    }
+} // namespace detail
+
+Context::Context(int argc, const char* const* argv)
+        : p(new detail::ContextState) {
+    parseArgs(argc, argv, true);
+}
+
+Context::~Context() { delete p; }
+
+void Context::applyCommandLine(int argc, const char* const* argv) { parseArgs(argc, argv); }
+
+// parses args
+void Context::parseArgs(int argc, const char* const* argv, bool withDefaults) {
+    using namespace detail;
+
+    // clang-format off
+    parseCommaSepArgs(argc, argv, "dt-source-file=",        p->filters[0]);
+    parseCommaSepArgs(argc, argv, "dt-sf=",                 p->filters[0]);
+    parseCommaSepArgs(argc, argv, "dt-source-file-exclude=",p->filters[1]);
+    parseCommaSepArgs(argc, argv, "dt-sfe=",                p->filters[1]);
+    parseCommaSepArgs(argc, argv, "dt-test-suite=",         p->filters[2]);
+    parseCommaSepArgs(argc, argv, "dt-ts=",                 p->filters[2]);
+    parseCommaSepArgs(argc, argv, "dt-test-suite-exclude=", p->filters[3]);
+    parseCommaSepArgs(argc, argv, "dt-tse=",                p->filters[3]);
+    parseCommaSepArgs(argc, argv, "dt-test-case=",          p->filters[4]);
+    parseCommaSepArgs(argc, argv, "dt-tc=",                 p->filters[4]);
+    parseCommaSepArgs(argc, argv, "dt-test-case-exclude=",  p->filters[5]);
+    parseCommaSepArgs(argc, argv, "dt-tce=",                p->filters[5]);
+    // clang-format on
+
+    int    intRes = 0;
+    String strRes;
+
+#define DOCTEST_PARSE_AS_BOOL_OR_FLAG(name, sname, var, default)                                   \
+    if(parseIntOption(argc, argv, DOCTEST_STR_CONCAT_TOSTR(name, =), option_bool, intRes) ||       \
+       parseIntOption(argc, argv, DOCTEST_STR_CONCAT_TOSTR(sname, =), option_bool, intRes))        \
+        p->var = !!intRes;                                                                         \
+    else if(parseFlag(argc, argv, #name) || parseFlag(argc, argv, #sname))                         \
+        p->var = 1;                                                                                \
+    else if(withDefaults)                                                                          \
+    p->var = default
+
+#define DOCTEST_PARSE_INT_OPTION(name, sname, var, default)                                        \
+    if(parseIntOption(argc, argv, DOCTEST_STR_CONCAT_TOSTR(name, =), option_int, intRes) ||        \
+       parseIntOption(argc, argv, DOCTEST_STR_CONCAT_TOSTR(sname, =), option_int, intRes))         \
+        p->var = intRes;                                                                           \
+    else if(withDefaults)                                                                          \
+    p->var = default
+
+#define DOCTEST_PARSE_STR_OPTION(name, sname, var, default)                                        \
+    if(parseOption(argc, argv, DOCTEST_STR_CONCAT_TOSTR(name, =), strRes, default) ||              \
+       parseOption(argc, argv, DOCTEST_STR_CONCAT_TOSTR(sname, =), strRes, default) ||             \
+       withDefaults)                                                                               \
+    p->var = strRes
+
+    // clang-format off
+    DOCTEST_PARSE_STR_OPTION(dt-order-by, dt-ob, order_by, "file");
+    DOCTEST_PARSE_INT_OPTION(dt-rand-seed, dt-rs, rand_seed, 0);
+
+    DOCTEST_PARSE_INT_OPTION(dt-first, dt-f, first, 1);
+    DOCTEST_PARSE_INT_OPTION(dt-last, dt-l, last, 0);
+
+    DOCTEST_PARSE_INT_OPTION(dt-abort-after, dt-aa, abort_after, 0);
+
+    DOCTEST_PARSE_AS_BOOL_OR_FLAG(dt-success, dt-s, success, 0);
+    DOCTEST_PARSE_AS_BOOL_OR_FLAG(dt-case-sensitive, dt-cs, case_sensitive, 0);
+    DOCTEST_PARSE_AS_BOOL_OR_FLAG(dt-exit, dt-e, exit, 0);
+    DOCTEST_PARSE_AS_BOOL_OR_FLAG(dt-no-throw, dt-nt, no_throw, 0);
+    DOCTEST_PARSE_AS_BOOL_OR_FLAG(dt-no-exitcode, dt-ne, no_exitcode, 0);
+    DOCTEST_PARSE_AS_BOOL_OR_FLAG(dt-no-run, dt-nr, no_run, 0);
+    DOCTEST_PARSE_AS_BOOL_OR_FLAG(dt-no-version, dt-nv, no_version, 0);
+    DOCTEST_PARSE_AS_BOOL_OR_FLAG(dt-no-colors, dt-nc, no_colors, 0);
+    DOCTEST_PARSE_AS_BOOL_OR_FLAG(dt-force-colors, dt-fc, force_colors, 0);
+    DOCTEST_PARSE_AS_BOOL_OR_FLAG(dt-no-breaks, dt-nb, no_breaks, 0);
+    DOCTEST_PARSE_AS_BOOL_OR_FLAG(dt-no-path-filenames, dt-npf, no_path_in_filenames, 0);
+// clang-format on
+
+#undef DOCTEST_PARSE_STR_OPTION
+#undef DOCTEST_PARSE_INT_OPTION
+#undef DOCTEST_PARSE_AS_BOOL_OR_FLAG
+
+    if(withDefaults) {
+        p->help             = false;
+        p->version          = false;
+        p->count            = false;
+        p->list_test_cases  = false;
+        p->list_test_suites = false;
+    }
+    if(parseFlag(argc, argv, "dt-help") || parseFlag(argc, argv, "dt-h") ||
+       parseFlag(argc, argv, "dt-?")) {
+        p->help = true;
+        p->exit = true;
+    }
+    if(parseFlag(argc, argv, "dt-version") || parseFlag(argc, argv, "dt-v")) {
+        p->version = true;
+        p->exit    = true;
+    }
+    if(parseFlag(argc, argv, "dt-count") || parseFlag(argc, argv, "dt-c")) {
+        p->count = true;
+        p->exit  = true;
+    }
+    if(parseFlag(argc, argv, "dt-list-test-cases") || parseFlag(argc, argv, "dt-ltc")) {
+        p->list_test_cases = true;
+        p->exit            = true;
+    }
+    if(parseFlag(argc, argv, "dt-list-test-suites") || parseFlag(argc, argv, "dt-lts")) {
+        p->list_test_suites = true;
+        p->exit             = true;
+    }
+}
+
+// allows the user to add procedurally to the filters from the command line
+void Context::addFilter(const char* filter, const char* value) { setOption(filter, value); }
+
+// allows the user to clear all filters from the command line
+void Context::clearFilters() {
+    for(unsigned i = 0; i < p->filters.size(); ++i)
+        p->filters[i].clear();
+}
+
+// allows the user to override procedurally the int/bool options from the command line
+void Context::setOption(const char* option, int value) {
+    setOption(option, toString(value).c_str());
+}
+
+// allows the user to override procedurally the string options from the command line
+void Context::setOption(const char* option, const char* value) {
+    String      argv   = String("-") + option + "=" + value;
+    const char* lvalue = argv.c_str();
+    parseArgs(1, &lvalue);
+}
+
+// users should query this in their main() and exit the program if true
+bool Context::shouldExit() { return p->exit; }
+
+// the main function that does all the filtering and test running
+int Context::run() {
+    using namespace detail;
+
+    getContextState() = p;
+    p->resetRunData();
+
+    // handle version, help and no_run
+    if(p->no_run || p->version || p->help) {
+        if(p->version)
+            printVersion();
+        if(p->help)
+            printHelp();
+
+        getContextState() = 0;
+
+        return EXIT_SUCCESS;
+    }
+
+    printVersion();
+    DOCTEST_PRINTF_COLORED("[doctest] ", Color::Cyan);
+    printf("run with \"--help\" for options\n");
+
+    unsigned i = 0; // counter used for loops - here for VC6
+
+    std::set<TestData>& registeredTests = getRegisteredTests();
+
+    std::vector<const TestData*> testArray;
+    for(std::set<TestData>::iterator it = registeredTests.begin(); it != registeredTests.end();
+        ++it)
+        testArray.push_back(&(*it));
+
+    // sort the collected records
+    if(testArray.size() > 0) {
+        if(p->order_by.compare("file", true) == 0) {
+            qsort(&testArray[0], testArray.size(), sizeof(TestData*), fileOrderComparator);
+        } else if(p->order_by.compare("suite", true) == 0) {
+            qsort(&testArray[0], testArray.size(), sizeof(TestData*), suiteOrderComparator);
+        } else if(p->order_by.compare("name", true) == 0) {
+            qsort(&testArray[0], testArray.size(), sizeof(TestData*), nameOrderComparator);
+        } else if(p->order_by.compare("rand", true) == 0) {
+            srand(p->rand_seed);
+
+            // random_shuffle implementation
+            const TestData** first = &testArray[0];
+            for(i = testArray.size() - 1; i > 0; --i) {
+                int idxToSwap = rand() % (i + 1);
+
+                const TestData* temp = first[i];
+
+                first[i]         = first[idxToSwap];
+                first[idxToSwap] = temp;
+            }
+        }
+    }
+
+    if(p->list_test_cases) {
+        DOCTEST_PRINTF_COLORED("[doctest] ", Color::Cyan);
+        printf("listing all test case names\n");
+    }
+
+    std::set<String> testSuitesPassingFilters;
+    if(p->list_test_suites) {
+        DOCTEST_PRINTF_COLORED("[doctest] ", Color::Cyan);
+        printf("listing all test suites\n");
+    }
+
+    unsigned numTestsPassingFilters = 0;
+    unsigned numFailed              = 0;
+    // invoke the registered functions if they match the filter criteria (or just count them)
+    for(i = 0; i < testArray.size(); i++) {
+        const TestData& data = *testArray[i];
+        if(!matchesAny(data.m_file, p->filters[0], 1, p->case_sensitive))
+            continue;
+        if(matchesAny(data.m_file, p->filters[1], 0, p->case_sensitive))
+            continue;
+        if(!matchesAny(data.m_suite, p->filters[2], 1, p->case_sensitive))
+            continue;
+        if(matchesAny(data.m_suite, p->filters[3], 0, p->case_sensitive))
+            continue;
+        if(!matchesAny(data.m_name, p->filters[4], 1, p->case_sensitive))
+            continue;
+        if(matchesAny(data.m_name, p->filters[5], 0, p->case_sensitive))
+            continue;
+
+        numTestsPassingFilters++;
+
+        // do not execute the test if we are to only count the number of filter passing tests
+        if(p->count)
+            continue;
+
+        // print the name of the test and don't execute it
+        if(p->list_test_cases) {
+            printf("%s\n", data.m_name);
+            continue;
+        }
+
+        // print the name of the test suite if not done already and don't execute it
+        if(p->list_test_suites) {
+            if(testSuitesPassingFilters.count(data.m_suite) == 0) {
+                printf("%s\n", data.m_suite);
+                testSuitesPassingFilters.insert(data.m_suite);
+            }
+            continue;
+        }
+
+        // skip the test if it is not in the execution range
+        if((p->last < numTestsPassingFilters && p->first <= p->last) ||
+           (p->first > numTestsPassingFilters))
+            continue;
+
+        // execute the test if it passes all the filtering
+        {
+#ifdef _MSC_VER
+//__try {
+#endif // _MSC_VER
+
+            p->currentTest = &data;
+
+            // if logging successful tests - force the start log
+            p->hasLoggedCurrentTestStart = false;
+            if(p->success)
+                DOCTEST_LOG_START();
+
+            unsigned didFail = 0;
+            p->subcasesPassed.clear();
+            do {
+                // reset the assertion state
+                p->numAssertionsForCurrentTestcase       = 0;
+                p->numFailedAssertionsForCurrentTestcase = 0;
+
+                // reset some of the fields for subcases (except for the set of fully passed ones)
+                p->subcasesHasSkipped   = false;
+                p->subcasesCurrentLevel = 0;
+                p->subcasesEnteredLevels.clear();
+
+                // execute the test
+                didFail += callTestFunc(data.m_f);
+                p->numAssertions += p->numAssertionsForCurrentTestcase;
+
+                // exit this loop if enough assertions have failed
+                if(p->abort_after > 0 && p->numFailedAssertions >= p->abort_after)
+                    p->subcasesHasSkipped = false;
+
+                // if the start has been logged
+                if(p->hasLoggedCurrentTestStart)
+                    logTestEnd();
+                p->hasLoggedCurrentTestStart = false;
+
+            } while(p->subcasesHasSkipped == true);
+
+            if(didFail > 0)
+                numFailed++;
+
+            // stop executing tests if enough assertions have failed
+            if(p->abort_after > 0 && p->numFailedAssertions >= p->abort_after)
+                break;
+
+#ifdef _MSC_VER
+//} __except(1) {
+//    printf("Unknown SEH exception caught!\n");
+//    numFailed++;
+//}
+#endif // _MSC_VER
+        }
+    }
+
+    DOCTEST_PRINTF_COLORED(getSeparator(), numFailed > 0 ? Color::Red : Color::Green);
+    if(p->count || p->list_test_cases || p->list_test_suites) {
+        DOCTEST_PRINTF_COLORED("[doctest] ", Color::Cyan);
+        printf("number of tests passing the current filters: %d\n", numTestsPassingFilters);
+    } else {
+        char buff[DOCTEST_SNPRINTF_BUFFER_LENGTH];
+
+        DOCTEST_PRINTF_COLORED("[doctest] ", Color::Cyan);
+
+        DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), "test cases: %4d", numTestsPassingFilters);
+        DOCTEST_PRINTF_COLORED(buff, Color::None);
+        DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), " | ");
+        DOCTEST_PRINTF_COLORED(buff, Color::None);
+        DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), "%4d passed",
+                         numTestsPassingFilters - numFailed);
+        DOCTEST_PRINTF_COLORED(buff, numFailed > 0 ? Color::None : Color::Green);
+        DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), " | ");
+        DOCTEST_PRINTF_COLORED(buff, Color::None);
+        DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), "%4d failed", numFailed);
+        DOCTEST_PRINTF_COLORED(buff, numFailed > 0 ? Color::Red : Color::None);
+
+        DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), " | ");
+        DOCTEST_PRINTF_COLORED(buff, Color::None);
+        DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), "%4d skipped\n",
+                         static_cast<unsigned>(testArray.size()) - numTestsPassingFilters);
+        DOCTEST_PRINTF_COLORED(buff, Color::None);
+
+        DOCTEST_PRINTF_COLORED("[doctest] ", Color::Cyan);
+
+        DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), "assertions: %4d", p->numAssertions);
+        DOCTEST_PRINTF_COLORED(buff, Color::None);
+        DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), " | ");
+        DOCTEST_PRINTF_COLORED(buff, Color::None);
+        DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), "%4d passed",
+                         p->numAssertions - p->numFailedAssertions);
+        DOCTEST_PRINTF_COLORED(buff, numFailed > 0 ? Color::None : Color::Green);
+        DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), " | ");
+        DOCTEST_PRINTF_COLORED(buff, Color::None);
+        DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), "%4d failed", p->numFailedAssertions);
+        DOCTEST_PRINTF_COLORED(buff, p->numFailedAssertions > 0 ? Color::Red : Color::None);
+
+        DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), " |\n");
+        DOCTEST_PRINTF_COLORED(buff, Color::None);
+    }
+
+    // remove any coloring
+    DOCTEST_PRINTF_COLORED("", Color::None);
+
+    getContextState() = 0;
+
+    if(numFailed && !p->no_exitcode)
+        return EXIT_FAILURE;
+    return EXIT_SUCCESS;
+}
+} // namespace doctest
+
+#endif // DOCTEST_CONFIG_DISABLE
+#endif // DOCTEST_LIBRARY_IMPLEMENTATION
+#endif // DOCTEST_CONFIG_IMPLEMENT
+
+// == THIS SUPPLIES A MAIN FUNCTION AND SHOULD BE DONE ONLY IN ONE TRANSLATION UNIT
+#if defined(DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN) && !defined(DOCTEST_MAIN_CONFIGURED)
+#define DOCTEST_MAIN_CONFIGURED
+int main(int argc, char** argv) { return doctest::Context(argc, argv).run(); }
+#endif // DOCTEST_MAIN_CONFIGURED
+
+#if defined(__clang__)
+#pragma clang diagnostic pop
+#endif // __clang__
+
+#if defined(__GNUC__) && !defined(__clang__)
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 6)
+#pragma GCC diagnostic pop
+#endif // > gcc 4.6
+#endif // __GNUC__
+
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif // _MSC_VER
diff --git a/test/test_distributions.cpp b/test/test_distributions.cpp
index 20257b4..4fddb08 100644
--- a/test/test_distributions.cpp
+++ b/test/test_distributions.cpp
@@ -43,7 +43,7 @@ knowledge of the CeCILL license and that you accept its terms.
 using namespace bpp;
 using namespace std;
 
-void testSumProbs(const DiscreteDistribution& dist) throw (Exception) {
+void testSumProbs(const DiscreteDistribution& dist) {
   cout << "Test sum of probabilities: ";
   cout.flush();
   double s = VectorTools::sum(dist.getProbabilities());
@@ -52,7 +52,7 @@ void testSumProbs(const DiscreteDistribution& dist) throw (Exception) {
   cout << "ok" << endl;
 }
 
-void testEqualProbs(const DiscreteDistribution& dist) throw (Exception) {
+void testEqualProbs(const DiscreteDistribution& dist) {
   cout << "Test equality of probabilities: ";
   cout.flush();
   for (size_t i = 1; i < dist.getNumberOfCategories(); ++i)
diff --git a/test/test_graphObs.cpp b/test/test_graphObs.cpp
index 769c4bc..e1ce2b0 100644
--- a/test/test_graphObs.cpp
+++ b/test/test_graphObs.cpp
@@ -44,7 +44,10 @@ using namespace bpp;
 using namespace std;
 
 int main() {
-  AssociationGlobalGraphObserver<string,unsigned int> grObs(true);
+
+  typedef AssociationGlobalGraphObserver<string,unsigned int>  si_Graph;
+  
+  si_Graph grObs(true);
   shared_ptr<string> zero(new string("zero"));
   shared_ptr<string> one(new string("one"));
   shared_ptr<string> two(new string("two"));
@@ -81,7 +84,7 @@ int main() {
   cout << endl;
   cout << "Iteration on all nodes:" << endl;
   
-  unique_ptr<AssociationGlobalGraphObserver<string, unsigned int>::NodeIterator> nIt=grObs.allNodesIterator();
+  unique_ptr<si_Graph::NodeIterator> nIt=grObs.allNodesIterator();
 
   for (;!nIt->end();nIt->next())
   {
@@ -91,7 +94,7 @@ int main() {
   cout << endl;
   cout << "Iteration on all edges:" << endl;
   
-  unique_ptr<AssociationGlobalGraphObserver<string, unsigned int>::EdgeIterator> eIt=grObs.allEdgesIterator();
+  unique_ptr<si_Graph::EdgeIterator> eIt=grObs.allEdgesIterator();
 
   for (;!eIt->end();eIt->next())
   {
@@ -101,7 +104,7 @@ int main() {
   cout << endl;
   cout << "Iteration on outgoing nodes neighbor of 1:" << endl;
   
-  unique_ptr<AssociationGlobalGraphObserver<string, unsigned int>::NodeIterator> on1It=grObs.outgoingNeighborNodesIterator(one);
+  unique_ptr<si_Graph::NodeIterator> on1It=grObs.outgoingNeighborNodesIterator(one);
 
   for (;!on1It->end();on1It->next())
   {
@@ -111,7 +114,7 @@ int main() {
   cout << endl;
   cout << "Iteration on incoming nodes neighbor of 0:" << endl;
   
-  unique_ptr<AssociationGlobalGraphObserver<string, unsigned int>::NodeIterator> in0It=grObs.incomingNeighborNodesIterator(zero);
+  unique_ptr<si_Graph::NodeIterator> in0It=grObs.incomingNeighborNodesIterator(zero);
 
   for (;!in0It->end();in0It->next())
   {
@@ -121,7 +124,7 @@ int main() {
   cout << endl;
   cout << "Iteration on outgoing edges neighbor of 1:" << endl;
   
-  unique_ptr<AssociationGlobalGraphObserver<string, unsigned int>::EdgeIterator> oe1It=grObs.outgoingEdgesIterator(one);
+  unique_ptr<si_Graph::EdgeIterator> oe1It=grObs.outgoingEdgesIterator(one);
 
   for (;!oe1It->end();oe1It->next())
   {
@@ -132,13 +135,27 @@ int main() {
   
   cout << "Iteration on incoming edges neighbor of 0:" << endl;
   
-  unique_ptr<AssociationGlobalGraphObserver<string, unsigned int>::EdgeIterator> ie0It=grObs.incomingEdgesIterator(zero);
+  unique_ptr<si_Graph::EdgeIterator> ie0It=grObs.incomingEdgesIterator(zero);
 
   for (;!ie0It->end();ie0It->next())
   {
     cout << ***ie0It << endl;
   }
 
-    
+  cout << endl;
+  
+  cout << "Test const Iterator on all edges:" << endl;
+
+  
+  const si_Graph& grObs_const=grObs;
+  
+  unique_ptr<si_Graph::EdgeIterator> eIt_const=grObs_const.allEdgesIterator();
+
+  for (;!eIt_const->end();eIt_const->next())
+  {
+    cout << ***eIt_const << endl;
+  }
+
+  cout << endl;
   return (test ? 0 : 1);
 }
diff --git a/test/test_reparametrization.cpp b/test/test_reparametrization.cpp
index c503ca8..6138e5b 100644
--- a/test/test_reparametrization.cpp
+++ b/test/test_reparametrization.cpp
@@ -64,12 +64,11 @@ class MyFunction:
     MyFunction* clone() const { return new MyFunction(*this); }
  
   public:
-    void setParameters(const ParameterList& pl) 
-        throw (ParameterNotFoundException, ConstraintException, Exception)
+    void setParameters(const ParameterList& pl)
     {
       matchParametersValues(pl);
     }
-    double getValue() const throw (Exception) { return fval_; }
+    double getValue() const { return fval_; }
  
     void fireParameterChanged(const ParameterList& pl) {
       double x = getParameterValue("x");
diff --git a/test/test_text_tools.cpp b/test/test_text_tools.cpp
index c466711..76eb40a 100644
--- a/test/test_text_tools.cpp
+++ b/test/test_text_tools.cpp
@@ -1,112 +1,219 @@
 //
 // File: test_text_tools.cpp
-// Created by: Julien Dutheil
-// Created on: Mon Nov 5 16:12 2011
+// Authors:
+//   Julien Dutheil
+//   Francois Gindraud (2017)
+// Created: 2011-11-05 16:12:00
+// Last modified: 2017-06-26
 //
 
 /*
-Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
+  Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
+  
+  This software is a computer program whose purpose is to provide classes
+  for numerical calculus. This file is part of the Bio++ project.
+  
+  This software is governed by the CeCILL license under French law and
+  abiding by the rules of distribution of free software. You can use,
+  modify and/ or redistribute the software under the terms of the CeCILL
+  license as circulated by CEA, CNRS and INRIA at the following URL
+  "http://www.cecill.info".
+  
+  As a counterpart to the access to the source code and rights to copy,
+  modify and redistribute granted by the license, users are provided only
+  with a limited warranty and the software's author, the holder of the
+  economic rights, and the successive licensors have only limited
+  liability.
+  
+  In this respect, the user's attention is drawn to the risks associated
+  with loading, using, modifying and/or developing or reproducing the
+  software by the user in light of its specific status of free software,
+  that may mean that it is complicated to manipulate, and that also
+  therefore means that it is reserved for developers and experienced
+  professionals having in-depth computer knowledge. Users are therefore
+  encouraged to load and test the software's suitability as regards their
+  requirements in conditions enabling the security of their systems and/or
+  data to be ensured and, more generally, to use and operate it in the
+  same conditions as regards security.
+  
+  The fact that you are presently reading this means that you have had
+  knowledge of the CeCILL license and that you accept its terms.
+*/
 
-This software is a computer program whose purpose is to provide classes
-for numerical calculus. This file is part of the Bio++ project.
+#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
+#include "doctest.h"
 
-This software is governed by the CeCILL  license under French law and
-abiding by the rules of distribution of free software.  You can  use, 
-modify and/ or redistribute the software under the terms of the CeCILL
-license as circulated by CEA, CNRS and INRIA at the following URL
-"http://www.cecill.info". 
+#include <Bpp/Text/StringTokenizer.h>
+#include <Bpp/Text/TextTools.h>
+#include <iostream>
+#include <string>
 
-As a counterpart to the access to the source code and  rights to copy,
-modify and redistribute granted by the license, users are provided only
-with a limited warranty  and the software's author,  the holder of the
-economic rights,  and the successive licensors  have only  limited
-liability. 
+namespace TextTools = bpp::TextTools;
+using bpp::StringTokenizer;
 
-In this respect, the user's attention is drawn to the risks associated
-with loading,  using,  modifying and/or developing or reproducing the
-software by the user in light of its specific status of free software,
-that may mean  that it is complicated to manipulate,  and  that  also
-therefore means  that it is reserved for developers  and  experienced
-professionals having in-depth computer knowledge. Users are therefore
-encouraged to load and test the software's suitability as regards their
-requirements in conditions enabling the security of their systems and/or 
-data to be ensured and,  more generally, to use and operate it in the 
-same conditions as regards security. 
+TEST_CASE("string capitalization")
+{
+  CHECK(TextTools::toUpper("aBcDEF ") == "ABCDEF ");
+  CHECK(TextTools::toLower("aBcDEF ") == "abcdef ");
+}
 
-The fact that you are presently reading this means that you have had
-knowledge of the CeCILL license and that you accept its terms.
-*/
+TEST_CASE("string stripping")
+{
+  std::string base_text = "abc def";
+  std::string base_text_no_spaces = "abcdef";
 
-#include <Bpp/Text/TextTools.h>
-#include <Bpp/Text/StringTokenizer.h>
-#include <iostream>
+  std::string empty = "";
+  std::string all_space = " \t\n";
+  std::string no_space = base_text;
+  std::string leading_space_only = "  " + base_text;
+  std::string trailing_space_only = base_text + "  ";
+  std::string multi_space = "  " + base_text + "  ";
 
-using namespace bpp;
-using namespace std;
+  SUBCASE("Remove all whitespace")
+  {
+    CHECK(TextTools::removeWhiteSpaces(empty) == empty);
+    CHECK(TextTools::removeWhiteSpaces(all_space) == empty);
+    CHECK(TextTools::removeWhiteSpaces(no_space) == base_text_no_spaces);
+    CHECK(TextTools::removeWhiteSpaces(leading_space_only) == base_text_no_spaces);
+    CHECK(TextTools::removeWhiteSpaces(trailing_space_only) == base_text_no_spaces);
+    CHECK(TextTools::removeWhiteSpaces(multi_space) == base_text_no_spaces);
+  }
+  SUBCASE("Remove leading space")
+  {
+    CHECK(TextTools::removeFirstWhiteSpaces(empty) == "");
+    CHECK(TextTools::removeFirstWhiteSpaces(all_space) == "");
+    CHECK(TextTools::removeFirstWhiteSpaces(no_space) == base_text);
+    CHECK(TextTools::removeFirstWhiteSpaces(leading_space_only) == base_text);
+    CHECK(TextTools::removeFirstWhiteSpaces(trailing_space_only) == trailing_space_only);
+    CHECK(TextTools::removeFirstWhiteSpaces(multi_space) == trailing_space_only);
+  }
+  SUBCASE("Remove trailing space")
+  {
+    CHECK(TextTools::removeLastWhiteSpaces(empty) == "");
+    CHECK(TextTools::removeLastWhiteSpaces(all_space) == "");
+    CHECK(TextTools::removeLastWhiteSpaces(no_space) == base_text);
+    CHECK(TextTools::removeLastWhiteSpaces(leading_space_only) == leading_space_only);
+    CHECK(TextTools::removeLastWhiteSpaces(trailing_space_only) == base_text);
+    CHECK(TextTools::removeLastWhiteSpaces(multi_space) == leading_space_only);
+  }
+  SUBCASE("Remove leading and trailing space")
+  {
+    CHECK(TextTools::removeSurroundingWhiteSpaces(empty) == "");
+    CHECK(TextTools::removeSurroundingWhiteSpaces(all_space) == "");
+    CHECK(TextTools::removeSurroundingWhiteSpaces(no_space) == base_text);
+    CHECK(TextTools::removeSurroundingWhiteSpaces(leading_space_only) == base_text);
+    CHECK(TextTools::removeSurroundingWhiteSpaces(trailing_space_only) == base_text);
+    CHECK(TextTools::removeSurroundingWhiteSpaces(multi_space) == base_text);
+  }
+}
 
-int main()
+TEST_CASE("string conversion")
 {
-  cout << "Testing string conversion..." << endl;
-  if ( TextTools::isDecimalNumber("aazz")) { cout << "aazz is not a decimal number!" << endl; return 1; }
-  if ( TextTools::isDecimalNumber("-aazz")) { cout << "-aazz is not a decimal number!" << endl; return 1; }
-  if ( TextTools::isDecimalNumber("-3.45z")) { cout << "-3.45z is not a decimal number!" << endl; return 1; }
-  if (!TextTools::isDecimalNumber("0")) { cout << "0 is a decimal number!" << endl; return 1; }
-  if (!TextTools::isDecimalNumber("123")) { cout << "123 is a decimal number!" << endl; return 1; }
-  if (!TextTools::isDecimalNumber("-123")) { cout << "-123 is a decimal number!" << endl; return 1; }
-  if (!TextTools::isDecimalNumber("-123.456")) { cout << "-123.456 is a decimal number!" << endl; return 1; }
-  if (!TextTools::isDecimalInteger("123456")) { cout << "123456 is a decimal integer!" << endl; return 1; }
-  if (!TextTools::isDecimalInteger("-7890")) { cout << "-7890 is a decimal integer!" << endl; return 1; }
-  if (!TextTools::isDecimalNumber("-123.456e-5")) { cout << "-123.456e-5 is a decimal number!" << endl; return 1; }
-  if ( TextTools::isDecimalNumber("-123.456e-5.8")) { cout << "-123.456e-5.8 is not a decimal number!" << endl; return 1; }
-  if (!TextTools::isDecimalInteger("-123e6")) { cout << "-123e6 is a decimal integer!" << endl; return 1; }
-  if ( TextTools::isDecimalInteger("-123.456e5")) { cout << "-123.456e5 is not a decimal integer!" << endl; return 1; }
-  if ( TextTools::isDecimalInteger("-123e-6")) { cout << "-123e-6 is not a decimal integer!" << endl; return 1; }
+  CHECK_FALSE(TextTools::isDecimalNumber("aazz"));
+  CHECK_FALSE(TextTools::isDecimalNumber("-aazz"));
+  CHECK_FALSE(TextTools::isDecimalNumber("-3.45z"));
+  CHECK(TextTools::isDecimalNumber("0"));
+  CHECK(TextTools::isDecimalNumber("123"));
+  CHECK(TextTools::isDecimalNumber("-123"));
+  CHECK(TextTools::isDecimalNumber("-123.456"));
+  CHECK(TextTools::isDecimalInteger("123456"));
+  CHECK(TextTools::isDecimalInteger("-7890"));
+  CHECK(TextTools::isDecimalNumber("-123.456e-5"));
+  CHECK_FALSE(TextTools::isDecimalNumber("-123.456e-5.8"));
+  CHECK(TextTools::isDecimalInteger("-123e6"));
+  CHECK_FALSE(TextTools::isDecimalInteger("-123.456e5"));
+  CHECK_FALSE(TextTools::isDecimalInteger("-123e-6"));
+}
 
-  cout << "Testing string tokenizer..." << endl;
-  string t;
-  StringTokenizer st1(" aaazzer  aeerd a    eer", " \t", false, false);
-  if (st1.numberOfRemainingTokens() != 4) return 1;
-  cout << (t = st1.nextToken()) << endl;
-  if (t != "aaazzer") return 1;
-  cout << (t = st1.nextToken()) << endl;
-  if (t != "aeerd") return 1;
-  cout << (t = st1.nextToken()) << endl;
-  if (t != "a") return 1;
-  cout << (t = st1.nextToken()) << endl;
-  if (t != "eer") return 1;
+TEST_CASE("string resizing")
+{
+  std::string t = "hello world";
+  CHECK(TextTools::resizeRight(t, 4) == "hell");
+  CHECK(TextTools::resizeRight(t, 20) == t + std::string(20 - t.size(), ' '));
+  CHECK(TextTools::resizeLeft(t, 4) == "orld");
+  CHECK(TextTools::resizeLeft(t, 20) == std::string(20 - t.size(), ' ') + t);
+}
+
+TEST_CASE("string splitting")
+{
+  std::vector<std::string> r1 {"hell", "o wo", "rld"};
+  CHECK(TextTools::split("hello world", 4) == r1);
+  std::vector<std::string> r2 {"hell", "o wo", "rld!"};
+  CHECK(TextTools::split("hello world!", 4) == r2);
+}
+
+TEST_CASE("string search")
+{
+  std::string t = "hello world world !";
+
+  SUBCASE("startswith")
+  {
+    CHECK(TextTools::startsWith(t, "hello"));
+    CHECK_FALSE(TextTools::startsWith(t, "blah"));
+    CHECK(TextTools::startsWith(t, ""));
+    CHECK_FALSE(TextTools::startsWith("", "blah"));
+  }
+  SUBCASE("endswith")
+  {
+    CHECK(TextTools::endsWith(t, "world !"));
+    CHECK_FALSE(TextTools::endsWith(t, "blah"));
+    CHECK(TextTools::endsWith(t, ""));
+    CHECK_FALSE(TextTools::endsWith("", "blah"));
+  }
+  SUBCASE("hasSubstring")
+  {
+    CHECK(TextTools::hasSubstring(t, "world"));
+    CHECK_FALSE(TextTools::hasSubstring(t, "blah"));
+    CHECK(TextTools::hasSubstring(t, ""));
+    CHECK_FALSE(TextTools::hasSubstring("", "blah"));
+  }
+  SUBCASE("count")
+  {
+    CHECK(TextTools::count(t, "world") == 2);
+    CHECK(TextTools::count(t, "blah") == 0);
+    CHECK(TextTools::count(t, "hell") == 1);
+    CHECK(TextTools::count("", "blah") == 0);
+  }
+}
 
-  StringTokenizer st2(" aaazzer  aeerd a    eer", " \t", false, true);
-  if (st2.numberOfRemainingTokens() != 8) return 1;
-  cout << (t = st2.nextToken()) << endl;
-  if (t != "aaazzer") return 1;
-  cout << (t = st2.nextToken()) << endl;
-  if (t != "") return 1;
-  cout << (t = st2.nextToken()) << endl;
-  if (t != "aeerd") return 1;
-  cout << (t = st2.nextToken()) << endl;
-  if (t != "a") return 1;
-  cout << (t = st2.nextToken()) << endl;
-  if (t != "") return 1;
-  cout << (t = st2.nextToken()) << endl;
-  if (t != "") return 1;
-  cout << (t = st2.nextToken()) << endl;
-  if (t != "") return 1;
-  cout << (t = st2.nextToken()) << endl;
-  if (t != "eer") return 1;
- 
-  StringTokenizer st3(" aaazzer  aeerd a    eer", " \t", true, false);
-  if (st3.numberOfRemainingTokens() != 1) return 1;
-  cout << (t = st3.nextToken()) << endl;
-  if (t != " aaazzer  aeerd a    eer") return 1;
+TEST_CASE("string replace")
+{
+  std::string t = "hello world world !";
+  TextTools::replaceAll (t, "world", "sun");
+  CHECK (t == "hello sun sun !");
+  std::string t2 = "hell";
+  TextTools::replaceAll (t2, "world", "sun");
+  CHECK (t2 == "hell");
+}
 
-  StringTokenizer st4(" aaazzer  aeerd a    eer", " \t", false, false);
-  cout << st4.nextToken() << "+";
-  cout << st4.unparseRemainingTokens() << endl;
-  cout << st4.nextToken() << "+";
-  cout << st4.unparseRemainingTokens() << endl;
-  cout << st4.nextToken() << "+";
-  cout << st4.unparseRemainingTokens() << endl;
-  cout << st4.nextToken() << "+";
-  cout << st4.unparseRemainingTokens() << endl;
-  return 0;
+TEST_CASE("string tokenizer")
+{
+  SUBCASE("Case 1")
+  {
+    StringTokenizer st(" aaazzer  aeerd a    eer", " \t", false, false);
+    CHECK(st.numberOfRemainingTokens() == 4);
+    CHECK(st.nextToken() == "aaazzer");
+    CHECK(st.nextToken() == "aeerd");
+    CHECK(st.nextToken() == "a");
+    CHECK(st.nextToken() == "eer");
+  }
+  SUBCASE("Case 2")
+  {
+    StringTokenizer st(" aaazzer  aeerd a    eer", " \t", false, true);
+    CHECK(st.numberOfRemainingTokens() == 8);
+    CHECK(st.nextToken() == "aaazzer");
+    CHECK(st.nextToken() == "");
+    CHECK(st.nextToken() == "aeerd");
+    CHECK(st.nextToken() == "a");
+    CHECK(st.nextToken() == "");
+    CHECK(st.nextToken() == "");
+    CHECK(st.nextToken() == "");
+    CHECK(st.nextToken() == "eer");
+  }
+  SUBCASE("Case 3")
+  {
+    StringTokenizer st(" aaazzer  aeerd a    eer", " \t", true, false);
+    CHECK(st.numberOfRemainingTokens() == 1);
+    CHECK(st.nextToken() == " aaazzer  aeerd a    eer");
+  }
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/libbpp-core.git



More information about the debian-med-commit mailing list