[med-svn] [Git][med-team/libbpp-seq][master] 4 commits: New upstream version 2.4.1
Julien Y. Dutheil
gitlab at salsa.debian.org
Wed Aug 22 08:02:11 BST 2018
Julien Y. Dutheil pushed to branch master at Debian Med / libbpp-seq
Commits:
8ad7c609 by Julien Y. Dutheil at 2018-08-19T09:45:35Z
New upstream version 2.4.1
- - - - -
6c0e84e6 by Julien Y. Dutheil at 2018-08-19T09:45:37Z
Update upstream source from tag 'upstream/2.4.1'
Update to upstream version '2.4.1'
with Debian dir 7194a4f3dba0b6a72f876d206d204578076d3e97
- - - - -
4f3549d6 by Julien Y. Dutheil at 2018-08-19T10:09:51Z
New version 2.4.1.
Adresses: #897784
Generated new symbol files
- - - - -
b79177b0 by Julien Y. Dutheil at 2018-08-22T07:01:13Z
Fixed dep version number.
- - - - -
20 changed files:
- CMakeLists.txt
- Doxyfile
- bpp-seq.spec
- debian/changelog
- debian/control
- debian/libbpp-seq12.symbols
- src/Bpp/Seq/Alphabet/DefaultAlphabet.h
- src/Bpp/Seq/Alphabet/LetterAlphabet.h
- src/Bpp/Seq/AlphabetIndex/AAChargeIndex.h
- src/Bpp/Seq/AlphabetIndex/AAIndex2Entry.h
- src/Bpp/Seq/AlphabetIndex/AAVolumeIndex.h
- src/Bpp/Seq/AlphabetIndex/BLOSUM50.cpp
- src/Bpp/Seq/AlphabetIndex/GranthamAAChemicalDistance.cpp
- src/Bpp/Seq/AlphabetIndex/MiyataAAChemicalDistance.cpp
- src/Bpp/Seq/AlphabetIndex/SimpleScore.cpp
- src/Bpp/Seq/AlphabetIndex/UserAlphabetIndex1.h
- src/Bpp/Seq/GeneticCode/GeneticCode.cpp
- src/Bpp/Seq/Io/ISequenceStream.h
- src/Bpp/Seq/SequenceTools.cpp
- src/Bpp/Seq/SymbolList.cpp
Changes:
=====================================
CMakeLists.txt
=====================================
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -95,10 +95,10 @@ ENDIF(NO_DEP_CHECK)
# Packager
SET(CPACK_PACKAGE_NAME "libbpp-seq")
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++ Sequence library")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING.txt")
SET(CPACK_RESOURCE_FILE_AUTHORS "${CMAKE_SOURCE_DIR}/AUTHORS.txt")
=====================================
Doxyfile
=====================================
--- a/Doxyfile
+++ b/Doxyfile
@@ -38,7 +38,7 @@ PROJECT_NAME = bpp-seq
# 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-seq.spec
=====================================
--- a/bpp-seq.spec
+++ b/bpp-seq.spec
@@ -3,7 +3,7 @@
URL: https://github.com/BioPP/bpp-seq
Name: bpp-seq
-Version: 2.4.0
+Version: 2.4.1
Release: 1%{?dist}
License: CECILL-2.0
Vendor: The Bio++ Project
@@ -78,6 +78,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
+- Compatibility update gcc8
* Fri Mar 03 2018 Julien Dutheil <julien.dutheil at univ-montp2.fr> 2.4.0-1
- Increased interface number
- Removed dynamic exceptions declarations.
=====================================
debian/changelog
=====================================
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+libbpp-seq (2.4.1-1) UNRELEASED; urgency=medium
+
+ * New upstream version
+ * Ref: #897784
+
+ -- Julien Dutheil <julien.dutheil at univ-montp2.fr> Sun, 19 Aug 2018 11:45:47 +0200
+
libbpp-seq (2.4.0-2) unstable; urgency=medium
[ Julien Dutheil ]
=====================================
debian/control
=====================================
--- a/debian/control
+++ b/debian/control
@@ -7,10 +7,10 @@ Priority: optional
Build-Depends: debhelper (>= 11~),
cmake,
d-shlibs (>= 0.80),
- libbpp-core-dev (>= 2.4.0)
+ libbpp-core-dev (>= 2.4.1)
Standards-Version: 4.1.3
-Vcs-Browser: https://anonscm.debian.org/cgit/debian-med/libbpp-seq.git
-Vcs-Git: https://anonscm.debian.org/git/debian-med/libbpp-seq.git
+Vcs-Browser: https://salsa.debian.org/med-team/libbpp-seq
+Vcs-Git: https://salsa.debian.org/med-team/libbpp-seq.git
Homepage: http://biopp.univ-montp2.fr/wiki/index.php/Main_Page
Package: libbpp-seq-dev
@@ -18,7 +18,7 @@ Architecture: any
Section: libdevel
Depends: libbpp-seq12 (= ${binary:Version}),
${misc:Depends},
- libbpp-core-dev (>= 2.4.0)
+ libbpp-core-dev (>= 2.4.1)
Description: Bio++ Sequence library development files
Bio++ is a set of C++ libraries for Bioinformatics, including sequence
analysis, phylogenetics, molecular evolution and population genetics.
@@ -35,7 +35,7 @@ Multi-Arch: same
Section: libs
Depends: ${shlibs:Depends},
${misc:Depends},
- libbpp-core4 (>= 2.4.0)
+ libbpp-core4 (>= 2.4.1)
Pre-Depends: ${misc:Pre-Depends}
Description: Bio++ Sequence library
Bio++ is a set of C++ libraries for Bioinformatics, including sequence
=====================================
debian/libbpp-seq12.symbols
=====================================
The diff for this file was not included because it is too large.
=====================================
src/Bpp/Seq/Alphabet/DefaultAlphabet.h
=====================================
--- a/src/Bpp/Seq/Alphabet/DefaultAlphabet.h
+++ b/src/Bpp/Seq/Alphabet/DefaultAlphabet.h
@@ -55,9 +55,6 @@ namespace bpp
public LetterAlphabet
{
protected:
- void registerState(AlphabetState* st) {
- AbstractAlphabet::registerState(st);
- }
std::string chars_;
public:
=====================================
src/Bpp/Seq/Alphabet/LetterAlphabet.h
=====================================
--- a/src/Bpp/Seq/Alphabet/LetterAlphabet.h
+++ b/src/Bpp/Seq/Alphabet/LetterAlphabet.h
@@ -70,8 +70,8 @@ namespace bpp {
LetterAlphabet& operator=(const LetterAlphabet& bia)
{
AbstractAlphabet::operator=(bia);
- letters_=bia.letters_;
- caseSensitive_=bia.caseSensitive_;
+ letters_ = bia.letters_;
+ caseSensitive_ = bia.caseSensitive_;
return *this;
@@ -83,7 +83,7 @@ namespace bpp {
public:
bool isCharInAlphabet(char state) const {
- return letters_[static_cast<unsigned int>(state)] != LETTER_UNDEF_VALUE;
+ return letters_[static_cast<size_t>(state)] != LETTER_UNDEF_VALUE;
}
bool isCharInAlphabet(const std::string& state) const {
return isCharInAlphabet(state[0]);
@@ -98,20 +98,20 @@ namespace bpp {
void registerState(AlphabetState* st) {
AbstractAlphabet::registerState(st);
if (caseSensitive_) {
- letters_[static_cast<unsigned int>(st->getLetter()[0])] = st->getNum();
+ letters_[static_cast<size_t>(st->getLetter()[0])] = st->getNum();
} else {
- letters_[static_cast<unsigned int>(tolower(st->getLetter()[0]))] = st->getNum();
- letters_[static_cast<unsigned int>(toupper(st->getLetter()[0]))] = st->getNum();
+ letters_[static_cast<size_t>(tolower(st->getLetter()[0]))] = st->getNum();
+ letters_[static_cast<size_t>(toupper(st->getLetter()[0]))] = st->getNum();
}
}
void setState(size_t pos, AlphabetState* st) {
AbstractAlphabet::setState(pos, st);
if (caseSensitive_) {
- letters_[static_cast<unsigned int>(st->getLetter()[0])] = st->getNum();
+ letters_[static_cast<size_t>(st->getLetter()[0])] = st->getNum();
} else {
- letters_[static_cast<unsigned int>(tolower(st->getLetter()[0]))] = st->getNum();
- letters_[static_cast<unsigned int>(toupper(st->getLetter()[0]))] = st->getNum();
+ letters_[static_cast<size_t>(tolower(st->getLetter()[0]))] = st->getNum();
+ letters_[static_cast<size_t>(toupper(st->getLetter()[0]))] = st->getNum();
}
}
=====================================
src/Bpp/Seq/AlphabetIndex/AAChargeIndex.h
=====================================
--- a/src/Bpp/Seq/AlphabetIndex/AAChargeIndex.h
+++ b/src/Bpp/Seq/AlphabetIndex/AAChargeIndex.h
@@ -81,7 +81,7 @@ namespace bpp
* C RICJ880106 0.849
* I A/L R/K N/M D/F C/P Q/S E/T G/W H/Y I/V
* 0. 0. 0. 1. 0. 0. 1. 0. 0. 0.
- * 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. * Soit:
+ * 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.
* //
* @endcode
*
=====================================
src/Bpp/Seq/AlphabetIndex/AAIndex2Entry.h
=====================================
--- a/src/Bpp/Seq/AlphabetIndex/AAIndex2Entry.h
+++ b/src/Bpp/Seq/AlphabetIndex/AAIndex2Entry.h
@@ -94,16 +94,17 @@ public:
double getIndex(int state1, int state2) const
{
- size_t stateIndex1 = alpha_->getStateIndex(state1);
- size_t stateIndex2 = alpha_->getStateIndex(state2);
- return property_(stateIndex1, stateIndex2);
+ if (state1 < 0 || state1 > 19)
+ throw BadIntException(state1, "AAIndex2Entry::getIndex(). Invalid state1.", alpha_);
+ if (state2 < 0 || state2 > 19)
+ throw BadIntException(state2, "AAIndex2Entry::getIndex(). Invalid state2.", alpha_);
+ double d = property_(static_cast<size_t>(state1), static_cast<size_t>(state2));
+ return d;
}
double getIndex(const std::string& state1, const std::string& state2) const
{
- size_t stateIndex1 = alpha_->getStateIndex(state1);
- size_t stateIndex2 = alpha_->getStateIndex(state2);
- return property_(stateIndex1, stateIndex2);
+ return getIndex(alpha_->charToInt(state1), alpha_->charToInt(state2));
}
LinearMatrix<double>* getIndexMatrix() const { return new LinearMatrix<double>(property_); }
=====================================
src/Bpp/Seq/AlphabetIndex/AAVolumeIndex.h
=====================================
--- a/src/Bpp/Seq/AlphabetIndex/AAVolumeIndex.h
+++ b/src/Bpp/Seq/AlphabetIndex/AAVolumeIndex.h
@@ -47,7 +47,7 @@
namespace bpp
{
/**
- * @brief Volume (Angström^3) of each amino acid, according to http://www.imb-jena.de/IMAGE_AA.html
+ * @brief Volume (Angström^3) of each amino acid, according to http://www.imb-jena.de/IMAGE_AA.html (Note: original webpage is not available anymore)
*
*
*/
=====================================
src/Bpp/Seq/AlphabetIndex/BLOSUM50.cpp
=====================================
--- a/src/Bpp/Seq/AlphabetIndex/BLOSUM50.cpp
+++ b/src/Bpp/Seq/AlphabetIndex/BLOSUM50.cpp
@@ -57,16 +57,17 @@ BLOSUM50::BLOSUM50() :
double BLOSUM50::getIndex(int state1, int state2) const
{
- size_t stateIndex1 = alpha_->getStateIndex(state1);
- size_t stateIndex2 = alpha_->getStateIndex(state2);
- return distanceMatrix_(stateIndex1, stateIndex2);
+ if (state1 < 0 || state1 > 19)
+ throw BadIntException(state1, "BLOSUM50::getIndex(). Invalid state1.", alpha_);
+ if (state2 < 0 || state2 > 19)
+ throw BadIntException(state2, "BLOSUM50::getIndex(). Invalid state2.", alpha_);
+ double d = distanceMatrix_(static_cast<size_t>(state1), static_cast<size_t>(state2));
+ return d;
}
double BLOSUM50::getIndex(const std::string& state1, const std::string& state2) const
{
- return distanceMatrix_(
- static_cast<size_t>(alpha_->charToInt(state1)),
- static_cast<size_t>(alpha_->charToInt(state2)));
+ return getIndex(alpha_->charToInt(state1), alpha_->charToInt(state2));
}
LinearMatrix<double>* BLOSUM50::getIndexMatrix() const
=====================================
src/Bpp/Seq/AlphabetIndex/GranthamAAChemicalDistance.cpp
=====================================
--- a/src/Bpp/Seq/AlphabetIndex/GranthamAAChemicalDistance.cpp
+++ b/src/Bpp/Seq/AlphabetIndex/GranthamAAChemicalDistance.cpp
@@ -63,13 +63,15 @@ GranthamAAChemicalDistance::~GranthamAAChemicalDistance() {}
double GranthamAAChemicalDistance::getIndex(int state1, int state2) const
{
- size_t stateIndex1 = alpha_->getStateIndex(state1);
- size_t stateIndex2 = alpha_->getStateIndex(state2);
- double d = distanceMatrix_(stateIndex1, stateIndex2);
+ if (state1 < 0 || state1 > 19)
+ throw BadIntException(state1, "GranthamAAChemicalDistance::getIndex(). Invalid state1.", alpha_);
+ if (state2 < 0 || state2 > 19)
+ throw BadIntException(state2, "GranthamAAChemicalDistance::getIndex(). Invalid state2.", alpha_);
+ double d = distanceMatrix_(static_cast<size_t>(state1), static_cast<size_t>(state2));
if (sign_ == SIGN_NONE)
return NumTools::abs<double>(d);
if (sign_ == SIGN_PC1)
- return signMatrix_(stateIndex1, stateIndex2) * NumTools::abs<double>(d);
+ return signMatrix_(static_cast<size_t>(state1), static_cast<size_t>(state2)) * NumTools::abs<double>(d);
return d;
}
=====================================
src/Bpp/Seq/AlphabetIndex/MiyataAAChemicalDistance.cpp
=====================================
--- a/src/Bpp/Seq/AlphabetIndex/MiyataAAChemicalDistance.cpp
+++ b/src/Bpp/Seq/AlphabetIndex/MiyataAAChemicalDistance.cpp
@@ -58,18 +58,17 @@ MiyataAAChemicalDistance::MiyataAAChemicalDistance() :
double MiyataAAChemicalDistance::getIndex(int state1, int state2) const
{
- size_t stateIndex1 = alpha_->getStateIndex(state1);
- size_t stateIndex2 = alpha_->getStateIndex(state2);
- double d = distanceMatrix_(stateIndex1, stateIndex2);
+ if (state1 < 0 || state1 > 19)
+ throw BadIntException(state1, "MiyataAAChemicalDistance::getIndex(). Invalid state1.", alpha_);
+ if (state2 < 0 || state2 > 19)
+ throw BadIntException(state2, "MiyataAAChemicalDistance::getIndex(). Invalid state2.", alpha_);
+ double d = distanceMatrix_(static_cast<size_t>(state1), static_cast<size_t>(state2));
return sym_ ? NumTools::abs<double>(d) : d;
}
double MiyataAAChemicalDistance::getIndex(const string& state1, const string& state2) const
{
- double d = distanceMatrix_(
- static_cast<size_t>(alpha_->charToInt(state1)),
- static_cast<size_t>(alpha_->charToInt(state2)));
- return sym_ ? NumTools::abs(d) : d;
+ return getIndex(alpha_->charToInt(state1), alpha_->charToInt(state2));
}
Matrix<double>* MiyataAAChemicalDistance::getIndexMatrix() const
=====================================
src/Bpp/Seq/AlphabetIndex/SimpleScore.cpp
=====================================
--- a/src/Bpp/Seq/AlphabetIndex/SimpleScore.cpp
+++ b/src/Bpp/Seq/AlphabetIndex/SimpleScore.cpp
@@ -63,15 +63,15 @@ SimpleScore::SimpleScore(const Alphabet* alphabet, double match, double mismatch
double SimpleScore::getIndex(int state1, int state2) const
{
- size_t stateIndex1 = alphabet_->getStateIndex(state1);
- size_t stateIndex2 = alphabet_->getStateIndex(state2);
+ size_t stateIndex1 = alphabet_->getStateIndex(state1)-1;
+ size_t stateIndex2 = alphabet_->getStateIndex(state2)-1;
return distanceMatrix_(stateIndex1, stateIndex2);
}
double SimpleScore::getIndex(const std::string& state1, const std::string& state2) const
{
- size_t stateIndex1 = alphabet_->getStateIndex(state1);
- size_t stateIndex2 = alphabet_->getStateIndex(state2);
+ size_t stateIndex1 = alphabet_->getStateIndex(state1)-1;
+ size_t stateIndex2 = alphabet_->getStateIndex(state2)-1;
return distanceMatrix_(stateIndex1, stateIndex2);
}
=====================================
src/Bpp/Seq/AlphabetIndex/UserAlphabetIndex1.h
=====================================
--- a/src/Bpp/Seq/AlphabetIndex/UserAlphabetIndex1.h
+++ b/src/Bpp/Seq/AlphabetIndex/UserAlphabetIndex1.h
@@ -65,13 +65,13 @@ public:
{}
UserAlphabetIndex1(const UserAlphabetIndex1& uAlph) :
- alph_(uAlph.alph_),//->clone()),
+ alph_(uAlph.alph_),
index_(uAlph.index_)
{}
UserAlphabetIndex1& operator=(const UserAlphabetIndex1& uAlph)
{
- alph_ = uAlph.alph_;//->clone();
+ alph_ = uAlph.alph_;
index_ = uAlph.index_;
return *this;
}
@@ -83,22 +83,22 @@ public:
public:
double getIndex(int state) const
{
- return index_[alph_->getStateIndex(state)];
+ return index_[alph_->getStateIndex(state)-1];
}
void setIndex(int state, double val)
{
- index_[alph_->getStateIndex(state)] = val;
+ index_[alph_->getStateIndex(state)-1] = val;
}
double getIndex(const std::string& state) const
{
- return index_[alph_->getStateIndex(state)];
+ return index_[alph_->getStateIndex(state)-1];
}
void setIndex(const std::string& state, double val)
{
- index_[alph_->getStateIndex(state)] = val;
+ index_[alph_->getStateIndex(state)-1] = val;
}
std::vector<double>* getIndexVector() const { return new std::vector<double>(index_); }
=====================================
src/Bpp/Seq/GeneticCode/GeneticCode.cpp
=====================================
--- a/src/Bpp/Seq/GeneticCode/GeneticCode.cpp
+++ b/src/Bpp/Seq/GeneticCode/GeneticCode.cpp
@@ -87,7 +87,7 @@ vector<int> GeneticCode::getSynonymous(int aminoacid) const
if (translate(i) == aminoacid)
synonymes.push_back(i);
}
- catch (StopCodonException)
+ catch (StopCodonException&)
{ }
}
return synonymes;
@@ -108,7 +108,7 @@ std::vector<std::string> GeneticCode::getSynonymous(const std::string& aminoacid
if (translate(i) == aa)
synonymes.push_back(codonAlphabet_.intToChar(i));
}
- catch (StopCodonException)
+ catch (StopCodonException&)
{ }
}
return synonymes;
=====================================
src/Bpp/Seq/Io/ISequenceStream.h
=====================================
--- a/src/Bpp/Seq/Io/ISequenceStream.h
+++ b/src/Bpp/Seq/Io/ISequenceStream.h
@@ -57,11 +57,11 @@ namespace bpp
*/
class ISequenceStream: public virtual IOSequenceStream
{
- public:
- ISequenceStream() {}
- virtual ~ISequenceStream() {}
+ public:
+ ISequenceStream() {}
+ virtual ~ISequenceStream() {}
- public:
+ public:
/**
* @brief Read sequence from stream.
*
@@ -78,5 +78,5 @@ class ISequenceStream: public virtual IOSequenceStream
} //end of namespace bpp.
-#endif // _ISEQUENCESTREAM_H_
+#endif // _ISEQUENCESTREAM_H_
=====================================
src/Bpp/Seq/SequenceTools.cpp
=====================================
--- a/src/Bpp/Seq/SequenceTools.cpp
+++ b/src/Bpp/Seq/SequenceTools.cpp
@@ -155,7 +155,7 @@ Sequence* SequenceTools::getComplement(const Sequence& sequence)
Sequence* SequenceTools::transcript(const Sequence& sequence)
{
// Alphabet type checking
- if (AlphabetTools::isDNAAlphabet(sequence.getAlphabet()))
+ if (!AlphabetTools::isDNAAlphabet(sequence.getAlphabet()))
{
throw AlphabetException ("SequenceTools::transcript : Sequence must be DNA", sequence.getAlphabet());
}
@@ -168,7 +168,7 @@ Sequence* SequenceTools::transcript(const Sequence& sequence)
Sequence* SequenceTools::reverseTranscript(const Sequence& sequence)
{
// Alphabet type checking
- if (AlphabetTools::isRNAAlphabet(sequence.getAlphabet()))
+ if (!AlphabetTools::isRNAAlphabet(sequence.getAlphabet()))
{
throw AlphabetException ("SequenceTools::reverseTranscript : Sequence must be RNA", sequence.getAlphabet());
}
=====================================
src/Bpp/Seq/SymbolList.cpp
=====================================
--- a/src/Bpp/Seq/SymbolList.cpp
+++ b/src/Bpp/Seq/SymbolList.cpp
@@ -47,15 +47,15 @@ using namespace std;
/****************************************************************************************/
BasicSymbolList::BasicSymbolList(const std::vector<string>& list, const Alphabet* alpha) :
- alphabet_(alpha), content_()
+ alphabet_(alpha), content_()
{
- setContent(list);
+ setContent(list);
}
BasicSymbolList::BasicSymbolList(const std::vector<int>& list, const Alphabet* alpha) :
- alphabet_(alpha), content_()
+ alphabet_(alpha), content_()
{
- setContent(list);
+ setContent(list);
}
/****************************************************************************************/
@@ -72,61 +72,61 @@ BasicSymbolList::BasicSymbolList(const BasicSymbolList& list):
BasicSymbolList& BasicSymbolList::operator=(const SymbolList& list)
{
- content_.resize(list.size());
+ content_.resize(list.size());
for (size_t i = 0; i < list.size(); ++i)
content_[i] = list[i];
- alphabet_ = list.getAlphabet();
- return *this;
+ alphabet_ = list.getAlphabet();
+ return *this;
}
BasicSymbolList& BasicSymbolList::operator=(const BasicSymbolList& list)
{
- content_ = list.content_;
- alphabet_ = list.alphabet_;
- return *this;
+ content_ = list.content_;
+ alphabet_ = list.alphabet_;
+ return *this;
}
/****************************************************************************************/
void BasicSymbolList::setContent(const vector<string>& list)
{
- // Check list for incorrect characters
- vector<int> coded(list.size());
- for (size_t i = 0; i < list.size(); i++)
- if(!alphabet_->isCharInAlphabet(list[i])) throw BadCharException(list[i], "BasicSymbolList::setContent", alphabet_);
+ // Check list for incorrect characters
+ vector<int> coded(list.size());
+ for (size_t i = 0; i < list.size(); i++)
+ if(!alphabet_->isCharInAlphabet(list[i])) throw BadCharException(list[i], "BasicSymbolList::setContent", alphabet_);
for (size_t i = 0; i < list.size(); i++)
- coded[i] = alphabet_->charToInt(list[i]);
-
+ coded[i] = alphabet_->charToInt(list[i]);
+
//BasicSymbolList is valid:
- content_ = coded;
+ content_ = coded;
};
/****************************************************************************************/
void BasicSymbolList::setContent(const vector<int>& list)
{
- // Check list for incorrect characters
- for (size_t i = 0; i < list.size(); i++)
- if(!alphabet_->isIntInAlphabet(list[i]))
+ // Check list for incorrect characters
+ for (size_t i = 0; i < list.size(); i++)
+ if(!alphabet_->isIntInAlphabet(list[i]))
throw BadIntException(list[i], "BasicSymbolList::setContent", alphabet_);
-
+
//Sequence is valid:
- content_ = list;
+ content_ = list;
};
/****************************************************************************************/
string BasicSymbolList::toString() const
{
- return StringSequenceTools::decodeSequence(content_, alphabet_);
+ return StringSequenceTools::decodeSequence(content_, alphabet_);
};
/****************************************************************************************/
void BasicSymbolList::addElement(const string& c)
{
- content_.push_back(alphabet_->charToInt(c));
+ content_.push_back(alphabet_->charToInt(c));
}
/****************************************************************************************/
@@ -134,83 +134,83 @@ void BasicSymbolList::addElement(const string& c)
void BasicSymbolList::addElement(size_t pos, const string& c)
{
if(pos >= content_.size()) throw IndexOutOfBoundsException("BasicSymbolList::addElement. Invalid position.", pos, 0, size() - 1);
- content_.insert(content_.begin() + static_cast<ptrdiff_t>(pos), alphabet_->charToInt(c));
+ content_.insert(content_.begin() + static_cast<ptrdiff_t>(pos), alphabet_->charToInt(c));
}
/****************************************************************************************/
void BasicSymbolList::setElement(size_t pos, const string& c)
{
- if(pos >= content_.size())
+ if(pos >= content_.size())
throw IndexOutOfBoundsException("BasicSymbolList::setElement. Invalid position.", pos, 0, size() - 1);
- content_[pos] = alphabet_->charToInt(c);
+ content_[pos] = alphabet_->charToInt(c);
}
/****************************************************************************************/
string BasicSymbolList::getChar(size_t pos) const
{
- if(pos >= content_.size())
+ if(pos >= content_.size())
throw IndexOutOfBoundsException("BasicSymbolList::getChar. Invalid position.", pos, 0, size() - 1);
- string c = "";
- try
+ string c = "";
+ try
{
- c = alphabet_->intToChar(content_[pos]);
- }
- catch(BadIntException bie)
+ c = alphabet_->intToChar(content_[pos]);
+ }
+ catch(BadIntException& bie)
{
- //This should never happen!
- }
- return c;
+ //This should never happen!
+ }
+ return c;
}
/****************************************************************************************/
void BasicSymbolList::deleteElement(size_t pos)
{
- if(pos >= content_.size())
+ if(pos >= content_.size())
throw IndexOutOfBoundsException("BasicSymbolList::deleteElement. Invalid position.", pos, 0, size() - 1);
- content_.erase(content_.begin() + static_cast<ptrdiff_t>(pos));
+ content_.erase(content_.begin() + static_cast<ptrdiff_t>(pos));
}
/****************************************************************************************/
void BasicSymbolList::deleteElements(size_t pos, size_t len)
{
- if (pos + len > content_.size())
+ if (pos + len > content_.size())
throw IndexOutOfBoundsException("BasicSymbolList::deleteElements. Invalid position.", pos + len, 0, size() - 1);
- content_.erase(content_.begin() + static_cast<ptrdiff_t>(pos), content_.begin() + static_cast<ptrdiff_t>(pos + len));
+ content_.erase(content_.begin() + static_cast<ptrdiff_t>(pos), content_.begin() + static_cast<ptrdiff_t>(pos + len));
}
/****************************************************************************************/
void BasicSymbolList::addElement(int v)
{
- //test:
- alphabet_->intToChar(v);
- content_.push_back(v);
+ //test:
+ alphabet_->intToChar(v);
+ content_.push_back(v);
}
/****************************************************************************************/
void BasicSymbolList::addElement(size_t pos, int v)
{
- //test:
- if(pos >= content_.size())
+ //test:
+ if(pos >= content_.size())
throw IndexOutOfBoundsException("BasicSymbolList::addElement. Invalid position.", pos, 0, size() - 1);
- alphabet_->intToChar(v);
- content_.insert(content_.begin() + static_cast<ptrdiff_t>(pos), v);
+ alphabet_->intToChar(v);
+ content_.insert(content_.begin() + static_cast<ptrdiff_t>(pos), v);
}
/****************************************************************************************/
void BasicSymbolList::setElement(size_t pos, int v)
{
- //test:
+ //test:
if(pos >= content_.size())
throw IndexOutOfBoundsException("BasicSymbolList::setElement. Invalid position.", pos, 0, size() - 1);
- alphabet_->intToChar(v);
- content_[pos] = v;
+ alphabet_->intToChar(v);
+ content_[pos] = v;
}
/****************************************************************************************/
@@ -219,7 +219,7 @@ int BasicSymbolList::getValue(size_t pos) const
{
if(pos >= content_.size())
throw IndexOutOfBoundsException("BasicSymbolList::getValue. Invalid position.", pos, 0, size() - 1);
- return content_[pos];
+ return content_[pos];
}
/****************************************************************************************/
@@ -228,15 +228,15 @@ int BasicSymbolList::getValue(size_t pos) const
/****************************************************************************************/
EdSymbolList::EdSymbolList(const std::vector<string>& list, const Alphabet* alpha) :
- alphabet_(alpha), propagateEvents_(true), content_(), listeners_()
+ alphabet_(alpha), propagateEvents_(true), content_(), listeners_()
{
- setContent(list);
+ setContent(list);
}
EdSymbolList::EdSymbolList(const std::vector<int>& list, const Alphabet* alpha) :
- alphabet_(alpha), propagateEvents_(true), content_(), listeners_()
+ alphabet_(alpha), propagateEvents_(true), content_(), listeners_()
{
- setContent(list);
+ setContent(list);
}
/****************************************************************************************/
@@ -259,23 +259,23 @@ EdSymbolList::EdSymbolList(const EdSymbolList& list):
EdSymbolList& EdSymbolList::operator=(const SymbolList& list)
{
- content_.resize(list.size());
+ content_.resize(list.size());
for (size_t i = 0; i < list.size(); ++i) {
content_[i] = list[i];
}
- alphabet_ = list.getAlphabet();
+ alphabet_ = list.getAlphabet();
propagateEvents_ = true;
for (size_t i = 0; i < listeners_.size(); ++i)
if (!listeners_[i]->isShared())
delete listeners_[i];
listeners_.clear();
- return *this;
+ return *this;
}
EdSymbolList& EdSymbolList::operator=(const EdSymbolList& list)
{
- content_ = list.getContent();
- alphabet_ = list.getAlphabet();
+ content_ = list.getContent();
+ alphabet_ = list.getAlphabet();
propagateEvents_ = list.propagateEvents_;
for (size_t i = 0; i < listeners_.size(); ++i)
delete listeners_[i];
@@ -283,7 +283,7 @@ EdSymbolList& EdSymbolList::operator=(const EdSymbolList& list)
for (size_t i = 0; i < listeners_.size(); ++i)
if (!list.listeners_[i]->isShared())
listeners_[i] = dynamic_cast<SymbolListListener*>(list.listeners_[i]->clone());
- return *this;
+ return *this;
}
/****************************************************************************************/
@@ -294,15 +294,15 @@ void EdSymbolList::setContent(const vector<string>& list)
fireBeforeSequenceChanged(event);
// Check list for incorrect characters
- vector<int> coded(list.size());
- for (size_t i = 0; i < list.size(); i++)
- if (!alphabet_->isCharInAlphabet(list[i])) throw BadCharException(list[i], "EdSymbolList::setContent", alphabet_);
-
+ vector<int> coded(list.size());
+ for (size_t i = 0; i < list.size(); i++)
+ if (!alphabet_->isCharInAlphabet(list[i])) throw BadCharException(list[i], "EdSymbolList::setContent", alphabet_);
+
for (size_t i = 0; i < list.size(); i++)
- coded[i] = alphabet_->charToInt(list[i]);
-
+ coded[i] = alphabet_->charToInt(list[i]);
+
//SymbolList is valid:
- content_ = coded;
+ content_ = coded;
fireAfterSequenceChanged(event);
};
@@ -313,13 +313,13 @@ void EdSymbolList::setContent(const vector<int>& list)
SymbolListEditionEvent event(this);
fireBeforeSequenceChanged(event);
- // Check list for incorrect characters
- for (size_t i = 0; i < list.size(); i++)
- if(!alphabet_->isIntInAlphabet(list[i]))
+ // Check list for incorrect characters
+ for (size_t i = 0; i < list.size(); i++)
+ if(!alphabet_->isIntInAlphabet(list[i]))
throw BadIntException(list[i], "EdSymbolList::setContent", alphabet_);
-
+
//Sequence is valid:
- content_ = list;
+ content_ = list;
fireAfterSequenceChanged(event);
};
@@ -327,7 +327,7 @@ void EdSymbolList::setContent(const vector<int>& list)
string EdSymbolList::toString() const
{
- return StringSequenceTools::decodeSequence(content_, alphabet_);
+ return StringSequenceTools::decodeSequence(content_, alphabet_);
};
/****************************************************************************************/
@@ -336,7 +336,7 @@ void EdSymbolList::addElement(const string& c)
{
SymbolListInsertionEvent event(this, size(), 1);
fireBeforeSequenceInserted(event);
- content_.push_back(alphabet_->charToInt(c));
+ content_.push_back(alphabet_->charToInt(c));
fireAfterSequenceInserted(event);
}
@@ -347,7 +347,7 @@ void EdSymbolList::addElement(size_t pos, const string& c)
if (pos >= content_.size()) throw IndexOutOfBoundsException("EdSymbolList::addElement. Invalid position.", pos, 0, size() - 1);
SymbolListInsertionEvent event(this, pos, 1);
fireBeforeSequenceInserted(event);
- content_.insert(content_.begin() + static_cast<ptrdiff_t>(pos), alphabet_->charToInt(c));
+ content_.insert(content_.begin() + static_cast<ptrdiff_t>(pos), alphabet_->charToInt(c));
fireAfterSequenceInserted(event);
}
@@ -355,11 +355,11 @@ void EdSymbolList::addElement(size_t pos, const string& c)
void EdSymbolList::setElement(size_t pos, const string& c)
{
- if (pos >= content_.size())
+ if (pos >= content_.size())
throw IndexOutOfBoundsException("EdSymbolList::setElement. Invalid position.", pos, 0, size() - 1);
SymbolListSubstitutionEvent event(this, pos, pos);
fireBeforeSequenceSubstituted(event);
- content_[pos] = alphabet_->charToInt(c);
+ content_[pos] = alphabet_->charToInt(c);
fireAfterSequenceSubstituted(event);
}
@@ -367,26 +367,26 @@ void EdSymbolList::setElement(size_t pos, const string& c)
string EdSymbolList::getChar(size_t pos) const
{
- if (pos >= content_.size())
+ if (pos >= content_.size())
throw IndexOutOfBoundsException("EdSymbolList::getChar. Invalid position.", pos, 0, size() - 1);
- string c = "";
- try {
- c = alphabet_->intToChar(content_[pos]);
- } catch(BadIntException bie) {
- //This should never happen!
- }
- return c;
+ string c = "";
+ try {
+ c = alphabet_->intToChar(content_[pos]);
+ } catch(BadIntException& bie) {
+ //This should never happen!
+ }
+ return c;
}
/****************************************************************************************/
void EdSymbolList::deleteElement(size_t pos)
{
- if (pos >= content_.size())
+ if (pos >= content_.size())
throw IndexOutOfBoundsException("EdSymbolList::deleteElement. Invalid position.", pos, 0, size() - 1);
SymbolListDeletionEvent event(this, pos, 1);
fireBeforeSequenceDeleted(event);
- content_.erase(content_.begin() + static_cast<ptrdiff_t>(pos));
+ content_.erase(content_.begin() + static_cast<ptrdiff_t>(pos));
fireAfterSequenceDeleted(event);
}
@@ -394,11 +394,11 @@ void EdSymbolList::deleteElement(size_t pos)
void EdSymbolList::deleteElements(size_t pos, size_t len)
{
- if(pos + len > content_.size())
+ if(pos + len > content_.size())
throw IndexOutOfBoundsException("EdSymbolList::deleteElements. Invalid position.", pos + len, 0, size() - 1);
SymbolListDeletionEvent event(this, pos, len);
fireBeforeSequenceDeleted(event);
- content_.erase(content_.begin() + static_cast<ptrdiff_t>(pos), content_.begin() + static_cast<ptrdiff_t>(pos + len));
+ content_.erase(content_.begin() + static_cast<ptrdiff_t>(pos), content_.begin() + static_cast<ptrdiff_t>(pos + len));
fireAfterSequenceDeleted(event);
}
@@ -409,9 +409,9 @@ void EdSymbolList::addElement(int v)
{
SymbolListInsertionEvent event(this, size(), 1);
fireBeforeSequenceInserted(event);
- //test:
- alphabet_->intToChar(v);
- content_.push_back(v);
+ //test:
+ alphabet_->intToChar(v);
+ content_.push_back(v);
fireAfterSequenceInserted(event);
}
@@ -419,13 +419,13 @@ void EdSymbolList::addElement(int v)
void EdSymbolList::addElement(size_t pos, int v)
{
- //test:
- if (pos >= content_.size())
+ //test:
+ if (pos >= content_.size())
throw IndexOutOfBoundsException("EdSymbolList::addElement. Invalid position.", pos, 0, size() - 1);
SymbolListInsertionEvent event(this, pos, 1);
fireBeforeSequenceInserted(event);
- alphabet_->intToChar(v);
- content_.insert(content_.begin() + static_cast<ptrdiff_t>(pos), v);
+ alphabet_->intToChar(v);
+ content_.insert(content_.begin() + static_cast<ptrdiff_t>(pos), v);
fireAfterSequenceInserted(event);
}
@@ -433,13 +433,13 @@ void EdSymbolList::addElement(size_t pos, int v)
void EdSymbolList::setElement(size_t pos, int v)
{
- //test:
+ //test:
if (pos >= content_.size())
throw IndexOutOfBoundsException("EdSymbolList::setElement. Invalid position.", pos, 0, size() - 1);
SymbolListSubstitutionEvent event(this, pos, pos);
fireBeforeSequenceSubstituted(event);
- alphabet_->intToChar(v);
- content_[pos] = v;
+ alphabet_->intToChar(v);
+ content_[pos] = v;
fireAfterSequenceSubstituted(event);
}
@@ -449,7 +449,7 @@ int EdSymbolList::getValue(size_t pos) const
{
if (pos >= content_.size())
throw IndexOutOfBoundsException("EdSymbolList::getValue. Invalid position.", pos, 0, size() - 1);
- return content_[pos];
+ return content_[pos];
}
/****************************************************************************************/
View it on GitLab: https://salsa.debian.org/med-team/libbpp-seq/compare/8848ab726996229dead3c53526afb7e6de73b711...b79177b0ae3a938c67dc51f0dc772892186768ed
--
View it on GitLab: https://salsa.debian.org/med-team/libbpp-seq/compare/8848ab726996229dead3c53526afb7e6de73b711...b79177b0ae3a938c67dc51f0dc772892186768ed
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/995f7837/attachment-0001.html>
More information about the debian-med-commit
mailing list