[med-svn] [libbpp-seq] 01/04: Turn removal of VectorProbabilisticSiteContainer into a quilt patch

Andreas Tille tille at debian.org
Thu Jul 13 07:00:31 UTC 2017


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

tille pushed a commit to branch master
in repository libbpp-seq.

commit 5952977d6fbb4760c8048e13513d5353e04c0f97
Author: Andreas Tille <tille at debian.org>
Date:   Thu Jul 13 08:51:45 2017 +0200

    Turn removal of VectorProbabilisticSiteContainer into a quilt patch
---
 .../rm_VectorProbabilisticSiteContainer.patch      | 322 +++++++++++++++++++++
 debian/patches/series                              |   1 +
 .../Container/VectorProbabilisticSiteContainer.cpp | 187 ++++++++++++
 .../Container/VectorProbabilisticSiteContainer.h   | 123 ++++++++
 4 files changed, 633 insertions(+)

diff --git a/debian/patches/rm_VectorProbabilisticSiteContainer.patch b/debian/patches/rm_VectorProbabilisticSiteContainer.patch
new file mode 100644
index 0000000..a869f0a
--- /dev/null
+++ b/debian/patches/rm_VectorProbabilisticSiteContainer.patch
@@ -0,0 +1,322 @@
+Author: Julien Dutheil <julien.dutheil at univ-montp2.fr>
+Last-Update: Wed, 12 Jul 2017 13:21:07 +0000
+Description: Removed unused class VectorProbabilisticSiteContainer
+ This class was moved to a dedicated branch but these files were left on
+ the master branch. Yet they were not listed by cmake for compilation.
+
+--- a/src/Bpp/Seq/Container/VectorProbabilisticSiteContainer.cpp
++++ /dev/null
+@@ -1,187 +0,0 @@
+-//
+-// File: VectorProbabilisticSiteContainer.cpp
+-// Created by: Murray Patterson
+-// Created on: Mon Oct 19 2015
+-//
+-
+-/*
+-   Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
+-
+-   This software is a computer program whose purpose is to provide classes
+-   for sequences analysis.
+-
+-   This software is governed by the CeCILL  license under French law and
+-   abiding by the rules of distribution of free software.  You can  use,
+-   modify and/ or redistribute the software under the terms of the CeCILL
+-   license as circulated by CEA, CNRS and INRIA at the following URL
+-   "http://www.cecill.info".
+-
+-   As a counterpart to the access to the source code and  rights to copy,
+-   modify and redistribute granted by the license, users are provided only
+-   with a limited warranty  and the software's author,  the holder of the
+-   economic rights,  and the successive licensors  have only  limited
+-   liability.
+-
+-   In this respect, the user's attention is drawn to the risks associated
+-   with loading,  using,  modifying and/or developing or reproducing the
+-   software by the user in light of its specific status of free software,
+-   that may mean  that it is complicated to manipulate,  and  that  also
+-   therefore means  that it is reserved for developers  and  experienced
+-   professionals having in-depth computer knowledge. Users are therefore
+-   encouraged to load and test the software's suitability as regards their
+-   requirements in conditions enabling the security of their systems and/or
+-   data to be ensured and,  more generally, to use and operate it in the
+-   same conditions as regards security.
+-
+-   The fact that you are presently reading this means that you have had
+-   knowledge of the CeCILL license and that you accept its terms.
+-*/
+-
+-#include "VectorProbabilisticSiteContainer.h"
+-
+-#include <Bpp/Text/TextTools.h>
+-#include <Bpp/Numeric/DataTable.h>
+-
+-using namespace bpp;
+-
+-/********************************************************************************/
+-
+-VectorProbabilisticSiteContainer::VectorProbabilisticSiteContainer(const Alphabet * alpha) :
+-  VectorSiteContainer(alpha),
+-  p_sites_(0),
+-  p_sequences_(0)
+-{}
+-
+-/********************************************************************************/
+-
+-const ProbabilisticSite & VectorProbabilisticSiteContainer::getProbabilisticSite(std::size_t i) const throw (IndexOutOfBoundsException)
+-{
+-  if(i >= getNumberOfProbabilisticSites())
+-    throw IndexOutOfBoundsException("VectorProbabilisticSiteContainer::getProbabilisticSite.", i, 0, getNumberOfProbabilisticSites() - 1);
+-
+-  return *p_sites_[i];
+-}
+-
+-/********************************************************************************/
+-
+-void VectorProbabilisticSiteContainer::addSite(const ProbabilisticSite & site, bool checkPosition) throw (Exception)
+-{
+-  // check size :
+-  if(site.size() != getNumberOfProbabilisticSequences())
+-    throw Exception("VectorProbabilisticSiteContainer::addSite. Site does not have the appropriate length: " + TextTools::toString(site.size()) + ", should be " + TextTools::toString(getNumberOfProbabilisticSequences()) + ".");
+-
+-  // new site's alphabet and site container's alphabet must match :
+-  if(site.getAlphabet()->getAlphabetType() != getAlphabet()->getAlphabetType())
+-    throw AlphabetMismatchException("VectorProbabilisticSiteContainer::addSite.", getAlphabet(), site.getAlphabet());
+-
+-  // check position :
+-  if(checkPosition) {
+-
+-    int position = site.getPosition();
+-    // for all positions in vector : throw exception if position already exists
+-    for(std::size_t i = 0; i < p_sites_.size(); ++i)
+-      if(p_sites_[i]->getPosition() == position)
+-	throw Exception("VectorSiteContainer::addSite. Site position: " + TextTools::toString(position) + ", already exists in container.");
+-  }
+-
+-  p_sites_.push_back(dynamic_cast<ProbabilisticSite *>(site.clone()));
+-}
+-
+-/********************************************************************************/
+-
+-const ProbabilisticSequence & VectorProbabilisticSiteContainer::getProbabilisticSequence(std::size_t i) const throw (IndexOutOfBoundsException)
+-{
+-
+-  if(i >= getNumberOfProbabilisticSequences())
+-    throw IndexOutOfBoundsException("VectorProbabilisticSiteContainer::getProbabilisticSequence.", i, 0, getNumberOfProbabilisticSequences() - 1);
+-
+-  // main loop : for all sites
+-  std::size_t n = getNumberOfProbabilisticSites();
+-  DataTable sequence(getAlphabet()->getResolvedChars());
+-  for(std::size_t j = 0; j < n; ++j)
+-    sequence.addRow(p_sites_[j]->getContent().getRow(i));
+-
+-  if(p_sequences_[i])
+-    delete p_sequences_[i];
+-
+-  p_sequences_[i] = new BasicProbabilisticSequence(names_[i], sequence, *comments_[i], getAlphabet());
+-
+-  return *p_sequences_[i];
+-}
+-
+-/********************************************************************************/
+-
+-void VectorProbabilisticSiteContainer::addSequence(const ProbabilisticSequence & sequence, bool checkName) throw (Exception)
+-{
+-
+-  // if the container has no sequence, we set the size to the size of this sequence :
+-  if(getNumberOfProbabilisticSequences() == 0)
+-    pRealloc(sequence.size());
+-
+-  // new sequence's alphabet and site container's alphabet must match :
+-  if(sequence.getAlphabet()->getAlphabetType() != getAlphabet()->getAlphabetType())
+-    throw AlphabetMismatchException("VectorProbabilisticSiteContainer::addSequence.", getAlphabet(), sequence.getAlphabet());
+-
+-  if(sequence.size() != p_sites_.size())
+-    throw Exception("VectorProbabilisticSiteContainer::addSequence. Sequence does not have the appropriate length: " + TextTools::toString(sequence.size()) + ", should be " + TextTools::toString(p_sites_.size()) + ".");
+-
+-  // check name :
+-  if(checkName)
+-    for(std::size_t i = 0; i < names_.size(); ++i)
+-      if(sequence.getName() == names_[i])
+-	throw Exception("VectorProbabilisticSiteContainer::addSequence. Name: " + sequence.getName() + ", already exists in the container.");
+-
+-  // append name :
+-  names_.push_back(sequence.getName());
+-
+-  // append elements at each site :
+-  for(size_t i = 0; i < p_sites_.size(); ++i)
+-    p_sites_[i]->addElement(sequence.getContent().getRow(i));
+-
+-  // append comments :
+-  comments_.push_back(new Comments(sequence.getComments()));
+-
+-  // sequence pointers :
+-  p_sequences_.push_back(0);
+-}
+-
+-/********************************************************************************/
+-
+-void VectorProbabilisticSiteContainer::pClear()
+-{
+-  clear(); // call VectorSiteContainer clear
+-
+-  // now clear all probabilistic sites / sequences
+-  for(std::size_t i = 0; i < p_sites_.size(); ++i)
+-    delete p_sites_[i];
+-
+-  for(std::size_t i = 0; i < p_sequences_.size(); ++i)
+-    delete p_sequences_[i];
+-
+-  // and delete the corresponding pointers
+-  p_sites_.clear();
+-  p_sequences_.clear();
+-}  
+-
+-/********************************************************************************/
+-
+-void VectorProbabilisticSiteContainer::reindexpSites()
+-{
+-  int pos = 1; // start at position 1
+-  std::vector<ProbabilisticSite *>::iterator i = p_sites_.begin();
+-  for(; i != p_sites_.end(); ++i)
+-    (*i)->setPosition(++pos);
+-}
+-
+-/********************************************************************************/
+-
+-void VectorProbabilisticSiteContainer::pRealloc(std::size_t n)
+-{
+-  pClear();
+-  p_sites_.resize(n);
+-
+-  for(std::size_t i = 0; i < n; ++i)
+-    p_sites_[i] = new BasicProbabilisticSite(getAlphabet());
+-
+-  reindexpSites();
+-}
+--- a/src/Bpp/Seq/Container/VectorProbabilisticSiteContainer.h
++++ /dev/null
+@@ -1,123 +0,0 @@
+-//
+-// File: VectorProbabilisticSiteContainer.h
+-// Created by: Murray Patterson
+-// Created on: Mon Oct 19 2015
+-//
+-
+-/*
+-   Copyright or © or Copr. CNRS, (November 17, 2004)
+-
+-   This software is a computer program whose purpose is to provide classes
+-   for sequences analysis.
+-
+-   This software is governed by the CeCILL  license under French law and
+-   abiding by the rules of distribution of free software.  You can  use,
+-   modify and/ or redistribute the software under the terms of the CeCILL
+-   license as circulated by CEA, CNRS and INRIA at the following URL
+-   "http://www.cecill.info".
+-
+-   As a counterpart to the access to the source code and  rights to copy,
+-   modify and redistribute granted by the license, users are provided only
+-   with a limited warranty  and the software's author,  the holder of the
+-   economic rights,  and the successive licensors  have only  limited
+-   liability.
+-
+-   In this respect, the user's attention is drawn to the risks associated
+-   with loading,  using,  modifying and/or developing or reproducing the
+-   software by the user in light of its specific status of free software,
+-   that may mean  that it is complicated to manipulate,  and  that  also
+-   therefore means  that it is reserved for developers  and  experienced
+-   professionals having in-depth computer knowledge. Users are therefore
+-   encouraged to load and test the software's suitability as regards their
+-   requirements in conditions enabling the security of their systems and/or
+-   data to be ensured and,  more generally, to use and operate it in the
+-   same conditions as regards security.
+-
+-   The fact that you are presently reading this means that you have had
+-   knowledge of the CeCILL license and that you accept its terms.
+-*/
+-
+-#ifndef _VECTORPROBABILISTICSITECONTAINER_H_
+-#define _VECTORPROBABILISTICSITECONTAINER_H_
+-
+-#include "VectorSiteContainer.h"
+-
+-#include "../ProbabilisticSite.h"
+-#include "../ProbabilisticSequence.h"
+-
+-// From the STL :
+-#include <vector>
+-
+-namespace bpp
+-{
+-
+-/**
+- * @brief The VectorProbabilisticSiteContainer class.
+- *
+- * ProbabilisticSites are stored in a std::vector of pointers.
+- * ProbabilisticSite access is hence in \f$O(1)\f$, and sequence
+- * access in \f$O(l)\f$, where \f$l\f$ is the number of sites in the
+- * container.
+- *
+- * This is a modified copy of VectorSiteContainer with the minimum
+- * changes necessary for it to work with bppML and bppAncestor
+- *
+- * @see ProbabilisticSequence, ProbabilisticSite, VectorSiteContainer
+- */
+-class VectorProbabilisticSiteContainer :
+-  public VectorSiteContainer
+-{
+-
+- protected :
+-
+-  std::vector<ProbabilisticSite *> p_sites_;
+-  mutable std::vector<ProbabilisticSequence *> p_sequences_;
+-
+- public :
+-
+-  /**
+-   * @brief Build a new emtpy container.
+-   *
+-   * @param alpha The alphabet for this container.
+-   */
+-  VectorProbabilisticSiteContainer(const Alphabet * alpha);
+-
+-  /**
+-   * @name The Clonable interface.
+-   *
+-   * @{
+-   */
+-  VectorSiteContainer* clone() const { return new VectorSiteContainer(*this); }
+-
+-  /**
+-   * @}
+-   */
+-
+-  // class destructor
+-  virtual ~VectorProbabilisticSiteContainer() { pClear(); }
+-
+- public :
+-
+-  const ProbabilisticSite & getProbabilisticSite(std::size_t i) const throw (IndexOutOfBoundsException);
+-
+-  void addSite(const ProbabilisticSite & site, bool checkPosition = true) throw (Exception);
+-
+-  const ProbabilisticSequence & getProbabilisticSequence(std::size_t i) const throw (IndexOutOfBoundsException);
+-
+-  void addSequence(const ProbabilisticSequence & sequence, bool checkName = true) throw (Exception);
+-
+-  std::size_t getNumberOfProbabilisticSites() const { return p_sites_.size(); }
+-  std::size_t getNumberOfProbabilisticSequences() const { return p_sequences_.size(); }
+-
+-  void pClear();
+-  void reindexpSites();
+-
+- protected :
+-
+-  // create n void probabilistic sites :
+-  void pRealloc(std::size_t n);
+-};
+-
+-} // end of namespace bpp
+-
+-#endif  // _VECTORPROBABILISTICSITECONTAINER_H_
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..4c4a8ac
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+rm_VectorProbabilisticSiteContainer.patch
diff --git a/src/Bpp/Seq/Container/VectorProbabilisticSiteContainer.cpp b/src/Bpp/Seq/Container/VectorProbabilisticSiteContainer.cpp
new file mode 100644
index 0000000..b40a379
--- /dev/null
+++ b/src/Bpp/Seq/Container/VectorProbabilisticSiteContainer.cpp
@@ -0,0 +1,187 @@
+//
+// File: VectorProbabilisticSiteContainer.cpp
+// Created by: Murray Patterson
+// Created on: Mon Oct 19 2015
+//
+
+/*
+   Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
+
+   This software is a computer program whose purpose is to provide classes
+   for sequences analysis.
+
+   This software is governed by the CeCILL  license under French law and
+   abiding by the rules of distribution of free software.  You can  use,
+   modify and/ or redistribute the software under the terms of the CeCILL
+   license as circulated by CEA, CNRS and INRIA at the following URL
+   "http://www.cecill.info".
+
+   As a counterpart to the access to the source code and  rights to copy,
+   modify and redistribute granted by the license, users are provided only
+   with a limited warranty  and the software's author,  the holder of the
+   economic rights,  and the successive licensors  have only  limited
+   liability.
+
+   In this respect, the user's attention is drawn to the risks associated
+   with loading,  using,  modifying and/or developing or reproducing the
+   software by the user in light of its specific status of free software,
+   that may mean  that it is complicated to manipulate,  and  that  also
+   therefore means  that it is reserved for developers  and  experienced
+   professionals having in-depth computer knowledge. Users are therefore
+   encouraged to load and test the software's suitability as regards their
+   requirements in conditions enabling the security of their systems and/or
+   data to be ensured and,  more generally, to use and operate it in the
+   same conditions as regards security.
+
+   The fact that you are presently reading this means that you have had
+   knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#include "VectorProbabilisticSiteContainer.h"
+
+#include <Bpp/Text/TextTools.h>
+#include <Bpp/Numeric/DataTable.h>
+
+using namespace bpp;
+
+/********************************************************************************/
+
+VectorProbabilisticSiteContainer::VectorProbabilisticSiteContainer(const Alphabet * alpha) :
+  VectorSiteContainer(alpha),
+  p_sites_(0),
+  p_sequences_(0)
+{}
+
+/********************************************************************************/
+
+const ProbabilisticSite & VectorProbabilisticSiteContainer::getProbabilisticSite(std::size_t i) const throw (IndexOutOfBoundsException)
+{
+  if(i >= getNumberOfProbabilisticSites())
+    throw IndexOutOfBoundsException("VectorProbabilisticSiteContainer::getProbabilisticSite.", i, 0, getNumberOfProbabilisticSites() - 1);
+
+  return *p_sites_[i];
+}
+
+/********************************************************************************/
+
+void VectorProbabilisticSiteContainer::addSite(const ProbabilisticSite & site, bool checkPosition) throw (Exception)
+{
+  // check size :
+  if(site.size() != getNumberOfProbabilisticSequences())
+    throw Exception("VectorProbabilisticSiteContainer::addSite. Site does not have the appropriate length: " + TextTools::toString(site.size()) + ", should be " + TextTools::toString(getNumberOfProbabilisticSequences()) + ".");
+
+  // new site's alphabet and site container's alphabet must match :
+  if(site.getAlphabet()->getAlphabetType() != getAlphabet()->getAlphabetType())
+    throw AlphabetMismatchException("VectorProbabilisticSiteContainer::addSite.", getAlphabet(), site.getAlphabet());
+
+  // check position :
+  if(checkPosition) {
+
+    int position = site.getPosition();
+    // for all positions in vector : throw exception if position already exists
+    for(std::size_t i = 0; i < p_sites_.size(); ++i)
+      if(p_sites_[i]->getPosition() == position)
+	throw Exception("VectorSiteContainer::addSite. Site position: " + TextTools::toString(position) + ", already exists in container.");
+  }
+
+  p_sites_.push_back(dynamic_cast<ProbabilisticSite *>(site.clone()));
+}
+
+/********************************************************************************/
+
+const ProbabilisticSequence & VectorProbabilisticSiteContainer::getProbabilisticSequence(std::size_t i) const throw (IndexOutOfBoundsException)
+{
+
+  if(i >= getNumberOfProbabilisticSequences())
+    throw IndexOutOfBoundsException("VectorProbabilisticSiteContainer::getProbabilisticSequence.", i, 0, getNumberOfProbabilisticSequences() - 1);
+
+  // main loop : for all sites
+  std::size_t n = getNumberOfProbabilisticSites();
+  DataTable sequence(getAlphabet()->getResolvedChars());
+  for(std::size_t j = 0; j < n; ++j)
+    sequence.addRow(p_sites_[j]->getContent().getRow(i));
+
+  if(p_sequences_[i])
+    delete p_sequences_[i];
+
+  p_sequences_[i] = new BasicProbabilisticSequence(names_[i], sequence, *comments_[i], getAlphabet());
+
+  return *p_sequences_[i];
+}
+
+/********************************************************************************/
+
+void VectorProbabilisticSiteContainer::addSequence(const ProbabilisticSequence & sequence, bool checkName) throw (Exception)
+{
+
+  // if the container has no sequence, we set the size to the size of this sequence :
+  if(getNumberOfProbabilisticSequences() == 0)
+    pRealloc(sequence.size());
+
+  // new sequence's alphabet and site container's alphabet must match :
+  if(sequence.getAlphabet()->getAlphabetType() != getAlphabet()->getAlphabetType())
+    throw AlphabetMismatchException("VectorProbabilisticSiteContainer::addSequence.", getAlphabet(), sequence.getAlphabet());
+
+  if(sequence.size() != p_sites_.size())
+    throw Exception("VectorProbabilisticSiteContainer::addSequence. Sequence does not have the appropriate length: " + TextTools::toString(sequence.size()) + ", should be " + TextTools::toString(p_sites_.size()) + ".");
+
+  // check name :
+  if(checkName)
+    for(std::size_t i = 0; i < names_.size(); ++i)
+      if(sequence.getName() == names_[i])
+	throw Exception("VectorProbabilisticSiteContainer::addSequence. Name: " + sequence.getName() + ", already exists in the container.");
+
+  // append name :
+  names_.push_back(sequence.getName());
+
+  // append elements at each site :
+  for(size_t i = 0; i < p_sites_.size(); ++i)
+    p_sites_[i]->addElement(sequence.getContent().getRow(i));
+
+  // append comments :
+  comments_.push_back(new Comments(sequence.getComments()));
+
+  // sequence pointers :
+  p_sequences_.push_back(0);
+}
+
+/********************************************************************************/
+
+void VectorProbabilisticSiteContainer::pClear()
+{
+  clear(); // call VectorSiteContainer clear
+
+  // now clear all probabilistic sites / sequences
+  for(std::size_t i = 0; i < p_sites_.size(); ++i)
+    delete p_sites_[i];
+
+  for(std::size_t i = 0; i < p_sequences_.size(); ++i)
+    delete p_sequences_[i];
+
+  // and delete the corresponding pointers
+  p_sites_.clear();
+  p_sequences_.clear();
+}  
+
+/********************************************************************************/
+
+void VectorProbabilisticSiteContainer::reindexpSites()
+{
+  int pos = 1; // start at position 1
+  std::vector<ProbabilisticSite *>::iterator i = p_sites_.begin();
+  for(; i != p_sites_.end(); ++i)
+    (*i)->setPosition(++pos);
+}
+
+/********************************************************************************/
+
+void VectorProbabilisticSiteContainer::pRealloc(std::size_t n)
+{
+  pClear();
+  p_sites_.resize(n);
+
+  for(std::size_t i = 0; i < n; ++i)
+    p_sites_[i] = new BasicProbabilisticSite(getAlphabet());
+
+  reindexpSites();
+}
diff --git a/src/Bpp/Seq/Container/VectorProbabilisticSiteContainer.h b/src/Bpp/Seq/Container/VectorProbabilisticSiteContainer.h
new file mode 100644
index 0000000..5f93474
--- /dev/null
+++ b/src/Bpp/Seq/Container/VectorProbabilisticSiteContainer.h
@@ -0,0 +1,123 @@
+//
+// File: VectorProbabilisticSiteContainer.h
+// Created by: Murray Patterson
+// Created on: Mon Oct 19 2015
+//
+
+/*
+   Copyright or © or Copr. CNRS, (November 17, 2004)
+
+   This software is a computer program whose purpose is to provide classes
+   for sequences analysis.
+
+   This software is governed by the CeCILL  license under French law and
+   abiding by the rules of distribution of free software.  You can  use,
+   modify and/ or redistribute the software under the terms of the CeCILL
+   license as circulated by CEA, CNRS and INRIA at the following URL
+   "http://www.cecill.info".
+
+   As a counterpart to the access to the source code and  rights to copy,
+   modify and redistribute granted by the license, users are provided only
+   with a limited warranty  and the software's author,  the holder of the
+   economic rights,  and the successive licensors  have only  limited
+   liability.
+
+   In this respect, the user's attention is drawn to the risks associated
+   with loading,  using,  modifying and/or developing or reproducing the
+   software by the user in light of its specific status of free software,
+   that may mean  that it is complicated to manipulate,  and  that  also
+   therefore means  that it is reserved for developers  and  experienced
+   professionals having in-depth computer knowledge. Users are therefore
+   encouraged to load and test the software's suitability as regards their
+   requirements in conditions enabling the security of their systems and/or
+   data to be ensured and,  more generally, to use and operate it in the
+   same conditions as regards security.
+
+   The fact that you are presently reading this means that you have had
+   knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#ifndef _VECTORPROBABILISTICSITECONTAINER_H_
+#define _VECTORPROBABILISTICSITECONTAINER_H_
+
+#include "VectorSiteContainer.h"
+
+#include "../ProbabilisticSite.h"
+#include "../ProbabilisticSequence.h"
+
+// From the STL :
+#include <vector>
+
+namespace bpp
+{
+
+/**
+ * @brief The VectorProbabilisticSiteContainer class.
+ *
+ * ProbabilisticSites are stored in a std::vector of pointers.
+ * ProbabilisticSite access is hence in \f$O(1)\f$, and sequence
+ * access in \f$O(l)\f$, where \f$l\f$ is the number of sites in the
+ * container.
+ *
+ * This is a modified copy of VectorSiteContainer with the minimum
+ * changes necessary for it to work with bppML and bppAncestor
+ *
+ * @see ProbabilisticSequence, ProbabilisticSite, VectorSiteContainer
+ */
+class VectorProbabilisticSiteContainer :
+  public VectorSiteContainer
+{
+
+ protected :
+
+  std::vector<ProbabilisticSite *> p_sites_;
+  mutable std::vector<ProbabilisticSequence *> p_sequences_;
+
+ public :
+
+  /**
+   * @brief Build a new emtpy container.
+   *
+   * @param alpha The alphabet for this container.
+   */
+  VectorProbabilisticSiteContainer(const Alphabet * alpha);
+
+  /**
+   * @name The Clonable interface.
+   *
+   * @{
+   */
+  VectorSiteContainer* clone() const { return new VectorSiteContainer(*this); }
+
+  /**
+   * @}
+   */
+
+  // class destructor
+  virtual ~VectorProbabilisticSiteContainer() { pClear(); }
+
+ public :
+
+  const ProbabilisticSite & getProbabilisticSite(std::size_t i) const throw (IndexOutOfBoundsException);
+
+  void addSite(const ProbabilisticSite & site, bool checkPosition = true) throw (Exception);
+
+  const ProbabilisticSequence & getProbabilisticSequence(std::size_t i) const throw (IndexOutOfBoundsException);
+
+  void addSequence(const ProbabilisticSequence & sequence, bool checkName = true) throw (Exception);
+
+  std::size_t getNumberOfProbabilisticSites() const { return p_sites_.size(); }
+  std::size_t getNumberOfProbabilisticSequences() const { return p_sequences_.size(); }
+
+  void pClear();
+  void reindexpSites();
+
+ protected :
+
+  // create n void probabilistic sites :
+  void pRealloc(std::size_t n);
+};
+
+} // end of namespace bpp
+
+#endif  // _VECTORPROBABILISTICSITECONTAINER_H_

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



More information about the debian-med-commit mailing list