Skip to content
Commits on Source (4)
......@@ -9,7 +9,7 @@ cmake_minimum_required (VERSION 2.8.11)
project (bpp-core CXX)
# Compile options
set (CMAKE_CXX_FLAGS "-std=c++11 -Wall -Weffc++ -Wshadow -Wconversion")
#set (CMAKE_CXX_FLAGS "-std=c++11 -g")
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
......@@ -25,7 +25,7 @@ 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 "3")
SET(${PROJECT_NAME}_VERSION_CURRENT "4")
SET(${PROJECT_NAME}_VERSION_REVISION "0")
SET(${PROJECT_NAME}_VERSION_AGE "0")
......@@ -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.3.1")
SET(CPACK_PACKAGE_VERSION "2.4.0")
SET(CPACK_PACKAGE_VERSION_MAJOR "2")
SET(CPACK_PACKAGE_VERSION_MINOR "3")
SET(CPACK_PACKAGE_VERSION_PATCH "1")
SET(CPACK_PACKAGE_VERSION_MINOR "4")
SET(CPACK_PACKAGE_VERSION_PATCH "0")
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")
......@@ -89,6 +89,8 @@ SET(CPACK_SOURCE_GENERATOR "TGZ")
# /!\ This assumes that an external build is used
SET(CPACK_SOURCE_IGNORE_FILES
"/build/"
"/html/"
"/BppCore.tag"
"/\\\\.git/"
"/\\\\.gitignore"
${CPACK_SOURCE_IGNORE_FILES}
......
10/0(/17 -*- Version 2.3.0 -*-
19/02/17 -*- Version 2.4.0 -*-
04/01/18 Laurent Guéguen
* Several bug fixes and improvements (interface break)
18/12/17 Laurent Guéguen
* TreeGraphs improvements
08/12/17 -*- Version 2.3.2 -*-
10/05/17 -*- Version 2.3.0 -*-
26/04/16 Julien Dutheil
* Upgrading to C++11
......
......@@ -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.3.0
PROJECT_NUMBER = 2.4.0
# 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
......
%define _basename bpp-core
%define _version 2.3.1
%define _release 1
%define _prefix /usr
URL: http://biopp.univ-montp2.fr/
URL: https://github.com/BioPP/bpp-core
Name: %{_basename}
Version: %{_version}
Release: %{_release}
Name: bpp-core
Version: 2.4.0
Release: 1%{?dist}
License: CECILL-2.0
Vendor: The Bio++ Project
Source: http://biopp.univ-montp2.fr/repos/sources/%{_basename}-%{_version}.tar.gz
Source: %{name}-%{version}.tar.gz
Summary: Bio++ Core library
Group: Development/Libraries/C and C++
BuildRoot: %{_builddir}/%{_basename}-root
BuildRoot: %{_builddir}/%{name}-root
BuildRequires: cmake >= 2.8.11
BuildRequires: gcc-c++ >= 4.7.0
AutoReq: yes
......@@ -23,17 +20,17 @@ AutoProv: yes
%description
This library contains the core classes and utilitary functions of the Bio++ project.
%package -n libbpp-core3
%package -n libbpp-core4
Summary: Bio++ Core library
Group: Development/Libraries/C and C++
%description -n libbpp-core3
%description -n libbpp-core4
This library contains the core classes and utilitary functions of the Bio++ project.
%package -n libbpp-core-devel
Summary: Libraries, includes to develop applications with %{_basename}
Summary: Libraries, includes to develop applications with %{name}
Group: Development/Libraries/C and C++
Requires: libbpp-core3 = %{_version}
Requires: libbpp-core4 = %{version}
%description -n libbpp-core-devel
The libbpp-core-devel package contains the header files and static libraries for
......@@ -54,11 +51,11 @@ make DESTDIR=$RPM_BUILD_ROOT install
%clean
rm -rf $RPM_BUILD_ROOT
%post -n libbpp-core3 -p /sbin/ldconfig
%post -n libbpp-core4 -p /sbin/ldconfig
%postun -n libbpp-core3 -p /sbin/ldconfig
%postun -n libbpp-core4 -p /sbin/ldconfig
%files -n libbpp-core3
%files -n libbpp-core4
%defattr(-,root,root)
%doc AUTHORS.txt COPYING.txt INSTALL.txt ChangeLog
%{_prefix}/%{_lib}/lib*.so.*
......@@ -74,6 +71,10 @@ rm -rf $RPM_BUILD_ROOT
%{_prefix}/include/*
%changelog
* Mon Mar 12 2018 Julien Dutheil <julien.dutheil@univ-montp2.fr> 2.4.0-1
- Increased interface number
- Removed dynamic exceptions specifications.
- Graphs classes improvements
* Tue Jun 06 2017 Julien Dutheil <julien.dutheil@univ-montp2.fr> 2.3.1-1
- Increased interface number
* Wed May 10 2017 Julien Dutheil <julien.dutheil@univ-montp2.fr> 2.3.0-1
......
......@@ -31,7 +31,7 @@ set (CMAKE_CXX_FLAGS "std=c++11 -Wall -Weffc++ -Wshadow -Wconversion")
# -> It also provides a "feature" property on targets which annotates, and auto selects the right -std=...
SET(${PROJECT_NAME}_VERSION_CURRENT "2")
SET(${PROJECT_NAME}_VERSION_REVISION "3")
SET(${PROJECT_NAME}_VERSION_REVISION "4")
SET(${PROJECT_NAME}_VERSION_AGE "0")
MATH(EXPR ${PROJECT_NAME}_VERSION_MAJOR "${${PROJECT_NAME}_VERSION_CURRENT} - ${${PROJECT_NAME}_VERSION_AGE}")
SET(${PROJECT_NAME}_VERSION_MINOR ${${PROJECT_NAME}_VERSION_AGE})
......
libbpp-core (2.3.2-2) UNRELEASED; urgency=medium
libbpp-core (2.4.0-1) UNRELEASED; urgency=medium
[ Julien Dutheil ]
* Version 2.4.0.
[ Andreas Tille ]
* Bump soversion due to ABI change
Closes: #890400
* Add symbols file
-- Andreas Tille <tille@debian.org> Thu, 15 Feb 2018 15:34:56 +0100
-- Andreas Tille <tille@debian.org> Wed, 21 Mar 2018 15:55:44 +0100
libbpp-core (2.3.2-1) unstable; urgency=medium
......
This diff is collapsed.
Description: Bump soversion due to ABI change
Bug-Debian: https://bugs.debian.org/890400
Author: Andreas Tille <tille@debian.org>
Last-Update: Thu, 15 Feb 2018 15:34:56 +0100
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -25,7 +25,7 @@ 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 "3")
+SET(${PROJECT_NAME}_VERSION_CURRENT "4")
SET(${PROJECT_NAME}_VERSION_REVISION "0")
SET(${PROJECT_NAME}_VERSION_AGE "0")
Author: Julien Y. Dutheil
Last-Update: 2018-02-05 13:11:51 +0100
Description: Fix issues with gcc-7
--- a/src/Bpp/Numeric/Prob/AbstractDiscreteDistribution.h
+++ b/src/Bpp/Numeric/Prob/AbstractDiscreteDistribution.h
@@ -58,7 +58,7 @@ namespace bpp
*/
class AbstractDiscreteDistribution :
public virtual DiscreteDistribution,
- public virtual AbstractParameterAliasable
+ public AbstractParameterAliasable
{
public:
--- a/src/Bpp/Numeric/Prob/BetaDiscreteDistribution.cpp
+++ b/src/Bpp/Numeric/Prob/BetaDiscreteDistribution.cpp
@@ -52,7 +52,6 @@ using namespace std;
/** Constructor: **************************************************************/
BetaDiscreteDistribution::BetaDiscreteDistribution(size_t n, double alpha, double beta) :
- AbstractParameterAliasable("Beta."),
AbstractDiscreteDistribution(n,NumConstants::VERY_TINY(),"Beta."), alpha_(alpha), beta_(beta), diffln_(0)
{
addParameter_(new Parameter("Beta.alpha", alpha, new IntervalConstraint(1, 0.0001, true), true));
@@ -67,14 +66,12 @@ BetaDiscreteDistribution::BetaDiscreteDi
}
BetaDiscreteDistribution::BetaDiscreteDistribution(const BetaDiscreteDistribution& bdd) :
- AbstractParameterAliasable(bdd),
AbstractDiscreteDistribution(bdd), alpha_(bdd.alpha_), beta_(bdd.beta_), diffln_(bdd.diffln_)
{
}
BetaDiscreteDistribution& BetaDiscreteDistribution::operator=(const BetaDiscreteDistribution& bdd)
{
- AbstractParameterAliasable::operator=(bdd);
AbstractDiscreteDistribution::operator=(bdd);
alpha_=bdd.alpha_;
--- a/src/Bpp/Numeric/Prob/ConstantDistribution.cpp
+++ b/src/Bpp/Numeric/Prob/ConstantDistribution.cpp
@@ -48,7 +48,6 @@ using namespace std;
/******************************************************************************/
ConstantDistribution::ConstantDistribution(double value):
- AbstractParameterAliasable("Constant."),
AbstractDiscreteDistribution(1, "Constant."),
value_(value)
{
@@ -57,14 +56,12 @@ ConstantDistribution::ConstantDistributi
}
ConstantDistribution::ConstantDistribution(const ConstantDistribution& cd) :
- AbstractParameterAliasable(cd),
AbstractDiscreteDistribution(cd),
value_(cd.value_)
{}
ConstantDistribution& ConstantDistribution::operator=(const ConstantDistribution& cd)
{
- AbstractParameterAliasable::operator=(cd);
AbstractDiscreteDistribution::operator=(cd);
value_=cd.value_;
--- a/src/Bpp/Numeric/Prob/GammaDiscreteDistribution.cpp
+++ b/src/Bpp/Numeric/Prob/GammaDiscreteDistribution.cpp
@@ -52,7 +52,6 @@ using namespace std;
/** Constructor: **************************************************************/
GammaDiscreteDistribution::GammaDiscreteDistribution(size_t n, double alpha, double beta, double minimumAlpha, double minimumBeta, bool paramOffset, double offset) :
- AbstractParameterAliasable("Gamma."),
AbstractDiscreteDistribution(n, "Gamma."),
alpha_(alpha),
beta_(beta),
@@ -76,7 +75,6 @@ GammaDiscreteDistribution::GammaDiscrete
}
GammaDiscreteDistribution::GammaDiscreteDistribution(const GammaDiscreteDistribution& gdd) :
- AbstractParameterAliasable(gdd),
AbstractDiscreteDistribution(gdd),
alpha_(gdd.alpha_),
beta_(gdd.beta_),
@@ -87,7 +85,6 @@ GammaDiscreteDistribution::GammaDiscrete
GammaDiscreteDistribution& GammaDiscreteDistribution::operator=(const GammaDiscreteDistribution& gdd)
{
- AbstractParameterAliasable::operator=(gdd);
AbstractDiscreteDistribution::operator=(gdd);
alpha_=gdd.alpha_;
beta_=gdd.beta_;
--- a/src/Bpp/Numeric/Prob/UniformDiscreteDistribution.cpp
+++ b/src/Bpp/Numeric/Prob/UniformDiscreteDistribution.cpp
@@ -51,7 +51,6 @@ using namespace std;
/** Constructor: **************************************************************/
UniformDiscreteDistribution::UniformDiscreteDistribution(unsigned int n, double min, double max) :
- AbstractParameterAliasable("Uniform."),
AbstractDiscreteDistribution(n,"Uniform."),
min_((min<max)?min:max),
max_((min<max)?max:min)
@@ -63,7 +62,6 @@ UniformDiscreteDistribution::UniformDisc
}
UniformDiscreteDistribution::UniformDiscreteDistribution(const UniformDiscreteDistribution& udd) :
- AbstractParameterAliasable(udd),
AbstractDiscreteDistribution(udd),
min_(udd.min_),
max_(udd.max_)
@@ -72,7 +70,6 @@ UniformDiscreteDistribution::UniformDisc
UniformDiscreteDistribution& UniformDiscreteDistribution::operator=(const UniformDiscreteDistribution& udd)
{
- AbstractParameterAliasable::operator=(udd);
AbstractDiscreteDistribution::operator=(udd);
min_=udd.min_;
max_=udd.max_;
--- a/src/Bpp/Numeric/Prob/ExponentialDiscreteDistribution.cpp
+++ b/src/Bpp/Numeric/Prob/ExponentialDiscreteDistribution.cpp
@@ -51,7 +51,6 @@ using namespace std;
/****************************************************************/
ExponentialDiscreteDistribution::ExponentialDiscreteDistribution(size_t n, double lambda) :
- AbstractParameterAliasable("Exponential."),
AbstractDiscreteDistribution(n, "Exponential."),
lambda_(lambda)
{
--- a/src/Bpp/Numeric/Prob/InvariantMixedDiscreteDistribution.cpp
+++ b/src/Bpp/Numeric/Prob/InvariantMixedDiscreteDistribution.cpp
@@ -48,7 +48,6 @@ using namespace std;
InvariantMixedDiscreteDistribution::InvariantMixedDiscreteDistribution(
DiscreteDistribution* dist, double p, double invariant) :
- AbstractParameterAliasable("Invariant."),
AbstractDiscreteDistribution(1, "Invariant."),
dist_(dist),
invariant_(invariant),
--- a/src/Bpp/Numeric/Prob/TruncatedExponentialDiscreteDistribution.cpp
+++ b/src/Bpp/Numeric/Prob/TruncatedExponentialDiscreteDistribution.cpp
@@ -51,7 +51,6 @@ using namespace std;
/** Constructor: **************************************************************/
TruncatedExponentialDiscreteDistribution::TruncatedExponentialDiscreteDistribution(size_t n, double lambda, double truncationPoint) :
- AbstractParameterAliasable("TruncExponential."),
AbstractDiscreteDistribution(n, "TruncExponential."),
lambda_(lambda),
tp_(truncationPoint),
--- a/src/Bpp/Numeric/Prob/ExponentialDiscreteDistribution.h
+++ b/src/Bpp/Numeric/Prob/ExponentialDiscreteDistribution.h
@@ -70,14 +70,12 @@ public:
ExponentialDiscreteDistribution(size_t n, double lambda = 1.);
ExponentialDiscreteDistribution(const ExponentialDiscreteDistribution& dist) :
- AbstractParameterAliasable(dist),
AbstractDiscreteDistribution(dist),
lambda_(dist.lambda_)
{}
ExponentialDiscreteDistribution& operator=(const ExponentialDiscreteDistribution& dist)
{
- AbstractParameterAliasable::operator=(dist);
AbstractDiscreteDistribution::operator=(dist);
lambda_ = dist.lambda_;
return *this;
--- a/src/Bpp/Numeric/Prob/InvariantMixedDiscreteDistribution.h
+++ b/src/Bpp/Numeric/Prob/InvariantMixedDiscreteDistribution.h
@@ -76,7 +76,6 @@ public:
}
InvariantMixedDiscreteDistribution(const InvariantMixedDiscreteDistribution& imdd) :
- AbstractParameterAliasable(imdd),
AbstractDiscreteDistribution(imdd),
dist_(dynamic_cast<DiscreteDistribution*>(imdd.dist_->clone())),
invariant_(imdd.invariant_),
@@ -86,7 +85,6 @@ public:
InvariantMixedDiscreteDistribution& operator=(const InvariantMixedDiscreteDistribution& imdd)
{
- AbstractParameterAliasable::operator=(imdd);
AbstractDiscreteDistribution::operator=(imdd);
dist_ = dynamic_cast<DiscreteDistribution*>(imdd.dist_->clone());
invariant_ = imdd.invariant_;
--- a/src/Bpp/Numeric/Prob/TruncatedExponentialDiscreteDistribution.h
+++ b/src/Bpp/Numeric/Prob/TruncatedExponentialDiscreteDistribution.h
@@ -85,7 +85,6 @@ public:
TruncatedExponentialDiscreteDistribution(size_t n, double lambda = 1., double truncationPoint = 10);
TruncatedExponentialDiscreteDistribution(const TruncatedExponentialDiscreteDistribution& dist) :
- AbstractParameterAliasable(dist),
AbstractDiscreteDistribution(dist),
lambda_(dist.lambda_),
tp_(dist.tp_),
@@ -94,7 +93,6 @@ public:
TruncatedExponentialDiscreteDistribution& operator=(const TruncatedExponentialDiscreteDistribution& dist)
{
- AbstractParameterAliasable::operator=(dist);
AbstractDiscreteDistribution::operator=(dist);
lambda_= dist.lambda_;
tp_ = dist.tp_;
--- a/src/Bpp/Numeric/Prob/GaussianDiscreteDistribution.cpp
+++ b/src/Bpp/Numeric/Prob/GaussianDiscreteDistribution.cpp
@@ -52,7 +52,6 @@ using namespace std;
/** Constructor: **************************************************************/
GaussianDiscreteDistribution::GaussianDiscreteDistribution(size_t n, double mu, double sigma) :
- AbstractParameterAliasable("Gaussian."),
AbstractDiscreteDistribution(n,"Gaussian."), mu_(mu), sigma_(sigma)
{
addParameter_(new Parameter("Gaussian.mu", mu));
@@ -61,7 +60,6 @@ GaussianDiscreteDistribution::GaussianDi
}
GaussianDiscreteDistribution::GaussianDiscreteDistribution(const GaussianDiscreteDistribution& gdd) :
- AbstractParameterAliasable(gdd),
AbstractDiscreteDistribution(gdd),
mu_(gdd.mu_),
sigma_(gdd.sigma_)
@@ -70,7 +68,6 @@ GaussianDiscreteDistribution::GaussianDi
GaussianDiscreteDistribution& GaussianDiscreteDistribution::operator=(const GaussianDiscreteDistribution& gdd)
{
- AbstractParameterAliasable::operator=(gdd);
AbstractDiscreteDistribution::operator=(gdd);
mu_=gdd.mu_;
sigma_=gdd.sigma_;
--- a/src/Bpp/Numeric/Prob/MixtureOfDiscreteDistributions.cpp
+++ b/src/Bpp/Numeric/Prob/MixtureOfDiscreteDistributions.cpp
@@ -47,7 +47,6 @@ using namespace std;
MixtureOfDiscreteDistributions::MixtureOfDiscreteDistributions(const vector<DiscreteDistribution*>& distributions,
const vector<double>& probas ) :
- AbstractParameterAliasable("Mixture."),
AbstractDiscreteDistribution(1, "Mixture."),
vdd_(),
probas_(),
@@ -108,7 +107,6 @@ MixtureOfDiscreteDistributions::MixtureO
}
MixtureOfDiscreteDistributions::MixtureOfDiscreteDistributions(const MixtureOfDiscreteDistributions& mdd) :
- AbstractParameterAliasable(mdd),
AbstractDiscreteDistribution(mdd),
vdd_(),
probas_(),
@@ -124,7 +122,6 @@ MixtureOfDiscreteDistributions::MixtureO
MixtureOfDiscreteDistributions& MixtureOfDiscreteDistributions::operator=(const MixtureOfDiscreteDistributions& mdd)
{
- AbstractParameterAliasable::operator=(mdd);
AbstractDiscreteDistribution::operator=(mdd);
vdd_.clear();
probas_.clear();
--- a/src/Bpp/Numeric/Prob/SimpleDiscreteDistribution.cpp
+++ b/src/Bpp/Numeric/Prob/SimpleDiscreteDistribution.cpp
@@ -49,7 +49,6 @@ using namespace std;
SimpleDiscreteDistribution::SimpleDiscreteDistribution(const map<double, double>& distribution,
double prec,
bool fixed) :
- AbstractParameterAliasable("Simple."),
AbstractDiscreteDistribution(distribution.size(), prec, "Simple."),
givenRanges_()
{
@@ -87,7 +86,6 @@ SimpleDiscreteDistribution::SimpleDiscre
double prec,
bool fixed
) :
- AbstractParameterAliasable("Simple."),
AbstractDiscreteDistribution(values.size(), prec, "Simple."),
givenRanges_()
{
@@ -129,7 +127,6 @@ SimpleDiscreteDistribution::SimpleDiscre
const std::vector<double>& probas,
double prec,
bool fixed) :
- AbstractParameterAliasable("Simple."),
AbstractDiscreteDistribution(values.size(), prec, "Simple."),
givenRanges_()
{
@@ -193,14 +190,12 @@ SimpleDiscreteDistribution::SimpleDiscre
SimpleDiscreteDistribution::SimpleDiscreteDistribution(const SimpleDiscreteDistribution& sdd) :
- AbstractParameterAliasable(sdd),
AbstractDiscreteDistribution(sdd),
givenRanges_(sdd.givenRanges_)
{}
SimpleDiscreteDistribution& SimpleDiscreteDistribution::operator=(const SimpleDiscreteDistribution& sdd)
{
- AbstractParameterAliasable::operator=(sdd);
AbstractDiscreteDistribution::operator=(sdd);
givenRanges_ = sdd.givenRanges_;
unforce-cxxflags.patch
gcc-7.patch
bump_soversion.patch
......@@ -11,7 +11,7 @@ Comment: Upstream version 2.3.0 now has additional -std=c++11 which might
# Compile options
-set (CMAKE_CXX_FLAGS "-std=c++11 -Wall -Weffc++ -Wshadow -Wconversion")
+set (CMAKE_CXX_FLAGS "-std=c++11 -Wno-deprecated -g")
+#set (CMAKE_CXX_FLAGS "-std=c++11 -g")
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
......@@ -49,9 +49,9 @@ using namespace std;
/******************************************************************************/
OutputStream* ApplicationTools::error = new StdErr();
OutputStream* ApplicationTools::message = new StdOut();
OutputStream* ApplicationTools::warning = new StdOut();
std::shared_ptr<OutputStream> ApplicationTools::error(new StdErr());
std::shared_ptr<OutputStream> ApplicationTools::message(new StdOut());
std::shared_ptr<OutputStream> ApplicationTools::warning(new StdOut());
time_t ApplicationTools::startTime;
size_t ApplicationTools::terminalWidth = 80;
float ApplicationTools::terminalSplit = 0.5;
......
......@@ -96,15 +96,15 @@ namespace bpp
/**
* @brief The output stream where errors have to be displayed.
*/
static OutputStream* error;
static std::shared_ptr<OutputStream> error;
/**
* @brief The output stream where messages have to be displayed.
*/
static OutputStream* message;
static std::shared_ptr<OutputStream> message;
/**
* @brief The output stream where warnings have to be displayed.
*/
static OutputStream* warning;
static std::shared_ptr<OutputStream> warning;
/**
* @brief Timer variable.
......
......@@ -48,10 +48,10 @@ using namespace std;
vector<int> NumCalcApplicationTools::seqFromString(const std::string& s, const std::string& delim, const std::string& seqdelim)
{
vector<int> seq;
StringTokenizer * st = new StringTokenizer(s, delim, true);
unique_ptr<StringTokenizer> st(new StringTokenizer(s, delim, true));
while (st->hasMoreToken())
{
StringTokenizer * st2 = new StringTokenizer(st->nextToken(), seqdelim, true);
unique_ptr<StringTokenizer> st2(new StringTokenizer(st->nextToken(), seqdelim, true));
if (st2->numberOfRemainingTokens() > 1)
{
......@@ -62,7 +62,7 @@ vector<int> NumCalcApplicationTools::seqFromString(const std::string& s, const s
{
seq.push_back(TextTools::toInt(st2->getToken(0)));
}
}
}
return seq;
}
......
......@@ -197,7 +197,7 @@ public:
*/
AssociationGraphImplObserver(bool directed = false) :
subjectGraph_(new GraphImpl(directed)),
subjectGraph_(std::shared_ptr<GraphImpl>(new GraphImpl(directed))),
graphidToN_(),
graphidToE_(),
NToGraphid_(),
......@@ -216,7 +216,7 @@ public:
*/
AssociationGraphImplObserver(std::shared_ptr<GraphImpl> subjectGraph = 00) :
subjectGraph_(subjectGraph ? subjectGraph : new GraphImpl()),
subjectGraph_(subjectGraph ? subjectGraph : std::shared_ptr<GraphImpl>(new GraphImpl(true))),
graphidToN_(),
graphidToE_(),
NToGraphid_(),
......@@ -1039,6 +1039,22 @@ public:
return leavesToReturn;
}
std::vector<typename AssociationGraphObserver<N, E>::NodeIndex > getAllLeavesIndexes() const
{
std::vector<typename AssociationGraphObserver<N, E>::NodeIndex > leavesToReturn;
// fetching all the graph Leaves
std::vector<NodeGraphid> graphLeaves = getGraph()->getAllLeaves();
// testing if they are defined in this observer
for (typename std::vector<NodeGraphid>::iterator currGraphLeave = graphLeaves.begin(); currGraphLeave != graphLeaves.end(); currGraphLeave++)
{
std::shared_ptr<N> foundLeafObject = graphidToN_.at(*currGraphLeave);
if (foundLeafObject != 00)
leavesToReturn.push_back(getNodeIndex(foundLeafObject));
}
return leavesToReturn;
}
/**
* Get all the inner nodes of a graph, ie, nodes with degree >= 2.
* @return a vector containing the inner nodes.
......
......@@ -400,6 +400,7 @@ public:
* @return a vector containing the leaves
*/
virtual std::vector<std::shared_ptr<N> > getAllLeaves() const = 0;
virtual std::vector<NodeIndex> getAllLeavesIndexes() const = 0;
/**
* Get all the inner nodes of a graph, ie, nodes with degree >= 2.
......
......@@ -62,6 +62,7 @@ public:
typedef typename AssociationGraphObserver<N, E>::EdgeIndex EdgeIndex;
typedef typename Graph::NodeId NodeGraphid;
typedef typename Graph::EdgeId EdgeGraphid;
public:
......@@ -77,10 +78,11 @@ public:
* Constructor
* @param subjectTreeGraph the graph which is observed
*/
AssociationTreeGraphImplObserver(std::shared_ptr<TreeGraphImpl> subjectTreeGraph = 00) :
AssociationGraphImplObserver<N, E, TreeGraphImpl>(subjectTreeGraph)
{}
/**
* Copy Constructor
* @param treeGraphObserver the treeGraphObserver to be copied
......
......@@ -426,7 +426,7 @@ void BppODiscreteDistributionFormat::initialize_(
for (size_t i = 0; i < pl.size(); ++i)
{
AutoParameter ap(pl[i]);
ap.setMessageHandler(ApplicationTools::warning);
ap.setMessageHandler(ApplicationTools::warning.get());
pl.setParameter(i, ap);
}
......
......@@ -172,7 +172,7 @@ void AbstractParameterAliasable::aliasParameters(map<string, string>& unparsedPa
for (size_t i = 0; i < pl.size(); i++)
{
if (unparsedParams.find(pl[i].getName()) == unparsedParams.end())
plpars.addParameter(*pl[i].clone());
plpars.addParameter(pl[i].clone());
}
size_t unp_s = unparsedParams.size();
......
......@@ -59,9 +59,9 @@ string AutoParameter::CONSTRAINTS_KEEP = "keep";
/** Constructors: *************************************************************/
AutoParameter::AutoParameter(const std::string& name, double value, Constraint* constraint, bool attachConstraint):
Parameter(name, value, constraint, attachConstraint), messageHandler_(ApplicationTools::message) {}
Parameter(name, value, constraint, attachConstraint), messageHandler_(ApplicationTools::message.get()) {}
AutoParameter::AutoParameter(const Parameter& p): Parameter(p), messageHandler_(ApplicationTools::message) {}
AutoParameter::AutoParameter(const Parameter& p): Parameter(p), messageHandler_(ApplicationTools::message.get()) {}
AutoParameter::AutoParameter(const AutoParameter& p): Parameter(p), messageHandler_(p.messageHandler_) {}
......