[PPL-devel] [GIT] ppl/ppl(master): Fixed a bug in the implementation of dense rows.
Roberto Bagnara
bagnara at cs.unipr.it
Tue Nov 4 10:18:01 CET 2014
Module: ppl/ppl
Branch: master
Commit: f4c396b642a8b67f8290ceeda53ddeb114fc34ac
URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=f4c396b642a8b67f8290ceeda53ddeb114fc34ac
Author: Roberto Bagnara <bagnara at cs.unipr.it>
Date: Tue Nov 4 10:17:38 2014 +0100
Fixed a bug in the implementation of dense rows.
(Thanks to Enea Zaffanella.)
---
NEWS | 19 +++++++++++++++++++
configure.ac | 2 +-
src/Dense_Row.cc | 5 +++--
tests/Polyhedron/sparserow1.cc | 8 ++++++++
4 files changed, 31 insertions(+), 3 deletions(-)
diff --git a/NEWS b/NEWS
index db282a4..3ef75d9 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,25 @@ Parma Polyhedra Library NEWS -- history of user-visible changes
===============================================================
--------------------------------------------------------------------------
+NEWS for version 1.2 (released date to be decided)
+--------------------------------------------------------------------------
+
+New and Changed Features
+========================
+
+o TO BE WRITTEN
+
+
+
+Bugfixes
+========
+
+o Fixed a bug in the implementation of dense rows.
+
+o Portability improved.
+
+
+--------------------------------------------------------------------------
NEWS for version 1.1 (released on October 28, 2013)
--------------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 2090e62..890d386 100644
--- a/configure.ac
+++ b/configure.ac
@@ -24,7 +24,7 @@
# Process this file with Autoconf to produce a configure script.
# Every other copy of the package version number gets its value from here.
-AC_INIT([the Parma Polyhedra Library], [1.2pre4], [ppl-devel at cs.unipr.it], [ppl])
+AC_INIT([the Parma Polyhedra Library], [1.2pre5], [ppl-devel at cs.unipr.it], [ppl])
# Minimum Autoconf version required.
AC_PREREQ(2.61)
diff --git a/src/Dense_Row.cc b/src/Dense_Row.cc
index 22b8673..c7adbaf 100644
--- a/src/Dense_Row.cc
+++ b/src/Dense_Row.cc
@@ -31,10 +31,11 @@ site: http://bugseng.com/products/ppl/ . */
namespace PPL = Parma_Polyhedra_Library;
-PPL::Dense_Row::Dense_Row(const Sparse_Row& y, dimension_type sz, dimension_type capacity) {
+PPL::Dense_Row::Dense_Row(const Sparse_Row& y,
+ dimension_type sz, dimension_type capacity) {
resize(sz, capacity);
for (Sparse_Row::const_iterator i = y.begin(),
- i_end = y.lower_bound(sz); i != i_end; ++i) {
+ i_end = y.lower_bound(std::min(y.size(), sz)); i != i_end; ++i) {
(*this)[i.index()] = *i;
}
PPL_ASSERT(OK());
diff --git a/tests/Polyhedron/sparserow1.cc b/tests/Polyhedron/sparserow1.cc
index 8cea98c..0ed85b5 100644
--- a/tests/Polyhedron/sparserow1.cc
+++ b/tests/Polyhedron/sparserow1.cc
@@ -598,6 +598,13 @@ test09() {
return true;
}
+bool
+test10() {
+ Sparse_Row sparse(2);
+ Dense_Row dense(sparse, 8, 8);
+ return true;
+}
+
} // namespace
BEGIN_MAIN
@@ -610,6 +617,7 @@ BEGIN_MAIN
DO_TEST(test07);
DO_TEST(test08);
DO_TEST(test09);
+ DO_TEST(test10);
END_MAIN
#else // !PPL_USE_SPARSE_MATRIX
More information about the PPL-devel
mailing list