summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Lecher <jlec@gentoo.org>2014-03-26 13:27:45 +0000
committerJustin Lecher <jlec@gentoo.org>2014-03-26 13:27:45 +0000
commit35a59ca07bf11341931084675cfd8818934a2495 (patch)
tree91901455455c64bf600824f18528cac4cd0ecb52 /sci-chemistry
parentsci-chemistry/ball: Drop old, fixes #485830, #505856 (diff)
downloadgentoo-2-35a59ca07bf11341931084675cfd8818934a2495.tar.gz
gentoo-2-35a59ca07bf11341931084675cfd8818934a2495.tar.bz2
gentoo-2-35a59ca07bf11341931084675cfd8818934a2495.zip
sci-chemistry/ball: Drop old, fixes #485830, #505856
(Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key B9D4F231BD1558AB!)
Diffstat (limited to 'sci-chemistry')
-rw-r--r--sci-chemistry/ball/ChangeLog12
-rw-r--r--sci-chemistry/ball/ball-1.4.1-r1.ebuild87
-rw-r--r--sci-chemistry/ball/files/ball-1.4.1-Added-MAX_PENALTY-option-to-bond-order-assignment.patch975
-rw-r--r--sci-chemistry/ball/files/ball-1.4.1-Fix-compilation-of-FTPBondOrderStrategy-Fixes-451.patch138
-rw-r--r--sci-chemistry/ball/files/ball-1.4.1-Fix-compilation-of-Python-bindings-with-new-sip-vers.patch25
-rw-r--r--sci-chemistry/ball/files/ball-1.4.1-Fixed-a-bug-in-the-AssignBondOrderProcessor.patch271
-rw-r--r--sci-chemistry/ball/files/ball-1.4.1-Fixed-the-FPT-version-of-bond-order-assignment-2.patch444
-rw-r--r--sci-chemistry/ball/files/ball-1.4.1-gcc-4.7.patch592
-rw-r--r--sci-chemistry/ball/files/ball-1.4.1-libsvm.patch24
-rw-r--r--sci-chemistry/ball/files/ball-1.4.1-pthread.patch19
-rw-r--r--sci-chemistry/ball/files/ball-1.4.1-python.patch82
11 files changed, 11 insertions, 2658 deletions
diff --git a/sci-chemistry/ball/ChangeLog b/sci-chemistry/ball/ChangeLog
index 86793ce83543..8ba4f0172e09 100644
--- a/sci-chemistry/ball/ChangeLog
+++ b/sci-chemistry/ball/ChangeLog
@@ -1,6 +1,16 @@
# ChangeLog for sci-chemistry/ball
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/ball/ChangeLog,v 1.13 2014/03/26 11:20:39 jlec Exp $
+# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/ball/ChangeLog,v 1.14 2014/03/26 13:27:44 jlec Exp $
+
+ 26 Mar 2014; Justin Lecher <jlec@gentoo.org> -ball-1.4.1-r1.ebuild,
+ -files/ball-1.4.1-Added-MAX_PENALTY-option-to-bond-order-assignment.patch,
+ -files/ball-1.4.1-Fix-compilation-of-FTPBondOrderStrategy-Fixes-451.patch,
+ -files/ball-1.4.1-Fix-compilation-of-Python-bindings-with-new-sip-vers.patch,
+ -files/ball-1.4.1-Fixed-a-bug-in-the-AssignBondOrderProcessor.patch,
+ -files/ball-1.4.1-Fixed-the-FPT-version-of-bond-order-assignment-2.patch,
+ -files/ball-1.4.1-gcc-4.7.patch, -files/ball-1.4.1-libsvm.patch,
+ -files/ball-1.4.1-pthread.patch, -files/ball-1.4.1-python.patch:
+ Drop old, fixes #485830, #505856
*ball-1.4.2 (26 Mar 2014)
diff --git a/sci-chemistry/ball/ball-1.4.1-r1.ebuild b/sci-chemistry/ball/ball-1.4.1-r1.ebuild
deleted file mode 100644
index ba23080fc497..000000000000
--- a/sci-chemistry/ball/ball-1.4.1-r1.ebuild
+++ /dev/null
@@ -1,87 +0,0 @@
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/ball/ball-1.4.1-r1.ebuild,v 1.7 2014/03/26 11:20:39 jlec Exp $
-
-EAPI=5
-
-PYTHON_COMPAT=( python{2_6,2_7} )
-
-inherit cmake-utils python-single-r1
-
-DESCRIPTION="Biochemical Algorithms Library"
-HOMEPAGE="http://www.ball-project.org/"
-SRC_URI="http://dev.gentoo.org/~jlec/distfiles/${P}.tar.gz"
-
-SLOT="0"
-LICENSE="LGPL-2 GPL-3"
-KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
-IUSE="cuda mpi +python sql test +threads +webkit"
-
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
-
-RDEPEND="
- dev-cpp/eigen:3
- dev-libs/boost
- dev-qt/qtcore:4
- dev-qt/qtgui:4
- dev-qt/qtopengl:4
- dev-qt/qttest:4
- dev-qt/qtwebkit:4
- media-libs/glew
- sci-libs/fftw:3.0[threads?]
- sci-libs/gsl
- sci-libs/libsvm
- sci-mathematics/lpsolve
- virtual/opengl
- x11-libs/libX11
- cuda? ( dev-util/nvidia-cuda-toolkit )
- mpi? ( virtual/mpi )
- python? ( ${PYTHON_DEPS} )
- sql? ( dev-qt/qtsql:4 )
- webkit? ( dev-qt/qtwebkit:4 )"
-DEPEND="${RDEPEND}
- dev-python/sip
- sys-devel/bison
- virtual/yacc"
-
-S="${WORKDIR}"/BALL
-
-PATCHES=(
- "${FILESDIR}"/${P}-multilib.patch
- "${FILESDIR}"/${P}-libsvm.patch
- "${FILESDIR}"/${P}-pthread.patch
- "${FILESDIR}"/${P}-python.patch
- "${FILESDIR}"/${P}-missing-signed.patch
- "${FILESDIR}"/${P}-gcc-4.7.patch
- "${FILESDIR}"/${P}-BondOrder.xml.patch
- "${FILESDIR}"/${P}-Fixed-the-FPT-version-of-bond-order-assignment-2.patch
- "${FILESDIR}"/${P}-Added-MAX_PENALTY-option-to-bond-order-assignment.patch
- "${FILESDIR}"/${P}-Fixed-a-bug-in-the-AssignBondOrderProcessor.patch
- "${FILESDIR}"/${P}-Fix-compilation-of-Python-bindings-with-new-sip-vers.patch
- )
-
-pkg_setup() {
- use python && python-single-r1_pkg_setup
-}
-
-src_configure() {
- local mycmakeargs=(
- $(cmake-utils_use_use threads FFTW_THREADS)
- $(cmake-utils_use cuda MT_ENABLE_CUDA)
- $(cmake-utils_use mpi MT_ENABLE_MPI)
- $(cmake-utils_use sql BALL_HAS_QTSQL)
- $(cmake-utils_use_use webkit USE_QTWEBKIT)
- $(cmake-utils_use python BALL_PYTHON_SUPPORT)
- )
- cmake-utils_src_configure
- local i
- for i in "${S}"/data/*; do
- ln -sf "${i}" "${BUILD_DIR}"/source/TEST/ || die
- ln -sf "${i}" "${S}"/source/TEST/ || die
- done
-}
-
-src_compile() {
- cmake-utils_src_compile
- use test && cmake-utils_src_make build_tests
-}
diff --git a/sci-chemistry/ball/files/ball-1.4.1-Added-MAX_PENALTY-option-to-bond-order-assignment.patch b/sci-chemistry/ball/files/ball-1.4.1-Added-MAX_PENALTY-option-to-bond-order-assignment.patch
deleted file mode 100644
index 4af96b783cdb..000000000000
--- a/sci-chemistry/ball/files/ball-1.4.1-Added-MAX_PENALTY-option-to-bond-order-assignment.patch
+++ /dev/null
@@ -1,975 +0,0 @@
-From: Anna Dehof <anne@bioinf.uni-sb.de>
-Date: Mon, 26 Mar 2012 19:11:39 +0200
-Subject: Added MAX_PENALTY option to bond order assignment
-
----
- include/BALL/DATATYPE/GRAPH/treeWidth.h | 28 +--
- .../STRUCTURE/BONDORDERS/FPTBondOrderStrategy.h | 16 +-
- include/BALL/STRUCTURE/assignBondOrderProcessor.h | 30 ++-
- source/APPLICATIONS/UTILITIES/assign_bond_orders.C | 34 +++-
- source/DATATYPE/GRAPH/treeWidth.C | 2 +-
- source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C | 199 +++++++++-----------
- source/STRUCTURE/assignBondOrderProcessor.C | 44 +++--
- 7 files changed, 186 insertions(+), 167 deletions(-)
-
-diff --git a/include/BALL/DATATYPE/GRAPH/treeWidth.h b/include/BALL/DATATYPE/GRAPH/treeWidth.h
-index f7687ef..53ecffc 100644
---- a/include/BALL/DATATYPE/GRAPH/treeWidth.h
-+++ b/include/BALL/DATATYPE/GRAPH/treeWidth.h
-@@ -100,14 +100,14 @@ namespace BALL
-
- typedef boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS,
- boost::property<boost::vertex_bag_content_t, std::set<OriginalVertexType>,
-- boost::property<boost::vertex_bag_special_t, OriginalVertexType,
-- boost::property<boost::vertex_bag_type_t, int> > >,
-+ boost::property<boost::vertex_bag_special_t, OriginalVertexType,
-+ boost::property<boost::vertex_bag_type_t, int> > >,
- boost::no_property> TreeDecompositionGraph;
-
- typedef typename boost::graph_traits<TreeDecompositionGraph>::vertex_descriptor TreeDecompositionBag;
-
- typedef boost::iterator_property_map<typename std::vector<TreeDecompositionBag>::iterator,
-- typename boost::property_map<TreeDecompositionGraph, boost::vertex_index_t>::type>
-+ typename boost::property_map<TreeDecompositionGraph, boost::vertex_index_t>::type>
- TreeDecompositionParentMap;
- typedef boost::graph_as_tree<TreeDecompositionGraph, TreeDecompositionParentMap> TreeDecomposition;
-
-@@ -131,7 +131,7 @@ namespace BALL
- class ComponentFilter_
- {
- public:
-- ComponentFilter_(ComponentMap cm, Position i)
-+ ComponentFilter_(ComponentMap cm, Position i)
- : cm_(cm),
- component_(i)
- { }
-@@ -144,7 +144,7 @@ namespace BALL
-
- protected:
- ComponentMap cm_;
-- Position component_;
-+ Position component_;
- };
-
- /** PropertyWriter for graphviz output.
-@@ -167,7 +167,7 @@ namespace BALL
- // TODO: would UndirectedGraph suffice here?
- MolecularGraph const* input_;
-
-- std::vector<boost::shared_ptr<EditableGraph> > components_;
-+ std::vector<boost::shared_ptr<EditableGraph> > components_;
-
- std::vector<boost::shared_ptr<TreeDecomposition> > nice_tree_decompositions_;
- std::vector<boost::shared_ptr<TreeDecompositionGraph> > nice_tree_decomposition_graphs_;
-@@ -201,7 +201,7 @@ namespace BALL
- * @tparam Reducer the reducer which removes a vertex from the graph to reduce it's size
- */
- template<class Criterion, class Reducer>
-- class GeneralLowerBoundAlgorithm
-+ class GeneralLowerBoundAlgorithm
- : public UnaryFunctor<UndirectedGraph, Size>
- {
- public:
-@@ -284,7 +284,7 @@ namespace BALL
- * @throw BALL::GRAPH::UnconnectedGraphException if called on unconnected graphs
- */
- template<class Criterion>
-- class GreedyX
-+ class GreedyX
- : public UnaryFunctor<UndirectedGraph, typename std::pair<
- std::vector<boost::graph_traits<typename UndirectedGraph::vertex_descriptor> >, Size> >
- {
-@@ -296,7 +296,7 @@ namespace BALL
- * A criterium for GreedyFillIn which search for a vertex with
- * minimum number of additional edges after eliminating
- */
-- struct FillInHeuristic
-+ struct FillInHeuristic
- {
- VertexType& operator() (UndirectedGraph& graph);
-
-@@ -323,8 +323,8 @@ namespace BALL
- */
- enum SIMPLICIAL_TYPE
- {
-- NOT_SIMPLICIAL,
-- ALMOST_SIMPLICIAL,
-+ NOT_SIMPLICIAL,
-+ ALMOST_SIMPLICIAL,
- IS_SIMPLICIAL
- };
-
-@@ -484,7 +484,7 @@ namespace BALL
- TreeDecompositionBag buildJoin_(TreeDecompositionBag node, TreeDecompositionBag left,
- TreeDecompositionBag right, bool do_forget);
-
-- TreeDecompositionBag buildSingle_(TreeDecompositionBag node, int node_type,
-+ TreeDecompositionBag buildSingle_(TreeDecompositionBag node, int node_type,
- TreeDecompositionBag child);
-
- TreeDecompositionBag buildLinkage_(TreeDecompositionBag node, TreeDecompositionBag child);
-@@ -492,8 +492,8 @@ namespace BALL
- TreeDecompositionBag linkWithIntroduceNodes_(TreeDecompositionContent parent_set, TreeDecompositionBag child);
- TreeDecompositionBag linkWithForgetNodes_ (TreeDecompositionContent parent_set, TreeDecompositionBag child);
-
-- TreeDecompositionBag branch_(TreeDecompositionBag node, int node_type,
-- typename std::vector<TreeDecompositionBag>::iterator begin,
-+ TreeDecompositionBag branch_(TreeDecompositionBag node, int node_type,
-+ typename std::vector<TreeDecompositionBag>::iterator begin,
- typename std::vector<TreeDecompositionBag>::iterator end);
-
- boost::shared_ptr<TreeDecomposition> tree_;
-diff --git a/include/BALL/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.h b/include/BALL/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.h
-index 55cef31..ba129b0 100644
---- a/include/BALL/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.h
-+++ b/include/BALL/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.h
-@@ -1117,6 +1117,11 @@ namespace BALL
- Size max_heap_size_;
-
- /**
-+ * The number of solutions produced so far.
-+ */
-+ Size num_computed_solutions_;
-+
-+ /**
- * current upperbound. This algorithm will just iterate solutions which are better than this upperbound;
- */
- Penalty upper_bound_;
-@@ -1248,14 +1253,6 @@ namespace BALL
- Size solution_number, Penalty upper_bound = infinite_penalty);
-
- /**
-- * Construct a DPBackTrackingCombiner with the given FPTBondOrder and the number of solutions
-- * @param bondAssignments vector with the bond assignments. Call #compute before constructing
-- * @param solutionNumber the maximum number of solutions you want to backtrack
-- */
-- DPBackTrackingCombiner_(std::vector<FPTBondOrderAssignment_>& bond_assignments,
-- Size solution_number, Penalty upper_bound = infinite_penalty);
--
-- /**
- * Copy constructor
- */
- DPBackTrackingCombiner_(DPBackTrackingCombiner_ const& copy);
-@@ -1407,9 +1404,6 @@ namespace BALL
- */
- std::vector<std::vector<int> > const* atom_to_block_;
-
-- /// upper bound on the penalty values for which we compute solutions
-- Penalty upper_bound_;
--
- /**
- * A shared pointer to the computing data, so that you can copy this instance without copying
- * all the computing data
-diff --git a/include/BALL/STRUCTURE/assignBondOrderProcessor.h b/include/BALL/STRUCTURE/assignBondOrderProcessor.h
-index f8065d6..0d14af8 100644
---- a/include/BALL/STRUCTURE/assignBondOrderProcessor.h
-+++ b/include/BALL/STRUCTURE/assignBondOrderProcessor.h
-@@ -183,17 +183,35 @@ namespace BALL
-
- /** the maximal number of solutions to compute
- *
-- * If set to zero all optimal solutions will be computed.
-+ * If set to zero all optimal or all up to \link MAX_PENALTY MAX_PENALTY \endlink
-+ * solutions will be computed.
- *
-- * @see Option::COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS
-+ * @see Option::COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS
-+ * @see Option::MAX_PENALTY
- */
- static const char* MAX_NUMBER_OF_SOLUTIONS;
-
-- /** compute also non-optimal solutions but not more than
-- * \link MAX_NUMBER_OF_SOLUTIONS MAX_NUMBER_OF_SOLUTIONS \endlink solutions.
-+ /** the maximal penalty score allowed
-+ *
-+ * This option respects option \link MAX_NUMBER_OF_SOLUTIONS MAX_NUMBER_OF_SOLUTIONS \endlink
-+ * if specified.
- *
-+ * If set to -1 this option will be ignored.
-+ *
-+ * @see Option::COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS
- * @see Option::MAX_NUMBER_OF_SOLUTIONS
- */
-+ static const char* MAX_PENALTY;
-+
-+ /** compute also sub-optimal solutions but not more than
-+ * \link MAX_NUMBER_OF_SOLUTIONS MAX_NUMBER_OF_SOLUTIONS \endlink solutions.
-+ *
-+ * Alternatively \link Option::MAX_PENALTY Option::MAX_PENALTY \endlink
-+ * allows to specify a maximal penalty.
-+ *
-+ * @see Option::MAX_NUMBER_OF_SOLUTIONS
-+ * @see Option::MAX_PENALTY
-+ */
- static const char* COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS;
-
- /** weighting of bond length penalties wrt valence penalties.
-@@ -227,6 +245,7 @@ namespace BALL
- static const String INIFile;
- static const int MAX_BOND_ORDER;
- static const int MAX_NUMBER_OF_SOLUTIONS;
-+ static const int MAX_PENALTY;
- static const bool COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS;
- static const float BOND_LENGTH_WEIGHTING;
- static const bool APPLY_FIRST_SOLUTION;
-@@ -716,6 +735,9 @@ namespace BALL
- // the max number of solutions to compute
- int max_number_of_solutions_;
-
-+ // the max penalty score
-+ int max_penalty_;
-+
- // flag to indicate, whether also non-optimal solutions should be computed
- bool compute_also_non_optimal_solutions_;
-
-diff --git a/source/APPLICATIONS/UTILITIES/assign_bond_orders.C b/source/APPLICATIONS/UTILITIES/assign_bond_orders.C
-index cefef9b..7053baa 100644
---- a/source/APPLICATIONS/UTILITIES/assign_bond_orders.C
-+++ b/source/APPLICATIONS/UTILITIES/assign_bond_orders.C
-@@ -16,10 +16,10 @@ using namespace BALL;
-
- int main(int argc, char** argv)
- {
-- if ((argc < 3) || (argc > 4))
-+ if (argc < 3)
- // if (argc != 3)
- {
-- Log << "Usage:" << argv[0] << " <Molecule infile> <Molecule outfile> [num_sol]" << endl;
-+ Log << "Usage:" << argv[0] << " <Molecule infile> <Molecule outfile> [--num-sol=n] [--strategy=(fpt|a_star|ilp)] [--max-penalty=m]" << endl;
- return 1;
- }
-
-@@ -49,24 +49,40 @@ int main(int argc, char** argv)
- // set the options:
- //
- // the solution strategy (A*, ILP or FPT)
-- abop.options.set(AssignBondOrderProcessor::Option::ALGORITHM, AssignBondOrderProcessor::Algorithm::A_STAR);
-+ abop.options.set(AssignBondOrderProcessor::Option::ALGORITHM, AssignBondOrderProcessor::Algorithm::FPT);
-
- // specify the inifile with the atomic valence penalties
- abop.options.set(AssignBondOrderProcessor::Option::INIFile, AssignBondOrderProcessor::Default::INIFile);
-
- // options for considering bond length as well
-- abop.options.setReal(AssignBondOrderProcessor::Option::BOND_LENGTH_WEIGHTING, 0);
-- abop.options.setReal(AssignBondOrderProcessor::Option::USE_FINE_PENALTY, true);
-+// abop.options.setReal(AssignBondOrderProcessor::Option::BOND_LENGTH_WEIGHTING, 0);
-+// abop.options.setReal(AssignBondOrderProcessor::Option::USE_FINE_PENALTY, true);
-
- // the combination of the following two options causes the computation of all optimal solutions
- abop.options.setInteger(AssignBondOrderProcessor::Option::MAX_NUMBER_OF_SOLUTIONS, 0);
- abop.options.setBool(AssignBondOrderProcessor::Option::COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS, false);
-
-- if (argc == 4)
-+ if (argc > 3)
- {
-- Log << " with compute fixed number (" << argv[3] << ") solutions" << endl;
-- abop.options.setInteger(AssignBondOrderProcessor::Option::MAX_NUMBER_OF_SOLUTIONS, String(argv[3]).toInt());
-- abop.options.setBool(AssignBondOrderProcessor::Option::COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS, true);
-+ for (Index i=3; i<argc; ++i)
-+ {
-+ if (String(argv[i]).hasPrefix("--strategy"))
-+ {
-+ abop.options.set(AssignBondOrderProcessor::Option::ALGORITHM, String(argv[i]).getField(1, "="));
-+ }
-+ else if (String(argv[i]).hasPrefix("--num-sol"))
-+ {
-+ Log << " with compute fixed number (" << argv[i] << ") solutions" << endl;
-+ abop.options.setInteger(AssignBondOrderProcessor::Option::MAX_NUMBER_OF_SOLUTIONS, String(argv[i]).getField(1, "=").toInt());
-+ abop.options.setBool(AssignBondOrderProcessor::Option::COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS, true);
-+ }
-+ else if (String(argv[i]).hasPrefix("--max-penalty"))
-+ {
-+ abop.options.setInteger(AssignBondOrderProcessor::Option::MAX_PENALTY, String(argv[i]).getField(1, "=").toInt());
-+ abop.options.setBool(AssignBondOrderProcessor::Option::COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS, true);
-+ Log << " with maximum penalty (" << abop.options.getInteger(AssignBondOrderProcessor::Option::MAX_PENALTY) << ")" << endl;
-+ }
-+ }
- }
-
- // define input and output properties
-diff --git a/source/DATATYPE/GRAPH/treeWidth.C b/source/DATATYPE/GRAPH/treeWidth.C
-index 7485305..cd0a879 100644
---- a/source/DATATYPE/GRAPH/treeWidth.C
-+++ b/source/DATATYPE/GRAPH/treeWidth.C
-@@ -12,7 +12,7 @@ namespace BALL
- // find all vertices in the current bag
- TreeDecompositionContent content = boost::get(boost::vertex_bag_content, *td_, v);
-
-- for (typename TreeDecompositionContent::const_iterator tdc_it = content.begin(); tdc_it != content.end(); ++tdc_it)
-+ for (TreeDecompositionContent::const_iterator tdc_it = content.begin(); tdc_it != content.end(); ++tdc_it)
- {
- TreeWidth<MolecularGraph>::OriginalVertexType ov = *tdc_it;
- Atom const* atom = boost::get(boost::vertex_atom_ptr, *original_graph_, ov);
-diff --git a/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C b/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C
-index 42040e5..107823e 100644
---- a/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C
-+++ b/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C
-@@ -12,10 +12,6 @@ namespace BALL
- const FPTBondOrderStrategy::Penalty FPTBondOrderStrategy::infinite_penalty = 1e5;
- const FPTBondOrderStrategy::Valence FPTBondOrderStrategy::max_valence = 8;
-
-- String FPTBondOrderStrategy::Option::UPPER_PENALTY_BOUND = "upper_penalty_bound";
--
-- FPTBondOrderStrategy::Penalty FPTBondOrderStrategy::Default::UPPER_PENALTY_BOUND = infinite_penalty;
--
- FPTBondOrderStrategy::FPTBondOrderStrategy(AssignBondOrderProcessor* parent)
- : BondOrderAssignmentStrategy(parent)
- {
-@@ -33,15 +29,11 @@ namespace BALL
-
- bool FPTBondOrderStrategy::readOptions(const Options& options)
- {
-- upper_bound_ = options.get(Option::UPPER_PENALTY_BOUND).toFloat();
--
- return true;
- }
-
- void FPTBondOrderStrategy::setDefaultOptions()
- {
-- abop->options.setDefault(FPTBondOrderStrategy::Option::UPPER_PENALTY_BOUND,
-- FPTBondOrderStrategy::Default::UPPER_PENALTY_BOUND);
- }
-
- void FPTBondOrderStrategy::init()
-@@ -64,16 +56,22 @@ namespace BALL
- std::vector<boost::shared_ptr<TreeDecomposition> > & ntds = computing_data_->tw->getNiceTreeDecompositions();
- std::vector<FPTBondOrderAssignment_*>& bond_assignments = computing_data_->bond_assignments;
-
-+ int max_penalty = abop->max_penalty_;
-+ if (max_penalty == -1)
-+ max_penalty = infinite_penalty;
-+ else
-+ max_penalty += 1;
-+
- bond_assignments.reserve(ntds.size());
- for (Position i = 0; i < ntds.size(); ++i)
- {
-- bond_assignments.push_back(new FPTBondOrderAssignment_(*this, ntds[i], upper_bound_));
-- bond_assignments[i]->compute();
-+ bond_assignments.push_back(new FPTBondOrderAssignment_(*this, ntds[i], max_penalty));
-+ Penalty result = bond_assignments[i]->compute();
- }
-
- // initialize backtracking
- combiner_ = boost::shared_ptr<DPBackTrackingCombiner_>(
-- new DPBackTrackingCombiner_(bond_assignments, abop->max_number_of_solutions_, upper_bound_));
-+ new DPBackTrackingCombiner_(bond_assignments, abop->max_number_of_solutions_, max_penalty));
- }
-
- boost::shared_ptr<BondOrderAssignment> FPTBondOrderStrategy::computeNextSolution()
-@@ -144,7 +142,7 @@ namespace BALL
- int penalty = (*penalties_)[start_index + position];
-
- return (penalty < 0) ? infinite_penalty : static_cast<float>(penalty);
-- }
-+ }
- else
- {
- return infinite_penalty;
-@@ -155,20 +153,20 @@ namespace BALL
- //* DPConfig_ *
- //*****************************************************************************************************
-
-- FPTBondOrderStrategy::DPConfig_::DPConfig_()
-- : consumed_valences(0),
-+ FPTBondOrderStrategy::DPConfig_::DPConfig_()
-+ : consumed_valences(0),
- bond_assignments(0)
- {
- }
-
-- FPTBondOrderStrategy::DPConfig_::DPConfig_(Size atoms, Size bonds)
-- : consumed_valences(atoms, 0),
-+ FPTBondOrderStrategy::DPConfig_::DPConfig_(Size atoms, Size bonds)
-+ : consumed_valences(atoms, 0),
- bond_assignments(bonds, 0)
- {
- }
-
-- FPTBondOrderStrategy::DPConfig_::DPConfig_(std::vector<Valence> const& v, std::vector<BondOrder> const& bo)
-- : consumed_valences(v),
-+ FPTBondOrderStrategy::DPConfig_::DPConfig_(std::vector<Valence> const& v, std::vector<BondOrder> const& bo)
-+ : consumed_valences(v),
- bond_assignments(bo)
- {
- }
-@@ -258,12 +256,12 @@ namespace BALL
- //* DPTable_ *
- //*****************************************************************************************************
-
-- FPTBondOrderStrategy::DPTable_::DPTable_()
-+ FPTBondOrderStrategy::DPTable_::DPTable_()
- : table()
- {
- }
-
-- FPTBondOrderStrategy::DPTable_::DPTable_(DPTable_ const& dptab)
-+ FPTBondOrderStrategy::DPTable_::DPTable_(DPTable_ const& dptab)
- : table(dptab.table)
- {
- }
-@@ -345,7 +343,7 @@ namespace BALL
- if (insertion.second)
- {
- return true;
-- }
-+ }
- else
- {
- if (insertion.first->second > penalty)
-@@ -353,7 +351,7 @@ namespace BALL
- insertion.first->second = penalty;
-
- return true;
-- }
-+ }
- else
- {
- return false;
-@@ -365,14 +363,14 @@ namespace BALL
- //* AdditionalBagProperties_ *
- //*****************************************************************************************************
-
-- FPTBondOrderStrategy::AdditionalBagProperties_::AdditionalBagProperties_()
-- : bonds(),
-- table(new DPTable_())
-+ FPTBondOrderStrategy::AdditionalBagProperties_::AdditionalBagProperties_()
-+ : bonds(),
-+ table(new DPTable_())
- {
- }
-
-- FPTBondOrderStrategy::AdditionalBagProperties_::AdditionalBagProperties_(AdditionalBagProperties_ const& copy)
-- : bonds(copy.bonds),
-+ FPTBondOrderStrategy::AdditionalBagProperties_::AdditionalBagProperties_(AdditionalBagProperties_ const& copy)
-+ : bonds(copy.bonds),
- table(new DPTable_(*copy.table))
- {
- }
-@@ -384,7 +382,7 @@ namespace BALL
-
- FPTBondOrderStrategy::AdditionalBagProperties_& FPTBondOrderStrategy::AdditionalBagProperties_::operator=(AdditionalBagProperties_ const& copy)
- {
-- if (&copy != this)
-+ if (&copy != this)
- {
- bonds = copy.bonds;
- table = new DPTable_(*copy.table);
-@@ -447,7 +445,7 @@ namespace BALL
- {
- throw Exception::NullPointer(__FILE__, __LINE__);
- }
-- case TreeWidth<MolecularGraph>::LEAF_BAG:
-+ case TreeWidth<MolecularGraph>::LEAF_BAG:
- break;
- case TreeWidth<MolecularGraph>::END_BAG:
- if (boost::num_vertices(*molecule_) == 0 && (bag == root(*ntd_)))
-@@ -455,7 +453,7 @@ namespace BALL
- // empty molecule -> empty table
- bag_properties.table->insert(DPConfig_(), 0);
- return bag_properties.table;
-- }
-+ }
- else
- {
- // else nice tree decomposition is damaged
-@@ -603,7 +601,7 @@ namespace BALL
- return bonds;
- }
-
-- void FPTBondOrderStrategy::FPTBondOrderAssignment_::computeIntroduceBag(TreeDecompositionBag& bag, DPTable_& child,
-+ void FPTBondOrderStrategy::FPTBondOrderAssignment_::computeIntroduceBag(TreeDecompositionBag& bag, DPTable_& child,
- AdditionalBagProperties_& property)
- {
- typedef TreeWidth<MolecularGraph>::TreeDecompositionContent TreeDecompositionContent;
-@@ -614,7 +612,7 @@ namespace BALL
-
- TreeDecompositionContent vertices = boost::get(boost::vertex_bag_content, *ntd_, bag);
- Size num_valences = vertices.size();
--
-+
- std::vector<MolecularGraphTraits::EdgeType>& bonds = property.bonds;
- Size num_bonds = bonds.size();
-
-@@ -654,7 +652,7 @@ namespace BALL
- {
- // remember the indizes of the new introduced bonds
- indices.push_back(vindex);
-- }
-+ }
- else
- {
- conf.bond_assignments[vindex] = child_entry.first.get().bond_assignments[cindex++];
-@@ -662,7 +660,7 @@ namespace BALL
- }
-
- // if there are any introduced bonds we have to fill them with each possible value
-- if (indices.size() > 0)
-+ if (indices.size() > 0)
- {
- std::vector<int> bond_values(indices.size());
-
-@@ -685,7 +683,7 @@ namespace BALL
- ++current_index;
- }
- }
-- }
-+ }
- else
- {
- table.insert(conf, child_entry.second);
-@@ -768,7 +766,7 @@ namespace BALL
- return parent_->getPenaltyFor_(forgotten_vertex, forgotten_valence) + child_row.second;
- }
-
-- void FPTBondOrderStrategy::FPTBondOrderAssignment_::computeForgetBag(TreeDecompositionBag& bag, DPTable_& child,
-+ void FPTBondOrderStrategy::FPTBondOrderAssignment_::computeForgetBag(TreeDecompositionBag& bag, DPTable_& child,
- AdditionalBagProperties_& property)
- {
- typedef TreeWidth<MolecularGraph>::TreeDecompositionContent TreeDecompositionContent;
-@@ -795,7 +793,7 @@ namespace BALL
- }
- }
-
-- void FPTBondOrderStrategy::FPTBondOrderAssignment_::computeRootBag(TreeDecompositionBag& bag,
-+ void FPTBondOrderStrategy::FPTBondOrderAssignment_::computeRootBag(TreeDecompositionBag& bag,
- DPTable_& child, AdditionalBagProperties_& bag_properties)
- {
- DPConfig_ empty(0, 0);
-@@ -816,7 +814,8 @@ namespace BALL
- }
-
- void FPTBondOrderStrategy::FPTBondOrderAssignment_::computeJoinBag(TreeDecompositionBag& bag,
-- DPTable_& left_child, DPTable_& right_child, AdditionalBagProperties_& property)
-+ DPTable_& left_child, DPTable_& right_child,
-+ AdditionalBagProperties_& property)
- {
- typedef TreeWidth<MolecularGraph>::TreeDecompositionContent TreeDecompositionContent;
-
-@@ -1268,22 +1267,23 @@ namespace BALL
- //* DPBackTracking_ *
- //*****************************************************************************************************
-
-- FPTBondOrderStrategy::DPBackTracking_::DPBackTracking_(FPTBondOrderAssignment_& bond_assignment, Size max_num_solutions,
-- std::vector<MolecularGraphTraits::EdgeType> const& bonds, Penalty upper_bound)
-- : bond_assignment_(&bond_assignment),
-- current_state_(NULL),
-- queue_(),
-- max_num_solutions_(max_num_solutions),
-+ FPTBondOrderStrategy::DPBackTracking_::DPBackTracking_(FPTBondOrderAssignment_& bond_assignment, Size max_num_solutions,
-+ std::vector<MolecularGraphTraits::EdgeType> const& bonds, Penalty upper_bound)
-+ : bond_assignment_(&bond_assignment),
-+ current_state_(NULL),
-+ queue_(),
-+ max_num_solutions_(max_num_solutions),
- bonds_(&bonds),
-- bags_(boost::shared_ptr<std::vector<TreeDecompositionBag> >(new std::vector<TreeDecompositionBag>)),
-- max_heap_size_(max_num_solutions),
-+ bags_(boost::shared_ptr<std::vector<TreeDecompositionBag> >(new std::vector<TreeDecompositionBag>)),
-+ max_heap_size_(1e6),
-+ num_computed_solutions_(0),
- upper_bound_(upper_bound)
- {
- // order bags in preorder
- if (bond_assignment.ntd_ == NULL)
- {
- throw Exception::NullPointer(__FILE__, __LINE__);
-- }
-+ }
- else
- {
- bags_->reserve(boost::num_vertices(bond_assignment.ntd_->_g));
-@@ -1303,14 +1303,15 @@ namespace BALL
- }
- }
-
-- FPTBondOrderStrategy::DPBackTracking_::DPBackTracking_(DPBackTracking_ const& copy)
-- : bond_assignment_(copy.bond_assignment_),
-- current_state_(NULL),
-+ FPTBondOrderStrategy::DPBackTracking_::DPBackTracking_(DPBackTracking_ const& copy)
-+ : bond_assignment_(copy.bond_assignment_),
-+ current_state_(NULL),
- queue_(),
-- max_num_solutions_(copy.max_num_solutions_),
-- bonds_(copy.bonds_),
-- bags_(copy.bags_),
-+ max_num_solutions_(copy.max_num_solutions_),
-+ bonds_(copy.bonds_),
-+ bags_(copy.bags_),
- max_heap_size_(copy.max_heap_size_),
-+ num_computed_solutions_(copy.num_computed_solutions_),
- upper_bound_(copy.upper_bound_)
- {
- if (copy.current_state_ != NULL)
-@@ -1345,6 +1346,7 @@ namespace BALL
- bonds_ = copy.bonds_;
- bags_ = copy.bags_;
- max_heap_size_ = copy.max_heap_size_;
-+ num_computed_solutions_ = copy.num_computed_solutions_;
- upper_bound_ = copy.upper_bound_;
- }
-
-@@ -1365,6 +1367,7 @@ namespace BALL
-
- std::vector<BackTrackingState_*> copy(queue_.begin(), queue_.end());
- queue_.clear();
-+ num_computed_solutions_ = 0;
-
- for (std::vector<BackTrackingState_*>::iterator iter = copy.begin(); iter != copy.end(); ++iter)
- {
-@@ -1372,7 +1375,7 @@ namespace BALL
- }
- }
-
-- bool FPTBondOrderStrategy::DPBackTracking_::StateComparator_::operator() (BackTrackingState_ const * left,
-+ bool FPTBondOrderStrategy::DPBackTracking_::StateComparator_::operator() (BackTrackingState_ const * left,
- BackTrackingState_ const * right) const
- {
- return *left < *right;
-@@ -1397,7 +1400,7 @@ namespace BALL
- if (order < properties.size())
- {
- return properties[order];
-- }
-+ }
- else
- {
- throw Exception::IndexOverflow(__FILE__, __LINE__, static_cast<Index>(order), properties.size());
-@@ -1426,12 +1429,12 @@ namespace BALL
-
- bool FPTBondOrderStrategy::DPBackTracking_::hasMoreSolutions() const
- {
-- return (!queue_.empty() && (max_heap_size_ > 0));
-+ return (!queue_.empty() && (!max_num_solutions_ || (num_computed_solutions_ <= max_num_solutions_)));
- }
-
- void FPTBondOrderStrategy::DPBackTracking_::nextSolution()
- {
-- if (queue_.empty() || max_heap_size_ == 0)
-+ if (queue_.empty() || max_heap_size_ == 0 || ((max_num_solutions_ > 0) && (num_computed_solutions_ > max_num_solutions_)))
- {
- throw Exception::OutOfRange(__FILE__, __LINE__);
- }
-@@ -1444,7 +1447,7 @@ namespace BALL
- std::multiset<BackTrackingState_*, StateComparator_>::iterator first = queue_.begin();
- current_state_ = *first;
- queue_.erase(first);
-- --max_heap_size_;
-+ ++num_computed_solutions_;
-
- TreeDecomposition& tree = *bond_assignment_->ntd_;
-
-@@ -1469,7 +1472,7 @@ namespace BALL
- {
- TreeDecomposition::children_iterator c_2 = c_i;
- ++c_2;
-- visitJoin(*current_state_, bag, getTable(boost::get(boost::vertex_index, tree, *c_i)),
-+ visitJoin(*current_state_, bag, getTable(boost::get(boost::vertex_index, tree, *c_i)),
- getTable(boost::get(boost::vertex_index, tree, *c_2)));
- break;
- }
-@@ -1769,7 +1772,7 @@ namespace BALL
- if (d < bonds_->size())
- {
- return d;
-- }
-+ }
- else
- {
- throw Exception::IndexOverflow(__FILE__, __LINE__, static_cast<Index>(d), bonds_->size());
-@@ -1795,7 +1798,7 @@ namespace BALL
-
- bool FPTBondOrderStrategy::DPBackTracking_::isSolutionNeeded(Penalty penalty)
- {
-- if (max_heap_size_ == 0) {return false;}
-+ if (max_heap_size_ == 0 || ((max_num_solutions_ > 0) && (num_computed_solutions_ > max_num_solutions_))) {return false;}
- if (queue_.size() >= max_heap_size_) {return Maths::isLess(penalty, upper_bound_);}
- return Maths::isLessOrEqual(penalty, upper_bound_);
- }
-@@ -1846,7 +1849,7 @@ namespace BALL
- if (queue_.empty() || max_heap_size_ == 0)
- {
- return FPTBondOrderStrategy::infinite_penalty;
-- }
-+ }
- else
- {
- return (*queue_.begin())->assignment.penalty;
-@@ -1857,25 +1860,25 @@ namespace BALL
- //* DPBackTrackingCombiner_ *
- //*****************************************************************************************************
-
-- FPTBondOrderStrategy::DPBackTrackingCombiner_::DPBackTrackingCombiner_(DPBackTrackingCombiner_ const& copy)
-- : backtrackers_(copy.deepCopyOfBacktrackers_()),
-+ FPTBondOrderStrategy::DPBackTrackingCombiner_::DPBackTrackingCombiner_(DPBackTrackingCombiner_ const& copy)
-+ : backtrackers_(copy.deepCopyOfBacktrackers_()),
- priority_queue_(copy.priority_queue_),
-- component_solutions_(copy.component_solutions_),
-+ component_solutions_(copy.component_solutions_),
- assignment_(copy.assignment_),
-- solution_number_(copy.solution_number_),
-- optimum_(copy.optimum_),
-+ solution_number_(copy.solution_number_),
-+ optimum_(copy.optimum_),
- upper_bound_(copy.upper_bound_)
- {
- }
-
-- FPTBondOrderStrategy::DPBackTrackingCombiner_::DPBackTrackingCombiner_(std::vector<FPTBondOrderAssignment_*>& bond_assignments,
-- Size solution_number, Penalty upper_bound)
-- : backtrackers_(),
-- priority_queue_(),
-+ FPTBondOrderStrategy::DPBackTrackingCombiner_::DPBackTrackingCombiner_(std::vector<FPTBondOrderAssignment_*>& bond_assignments,
-+ Size solution_number, Penalty upper_bound)
-+ : backtrackers_(),
-+ priority_queue_(),
- component_solutions_(bond_assignments.size()),
-- assignment_(),
-- solution_number_(solution_number),
-- optimum_(FPTBondOrderStrategy::infinite_penalty),
-+ assignment_(),
-+ solution_number_(solution_number),
-+ optimum_(FPTBondOrderStrategy::infinite_penalty),
- upper_bound_(upper_bound)
- {
- if (bond_assignments.empty())
-@@ -1897,7 +1900,7 @@ namespace BALL
- FPTBondOrderStrategy::EdgeComparator_ ec(&graph);
- std::sort(sorted_edges.begin(), sorted_edges.end(), ec);
-
-- for (std::vector<FPTBondOrderAssignment_*>::const_iterator iter = bond_assignments.begin();
-+ for (std::vector<FPTBondOrderAssignment_*>::const_iterator iter = bond_assignments.begin();
- iter != bond_assignments.end(); ++iter)
- {
- backtrackers_.push_back(new DPBackTracking_(**iter, solution_number_, sorted_edges, upper_bound_));
-@@ -1906,39 +1909,6 @@ namespace BALL
- initialize_();
- }
-
-- FPTBondOrderStrategy::DPBackTrackingCombiner_::DPBackTrackingCombiner_(std::vector<FPTBondOrderAssignment_>& bond_assignments,
-- Size solution_number, Penalty upper_bound)
-- : backtrackers_(),
-- priority_queue_(),
-- component_solutions_(bond_assignments.size()),
-- assignment_(),
-- solution_number_(solution_number),
-- optimum_(FPTBondOrderStrategy::infinite_penalty),
-- upper_bound_(upper_bound)
-- {
-- backtrackers_.reserve(bond_assignments.size());
--
-- MolecularGraph& graph = *bond_assignments[0].molecule_;
-- sorted_edges.reserve(boost::num_edges(graph));
--
-- BGL_FORALL_EDGES(edge_it, graph, MolecularGraph)
-- {
-- sorted_edges.push_back(edge_it);
-- }
--
-- // sort bonds - the second vertex could be in false order
-- FPTBondOrderStrategy::EdgeComparator_ ec(&graph);
-- std::sort(sorted_edges.begin(), sorted_edges.end(), ec);
--
-- for (std::vector<FPTBondOrderAssignment_>::iterator iter = bond_assignments.begin();
-- iter != bond_assignments.end(); ++iter)
-- {
-- backtrackers_.push_back(new DPBackTracking_(*iter, solution_number_, sorted_edges, upper_bound_));
-- }
--
-- initialize_();
-- }
--
- FPTBondOrderStrategy::DPBackTrackingCombiner_::~DPBackTrackingCombiner_()
- {
- clear();
-@@ -1946,14 +1916,14 @@ namespace BALL
-
- void FPTBondOrderStrategy::DPBackTrackingCombiner_::clear()
- {
-- for (std::vector<DPBackTracking_*>::iterator iter = backtrackers_.begin();
-+ for (std::vector<DPBackTracking_*>::iterator iter = backtrackers_.begin();
- iter != backtrackers_.end(); ++iter)
- {
- delete *iter;
- }
- }
-
-- FPTBondOrderStrategy::DPBackTrackingCombiner_&
-+ FPTBondOrderStrategy::DPBackTrackingCombiner_&
- FPTBondOrderStrategy::DPBackTrackingCombiner_::operator = (DPBackTrackingCombiner_ const& copy)
- {
- if (this != &copy)
-@@ -1972,7 +1942,7 @@ namespace BALL
- return *this;
- }
-
-- std::pair<Size, FPTBondOrderStrategy::Penalty>
-+ std::pair<Size, FPTBondOrderStrategy::Penalty>
- FPTBondOrderStrategy::DPBackTrackingCombiner_::getNextMinimumBackTracker_() const
- {
- if (backtrackers_.size() == 1)
-@@ -2034,7 +2004,7 @@ namespace BALL
- assignment_ = ass;
-
- return;
-- }
-+ }
- else
- {
- throw Exception::OutOfRange(__FILE__, __LINE__);
-@@ -2061,7 +2031,7 @@ namespace BALL
- assignment_ = priority_queue_.top();
-
- priority_queue_.pop();
-- }
-+ }
- else
- {
- throw Exception::OutOfRange(__FILE__, __LINE__);
-@@ -2151,7 +2121,7 @@ namespace BALL
- return assignment_;
- }
-
-- std::vector<FPTBondOrderStrategy::DPBackTracking_*>
-+ std::vector<FPTBondOrderStrategy::DPBackTracking_*>
- FPTBondOrderStrategy::DPBackTrackingCombiner_::deepCopyOfBacktrackers_() const
- {
- std::vector<DPBackTracking_*> ts;
-@@ -2166,5 +2136,4 @@ namespace BALL
- return ts;
- }
-
--
- }
-diff --git a/source/STRUCTURE/assignBondOrderProcessor.C b/source/STRUCTURE/assignBondOrderProcessor.C
-index f8acc4f..9863a54 100644
---- a/source/STRUCTURE/assignBondOrderProcessor.C
-+++ b/source/STRUCTURE/assignBondOrderProcessor.C
-@@ -108,6 +108,9 @@ namespace BALL
- const char* AssignBondOrderProcessor::Option::MAX_NUMBER_OF_SOLUTIONS = "max_number_of_solutions";
- const int AssignBondOrderProcessor::Default::MAX_NUMBER_OF_SOLUTIONS = 10;
-
-+ const char* AssignBondOrderProcessor::Option::MAX_PENALTY = "max_penalty_score";
-+ const int AssignBondOrderProcessor::Default::MAX_PENALTY = -1;
-+
- const char* AssignBondOrderProcessor::Option::COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS = "compute_also_non_optimal_solutions";
- const bool AssignBondOrderProcessor::Default::COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS = false;
-
-@@ -148,6 +151,7 @@ namespace BALL
- max_bond_order_(),
- alpha_(),
- max_number_of_solutions_(),
-+ max_penalty_(-1),
- compute_also_non_optimal_solutions_(),
- add_missing_hydrogens_(),
- compute_also_connectivity_(),
-@@ -237,13 +241,14 @@ namespace BALL
- ret &= s_it->second->readOptions(options);
- }
-
-- max_bond_order_ = options.getInteger(Option::MAX_BOND_ORDER);
-- alpha_ = options.getReal(Option::BOND_LENGTH_WEIGHTING);
-- max_number_of_solutions_ = options.getInteger(Option::MAX_NUMBER_OF_SOLUTIONS);
-+ max_bond_order_ = options.getInteger(Option::MAX_BOND_ORDER);
-+ alpha_ = options.getReal(Option::BOND_LENGTH_WEIGHTING);
-+ max_number_of_solutions_ = options.getInteger(Option::MAX_NUMBER_OF_SOLUTIONS);
-+ max_penalty_ = options.getInteger(Option::MAX_PENALTY);
- compute_also_non_optimal_solutions_ = options.getBool(Option::COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS);
-- add_missing_hydrogens_ = options.getBool(Option::ADD_HYDROGENS);
-+ add_missing_hydrogens_ = options.getBool(Option::ADD_HYDROGENS);
- compute_also_connectivity_ = options.getBool(Option::COMPUTE_ALSO_CONNECTIVITY);
-- use_fine_penalty_ = options.getBool(Option::USE_FINE_PENALTY);
-+ use_fine_penalty_ = options.getBool(Option::USE_FINE_PENALTY);
-
- if (max_bond_order_ <= 0)
- {
-@@ -257,6 +262,12 @@ namespace BALL
- << " : Error in options! Please check the option Option::MAX_NUMBER_OF_SOLUTIONS." << endl;
- ret = false;
- }
-+ if (max_penalty_ < -1)
-+ {
-+ Log.error() << __FILE__ << " " << __LINE__
-+ << " : Error in options! Please check the option Option::MAX_PENALTY." << endl;
-+ ret = false;
-+ }
- if ((alpha_ < 0) || ((alpha_ > 1)))
- {
- Log.error() << __FILE__ << " " << __LINE__
-@@ -280,14 +291,13 @@ namespace BALL
- || (options.getBool(Option::OVERWRITE_SELECTED_BONDS) == true)
- || (options.getBool(Option::OVERWRITE_SINGLE_BOND_ORDERS) == false)
- || (options.getBool(Option::OVERWRITE_DOUBLE_BOND_ORDERS) == false)
-- || (options.getBool(Option::OVERWRITE_TRIPLE_BOND_ORDERS) == false)
-- || (options.getInteger(Option::MAX_NUMBER_OF_SOLUTIONS) == 0))
-+ || (options.getBool(Option::OVERWRITE_TRIPLE_BOND_ORDERS) == false) )
- )
- {
- Log.error() << __FILE__ << " " << __LINE__
- << " : Error in options! FPT cannot be used with these options." << endl
-- << " Switch to solution strategy ASTAR by setting Option::ALGORITHM to Algorithm::ASTAR." << endl;
--
-+ << " Consider switch to solution strategy ASTAR by setting Option::ALGORITHM to Algorithm::ASTAR." << endl
-+ << " Abort." << endl;
- ret = false;
- }
-
-@@ -328,6 +338,7 @@ cout << " \t Penalty file " << options[Option::Option::INIFile] << endl;
- cout << " \t alpha: " << options[Option::BOND_LENGTH_WEIGHTING] << endl;
- cout << " \t max bond order: " << options[Option::MAX_BOND_ORDER] << endl;
- cout << " \t max number of solutions " << options[Option::MAX_NUMBER_OF_SOLUTIONS] << endl;
-+cout << " \t max penalty " << options[Option::MAX_PENALTY] << endl;
- cout << " \t compute also non-optimal solutions: " << options.getBool(Option::COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS) << endl;
- cout << " \t compute also connectivity: " << options.getBool(Option::COMPUTE_ALSO_CONNECTIVITY) << endl;
- cout << " \t connectivity cutoff: " << options[Option::CONNECTIVITY_CUTOFF] << endl;
-@@ -354,7 +365,7 @@ cout << endl;
- // check the options
-
- // What kind of composite do we have?
-- // Do we have a molecule? (Nothingelse is allowed)
-+ // Do we have a molecule? (Nothing else is allowed)
- if (RTTI::isKindOf<Molecule>(ac))
- {
- // Store the AtomContainer
-@@ -517,7 +528,7 @@ cout << "preassignPenaltyClasses_:" << preassignPenaltyClasses_() << " precomput
- #ifdef BALL_HAS_LPSOLVE
- strategy = strategies_["ILP"].get();
- #else
-- Log.error() << "Error: BALL was configured without lpsolve support! Try A_STAR instead!" <<
-+ Log.error() << "Error: BALL was configured without lpsolve support! Try A_STAR or FPT instead!" <<
- __FILE__ << " " << __LINE__<< std::endl;
-
- return Processor::ABORT;
-@@ -552,16 +563,20 @@ cout << "preassignPenaltyClasses_:" << preassignPenaltyClasses_() << " precomput
- solutions_.push_back(*solution);
-
- // Do we have to find more solutions?
-- bool found_another = true;
-- bool last_sol_is_optimal = true;
-+ bool found_another = true;
-+ bool last_sol_is_optimal = true;
-+ bool consider_max_penalty = (max_penalty_ > -1);
-+ double last_penalty = getTotalPenalty(0);
-
- while ( found_another
- && ((getNumberOfComputedSolutions() < max_number_of_solutions_) || (!max_number_of_solutions_))
- && (last_sol_is_optimal || (compute_also_non_optimal_solutions_))
-+ && ((last_penalty <= max_penalty_) || (!consider_max_penalty))
- )
- {
- found_another = computeNextSolution(options.getBool(Option::APPLY_FIRST_SOLUTION));
- last_sol_is_optimal &= (fabs(getTotalPenalty(0) - getTotalPenalty(solutions_.size()-1)) < 1.e-4);
-+ last_penalty = getTotalPenalty(solutions_.size()-1);
- }
- #if defined DEBUG_TIMER
- timer_.stop();
-@@ -1206,6 +1221,9 @@ cout << " ~~~~~~~~ added hydrogen dump ~~~~~~~~~~~~~~~~" << endl;
- options.setDefaultInteger(AssignBondOrderProcessor::Option::MAX_NUMBER_OF_SOLUTIONS,
- AssignBondOrderProcessor::Default::MAX_NUMBER_OF_SOLUTIONS);
-
-+ options.setDefaultInteger(AssignBondOrderProcessor::Option::MAX_PENALTY,
-+ AssignBondOrderProcessor::Default::MAX_PENALTY);
-+
- options.setDefaultBool(AssignBondOrderProcessor::Option::COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS,
- AssignBondOrderProcessor::Default::COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS);
-
diff --git a/sci-chemistry/ball/files/ball-1.4.1-Fix-compilation-of-FTPBondOrderStrategy-Fixes-451.patch b/sci-chemistry/ball/files/ball-1.4.1-Fix-compilation-of-FTPBondOrderStrategy-Fixes-451.patch
deleted file mode 100644
index 40b4b252fa48..000000000000
--- a/sci-chemistry/ball/files/ball-1.4.1-Fix-compilation-of-FTPBondOrderStrategy-Fixes-451.patch
+++ /dev/null
@@ -1,138 +0,0 @@
-From: Anna Dehof <anne@bioinf.uni-sb.de>
-Date: Fri, 8 Jun 2012 19:28:12 +0200
-Subject: Fix compilation of FTPBondOrderStrategy (Fixes #451)
-
-This patch is due to Daniel Stoeckel.
----
- source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C | 33 +++++++++++---------
- 1 file changed, 18 insertions(+), 15 deletions(-)
-
-diff --git a/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C b/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C
-index 6572d96..98adf98 100644
---- a/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C
-+++ b/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C
-@@ -322,7 +322,7 @@ namespace BALL
- }
- }
-
-- return *best;
-+ return DPConstRow_(boost::reference_wrapper<DPConfig_ const>(best->first), best->second);
- }
-
- FPTBondOrderStrategy::Penalty FPTBondOrderStrategy::DPTable_::operator[](FPTBondOrderStrategy::DPConfig_ const& config) const
-@@ -601,6 +601,9 @@ namespace BALL
-
- return bonds;
- }
-+
-+#define convertToCRow(tmp)\
-+ std::make_pair(boost::reference_wrapper<const DPConfig_>((tmp).first), (tmp).second)
-
- void FPTBondOrderStrategy::FPTBondOrderAssignment_::computeIntroduceBag(TreeDecompositionBag& bag, DPTable_& child,
- AdditionalBagProperties_& property)
-@@ -621,7 +624,7 @@ namespace BALL
- // copy with n new bondvalue-columns with different values
- for (DPTable_::const_iterator iter = child.begin(); iter != child.end(); ++iter)
- {
-- DPConstRow_ child_entry = *iter;
-+ DPConstRow_ child_entry = convertToCRow(*iter);
- DPConfig_ conf(num_valences, num_bonds);
-
- Size vindex = 0;
-@@ -786,7 +789,7 @@ namespace BALL
-
- for (DPTable_::const_iterator entry_iterator = child.begin(); entry_iterator != child.end(); ++entry_iterator)
- {
-- Penalty entry_penalty(forgetInnerVertexIn(bag, *entry_iterator, new_entry, child_property.bonds, forgotten_index));
-+ Penalty entry_penalty(forgetInnerVertexIn(bag, convertToCRow(*entry_iterator), new_entry, child_property.bonds, forgotten_index));
- if (entry_penalty < upper_bound_)
- {
- property.table->insert(new_entry, entry_penalty);
-@@ -803,7 +806,7 @@ namespace BALL
- Penalty min_penalty = FPTBondOrderStrategy::infinite_penalty;
- for (DPTable_::const_iterator iter = child.begin(); iter != child.end(); ++iter)
- {
-- min_penalty = std::min(min_penalty, forgetInnerVertexIn(bag, *iter, empty, empty_list, 0));
-+ min_penalty = std::min(min_penalty, forgetInnerVertexIn(bag, convertToCRow(*iter), empty, empty_list, 0));
-
- if (Maths::isEqual(0, min_penalty))
- {
-@@ -830,14 +833,14 @@ namespace BALL
- // insert each entry of the left child into a DPJoinMap
- for (DPTable_::const_iterator left_iter = left_child.begin(); left_iter != left_child.end(); ++left_iter)
- {
-- DPConstRow_ left_entry = *left_iter;
-+ DPConstRow_ left_entry = convertToCRow(*left_iter);
- map.insert(std::pair<DPConfig_ const*, Penalty> (left_entry.first.get_pointer(), left_entry.second));
- }
-
- // find for each entry of the right child's table appropiate entries in the DPJoinMap (which have the same bondvalues)
- for (DPTable_::const_iterator r_iter = right_child.begin(); r_iter != right_child.end(); ++r_iter)
- {
-- DPConstRow_ right_entry = *r_iter;
-+ DPConstRow_ right_entry = convertToCRow(*r_iter);
- DPConfig_ const* right_conf = right_entry.first.get_pointer();
-
- std::pair<DPJoinMap_::const_iterator, DPJoinMap_::const_iterator> matching_range(map.equal_range(right_conf));
-@@ -1602,7 +1605,7 @@ namespace BALL
- // insert possible antecessors in vectors
- for (DPTable_::const_iterator iter = left_table.begin(); iter != left_table.end(); ++iter)
- {
-- DPConstRow_ antecessor = *iter;
-+ DPConstRow_ antecessor = convertToCRow(*iter);
- if (comp.compare(&successor, antecessor.first.get_pointer()) == 0)
- {
- left_entries.push_back(iter);
-@@ -1611,7 +1614,7 @@ namespace BALL
-
- for (DPTable_::const_iterator iter = right_table.begin(); iter != right_table.end(); ++iter)
- {
-- DPConstRow_ antecessor = *iter;
-+ DPConstRow_ antecessor = convertToCRow(*iter);
- if (comp.compare(&successor, antecessor.first.get_pointer()) == 0)
- {
- right_entries.push_back(iter);
-@@ -1623,10 +1626,10 @@ namespace BALL
-
- for (std::vector<DPTable_::const_iterator>::const_iterator left = left_entries.begin(); left != left_entries.end(); ++left)
- {
-- DPConstRow_ left_entry = **left;
-+ DPConstRow_ left_entry = convertToCRow(**left);
- for (std::vector<DPTable_::const_iterator>::const_iterator right = right_entries.begin(); right != right_entries.end(); ++right)
- {
-- DPConstRow_ right_entry = **right;
-+ DPConstRow_ right_entry = convertToCRow(**right);
-
- // check sum of valences
- bool correct_valences = true;
-@@ -1657,8 +1660,8 @@ namespace BALL
-
- Penalty best_penalty = best.first->second + best.second->second;
-
-- DPConstRow_ left = *best.first;
-- DPConstRow_ right = *best.second;
-+ DPConstRow_ left = convertToCRow(*best.first);
-+ DPConstRow_ right = convertToCRow(*best.second);
-
- extendState(state, left.first, 0);
- ++state.index;
-@@ -1668,8 +1671,8 @@ namespace BALL
- {
- DPPairIt_ entry = *iter;
-
-- DPConstRow_ left = *entry.first;
-- DPConstRow_ right = *entry.second;
-+ DPConstRow_ left = convertToCRow(*entry.first);
-+ DPConstRow_ right = convertToCRow(*entry.second);
-
- Penalty add_penalty = (left.second + right.second) - best_penalty;
- if (isSolutionNeeded(state.assignment.penalty + add_penalty))
-@@ -1720,7 +1723,7 @@ namespace BALL
- // check for each row entry: is it a possible anteccessor?
- for (DPTable_::iterator iter = table.begin(); iter != table.end(); ++iter)
- {
-- Penalty pen = bond_assignment_->forgetInnerVertexIn(bag, *iter, test_entry, child_bonds, forgotten_index);
-+ Penalty pen = bond_assignment_->forgetInnerVertexIn(bag, convertToCRow(*iter), test_entry, child_bonds, forgotten_index);
-
- if (pen < FPTBondOrderStrategy::infinite_penalty && test_entry == successor)
- {
diff --git a/sci-chemistry/ball/files/ball-1.4.1-Fix-compilation-of-Python-bindings-with-new-sip-vers.patch b/sci-chemistry/ball/files/ball-1.4.1-Fix-compilation-of-Python-bindings-with-new-sip-vers.patch
deleted file mode 100644
index 38b3ba0dab1b..000000000000
--- a/sci-chemistry/ball/files/ball-1.4.1-Fix-compilation-of-Python-bindings-with-new-sip-vers.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From: Andreas Hildebrandt <andreas.hildebrandt@uni-mainz.de>
-Date: Wed, 15 Aug 2012 00:12:49 +0200
-Subject: Fix compilation of Python bindings with new sip versions.
-
-For some reason, sip does not like static members of the same type as the class.
-In this case, a varget_... - method is generated with the wrong arguments
-(unnamed parameter which should be called "sipSelf"). This patch works around
-it.
----
- source/PYTHON/EXTENSIONS/BALL/PTE_.sip | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/source/PYTHON/EXTENSIONS/BALL/PTE_.sip b/source/PYTHON/EXTENSIONS/BALL/PTE_.sip
-index 4589e92..3e5f8ff 100644
---- a/source/PYTHON/EXTENSIONS/BALL/PTE_.sip
-+++ b/source/PYTHON/EXTENSIONS/BALL/PTE_.sip
-@@ -61,7 +61,7 @@ class Element
- //friend ostream& operator << (ostream& s, const Element&);
- bool isUnknown() const;
-
-- static Element UNKNOWN;
-+ Element UNKNOWN;
- };
-
- class PTE_
diff --git a/sci-chemistry/ball/files/ball-1.4.1-Fixed-a-bug-in-the-AssignBondOrderProcessor.patch b/sci-chemistry/ball/files/ball-1.4.1-Fixed-a-bug-in-the-AssignBondOrderProcessor.patch
deleted file mode 100644
index 813c9369bdac..000000000000
--- a/sci-chemistry/ball/files/ball-1.4.1-Fixed-a-bug-in-the-AssignBondOrderProcessor.patch
+++ /dev/null
@@ -1,271 +0,0 @@
-From: Anna Dehof <anne@bioinf.uni-sb.de>
-Date: Fri, 27 Apr 2012 18:41:52 +0200
-Subject: Fixed a bug in the AssignBondOrderProcessor
-
----
- .../STRUCTURE/BONDORDERS/bondOrderAssignment.h | 2 +-
- source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C | 13 +++--
- source/STRUCTURE/assignBondOrderProcessor.C | 27 +++++++----
- source/TEST/AssignBondOrderProcessor_test.C | 50 +++++++++++++++-----
- 4 files changed, 67 insertions(+), 25 deletions(-)
-
-diff --git a/include/BALL/STRUCTURE/BONDORDERS/bondOrderAssignment.h b/include/BALL/STRUCTURE/BONDORDERS/bondOrderAssignment.h
-index 57adc41..f8aab75 100644
---- a/include/BALL/STRUCTURE/BONDORDERS/bondOrderAssignment.h
-+++ b/include/BALL/STRUCTURE/BONDORDERS/bondOrderAssignment.h
-@@ -68,7 +68,7 @@ namespace BALL
- float total_charge;
- int node_expansions;
- int queue_size;
--
-+
- AtomContainer* ac;
- };
- }
-diff --git a/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C b/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C
-index 107823e..6572d96 100644
---- a/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C
-+++ b/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C
-@@ -108,7 +108,8 @@ namespace BALL
- }
- else
- {
-- /* Log.info() << "AssignBondOrderProcessor: strategy FPT does not support computeNextSolution(). " << endl
-+ // since we return a pointer, nothing to do here
-+ /* Log.info() << "AssignBondOrderProcessor: strategy FPT does not support computeNextSolution(). " << endl
- << "Please use the options Option::MAX_NUMBER_OF_SOLUTIONS or Option::COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS " << endl
- << "to compute additional solutions." << endl; */
- }
-@@ -1429,12 +1430,12 @@ namespace BALL
-
- bool FPTBondOrderStrategy::DPBackTracking_::hasMoreSolutions() const
- {
-- return (!queue_.empty() && (!max_num_solutions_ || (num_computed_solutions_ <= max_num_solutions_)));
-+ return (!queue_.empty() && (!max_num_solutions_ || (num_computed_solutions_ < max_num_solutions_)));
- }
-
- void FPTBondOrderStrategy::DPBackTracking_::nextSolution()
- {
-- if (queue_.empty() || max_heap_size_ == 0 || ((max_num_solutions_ > 0) && (num_computed_solutions_ > max_num_solutions_)))
-+ if (queue_.empty() || (max_heap_size_ == 0) || ((max_num_solutions_ > 0) && (num_computed_solutions_ > max_num_solutions_)))
- {
- throw Exception::OutOfRange(__FILE__, __LINE__);
- }
-@@ -1987,7 +1988,9 @@ namespace BALL
-
- bool FPTBondOrderStrategy::DPBackTrackingCombiner_::hasMoreSolutions() const
- {
-- return (!priority_queue_.empty() || (getNextMinimumBackTracker_().second) < upper_bound_);
-+ std::pair<Size, Penalty> next_min = getNextMinimumBackTracker_();
-+
-+ return (backtrackers_[next_min.first]->hasMoreSolutions() && (!priority_queue_.empty() || (next_min.second) < upper_bound_));
- }
-
- void FPTBondOrderStrategy::DPBackTrackingCombiner_::nextSolution()
-@@ -2014,7 +2017,7 @@ namespace BALL
- // compute next minimal Solution
- std::pair<Size, Penalty> next_min = getNextMinimumBackTracker_();
-
-- if (next_min.second < upper_bound_ && (priority_queue_.empty() || next_min.second < priority_queue_.top().penalty))
-+ if ((next_min.second < upper_bound_) && (priority_queue_.empty() || (next_min.second < priority_queue_.top().penalty)))
- {
- DPBackTracking_& min_back_tracker = *backtrackers_[next_min.first];
-
-diff --git a/source/STRUCTURE/assignBondOrderProcessor.C b/source/STRUCTURE/assignBondOrderProcessor.C
-index 9863a54..9443fb8 100644
---- a/source/STRUCTURE/assignBondOrderProcessor.C
-+++ b/source/STRUCTURE/assignBondOrderProcessor.C
-@@ -295,8 +295,20 @@ namespace BALL
- )
- {
- Log.error() << __FILE__ << " " << __LINE__
-- << " : Error in options! FPT cannot be used with these options." << endl
-- << " Consider switch to solution strategy ASTAR by setting Option::ALGORITHM to Algorithm::ASTAR." << endl
-+ << " : Error in options! FPT cannot be used with these option(s): ";
-+ if (options.getReal(Option::BOND_LENGTH_WEIGHTING) > 0.)
-+ Log.error() << "BOND_LENGTH_WEIGHTING ";
-+ if (options.getBool(Option::ADD_HYDROGENS))
-+ Log.error() << "ADD_HYDROGENS ";
-+ if (options.getBool(Option::COMPUTE_ALSO_CONNECTIVITY))
-+ Log.error() << "COMPUTE_ALSO_CONNECTIVITY ";
-+ if (options.getBool(Option::OVERWRITE_SELECTED_BONDS))
-+ Log.error() << "OVERWRITE_SELECTED_BONDS ";
-+ if (!options.getBool(Option::OVERWRITE_SINGLE_BOND_ORDERS))
-+ Log.error() << "OVERWRITE_SINGLE_BOND_ORDERS ";
-+ Log.error() << endl;
-+
-+ Log.error() << " Consider switch to solution strategy ASTAR by setting Option::ALGORITHM to Algorithm::ASTAR." << endl
- << " Abort." << endl;
- ret = false;
- }
-@@ -321,8 +333,8 @@ namespace BALL
-
- #ifdef DEBUG
- cout << " OPTIONS:" << endl;
--cout << " \t Algorithm: " << options[Option::Option::ALGORITHM] << endl;
--cout << " \t Heuristic: " << options[Option::Option::HEURISTIC] << endl;
-+cout << " \t Algorithm: " << options[Option::ALGORITHM] << endl;
-+cout << " \t Heuristic: " << options[Option::HEURISTIC] << endl;
-
- cout << " \t Overwrite bonds (single, double, triple, selected):"
- << options.getBool(Option::OVERWRITE_SINGLE_BOND_ORDERS) << " "
-@@ -334,7 +346,7 @@ cout << " \t Overwrite bonds (single, double, triple, selected):"
- cout << " \t Add hydrogens : " << options.getBool(Option::ADD_HYDROGENS) << endl;
- cout << " \t Use fine penalty : " << options.getBool(Option::USE_FINE_PENALTY) << endl;
- cout << " \t Kekulizer: " << options.getBool(Option::KEKULIZE_RINGS) << endl;
--cout << " \t Penalty file " << options[Option::Option::INIFile] << endl;
-+cout << " \t Penalty file " << options[Option::INIFile] << endl;
- cout << " \t alpha: " << options[Option::BOND_LENGTH_WEIGHTING] << endl;
- cout << " \t max bond order: " << options[Option::MAX_BOND_ORDER] << endl;
- cout << " \t max number of solutions " << options[Option::MAX_NUMBER_OF_SOLUTIONS] << endl;
-@@ -549,7 +561,7 @@ cout << "preassignPenaltyClasses_:" << preassignPenaltyClasses_() << " precomput
- boost::shared_ptr<BondOrderAssignment> solution = strategy->computeNextSolution();
-
- // Do we have a solution?
-- if (!solution)
-+ if (!solution || !solution->valid)
- {
- Log.info() << "AssignBondOrderProcessor: No valid bond order assignment found!" << endl;
- #if defined DEBUG_TIMER
-@@ -1237,7 +1249,6 @@ cout << " ~~~~~~~~ added hydrogen dump ~~~~~~~~~~~~~~~~" << endl;
- AssignBondOrderProcessor::Default::APPLY_FIRST_SOLUTION);
- }
-
--
- bool AssignBondOrderProcessor::apply(Position i)
- {
- bool result = false;
-@@ -1370,7 +1381,7 @@ cout << " ~~~~~~~~ added hydrogen dump ~~~~~~~~~~~~~~~~" << endl;
-
- boost::shared_ptr<BondOrderAssignment> solution = strategy->computeNextSolution();
-
-- if (solution)
-+ if (solution && solution->valid)
- {
- solutions_.push_back(*solution);
- found_a_sol = true;
-diff --git a/source/TEST/AssignBondOrderProcessor_test.C b/source/TEST/AssignBondOrderProcessor_test.C
-index 6dfafcc..fdf92d1 100644
---- a/source/TEST/AssignBondOrderProcessor_test.C
-+++ b/source/TEST/AssignBondOrderProcessor_test.C
-@@ -201,6 +201,8 @@ RESULT
-
-
- CHECK(check Options for consistency)
-+ Log.error().disableOutput();
-+
- AssignBondOrderProcessor testbop;
- testbop.setDefaultOptions();
- TEST_EQUAL(testbop.hasValidOptions(), true)
-@@ -208,21 +210,17 @@ CHECK(check Options for consistency)
- testbop.setDefaultOptions();
- testbop.options.set(AssignBondOrderProcessor::Option::ALGORITHM, AssignBondOrderProcessor::Algorithm::FPT);
- testbop.options.set(AssignBondOrderProcessor::Option::ADD_HYDROGENS, true);
--
- TEST_EQUAL(testbop.hasValidOptions(), false)
-
- testbop.setDefaultOptions();
- testbop.options.set(AssignBondOrderProcessor::Option::ALGORITHM, AssignBondOrderProcessor::Algorithm::FPT);
- testbop.options.set(AssignBondOrderProcessor::Option::OVERWRITE_SELECTED_BONDS, true);
--
- TEST_EQUAL(testbop.hasValidOptions(), false)
-
- testbop.setDefaultOptions();
- testbop.options.set(AssignBondOrderProcessor::Option::ALGORITHM, AssignBondOrderProcessor::Algorithm::FPT);
- testbop.options.set(AssignBondOrderProcessor::Option::MAX_NUMBER_OF_SOLUTIONS, 0);
--
-- TEST_EQUAL(testbop.hasValidOptions(), false)
--
-+ TEST_EQUAL(testbop.hasValidOptions(), true)
-
- testbop.setDefaultOptions();
- testbop.options.set(AssignBondOrderProcessor::Option::ALGORITHM, AssignBondOrderProcessor::Algorithm::FPT);
-@@ -230,9 +228,8 @@ CHECK(check Options for consistency)
- testbop.options.set(AssignBondOrderProcessor::Option::OVERWRITE_SINGLE_BOND_ORDERS, true);
- testbop.options.set(AssignBondOrderProcessor::Option::COMPUTE_ALSO_CONNECTIVITY, true);
- testbop.options.set(AssignBondOrderProcessor::Option::MAX_NUMBER_OF_SOLUTIONS, 0);
--
- TEST_EQUAL(testbop.hasValidOptions(), false)
--
-+ Log.error().enableOutput();
- RESULT
-
- /////////////////////// ALGORITHMS //////////////////////
-@@ -841,10 +838,11 @@ CHECK(getTotalPenalty(Position i) and operator() FPT single solution)
- System sys2;
- MOL2File mol_in2(BALL_TEST_DATA_PATH(AssignBondOrderProcessor_test_AN06.mol2), std::ios::in);
- mol_in2 >> sys2;
-+ TEST_EQUAL(testbop.getNumberOfComputedSolutions(), 10)
-+
- sys2.apply(testbop);
- TEST_REAL_EQUAL(testbop.getTotalPenalty(0), 2.f)//0.00625)
-
--
- System sys3;
- MOL2File mol_in3(BALL_TEST_DATA_PATH(AssignBondOrderProcessor_test_BEWCUB.mol2), std::ios::in);
- mol_in3 >> sys3;
-@@ -856,6 +854,7 @@ CHECK(getTotalPenalty(Position i) and operator() FPT single solution)
- MOL2File mol15(BALL_TEST_DATA_PATH(AssignBondOrderProcessor_test_CUDJAM_sol_5.mol2), std::ios::in);
- mol15 >> sys15;
- sys15.apply(testbop);
-+
- TEST_REAL_EQUAL(testbop.getTotalPenalty(1), 2.f ) //0.0015528 )
- TEST_REAL_EQUAL(testbop.getTotalPenalty(2), 5.f ) //0.00388199)
- TEST_REAL_EQUAL(testbop.getTotalPenalty(3), 7.f ) //0.00543478)
-@@ -904,6 +903,34 @@ CHECK(getTotalPenalty(Position i) and operator() FPT single solution)
-
- RESULT
-
-+CHECK(operator() FPT vs A*)
-+ AssignBondOrderProcessor testbop_a;
-+ testbop_a.options.set(AssignBondOrderProcessor::Option::ALGORITHM,AssignBondOrderProcessor::Algorithm::A_STAR);
-+ testbop_a.options.setBool(AssignBondOrderProcessor::Option::COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS, true);
-+
-+ AssignBondOrderProcessor testbop_fpt;
-+ testbop_fpt.options.set(AssignBondOrderProcessor::Option::ALGORITHM,AssignBondOrderProcessor::Algorithm::FPT);
-+ testbop_fpt.options.setBool(AssignBondOrderProcessor::Option::COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS, true);
-+
-+ System sys4;
-+ MOL2File mol4(BALL_TEST_DATA_PATH(AssignBondOrderProcessor_test_CITSED10_sol_6.mol2), std::ios::in);
-+ mol4 >> sys4;
-+ sys4.apply(testbop_a);
-+ sys4.apply(testbop_fpt);
-+ TEST_REAL_EQUAL(testbop_a.getNumberOfComputedSolutions(), testbop_fpt.getNumberOfComputedSolutions())
-+
-+ TEST_REAL_EQUAL(testbop_a.getTotalPenalty(0), testbop_fpt.getTotalPenalty(0)) //1.f )
-+ TEST_REAL_EQUAL(testbop_a.getTotalPenalty(1), testbop_fpt.getTotalPenalty(1)) //1.f )
-+ TEST_REAL_EQUAL(testbop_a.getTotalPenalty(2), testbop_fpt.getTotalPenalty(2)) //32.f)
-+ TEST_REAL_EQUAL(testbop_a.getTotalPenalty(3), testbop_fpt.getTotalPenalty(3)) //34.f)
-+ TEST_REAL_EQUAL(testbop_a.getTotalPenalty(4), testbop_fpt.getTotalPenalty(4)) //34.f)
-+ TEST_REAL_EQUAL(testbop_a.getTotalPenalty(5), testbop_fpt.getTotalPenalty(5)) //34.f)
-+ TEST_REAL_EQUAL(testbop_a.getTotalPenalty(6), testbop_fpt.getTotalPenalty(6)) //66.f)
-+ TEST_REAL_EQUAL(testbop_a.getTotalPenalty(7), testbop_fpt.getTotalPenalty(7)) //66.f)
-+ TEST_REAL_EQUAL(testbop_a.getTotalPenalty(8), testbop_fpt.getTotalPenalty(8)) //67.f)
-+
-+RESULT
-+
-
- CHECK(getTotalCharge(Position i))
- // This feature is experimental!!
-@@ -1023,7 +1050,7 @@ CHECK(computeNextSolution() using ILP)
- MOL2File mol_in(BALL_TEST_DATA_PATH(AssignBondOrderProcessor_test_AN06.mol2), std::ios::in);
- mol_in >> sys;
- sys.apply(testbop);
-- TEST_EQUAL(testbop.getNumberOfComputedSolutions(),1)
-+ TEST_EQUAL(testbop.getNumberOfComputedSolutions(), 1)
- TEST_REAL_EQUAL(testbop.getTotalPenalty(0), 2.f)//0.00625)// 2.)
- TEST_EQUAL(testbop.computeNextSolution(), true)
- TEST_REAL_EQUAL(testbop.getTotalPenalty(1), 32.f)//0.1)//32.)
-@@ -1091,9 +1118,10 @@ CHECK(computeNextSolution() using FPT)
- MOL2File mol_in(BALL_TEST_DATA_PATH(AssignBondOrderProcessor_test_AN06.mol2), std::ios::in);
- mol_in >> sys;
- sys.apply(testbop);
-- TEST_EQUAL(testbop.getNumberOfComputedSolutions(),1)
-+ TEST_EQUAL(testbop.getNumberOfComputedSolutions(), 1)
- TEST_REAL_EQUAL(testbop.getTotalPenalty(0), 2.f)//0.00625)// 2.)
-- TEST_EQUAL(testbop.computeNextSolution(), false)
-+ bool test = testbop.computeNextSolution();
-+ TEST_EQUAL(test, false)
-
- RESULT
-
diff --git a/sci-chemistry/ball/files/ball-1.4.1-Fixed-the-FPT-version-of-bond-order-assignment-2.patch b/sci-chemistry/ball/files/ball-1.4.1-Fixed-the-FPT-version-of-bond-order-assignment-2.patch
deleted file mode 100644
index c5d3fddb1b89..000000000000
--- a/sci-chemistry/ball/files/ball-1.4.1-Fixed-the-FPT-version-of-bond-order-assignment-2.patch
+++ /dev/null
@@ -1,444 +0,0 @@
- include/BALL/DATATYPE/GRAPH/graphAlgorithms.h | 7 +-
- include/BALL/DATATYPE/GRAPH/treeWidth.h | 44 ++++++-
- include/BALL/DATATYPE/GRAPH/treeWidth.iC | 145 +++++++++++++--------
- source/DATATYPE/GRAPH/treeWidth.C | 24 ++++
- source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C | 12 +-
- 5 files changed, 161 insertions(+), 71 deletions(-)
-
-diff --git a/include/BALL/DATATYPE/GRAPH/graphAlgorithms.h b/include/BALL/DATATYPE/GRAPH/graphAlgorithms.h
-index d10de34..5e218ff 100644
---- a/include/BALL/DATATYPE/GRAPH/graphAlgorithms.h
-+++ b/include/BALL/DATATYPE/GRAPH/graphAlgorithms.h
-@@ -25,7 +25,7 @@ namespace boost
- enum vertex_orig_ptr_t { vertex_orig_ptr };
-
- enum edge_bond_ptr_t { edge_bond_ptr };
-- enum edge_orig_ptr_t { edge_orig_ptr };
-+ enum edge_orig_ptr_t { edge_orig_ptr };
-
- BOOST_INSTALL_PROPERTY(vertex, atom_ptr);
- BOOST_INSTALL_PROPERTY(vertex, orig_ptr);
-@@ -150,7 +150,7 @@ namespace BALL
- {
- bi = ai; ++bi;
- for (; bi != ai_end; ++bi)
-- if (!boost::edge(*ai, *bi, graph).second)
-+ if (*bi != *ai && !boost::edge(*ai, *bi, graph).second)
- boost::add_edge(*ai, *bi, graph);
- }
-
-@@ -179,7 +179,6 @@ namespace BALL
-
- typedef typename boost::property_traits<typename boost::property_map<UndirectedGraph, boost::edge_all_t>::type>::value_type EdgeProperties;
-
-- EdgeProperties ep = boost::get(boost::edge_all_t(), graph, boost::edge(vertex, *ai, graph).first) ;
- result.getEdgeProperties().push_back(boost::get(boost::edge_all_t(), graph, boost::edge(vertex, *ai, graph).first));
-
- bi = ai; ++bi;
-@@ -189,7 +188,7 @@ namespace BALL
- {
- boost::add_edge(*ai, *bi, graph);
- result.getEdges().push_back(std::make_pair(boost::get(boost::vertex_index, graph, *ai),
-- boost::get(boost::vertex_index, graph, *bi)));
-+ boost::get(boost::vertex_index, graph, *bi)));
- }
- }
- }
-diff --git a/include/BALL/DATATYPE/GRAPH/treeWidth.h b/include/BALL/DATATYPE/GRAPH/treeWidth.h
-index dc7cdc5..f7687ef 100644
---- a/include/BALL/DATATYPE/GRAPH/treeWidth.h
-+++ b/include/BALL/DATATYPE/GRAPH/treeWidth.h
-@@ -30,10 +30,12 @@
- #include <map>
- #include <set>
- #include <vector>
-+#include <iostream>
-
- #include <boost/graph/connected_components.hpp>
- #include <boost/graph/filtered_graph.hpp>
- #include <boost/graph/graph_as_tree.hpp>
-+#include <boost/graph/graphviz.hpp>
- #include <boost/graph/copy.hpp>
-
- namespace boost
-@@ -91,7 +93,7 @@ namespace BALL
- END_BAG
- };
-
-- typedef typename GRAPH::GraphTraits<UndirectedGraph>::EditableGraph EditableGraph;
-+ typedef typename GRAPH::GraphTraits<UndirectedGraph>::EditableGraph EditableGraph;
- typedef typename boost::graph_traits<UndirectedGraph>::vertex_descriptor OriginalVertexType;
-
- typedef std::set<OriginalVertexType> TreeDecompositionContent;
-@@ -111,6 +113,16 @@ namespace BALL
-
- TreeWidth(UndirectedGraph const& input);
-
-+ /** Compute the tree width of a given tree decomposition.
-+ * This function iterates over all nodes in the graph to determine the tree width,
-+ * i.e., the (maximum number of vertices over all bags) - 1
-+ */
-+ static Size computeTreeWidth(TreeDecomposition const& td);
-+
-+ /** Write a tree decomposition in graphviz format.
-+ */
-+ void writeGraphvizFile(std::ostream& out, TreeDecomposition const& td);
-+
- std::vector<boost::shared_ptr<EditableGraph> >& getComponents() { return components_; }
- std::vector<boost::shared_ptr<TreeDecomposition> >& getNiceTreeDecompositions() { return nice_tree_decompositions_; }
-
-@@ -120,25 +132,44 @@ namespace BALL
- {
- public:
- ComponentFilter_(ComponentMap cm, Position i)
-- : cm_(&cm),
-+ : cm_(cm),
- component_(i)
- { }
-
- template <typename Vertex>
- bool operator() (const Vertex& e) const
- {
-- return ((*cm_)[e] == component_);
-+ return ((cm_)[e] == component_);
- }
-
- protected:
-- ComponentMap* cm_;
-+ ComponentMap cm_;
- Position component_;
- };
-
-+ /** PropertyWriter for graphviz output.
-+ */
-+ class BagContentWriter
-+ {
-+ public:
-+ BagContentWriter(TreeDecomposition const* td, UndirectedGraph const* original_graph)
-+ : td_(td),
-+ original_graph_(original_graph)
-+ { }
-+
-+ void operator() (std::ostream& out, const TreeDecompositionBag& v) const;
-+
-+ protected:
-+ TreeDecomposition const* td_;
-+ UndirectedGraph const* original_graph_;
-+ };
-+
-+ // TODO: would UndirectedGraph suffice here?
- MolecularGraph const* input_;
-+
- std::vector<boost::shared_ptr<EditableGraph> > components_;
-
-- std::vector<boost::shared_ptr<TreeDecomposition> > nice_tree_decompositions_;
-+ std::vector<boost::shared_ptr<TreeDecomposition> > nice_tree_decompositions_;
- std::vector<boost::shared_ptr<TreeDecompositionGraph> > nice_tree_decomposition_graphs_;
- };
-
-@@ -397,6 +428,9 @@ namespace BALL
- * The bitset remembers the eliminated vertices without an ordering.
- */
- BitSet buildBitset() const;
-+
-+ protected:
-+ std::map<int, VertexType> index_to_vertex_;
- };
-
- /**
-diff --git a/include/BALL/DATATYPE/GRAPH/treeWidth.iC b/include/BALL/DATATYPE/GRAPH/treeWidth.iC
-index 633e588..99f14cf 100644
---- a/include/BALL/DATATYPE/GRAPH/treeWidth.iC
-+++ b/include/BALL/DATATYPE/GRAPH/treeWidth.iC
-@@ -68,6 +68,34 @@ namespace BALL
- }
- }
-
-+ template <class UndirectedGraph>
-+ Size TreeWidth<UndirectedGraph>::computeTreeWidth(TreeDecomposition const& td)
-+ {
-+ Size result = 1;
-+
-+ BGL_FORALL_VERTICES_T(current_vertex, td._g, UndirectedGraph)
-+ {
-+ result = std::max((Size)(boost::get(boost::vertex_bag_content, td, current_vertex).size()), result);
-+ }
-+
-+ return result - 1;
-+ }
-+
-+ template <class UndirectedGraph>
-+ void TreeWidth<UndirectedGraph>::writeGraphvizFile(std::ostream& out, TreeDecomposition const& td)
-+ {
-+ boost::write_graphviz(out, td._g, BagContentWriter(&td, input_));
-+ }
-+
-+ template <>
-+ void TreeWidth<MolecularGraph>::BagContentWriter::operator() (std::ostream& out, const TreeDecompositionBag& v) const;
-+
-+ template <class UndirectedGraph>
-+ void TreeWidth<UndirectedGraph>::BagContentWriter::operator() (std::ostream& out, const TreeDecompositionBag& v) const
-+ {
-+ out << "[label=\"" << boost::get(boost::vertex_index, *td_, v) << "\"]";
-+ }
-+
- // *****************************************************************************************
- // * TreeWidthImplementation *
- // *****************************************************************************************
-@@ -322,8 +350,9 @@ namespace BALL
- if (boost::out_degree(vertex, graph_) <= 1)
- return IS_SIMPLICIAL;
-
-- VertexType* n1 = NULL;
-- VertexType* n2 = NULL;
-+ VertexType n1 = VertexType();
-+ VertexType n2 = VertexType();
-+ bool found_unconnected = false;
-
- typename boost::graph_traits<UndirectedGraph>::adjacency_iterator a_i, a_j, ai_end;
-
-@@ -337,20 +366,21 @@ namespace BALL
-
- if (!boost::edge(i, j, graph_).second)
- {
-- if (!n1)
-+ if (!found_unconnected)
- {
-- n1 = &i;
-- n2 = &j;
-+ n1 = i;
-+ n2 = j;
-+ found_unconnected = true;
- }
-- else if (i == *n1 || i == *n2)
-+ else if (i == n1 || i == n2)
- {
-- n1 = &i;
-- n2 = &i;
-+ n1 = i;
-+ n2 = i;
- }
-- else if (j == *n1 || j == *n2)
-+ else if (j == n1 || j == n2)
- {
-- n1 = &j;
-- n2 = &j;
-+ n1 = j;
-+ n2 = j;
- }
- else
- {
-@@ -376,11 +406,10 @@ namespace BALL
- {
- Size nxt = cstate.permutation.size();
-
-- std::map<int, VertexType> index_to_vertex;
- BGL_FORALL_VERTICES_T(current_vertex, graph_, UndirectedGraph)
- {
- Size index = boost::get(boost::vertex_index, graph_, current_vertex);
-- index_to_vertex[index] = current_vertex;
-+ index_to_vertex_[index] = current_vertex;
- SIMPLICIAL_TYPE simplicial(isSimplicial(current_vertex));
- if (simplicial == IS_SIMPLICIAL || simplicial == ALMOST_SIMPLICIAL)
- {
-@@ -388,14 +417,13 @@ namespace BALL
- }
- }
-
--
-- for (typename std::vector<Size>::const_iterator st_iter = cstate.permutation.begin() + nxt;
-- st_iter != cstate.permutation.end(); ++st_iter)
-+ for (typename std::vector<Size>::const_iterator st_iter = cstate.permutation.begin() + nxt;
-+ st_iter != cstate.permutation.end();
-+ ++st_iter)
- {
-- VertexType vertex = index_to_vertex[*st_iter];
-+ VertexType vertex = index_to_vertex_[*st_iter];
- cstate.g = std::max(cstate.g, (Size)boost::out_degree(vertex, graph_));
- cstate.f = std::max(cstate.f, cstate.g);
--
- GRAPH::eliminateVertex(vertex, graph_);
- }
- }
-@@ -459,55 +487,62 @@ namespace BALL
- {
- upper_bound = nstate.f;
- state.permutation = nstate.permutation;
-- state.permutation.push_back(0);
-+ BGL_FORALL_VERTICES_T(v, graph_, UndirectedGraph) // yes, it is only one, but still...
-+ {
-+ state.permutation.push_back(boost::get(boost::vertex_index, graph_, v));
-+ }
- }
- }
- else
- {
-- std::map<int, VertexType> index_to_vertex;
-+ index_to_vertex_.clear();
- BGL_FORALL_VERTICES_T(v, graph_, UndirectedGraph)
- {
-- index_to_vertex[boost::get(boost::vertex_index, graph_, v)] = v;
-+ index_to_vertex_[boost::get(boost::vertex_index, graph_, v)] = v;
- }
-
- for (typename std::vector<Size>::iterator viter = greedy_solution.first.begin();
- viter != greedy_solution.first.end(); ++viter)
- {
-- VertexType& vertex = index_to_vertex[*viter];
-- Size degree = boost::out_degree(vertex, graph_);
--
-- GRAPH::UndoEliminateOperation<UndirectedGraph> elimination(graph_, vertex);
--
-- QuickBBState xstate(nstate);
-- xstate.g = std::max(nstate.g, degree);
-- xstate.permutation.push_back(boost::get(boost::vertex_index, graph_, vertex));
--
-- BitSet bitset(buildBitset());
--
-- Size lower_bound = L()(graph_);
-- xstate.h = lower_bound;
-- xstate.f = max(xstate.g, lower_bound);
--
-- if (xstate.f >= upper_bound)
-- {
-- elimination.undo();
--
-- continue;
-- }
--
-- MapPos entry(visitedSubgraphs.insert(MapEntry(bitset, xstate.f)));
--
-- if (entry.second)
-- {
-- branchAndBound(xstate);
-- }
-- else if ((entry.first)->second > xstate.f)
-+ if (index_to_vertex_.find(*viter) != index_to_vertex_.end())
- {
-- entry.first->second = xstate.f;
-- branchAndBound(xstate);
-+ VertexType& vertex = index_to_vertex_[*viter];
-+ Size degree = boost::out_degree(vertex, graph_);
-+
-+ GRAPH::UndoEliminateOperation<UndirectedGraph> elimination = GRAPH::eliminateVertexUndoable(vertex, graph_);
-+
-+ QuickBBState xstate(nstate);
-+ xstate.g = std::max(nstate.g, degree);
-+ xstate.permutation.push_back(*viter);
-+
-+ BitSet bitset(buildBitset());
-+
-+ Size lower_bound = L()(graph_);
-+ xstate.h = lower_bound;
-+ xstate.f = max(xstate.g, lower_bound);
-+
-+ if (xstate.f >= upper_bound)
-+ {
-+ VertexType vertex_replace = elimination.undo();
-+ index_to_vertex_[*viter] = vertex_replace;
-+ continue;
-+ }
-+
-+ MapPos entry(visitedSubgraphs.insert(MapEntry(bitset, xstate.f)));
-+
-+ if (entry.second)
-+ {
-+ branchAndBound(xstate);
-+ }
-+ else if ((entry.first)->second > xstate.f)
-+ {
-+ entry.first->second = xstate.f;
-+ branchAndBound(xstate);
-+ }
-+
-+ VertexType vertex_replace = elimination.undo();
-+ index_to_vertex_[*viter] = vertex_replace;
- }
--
-- elimination.undo();
- }
- }
- }
-@@ -687,7 +722,7 @@ namespace BALL
- typename TreeWidth<OriginalGraphType>::TreeDecompositionBag
- TreeWidthImplementation<UndirectedGraph>::TreeDecompositionBuilder<OriginalGraphType>::buildRoot_(TreeDecompositionBag child)
- {
-- TreeDecompositionBag last_vertex;
-+ TreeDecompositionBag last_vertex = TreeDecompositionBag();
-
- TreeDecompositionContent content = boost::get(boost::vertex_bag_content, *nice_tree_, child);
-
-diff --git a/source/DATATYPE/GRAPH/treeWidth.C b/source/DATATYPE/GRAPH/treeWidth.C
-index 981605d..7485305 100644
---- a/source/DATATYPE/GRAPH/treeWidth.C
-+++ b/source/DATATYPE/GRAPH/treeWidth.C
-@@ -1 +1,25 @@
- #include <BALL/DATATYPE/GRAPH/treeWidth.h>
-+
-+#include <BALL/KERNEL/atom.h>
-+
-+namespace BALL
-+{
-+ template <>
-+ void TreeWidth<MolecularGraph>::BagContentWriter::operator() (std::ostream& out, const TreeDecompositionBag& v) const
-+ {
-+ out << "[label=\"";
-+
-+ // find all vertices in the current bag
-+ TreeDecompositionContent content = boost::get(boost::vertex_bag_content, *td_, v);
-+
-+ for (typename TreeDecompositionContent::const_iterator tdc_it = content.begin(); tdc_it != content.end(); ++tdc_it)
-+ {
-+ TreeWidth<MolecularGraph>::OriginalVertexType ov = *tdc_it;
-+ Atom const* atom = boost::get(boost::vertex_atom_ptr, *original_graph_, ov);
-+
-+ out << atom->getFullName() << " (" << atom << ") " << "\\n";
-+ }
-+
-+ out << "\"]";
-+ }
-+}
-diff --git a/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C b/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C
-index 4f872ae..c708535 100644
---- a/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C
-+++ b/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C
-@@ -68,7 +68,7 @@ namespace BALL
- for (Position i = 0; i < ntds.size(); ++i)
- {
- bond_assignments.push_back(new FPTBondOrderAssignment_(*this, ntds[i], upper_bound_));
-- Penalty result = bond_assignments[i]->compute();
-+ bond_assignments[i]->compute();
- }
-
- // initialize backtracking
-@@ -650,8 +650,8 @@ namespace BALL
- {
- Edge e = *it;
-
-- MolecularGraphTraits::VertexType source = boost::source(*it, *molecule_);
-- MolecularGraphTraits::VertexType target = boost::target(*it, *molecule_);
-+ MolecularGraphTraits::VertexType source = boost::source(e, *molecule_);
-+ MolecularGraphTraits::VertexType target = boost::target(e, *molecule_);
-
- if (iv == source || iv == target)
- {
-@@ -1893,8 +1893,7 @@ namespace BALL
-
- BGL_FORALL_EDGES(edge_it, graph, MolecularGraph)
- {
-- if (boost::source(edge_it, graph) < boost::target(edge_it, graph))
-- sorted_edges.push_back(edge_it);
-+ sorted_edges.push_back(edge_it);
- }
-
- // sort bonds - the second vertex could be in false order
-@@ -1927,8 +1926,7 @@ namespace BALL
-
- BGL_FORALL_EDGES(edge_it, graph, MolecularGraph)
- {
-- if (boost::source(edge_it, graph) < boost::target(edge_it, graph))
-- sorted_edges.push_back(edge_it);
-+ sorted_edges.push_back(edge_it);
- }
-
- // sort bonds - the second vertex could be in false order
diff --git a/sci-chemistry/ball/files/ball-1.4.1-gcc-4.7.patch b/sci-chemistry/ball/files/ball-1.4.1-gcc-4.7.patch
deleted file mode 100644
index 6ab98729a83e..000000000000
--- a/sci-chemistry/ball/files/ball-1.4.1-gcc-4.7.patch
+++ /dev/null
@@ -1,592 +0,0 @@
- include/BALL/COMMON/global.h | 26 +++++------
- include/BALL/COMMON/hash.h | 36 +++++++--------
- include/BALL/DATATYPE/bitVector.h | 2 +-
- include/BALL/DATATYPE/hashMap.h | 9 +---
- include/BALL/DATATYPE/string.h | 11 +++--
- include/BALL/DATATYPE/string.iC | 5 ++
- include/BALL/SYSTEM/binaryFileAdaptor.h | 53 +++++++++++-----------
- source/COMMON/exception.C | 6 +--
- source/COMMON/hash.C | 2 +-
- source/COMMON/init.C | 4 +-
- source/COMMON/logStream.C | 6 +--
- source/COMMON/version.C | 2 +-
- source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C | 41 +++++++++--------
- source/STRUCTURE/kekulizer.C | 8 ++--
- source/TEST/INIFile_test.C | 8 ++--
- source/TEST/ParameterSection_test.C | 2 +-
- 16 files changed, 114 insertions(+), 107 deletions(-)
-
-diff --git a/include/BALL/COMMON/global.h b/include/BALL/COMMON/global.h
-index 11d9246..02c81c6 100644
---- a/include/BALL/COMMON/global.h
-+++ b/include/BALL/COMMON/global.h
-@@ -9,7 +9,7 @@
- # include <BALL/CONFIG/config.h>
- #endif
-
--#include <limits.h>
-+#include <limits>
- #include <time.h>
-
- #ifdef BALL_HAS_BASETSD_H
-@@ -223,28 +223,28 @@ namespace BALL
- ASCII__SEMICOLON = ';'
- };
-
-- static const Distance INVALID_DISTANCE = INT_MIN;
-- static const Distance DISTANCE_MIN = (INT_MIN + 1);
-- static const Distance DISTANCE_MAX = INT_MAX;
-+ static const Distance INVALID_DISTANCE = std::numeric_limits<Distance>::max();
-+ static const Distance DISTANCE_MIN = (std::numeric_limits<Distance>::min() + 1);
-+ static const Distance DISTANCE_MAX = std::numeric_limits<Distance>::max();
-
-- static const Handle INVALID_HANDLE = INT_MAX;
-+ static const Handle INVALID_HANDLE = std::numeric_limits<Handle>::max();
- static const Handle HANDLE_MIN = 0 ;
-- static const Handle HANDLE_MAX = INT_MAX - 1;
-+ static const Handle HANDLE_MAX = std::numeric_limits<Handle>::max() - 1;
-
- static const Index INVALID_INDEX = -1;
- static const Index INDEX_MIN = 0;
-- static const Index INDEX_MAX = INT_MAX;
-+ static const Index INDEX_MAX = std::numeric_limits<Index>::max();
-
-- static const Position INVALID_POSITION = INT_MAX;
-+ static const Position INVALID_POSITION = std::numeric_limits<Position>::max();
- static const Position POSITION_MIN = 0;
-- static const Position POSITION_MAX = INT_MAX - 1;
-+ static const Position POSITION_MAX = std::numeric_limits<Position>::max() - 1;
-
- # undef SIZE_MAX
-- static const Size INVALID_SIZE = INT_MAX;
-+ static const Size INVALID_SIZE = std::numeric_limits<Size>::max();
- static const Size SIZE_MIN = 0;
-- static const Size SIZE_MAX = INT_MAX - 1;
--
--
-+ static const Size SIZE_MAX = std::numeric_limits<Size>::max() - 1;
-+
-+
- }
-
- #endif // BALL_COMMON_GLOBAL_H
-diff --git a/include/BALL/COMMON/hash.h b/include/BALL/COMMON/hash.h
-index 8d45df3..ebb9a55 100644
---- a/include/BALL/COMMON/hash.h
-+++ b/include/BALL/COMMON/hash.h
-@@ -15,24 +15,6 @@
-
- namespace BALL
- {
-- /** General Hash Function Template.
-- This template function provides a simple wrapper
-- for the specialized hash functions. It facilitates their use
-- in STL hash associative containers which expect a <b>Hasher</b>
-- class as template parameter.
-- \ingroup Common
-- */
-- template <typename T>
-- class HashFunction
-- {
-- public:
--
-- HashIndex operator () (const T& t) const
-- {
-- return Hash(t);
-- }
-- };
--
- /** @name Specialized Hash Functions.
- */
- //@{
-@@ -105,6 +87,24 @@ namespace BALL
-
- //@}
-
-+ /** General Hash Function Template.
-+ This template function provides a simple wrapper
-+ for the specialized hash functions. It facilitates their use
-+ in STL hash associative containers which expect a <b>Hasher</b>
-+ class as template parameter.
-+ \ingroup Common
-+ */
-+ template <typename T>
-+ class HashFunction
-+ {
-+ public:
-+
-+ HashIndex operator () (const T& t) const
-+ {
-+ return Hash(t);
-+ }
-+ };
-+
- } // namespace BALL
-
- #endif // BALL_COMMON_HASH_H
-diff --git a/include/BALL/DATATYPE/bitVector.h b/include/BALL/DATATYPE/bitVector.h
-index 991f08e..dc7ead6 100644
---- a/include/BALL/DATATYPE/bitVector.h
-+++ b/include/BALL/DATATYPE/bitVector.h
-@@ -18,7 +18,7 @@
- #endif
-
-
--#include <string.h>
-+#include <cstring>
-
- #define BALL_BLOCK_BITS 8
- #define BALL_BLOCK_MASK (BALL_BLOCK_BITS - 1)
-diff --git a/include/BALL/DATATYPE/hashMap.h b/include/BALL/DATATYPE/hashMap.h
-index 329db2b..f185b8c 100644
---- a/include/BALL/DATATYPE/hashMap.h
-+++ b/include/BALL/DATATYPE/hashMap.h
-@@ -236,7 +236,7 @@ namespace BALL
- template <class Key, class T>
- const T& HashMap<Key, T>::operator [] (const Key& key) const
- {
-- ConstIterator it = find(key);
-+ ConstIterator it = this->find(key);
- if (it == Base::end())
- {
- throw IllegalKey(__FILE__, __LINE__);
-@@ -272,12 +272,7 @@ namespace BALL
- T& HashMap<Key, T>::operator [] (const Key& key)
-
- {
-- Iterator it = find(key);
-- if (it == Base::end())
-- {
-- it = insert(ValueType(key, T())).first;
-- }
-- return it->second;
-+ return BALL_MAP_NAME::operator[] (key);
- }
-
- } // namespace BALL
-diff --git a/include/BALL/DATATYPE/string.h b/include/BALL/DATATYPE/string.h
-index 1172180..aa11c35 100644
---- a/include/BALL/DATATYPE/string.h
-+++ b/include/BALL/DATATYPE/string.h
-@@ -27,10 +27,10 @@
- #endif
-
- #include <string>
--#include <ctype.h>
--#include <errno.h>
--#include <stdlib.h>
--#include <string.h>
-+#include <cctype>
-+#include <cerrno>
-+#include <cstdlib>
-+#include <cstring>
- #include <iostream>
- #include <vector>
-
-@@ -155,6 +155,9 @@ namespace BALL
- /// STL string copy constructor
- String(const string& string);
-
-+ /// Copy constructor
-+ String(const String& s);
-+
- #ifdef BALL_STD_STRING_HAS_RVALUE_REFERENCES
- /// Move constructor
- String(String&& s);
-diff --git a/include/BALL/DATATYPE/string.iC b/include/BALL/DATATYPE/string.iC
-index b255849..c347588 100644
---- a/include/BALL/DATATYPE/string.iC
-+++ b/include/BALL/DATATYPE/string.iC
-@@ -8,6 +8,11 @@ String::String()
- {
- }
-
-+BALL_INLINE String::String(const String& s)
-+ : string(s)
-+{
-+}
-+
- #ifdef BALL_STD_STRING_HAS_RVALUE_REFERENCES
- BALL_INLINE
- String::String(String&& s)
-diff --git a/include/BALL/SYSTEM/binaryFileAdaptor.h b/include/BALL/SYSTEM/binaryFileAdaptor.h
-index 64f0f5d..6488e18 100644
---- a/include/BALL/SYSTEM/binaryFileAdaptor.h
-+++ b/include/BALL/SYSTEM/binaryFileAdaptor.h
-@@ -10,6 +10,33 @@
-
- namespace BALL
- {
-+ /** Coping with endianness. This function swaps the bytes of a variable
-+ of type T if this type is of size 2n.
-+ */
-+ template <typename T>
-+ void swapBytes(T& t)
-+ {
-+ if (sizeof(T) % 2 != 0)
-+ {
-+ Log.error() << "Cannot swap types of uneven size." << std::endl;
-+ return;
-+ }
-+
-+ char* tmp = reinterpret_cast<char*>(&t);
-+ std::reverse(tmp, tmp + sizeof(T));
-+ }
-+
-+ //In the following some specialisations of swapBytes are provided for efficiency reasons
-+ //These should also cover BALL types like Size, Position and Index
-+ template<> BALL_EXPORT void swapBytes(unsigned short&);
-+ template<> BALL_EXPORT void swapBytes(short&);
-+ template<> BALL_EXPORT void swapBytes(unsigned int&);
-+ template<> BALL_EXPORT void swapBytes(int&);
-+ template<> BALL_EXPORT void swapBytes(unsigned long&);
-+ template<> BALL_EXPORT void swapBytes(long&);
-+ template<> BALL_EXPORT void swapBytes(float&);
-+ template<> BALL_EXPORT void swapBytes(double&);
-+
- /**
- * Helper class for data conversion.
- * BinaryFileAdaptors are used to read and write binary data from and to
-@@ -152,32 +179,6 @@ namespace BALL
- return is;
- }
-
-- /** Coping with endianness. This function swaps the bytes of a variable
-- of type T if this type is of size 2n.
-- */
-- template <typename T>
-- void swapBytes(T& t)
-- {
-- if (sizeof(T) % 2 != 0)
-- {
-- Log.error() << "Cannot swap types of uneven size." << std::endl;
-- return;
-- }
--
-- char* tmp = reinterpret_cast<char*>(&t);
-- std::reverse(tmp, tmp + sizeof(T));
-- }
--
-- //In the following some specialisations of swapBytes are provided for efficiency reasons
-- //These should also cover BALL types like Size, Position and Index
-- template<> BALL_EXPORT void swapBytes(unsigned short&);
-- template<> BALL_EXPORT void swapBytes(short&);
-- template<> BALL_EXPORT void swapBytes(unsigned int&);
-- template<> BALL_EXPORT void swapBytes(int&);
-- template<> BALL_EXPORT void swapBytes(unsigned long&);
-- template<> BALL_EXPORT void swapBytes(long&);
-- template<> BALL_EXPORT void swapBytes(float&);
-- template<> BALL_EXPORT void swapBytes(double&);
- } //namespace BALL
-
- #ifndef BALL_NO_INLINE_FUNCTIONS
-diff --git a/source/COMMON/exception.C b/source/COMMON/exception.C
-index e7855ce..464f971 100644
---- a/source/COMMON/exception.C
-+++ b/source/COMMON/exception.C
-@@ -9,10 +9,10 @@
- #include <iostream>
- #include <typeinfo>
- #include <exception>
--#include <stdio.h>
--#include <stdlib.h> // for getenv in terminate()
-+#include <cstdio>
-+#include <cstdlib> // for getenv in terminate()
- #include <sys/types.h>
--#include <signal.h> // for SIGSEGV and kill
-+#include <csignal> // for SIGSEGV and kill
-
- #ifdef BALL_HAS_UNISTD_H
- # include <unistd.h> // fot getpid
-diff --git a/source/COMMON/hash.C b/source/COMMON/hash.C
-index 0d81493..ffe75de 100644
---- a/source/COMMON/hash.C
-+++ b/source/COMMON/hash.C
-@@ -72,7 +72,7 @@ namespace BALL
- Index index = 0;
- Index temp_index;
-
--# define BALL_BITS_IN_HASHVALUE_ (sizeof(Index) * CHAR_BIT)
-+# define BALL_BITS_IN_HASHVALUE_ (sizeof(Index) * std::numeric_limits<unsigned char>::digits)
- # define BALL_THREE_QUARTERS_ ((Index)((BALL_BITS_IN_HASHVALUE_ * 3) / 4))
- # define BALL_ONE_EIGHTH_ ((Index)(BALL_BITS_IN_HASHVALUE_ / 8))
- # define BALL_HIGH_BITS_ (~((Index)(~0) >> BALL_ONE_EIGHTH_))
-diff --git a/source/COMMON/init.C b/source/COMMON/init.C
-index d426756..856fe68 100644
---- a/source/COMMON/init.C
-+++ b/source/COMMON/init.C
-@@ -4,8 +4,8 @@
-
- #include <BALL/COMMON/init.h>
-
--#include <locale.h>
--#include <stdlib.h>
-+#include <clocale>
-+#include <cstdlib>
-
- namespace BALL
- {
-diff --git a/source/COMMON/logStream.C b/source/COMMON/logStream.C
-index 12b9184..0340e24 100644
---- a/source/COMMON/logStream.C
-+++ b/source/COMMON/logStream.C
-@@ -26,9 +26,9 @@ namespace BALL
- // at this point, it is not yet possible to
- // include BALL/COMMON/limits.h (which were a
- // much nicer solution...). Ugly header dependencies...
-- const int LogStreamBuf::MIN_LEVEL = INT_MIN;
-- const int LogStreamBuf::MAX_LEVEL = INT_MAX;
-- const Time LogStreamBuf::MAX_TIME = INT_MAX;
-+ const int LogStreamBuf::MIN_LEVEL = std::numeric_limits<int>::min();
-+ const int LogStreamBuf::MAX_LEVEL = std::numeric_limits<int>::max();
-+ const Time LogStreamBuf::MAX_TIME = std::numeric_limits<Time>::max();
-
- LogStreamBuf::LogStreamBuf()
- : std::streambuf(),
-diff --git a/source/COMMON/version.C b/source/COMMON/version.C
-index 1a0987b..15c9d87 100644
---- a/source/COMMON/version.C
-+++ b/source/COMMON/version.C
-@@ -12,7 +12,7 @@ namespace BALL
- {
- const char* VersionInfo::getVersion()
- {
-- return BALL_RELEASE_STRING " ("__DATE__", " __TIME__ ")";
-+ return BALL_RELEASE_STRING " (" __DATE__ ", " __TIME__ ")";
- }
-
- int VersionInfo::getMinorRevision()
-diff --git a/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C b/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C
-index 89a1f68..4f872ae 100644
---- a/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C
-+++ b/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C
-@@ -323,7 +323,7 @@ namespace BALL
- }
- }
-
-- return *best;
-+ return DPConstRow_(boost::reference_wrapper<DPConfig_ const>(best->first), best->second);
- }
-
- FPTBondOrderStrategy::Penalty FPTBondOrderStrategy::DPTable_::operator[](FPTBondOrderStrategy::DPConfig_ const& config) const
-@@ -602,6 +602,9 @@ namespace BALL
-
- return bonds;
- }
-+
-+#define convertToCRow(tmp)\
-+ std::make_pair(boost::reference_wrapper<const DPConfig_>((tmp).first), (tmp).second)
-
- void FPTBondOrderStrategy::FPTBondOrderAssignment_::computeIntroduceBag(TreeDecompositionBag& bag, DPTable_& child,
- AdditionalBagProperties_& property)
-@@ -622,7 +625,7 @@ namespace BALL
- // copy with n new bondvalue-columns with different values
- for (DPTable_::const_iterator iter = child.begin(); iter != child.end(); ++iter)
- {
-- DPConstRow_ child_entry = *iter;
-+ DPConstRow_ child_entry = convertToCRow(*iter);
- DPConfig_ conf(num_valences, num_bonds);
-
- Size vindex = 0;
-@@ -787,7 +790,7 @@ namespace BALL
-
- for (DPTable_::const_iterator entry_iterator = child.begin(); entry_iterator != child.end(); ++entry_iterator)
- {
-- Penalty entry_penalty(forgetInnerVertexIn(bag, *entry_iterator, new_entry, child_property.bonds, forgotten_index));
-+ Penalty entry_penalty(forgetInnerVertexIn(bag, convertToCRow(*entry_iterator), new_entry, child_property.bonds, forgotten_index));
- if (entry_penalty < upper_bound_)
- {
- property.table->insert(new_entry, entry_penalty);
-@@ -804,7 +807,7 @@ namespace BALL
- Penalty min_penalty = FPTBondOrderStrategy::infinite_penalty;
- for (DPTable_::const_iterator iter = child.begin(); iter != child.end(); ++iter)
- {
-- min_penalty = std::min(min_penalty, forgetInnerVertexIn(bag, *iter, empty, empty_list, 0));
-+ min_penalty = std::min(min_penalty, forgetInnerVertexIn(bag, convertToCRow(*iter), empty, empty_list, 0));
-
- if (Maths::isEqual(0, min_penalty))
- {
-@@ -830,17 +833,17 @@ namespace BALL
- // insert each entry of the left child into a DPJoinMap
- for (DPTable_::const_iterator left_iter = left_child.begin(); left_iter != left_child.end(); ++left_iter)
- {
-- DPConstRow_ left_entry = *left_iter;
-- map.insert(pair<DPConfig_ const*, Penalty> (left_entry.first.get_pointer(), left_entry.second));
-+ DPConstRow_ left_entry = convertToCRow(*left_iter);
-+ map.insert(std::pair<DPConfig_ const*, Penalty> (left_entry.first.get_pointer(), left_entry.second));
- }
-
- // find for each entry of the right child's table appropiate entries in the DPJoinMap (which have the same bondvalues)
- for (DPTable_::const_iterator r_iter = right_child.begin(); r_iter != right_child.end(); ++r_iter)
- {
-- DPConstRow_ right_entry = *r_iter;
-+ DPConstRow_ right_entry = convertToCRow(*r_iter);
- DPConfig_ const* right_conf = right_entry.first.get_pointer();
-
-- pair<DPJoinMap_::const_iterator, DPJoinMap_::const_iterator> matching_range(map.equal_range(right_conf));
-+ std::pair<DPJoinMap_::const_iterator, DPJoinMap_::const_iterator> matching_range(map.equal_range(right_conf));
-
- for (DPJoinMap_::const_iterator match = matching_range.first;
- match != matching_range.second; ++match)
-@@ -1441,7 +1444,7 @@ namespace BALL
- delete current_state_;
- }
-
-- multiset<BackTrackingState_*, StateComparator_>::iterator first = queue_.begin();
-+ std::multiset<BackTrackingState_*, StateComparator_>::iterator first = queue_.begin();
- current_state_ = *first;
- queue_.erase(first);
- --max_heap_size_;
-@@ -1598,7 +1601,7 @@ namespace BALL
- // insert possible antecessors in vectors
- for (DPTable_::const_iterator iter = left_table.begin(); iter != left_table.end(); ++iter)
- {
-- DPConstRow_ antecessor = *iter;
-+ DPConstRow_ antecessor = convertToCRow(*iter);
- if (comp.compare(&successor, antecessor.first.get_pointer()) == 0)
- {
- left_entries.push_back(iter);
-@@ -1607,7 +1610,7 @@ namespace BALL
-
- for (DPTable_::const_iterator iter = right_table.begin(); iter != right_table.end(); ++iter)
- {
-- DPConstRow_ antecessor = *iter;
-+ DPConstRow_ antecessor = convertToCRow(*iter);
- if (comp.compare(&successor, antecessor.first.get_pointer()) == 0)
- {
- right_entries.push_back(iter);
-@@ -1619,10 +1622,10 @@ namespace BALL
-
- for (std::vector<DPTable_::const_iterator>::const_iterator left = left_entries.begin(); left != left_entries.end(); ++left)
- {
-- DPConstRow_ left_entry = **left;
-+ DPConstRow_ left_entry = convertToCRow(**left);
- for (std::vector<DPTable_::const_iterator>::const_iterator right = right_entries.begin(); right != right_entries.end(); ++right)
- {
-- DPConstRow_ right_entry = **right;
-+ DPConstRow_ right_entry = convertToCRow(**right);
-
- // check sum of valences
- bool correct_valences = true;
-@@ -1653,8 +1656,8 @@ namespace BALL
-
- Penalty best_penalty = best.first->second + best.second->second;
-
-- DPConstRow_ left = *best.first;
-- DPConstRow_ right = *best.second;
-+ DPConstRow_ left = convertToCRow(*best.first);
-+ DPConstRow_ right = convertToCRow(*best.second);
-
- extendState(state, left.first, 0);
- ++state.index;
-@@ -1664,8 +1667,8 @@ namespace BALL
- {
- DPPairIt_ entry = *iter;
-
-- DPConstRow_ left = *entry.first;
-- DPConstRow_ right = *entry.second;
-+ DPConstRow_ left = convertToCRow(*entry.first);
-+ DPConstRow_ right = convertToCRow(*entry.second);
-
- Penalty add_penalty = (left.second + right.second) - best_penalty;
- if (isSolutionNeeded(state.assignment.penalty + add_penalty))
-@@ -1716,7 +1719,7 @@ namespace BALL
- // check for each row entry: is it a possible anteccessor?
- for (DPTable_::iterator iter = table.begin(); iter != table.end(); ++iter)
- {
-- Penalty pen = bond_assignment_->forgetInnerVertexIn(bag, *iter, test_entry, child_bonds, forgotten_index);
-+ Penalty pen = bond_assignment_->forgetInnerVertexIn(bag, convertToCRow(*iter), test_entry, child_bonds, forgotten_index);
-
- if (pen < FPTBondOrderStrategy::infinite_penalty && test_entry == successor)
- {
-@@ -1783,7 +1786,7 @@ namespace BALL
- {
- while (queue_.size() > max_heap_size_)
- {
-- multiset<BackTrackingState_*, StateComparator_>::iterator pos = queue_.end();
-+ std::multiset<BackTrackingState_*, StateComparator_>::iterator pos = queue_.end();
- --pos;
- delete *pos;
- queue_.erase(pos);
-diff --git a/source/STRUCTURE/kekulizer.C b/source/STRUCTURE/kekulizer.C
-index d1f4e78..c277091 100644
---- a/source/STRUCTURE/kekulizer.C
-+++ b/source/STRUCTURE/kekulizer.C
-@@ -266,7 +266,7 @@ void Kekuliser::dump()
- Log.error() << partner->getName() << " ";
- }
- Log.error() << " " << current_penalty_;
-- if (lowest_penalty_ != INT_MAX) Log.error() << " + " << lowest_penalty_;
-+ if (lowest_penalty_ != std::numeric_limits<int>::max()) Log.error() << " + " << lowest_penalty_;
- Log.error() << std::endl;
- }
- }
-@@ -415,11 +415,11 @@ bool Kekuliser::fixAromaticRings_()
- #endif
-
- solutions_.clear();
-- lowest_penalty_ = INT_MAX;
-+ lowest_penalty_ = std::numeric_limits<int>::max();
- current_penalty_ = 0;
- fixAromaticSystem_(0);
- // test could be changed to achieve at most a given max value:
-- if (lowest_penalty_ < INT_MAX)
-+ if (lowest_penalty_ < std::numeric_limits<int>::max())
- {
- if (lowest_penalty_ == 0)
- {
-@@ -765,7 +765,7 @@ void Kekuliser::applySolution_(Position pos)
- // return the best solution
- Position Kekuliser::calculateDistanceScores_()
- {
-- float best_score = INT_MAX;
-+ float best_score = std::numeric_limits<int>::max();
- Size best_solution = 0;
-
- for (Position solp = 0; solp < solutions_.size(); solp++)
-diff --git a/source/TEST/INIFile_test.C b/source/TEST/INIFile_test.C
-index 1f59d2c..cf37841 100644
---- a/source/TEST/INIFile_test.C
-+++ b/source/TEST/INIFile_test.C
-@@ -198,10 +198,10 @@ CHECK(bool appendLine(const String& section_name, const String& line))
-
- CAPTURE_OUTPUT_LEVEL(2000)
- TEST_EQUAL(ini.appendLine("Section9", "GAU"), false)
-- COMPARE_OUTPUT("In INIFile "BALL_TEST_DATA_PATH(INIFile_test.ini)" , error while appending line: GAU . Illegal section-name: Section9\n")
-+ COMPARE_OUTPUT("In INIFile " BALL_TEST_DATA_PATH(INIFile_test.ini)" , error while appending line: GAU . Illegal section-name: Section9\n")
- CAPTURE_OUTPUT_LEVEL(2000)
- TEST_EQUAL(ini.appendLine("Section2", "[AU"), false)
-- COMPARE_OUTPUT("In INIFile "BALL_TEST_DATA_PATH(INIFile_test.ini)" , error while appending line: [AU . Illegal section-name: Section2\n")
-+ COMPARE_OUTPUT("In INIFile " BALL_TEST_DATA_PATH(INIFile_test.ini)" , error while appending line: [AU . Illegal section-name: Section2\n")
- TEST_EQUAL(ini.appendLine("Section3", "test1 = 123"), true)
- TEST_EQUAL(*ini.getLine(9), "test1 = 123")
- TEST_EQUAL(ini.getNumberOfLines(), 11)
-@@ -403,13 +403,13 @@ CHECK(bool appendSection(const String& section))
- TEST_EQUAL(ini.hasSection(ini.HEADER), true)
- CAPTURE_OUTPUT_LEVEL(2000)
- TEST_EQUAL(ini.appendSection(ini.HEADER), false)
-- const char* output = "INIFile::appendSection: "BALL_TEST_DATA_PATH(INIFile_test.ini)" , while adding section: '#HEADER!' already exists.\n";
-+ const char* output = "INIFile::appendSection: " BALL_TEST_DATA_PATH(INIFile_test.ini)" , while adding section: '#HEADER!' already exists.\n";
- COMPARE_OUTPUT(output)
- TEST_EQUAL(ini.getNumberOfLines(), 10)
-
- CAPTURE_OUTPUT_LEVEL(2000)
- TEST_EQUAL(ini.appendSection("Section1"), false)
-- COMPARE_OUTPUT("INIFile::appendSection: "BALL_TEST_DATA_PATH(INIFile_test.ini)" , while adding section: 'Section1' already exists.\n")
-+ COMPARE_OUTPUT("INIFile::appendSection: " BALL_TEST_DATA_PATH(INIFile_test.ini)" , while adding section: 'Section1' already exists.\n")
- TEST_EQUAL(ini.getNumberOfLines(), 10)
- TEST_EQUAL(ini.hasSection("Section1"), true)
-
-diff --git a/source/TEST/ParameterSection_test.C b/source/TEST/ParameterSection_test.C
-index 16424cd..b934b4a 100644
---- a/source/TEST/ParameterSection_test.C
-+++ b/source/TEST/ParameterSection_test.C
-@@ -55,7 +55,7 @@ CHECK(ParameterSection::extractSection(Parameters& parameters, const String& sec
- bool result;
- CAPTURE_OUTPUT_LEVEL(2000)
- result = ps.extractSection(param, "Section1");
-- COMPARE_OUTPUT("ParameterSection::extractSection: error reading section Section1 of file "BALL_TEST_DATA_PATH(ParameterSection_test.ini)":\nWrong number of fields in the format line: 0. FORMAT:\n")
-+ COMPARE_OUTPUT("ParameterSection::extractSection: error reading section Section1 of file " BALL_TEST_DATA_PATH(ParameterSection_test.ini)":\nWrong number of fields in the format line: 0. FORMAT:\n")
- TEST_EQUAL(result, false)
- TEST_EQUAL(ps.getSectionName(), "Section1")
-
diff --git a/sci-chemistry/ball/files/ball-1.4.1-libsvm.patch b/sci-chemistry/ball/files/ball-1.4.1-libsvm.patch
deleted file mode 100644
index c85506d72733..000000000000
--- a/sci-chemistry/ball/files/ball-1.4.1-libsvm.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 60a5f677587046b3e2077872c21b005bad549b85 Mon Sep 17 00:00:00 2001
-Message-Id: <60a5f677587046b3e2077872c21b005bad549b85.1332678065.git.jlec@gentoo.org>
-From: Justin Lecher <jlec@gentoo.org>
-Date: Sun, 25 Mar 2012 14:15:16 +0200
-Subject: [PATCH 1/2] Correct deprecated usage of svm_destroy_model to
- svm_free_and_destroy_model
-
----
- source/QSAR/libsvmModel.C | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/source/QSAR/libsvmModel.C b/source/QSAR/libsvmModel.C
-index 58ce4dc..1f24e15 100644
---- a/source/QSAR/libsvmModel.C
-+++ b/source/QSAR/libsvmModel.C
-@@ -81,7 +81,7 @@ void LibsvmModel::train()
-
- //free(prob);
- //free(prob->y); free(prob->x);
-- svm_destroy_model((::svm_model*)svm_train_result_);
-+ svm_free_and_destroy_model((::svm_model**)svm_train_result_);
- }
- }
-
diff --git a/sci-chemistry/ball/files/ball-1.4.1-pthread.patch b/sci-chemistry/ball/files/ball-1.4.1-pthread.patch
deleted file mode 100644
index 5ca9699dc7bd..000000000000
--- a/sci-chemistry/ball/files/ball-1.4.1-pthread.patch
+++ /dev/null
@@ -1,19 +0,0 @@
- CMakeLists.txt | 5 +++++
- 1 files changed, 5 insertions(+), 0 deletions(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index a68497f..264f321 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -426,6 +426,11 @@ LIST(APPEND BALL_DEP_LIBRARIES
- ${PYTHON_LIBRARIES}
- )
-
-+
-+IF(UNIX)
-+ LIST(APPEND BALL_DEP_LIBRARIES "pthread")
-+ENDIF()
-+
- IF(TBB_FOUND)
- LIST(APPEND BALL_DEP_LIBRARIES ${TBB_LIBRARIES})
- ENDIF()
diff --git a/sci-chemistry/ball/files/ball-1.4.1-python.patch b/sci-chemistry/ball/files/ball-1.4.1-python.patch
deleted file mode 100644
index f7a235a3bd78..000000000000
--- a/sci-chemistry/ball/files/ball-1.4.1-python.patch
+++ /dev/null
@@ -1,82 +0,0 @@
- source/PYTHON/EXTENSIONS/BALL/file.sip | 2 +-
- source/PYTHON/EXTENSIONS/BALL/periodicBoundary.sip | 4 ++--
- source/PYTHON/EXTENSIONS/VIEW/mainControl.sip | 2 +-
- source/PYTHON/pyInterpreter.C | 9 +++++----
- 4 files changed, 9 insertions(+), 8 deletions(-)
-
-diff --git a/source/PYTHON/EXTENSIONS/BALL/file.sip b/source/PYTHON/EXTENSIONS/BALL/file.sip
-index e29170a..6ec6dc4 100644
---- a/source/PYTHON/EXTENSIONS/BALL/file.sip
-+++ b/source/PYTHON/EXTENSIONS/BALL/file.sip
-@@ -70,7 +70,7 @@ class File
- // std::fstream& getFileStream();
- bool copyTo(const String&);
- bool moveTo(const String&);
-- bool remove() const;
-+ bool remove();
- bool renameTo(const String&);
- bool truncate(int) const;
- bool operator == (const File& /file/) const;
-diff --git a/source/PYTHON/EXTENSIONS/BALL/periodicBoundary.sip b/source/PYTHON/EXTENSIONS/BALL/periodicBoundary.sip
-index 2b79778..46daade 100644
---- a/source/PYTHON/EXTENSIONS/BALL/periodicBoundary.sip
-+++ b/source/PYTHON/EXTENSIONS/BALL/periodicBoundary.sip
-@@ -22,8 +22,8 @@ using namespace BALL;
- void disable();
- SimpleBox3 getBox() const;
- void setBox(const SimpleBox3&);
-- int addSolvent(const String&) const;
-- int removeSolvent() const;
-+ int addSolvent(const String& /In/);
-+ int removeSolvent();
- bool isEnabled() const;
- void updateMolecules();
- Options* options;
-diff --git a/source/PYTHON/EXTENSIONS/VIEW/mainControl.sip b/source/PYTHON/EXTENSIONS/VIEW/mainControl.sip
-index 0a6c319..61d4596 100644
---- a/source/PYTHON/EXTENSIONS/VIEW/mainControl.sip
-+++ b/source/PYTHON/EXTENSIONS/VIEW/mainControl.sip
-@@ -139,7 +139,7 @@ class MainControl
- virtual void openFile(const String&) throw();
- void saveBALLViewProjectFile(const String&);
- void loadBALLViewProjectFile(const String&) throw();
-- void quickSave() const;
-+ void quickSave();
- void quickLoad();
- void processEvents(Size);
- };
-diff --git a/source/PYTHON/pyInterpreter.C b/source/PYTHON/pyInterpreter.C
-index 155a09f..7a12c33 100644
---- a/source/PYTHON/pyInterpreter.C
-+++ b/source/PYTHON/pyInterpreter.C
-@@ -4,9 +4,9 @@
- // $Id: ball-1.4.1-python.patch,v 1.1 2012/03/25 14:13:39 jlec Exp $
- //
-
--#include <Python.h>
--
- #include <BALL/PYTHON/pyInterpreter.h>
-+#include <Python.h>
-+
- #include <BALL/PYTHON/BALLPythonConfig.h>
-
- #include <BALL/FORMAT/lineBasedFile.h>
-@@ -34,7 +34,6 @@ namespace BALL
- PyObject* result = PyRun_String(const_cast<char*>(str.c_str()), mode, context_, context_);
- if (PyErr_Occurred())
- {
-- PyErr_Print();
- PyObject* type;
- PyObject* value;
- PyObject* range;
-@@ -50,7 +49,9 @@ namespace BALL
- {
- error_message_ += " (error message could not be parsed)";
- }
--
-+
-+ PyErr_Print();
-+
- error_message_ += "\n";
-
- return 0;