[med-svn] [Git][med-team/libbpp-core][master] 3 commits: New upstream version 2.4.1
Julien Y. Dutheil
gitlab at salsa.debian.org
Wed Aug 22 08:01:23 BST 2018
Julien Y. Dutheil pushed to branch master at Debian Med / libbpp-core
Commits:
2805bd14 by Julien Y. Dutheil at 2018-08-18T11:31:45Z
New upstream version 2.4.1
- - - - -
79fb8f50 by Julien Y. Dutheil at 2018-08-18T11:31:47Z
Update upstream source from tag 'upstream/2.4.1'
Update to upstream version '2.4.1'
with Debian dir 4a714fe0faec99683e7b7db256af732c7cbdf897
- - - - -
53876a04 by Julien Y. Dutheil at 2018-08-19T09:22:04Z
New version 2.4.1.
- Adresses #897780
- Generated new wymbol files.
- - - - -
19 changed files:
- CMakeLists.txt
- ChangeLog
- Doxyfile
- bpp-core.spec
- debian/changelog
- debian/control
- debian/libbpp-core4.symbols
- src/Bpp/App/ApplicationTools.h
- src/Bpp/Graph/GlobalGraph.cpp
- src/Bpp/Graph/TreeGraphImpl.h
- src/Bpp/Numeric/AbstractParameterAliasable.cpp
- src/Bpp/Numeric/AbstractParametrizable.h
- src/Bpp/Numeric/Function/Operators/ComputationTree.cpp
- src/Bpp/Numeric/Function/PowellMultiDimensions.cpp
- src/Bpp/Numeric/Matrix/MatrixTools.h
- src/Bpp/Numeric/ParameterList.cpp
- src/Bpp/Numeric/Random/RandomTools.cpp
- src/Bpp/Utils/AttributesTools.cpp
- src/Bpp/Utils/AttributesTools.h
Changes:
=====================================
CMakeLists.txt
=====================================
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,7 +9,7 @@ cmake_minimum_required (VERSION 2.8.11)
project (bpp-core CXX)
# Compile options
-#set (CMAKE_CXX_FLAGS "-std=c++11 -g")
+set (CMAKE_CXX_FLAGS "-std=c++11 -Wall -Weffc++ -Wshadow -Wconversion")
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
@@ -25,9 +25,9 @@ ENDIF(NOT CMAKE_BUILD_TYPE)
# library implements.
# In other words, the library implements all the interface numbers in the
# range from number current - age to current.
-SET(${PROJECT_NAME}_VERSION_CURRENT "4")
+SET(${PROJECT_NAME}_VERSION_CURRENT "5")
SET(${PROJECT_NAME}_VERSION_REVISION "0")
-SET(${PROJECT_NAME}_VERSION_AGE "0")
+SET(${PROJECT_NAME}_VERSION_AGE "1")
# Effective version number computation
MATH(EXPR ${PROJECT_NAME}_VERSION_MAJOR "${${PROJECT_NAME}_VERSION_CURRENT} - ${${PROJECT_NAME}_VERSION_AGE}")
@@ -77,10 +77,10 @@ ENDIF (DOXYGEN_FOUND)
# Packager
SET(CPACK_PACKAGE_NAME "libbpp-core")
SET(CPACK_PACKAGE_VENDOR "Bio++ Development Team")
-SET(CPACK_PACKAGE_VERSION "2.4.0")
+SET(CPACK_PACKAGE_VERSION "2.4.1")
SET(CPACK_PACKAGE_VERSION_MAJOR "2")
SET(CPACK_PACKAGE_VERSION_MINOR "4")
-SET(CPACK_PACKAGE_VERSION_PATCH "0")
+SET(CPACK_PACKAGE_VERSION_PATCH "1")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The Bio++ Core library")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING.txt")
SET(CPACK_RESOURCE_FILE_AUTHORS "${CMAKE_SOURCE_DIR}/AUTHORS.txt")
=====================================
ChangeLog
=====================================
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+06/06/18 Julien Dutheil
+* Recursive param argument issue solved (closes #17).
+* New version number: current 4 -> 5, age 0 -> 1 because of new symbol in AttributeTools.
+
19/02/17 -*- Version 2.4.0 -*-
04/01/18 Laurent Guéguen
=====================================
Doxyfile
=====================================
--- a/Doxyfile
+++ b/Doxyfile
@@ -38,7 +38,7 @@ PROJECT_NAME = bpp-core
# could be handy for archiving the generated documentation or if some version
# control system is used.
-PROJECT_NUMBER = 2.4.0
+PROJECT_NUMBER = 2.4.1
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
=====================================
bpp-core.spec
=====================================
--- a/bpp-core.spec
+++ b/bpp-core.spec
@@ -3,7 +3,7 @@
URL: https://github.com/BioPP/bpp-core
Name: bpp-core
-Version: 2.4.0
+Version: 2.4.1
Release: 1%{?dist}
License: CECILL-2.0
Vendor: The Bio++ Project
@@ -71,6 +71,8 @@ rm -rf $RPM_BUILD_ROOT
%{_prefix}/include/*
%changelog
+* Fri Aug 10 2018 Julien Dutheil <julien.dutheil at univ-montp2.fr> 2.4.1-1
+- Update for gcc8 + bug fixes
* Mon Mar 12 2018 Julien Dutheil <julien.dutheil at univ-montp2.fr> 2.4.0-1
- Increased interface number
- Removed dynamic exceptions specifications.
=====================================
debian/changelog
=====================================
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+libbpp-core (2.4.1-1) UNRELEASED; urgency=medium
+
+ * Compatibility with gcc 8.0
+ Ref: #897780
+
+ -- Julien Dutheil <julien.dutheil at univ-montp2.fr> Sat, 18 Aug 2018 13:32:11 +0200
+
libbpp-core (2.4.0-3) unstable; urgency=medium
* Provide symbols file only for amd64
=====================================
debian/control
=====================================
--- a/debian/control
+++ b/debian/control
@@ -8,8 +8,8 @@ Build-Depends: debhelper (>= 11~),
cmake,
d-shlibs
Standards-Version: 4.1.3
-Vcs-Browser: https://anonscm.debian.org/cgit/debian-med/libbpp-core.git
-Vcs-Git: https://anonscm.debian.org/git/debian-med/libbpp-core.git
+Vcs-Browser: https://salsa.debian.org/med-team/libbpp-core
+Vcs-Git: https://salsa.debian.org/med-team/libbpp-core.git
Homepage: http://biopp.univ-montp2.fr/wiki/index.php/Main_Page
Package: libbpp-core-dev
=====================================
debian/libbpp-core4.symbols
=====================================
The diff for this file was not included because it is too large.
=====================================
src/Bpp/App/ApplicationTools.h
=====================================
--- a/src/Bpp/App/ApplicationTools.h
+++ b/src/Bpp/App/ApplicationTools.h
@@ -338,11 +338,12 @@ namespace bpp
*
* @param parameterName The name of the corresponding parameter.
* @param params The attribute map where options may be found.
- * @param separator The character used to delimit values.
+ * @param separator The character used to delimit values (cannot be a space character).
* @param defaultValue The default value to use if the parameter is not found.
* @param suffix A suffix to be applied to the parameter name.
* @param suffixIsOptional Tell if the suffix is absolutely required.
* @param warn Tell if a warning must be sent in case the parameter is not found.
+ * @throw Exception If a space character is used as separator.
* @return The corresponding value.
*/
template<class T> static std::vector<T> getVectorParameter(
@@ -354,6 +355,7 @@ namespace bpp
bool suffixIsOptional = true,
int warn = 0)
{
+ if (separator == ' ') throw Exception("ApplicationTools::getVectorParameter(). Separator cannot be a space character.");
std::string s = getStringParameter(parameterName, params, defaultValue, suffix, suffixIsOptional, warn);
if (TextTools::isEmpty(s)) return std::vector<T>(0);
if (s[0] == '(' && s[s.size() - 1] == ')') {
=====================================
src/Bpp/Graph/GlobalGraph.cpp
=====================================
--- a/src/Bpp/Graph/GlobalGraph.cpp
+++ b/src/Bpp/Graph/GlobalGraph.cpp
@@ -564,7 +564,7 @@ Graph::EdgeId GlobalGraph::getAnyEdge(Graph::NodeId nodeA, Graph::NodeId nodeB)
// trying in the given order A->B
return getEdge(nodeA, nodeB);
}
- catch (Exception e)
+ catch (Exception& e)
{
// didn’t work, hence trying in the opposite order B->A
return getEdge(nodeB, nodeA);
=====================================
src/Bpp/Graph/TreeGraphImpl.h
=====================================
--- a/src/Bpp/Graph/TreeGraphImpl.h
+++ b/src/Bpp/Graph/TreeGraphImpl.h
@@ -272,7 +272,7 @@ namespace bpp
{
std::vector<Graph::NodeId> incomers = getIncomingNeighbors(node);
if (incomers.size() > 1)
- throw Exception("TreeGraphImpl<GraphImpl>::getFather: more than one father for Node " + TextTools::toString(node) + " : " + VectorTools::paste(incomers, ",") + ". Should never happen since validity has been controled. Please report this bug.");
+ throw Exception("TreeGraphImpl<GraphImpl>::getFather: more than one father for Node " + TextTools::toString(node) + " : " + VectorTools::paste(incomers, ",") + ". Should never happen since validity has been controlled. Please report this bug.");
if (incomers.size() == 0)
throw Exception("TreeGraphImpl<GraphImpl>::getFather: node " + TextTools::toString(node) + " has no father.");
return *incomers.begin();
=====================================
src/Bpp/Numeric/AbstractParameterAliasable.cpp
=====================================
--- a/src/Bpp/Numeric/AbstractParameterAliasable.cpp
+++ b/src/Bpp/Numeric/AbstractParameterAliasable.cpp
@@ -48,7 +48,7 @@ AbstractParameterAliasable::AbstractParameterAliasable(const AbstractParameterAl
independentParameters_(),
aliasListenersRegister_()
{
- for (size_t i=0; i<ap.independentParameters_.size(); i++)
+ for (size_t i = 0; i < ap.independentParameters_.size(); i++)
independentParameters_.shareParameter(getSharedParameter(getParameterNameWithoutNamespace(ap.independentParameters_[i].getName())));
// Actualize the register with adequate pointers:
@@ -178,8 +178,8 @@ void AbstractParameterAliasable::aliasParameters(map<string, string>& unparsedPa
size_t unp_s = unparsedParams.size();
while (unp_s != 0)
{
- map<string, string>::iterator it;
- for (it = unparsedParams.begin(); it != unparsedParams.end(); it++)
+ auto it = unparsedParams.begin();
+ while (it != unparsedParams.end())
{
Parameter* pp = 0;
try
@@ -199,7 +199,7 @@ void AbstractParameterAliasable::aliasParameters(map<string, string>& unparsedPa
aliasParameters(it->second, it->first);
if (verbose)
ApplicationTools::displayResult("Parameter alias found", it->first + " -> " + it->second + " = " + TextTools::toString(pp->getValue()));
- unparsedParams.erase(it);
+ it = unparsedParams.erase(it);
}
if (unparsedParams.size() == unp_s)
=====================================
src/Bpp/Numeric/AbstractParametrizable.h
=====================================
--- a/src/Bpp/Numeric/AbstractParametrizable.h
+++ b/src/Bpp/Numeric/AbstractParametrizable.h
@@ -193,6 +193,8 @@ class AbstractParametrizable:
*/
Parameter& getParameter_(const std::string& name)
{
+ if (!hasParameter(name))
+ throw ParameterNotFoundException("AbstractParametrizable::getParameter_().", prefix_ + name);
return parameters_.getParameter(prefix_ + name);
}
=====================================
src/Bpp/Numeric/Function/Operators/ComputationTree.cpp
=====================================
--- a/src/Bpp/Numeric/Function/Operators/ComputationTree.cpp
+++ b/src/Bpp/Numeric/Function/Operators/ComputationTree.cpp
@@ -157,7 +157,7 @@ std::shared_ptr<Operator> ComputationTree::readFormula_(const std::string& formu
double v = TextTools::toDouble(formula);
here = shared_ptr<Operator>(new ConstantOperator(v));
}
- catch (Exception e)
+ catch (Exception& e)
{
if (formula[0]=='-')
{
=====================================
src/Bpp/Numeric/Function/PowellMultiDimensions.cpp
=====================================
--- a/src/Bpp/Numeric/Function/PowellMultiDimensions.cpp
+++ b/src/Bpp/Numeric/Function/PowellMultiDimensions.cpp
@@ -99,16 +99,16 @@ double PowellMultiDimensions::doStep()
{
size_t n = getParameters().size();
fp_ = fret_;
- unsigned int ibig = 0;
+ size_t ibig = 0;
double del = 0.0; // Will be the biggest function decrease
Vdouble xit(n);
// In each iteration, loop over all directions in the set.
double fptt;
- for(unsigned int i = 0; i < n; i++)
+ for (size_t i = 0; i < n; i++)
{
// Copy the direction:
- for(unsigned int j = 0; j < n; j++)
+ for (size_t j = 0; j < n; j++)
{
xit[j] = xi_[j][i];
}
@@ -127,7 +127,7 @@ double PowellMultiDimensions::doStep()
}
ParameterList ptt = getParameters();
- for (unsigned int j = 0; j < n; j++)
+ for (size_t j = 0; j < n; j++)
{
ptt[j].setValue(2.0 * getParameters()[j].getValue() - pt_[j].getValue());
xit[j] = getParameters()[j].getValue() - pt_[j].getValue();
@@ -144,8 +144,9 @@ double PowellMultiDimensions::doStep()
getParameters_(), xit, getStopCondition()->getTolerance(),
0, getMessageHandler(), getVerbose() > 0 ? getVerbose() - 1 : 0);
fret_ = getFunction()->f(getParameters());
- if (fret_ > fp_) throw Exception("DEBUG: PowellMultiDimensions::doStep(). Line minimization failed!");
- for (unsigned int j = 0; j < n; j++)
+ if (fret_ > fp_)
+ throw Exception("DEBUG: PowellMultiDimensions::doStep(). Line minimization failed!");
+ for (size_t j = 0; j < n; j++)
{
xi_[j][ibig] = xi_[j][n - 1];
xi_[j][n - 1] = xit[j];
=====================================
src/Bpp/Numeric/Matrix/MatrixTools.h
=====================================
--- a/src/Bpp/Numeric/Matrix/MatrixTools.h
+++ b/src/Bpp/Numeric/Matrix/MatrixTools.h
@@ -450,7 +450,7 @@ namespace bpp
size_t nrA = A.getNumberOfRows();
size_t nrB = B.getNumberOfRows();
size_t ncB = B.getNumberOfColumns();
- if (ncA > ncB) throw DimensionException("MatrixTools::operator+=(). A and B must have the same number of colums.", ncB, ncA);
+ if (ncA > ncB) throw DimensionException("MatrixTools::operator+=(). A and B must have the same number of columns.", ncB, ncA);
if (nrA > nrB) throw DimensionException("MatrixTools::operator+=(). A and B must have the same number of rows.", nrB, nrA);
@@ -478,7 +478,7 @@ namespace bpp
size_t nrA = A.getNumberOfRows();
size_t nrB = B.getNumberOfRows();
size_t ncB = B.getNumberOfColumns();
- if (ncA != ncB) throw DimensionException("MatrixTools::operator+(). A and B must have the same number of colums.", ncB, ncA);
+ if (ncA != ncB) throw DimensionException("MatrixTools::operator+(). A and B must have the same number of columns.", ncB, ncA);
if (nrA != nrB) throw DimensionException("MatrixTools::operator+(). A and B must have the same number of rows.", nrB, nrA);
for (size_t i = 0; i < nrA; i++)
=====================================
src/Bpp/Numeric/ParameterList.cpp
=====================================
--- a/src/Bpp/Numeric/ParameterList.cpp
+++ b/src/Bpp/Numeric/ParameterList.cpp
@@ -496,13 +496,11 @@ void ParameterList::matchParameters(const ParameterList& params)
/******************************************************************************/
void ParameterList::deleteParameter(const std::string& name)
{
- for (unsigned int i = 0; i < size(); i++)
+ for (auto it = parameters_.begin(); it != parameters_.end(); ++it)
{
- Parameter* p = parameters_[i].get();
-
- if (p->getName() == name)
+ if ((*it)->getName() == name)
{
- parameters_.erase(parameters_.begin() + i);
+ it = parameters_.erase(it);
return;
}
}
@@ -512,11 +510,11 @@ void ParameterList::deleteParameter(const std::string& name)
/******************************************************************************/
void ParameterList::deleteParameters(const std::vector<std::string>& names, bool mustExist)
{
- for (unsigned int i = 0; i < names.size(); i++)
+ for (auto it = names.begin(); it != names.end(); ++it)
{
try
{
- deleteParameter(names[i]);
+ deleteParameter(*it);
}
catch (ParameterNotFoundException& e)
{
@@ -532,8 +530,6 @@ void ParameterList::deleteParameters(const std::vector<std::string>& names, bool
void ParameterList::deleteParameter(size_t index)
{
if (index >= size()) throw IndexOutOfBoundsException("ParameterList::deleteParameter.", index, 0, size());
- // Parameter* p = parameters_[index].get();
- // delete p;
parameters_.erase(parameters_.begin() + static_cast<ptrdiff_t>(index));
}
=====================================
src/Bpp/Numeric/Random/RandomTools.cpp
=====================================
--- a/src/Bpp/Numeric/Random/RandomTools.cpp
+++ b/src/Bpp/Numeric/Random/RandomTools.cpp
@@ -517,10 +517,10 @@ double RandomTools::qBeta(double prob, double alpha, double beta)
volatile double xinbta;
if (alpha <= 0. || beta < 0.)
- throw ("RandomTools::qBeta wih non positive parameters");
+ throw ("RandomTools::qBeta with non positive parameters");
if (prob < 0. || prob > 1.)
- throw ("RandomTools::qBeta wih bad probability");
+ throw ("RandomTools::qBeta with bad probability");
/* initialize */
logbeta = lnBeta(alpha, beta);
=====================================
src/Bpp/Utils/AttributesTools.cpp
=====================================
--- a/src/Bpp/Utils/AttributesTools.cpp
+++ b/src/Bpp/Utils/AttributesTools.cpp
@@ -44,6 +44,7 @@
#include <fstream>
#include <algorithm>
+
using namespace std;
#include "AttributesTools.h"
@@ -53,6 +54,8 @@ using namespace std;
using namespace bpp;
+std::vector<std::string> AttributesTools::vParam_;
+
/******************************************************************************/
std::vector<std::string> AttributesTools::getVector(int argc, char* argv[])
@@ -119,13 +122,16 @@ void AttributesTools::getAttributesMap(
{
string name = string(arg.begin(), arg.begin() + static_cast<ptrdiff_t>(limit));
string value = string(arg.begin() + static_cast<ptrdiff_t>(limit + delimiter.size()), arg.end());
- // if ((name == "param") || (name == "params"))
- // {
- // //Recursive inclusion:
- // getAttributesMapFromFile(value, am, delimiter);
- // }
- // else
- am[name] = value;
+ if ((name == "param") || (name == "params"))
+ {
+ if (std::find(vParam_.begin(),vParam_.end(),value)!=vParam_.end())
+ throw Exception("Param name " + value + " already seen.");
+
+ //Recursive inclusion:
+ getAttributesMapFromFile(value, am, delimiter);
+ vParam_.push_back(value);
+ }
+ else am[name] = value;
}
}
}
@@ -162,8 +168,7 @@ void AttributesTools::actualizeAttributesMap(
{
for (map<string, string>::const_iterator i = atts.begin(); i != atts.end(); i++)
{
- if ((i->first != "param") && (i->first != "params"))
- attMap[i->first] = i->second;
+ attMap[i->first] = i->second;
}
}
@@ -248,68 +253,53 @@ std::map<std::string, std::string> AttributesTools::parseOptions(int args, char*
// Look for a specified file with parameters:
map<string, string> params;
- std::map<std::string, std::string>::iterator it;
-
- if (cmdParams.find("param") != cmdParams.end())
+ if (cmdParams.find("param") != cmdParams.end() || cmdParams.find("params") != cmdParams.end())
{
- string file = cmdParams["param"];
- if (!FileTools::fileExists(file))
- {
- throw Exception("AttributesTools::parseOptions(). Parameter file not found.");
- }
- else
+ string file;
+ if (cmdParams.find("param") != cmdParams.end())
{
- params = getAttributesMapFromFile(file, "=");
- // Actualize attributes with ones passed to command line:
- actualizeAttributesMap(params, cmdParams);
- }
- }
- else
- {
- params = cmdParams;
- }
- // Resolve variables:
- resolveVariables(params);
+ file=cmdParams["param"];
+ if (std::find(vParam_.begin(),vParam_.end(),file)!=vParam_.end())
+ throw Exception("Param name " + file + " already seen.");
- std::vector<string> mapfile;
- std::vector<string>::iterator imapfile;
- string file;
-
- while (true)
- {
- it = params.find("param");
- if (it != params.end())
- {
- file = it->second;
- if (std::find(mapfile.begin(), mapfile.end(), file) == mapfile.end())
+ if (!FileTools::fileExists(file))
{
- params.erase(it);
- mapfile.push_back(file);
- getAttributesMapFromFile(file, params, "=");
- resolveVariables(params);
- continue;
+ throw Exception("AttributesTools::parseOptions(). Parameter file not found.: " + file);
}
else
- throw Exception("parsing error : Already used file " + file);
+ {
+ params = getAttributesMapFromFile(file, "=");
+ // Actualize attributes with ones passed to command line:
+ actualizeAttributesMap(params, cmdParams);
+ }
+ vParam_.push_back(file);
+
}
- it = params.find("params");
- if (it != params.end())
+ if (cmdParams.find("params") != cmdParams.end())
{
- file = it->second;
- if (find(mapfile.begin(), mapfile.end(), file) == mapfile.end())
+ file=cmdParams["params"];
+ if (std::find(vParam_.begin(),vParam_.end(),file)!=vParam_.end())
+ throw Exception("Param name " + file + " already seen.");
+
+ if (!FileTools::fileExists(file))
{
- params.erase(it);
- mapfile.push_back(file);
- getAttributesMapFromFile(file, params, "=");
- resolveVariables(params);
- continue;
+ throw Exception("AttributesTools::parseOptions(). Parameter file not found.: " + file);
}
else
- throw Exception("parsing error : Already used file " + file);
+ {
+ params = getAttributesMapFromFile(file, "=");
+ // Actualize attributes with ones passed to command line:
+ actualizeAttributesMap(params, cmdParams);
+ }
+ vParam_.push_back(file);
}
- break;
}
-
+ else
+ {
+ params = cmdParams;
+ }
+ // Resolve variables:
+ resolveVariables(params);
return params;
}
=====================================
src/Bpp/Utils/AttributesTools.h
=====================================
--- a/src/Bpp/Utils/AttributesTools.h
+++ b/src/Bpp/Utils/AttributesTools.h
@@ -126,6 +126,14 @@ namespace bpp
*/
class AttributesTools
{
+private:
+ /*
+ * vector of param names already seen, to avoid infinite recursion
+ *
+ */
+
+ static std::vector<std::string> vParam_;
+
public:
AttributesTools() {}
virtual ~AttributesTools() {}
@@ -218,7 +226,7 @@ public:
char varCode = '$',
char varBeg = '(',
char varEnd = ')');
-
+
/**
* @brief Global function that reads all parameters from command line and files,
* and set the values in a map.
View it on GitLab: https://salsa.debian.org/med-team/libbpp-core/compare/b77136c03cc6fcb79fc53d80e07d685bfe5262d0...53876a04ed80ed863e0278e63dd83b72421ac443
--
View it on GitLab: https://salsa.debian.org/med-team/libbpp-core/compare/b77136c03cc6fcb79fc53d80e07d685bfe5262d0...53876a04ed80ed863e0278e63dd83b72421ac443
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20180822/9b0faa17/attachment-0001.html>
More information about the debian-med-commit
mailing list