[PPL-devel] [GIT] ppl/ppl(sparse_matrices): Weaken assertion in Linear_System<Row>:: shift_space_dimensions().

Enea Zaffanella zaffanella at cs.unipr.it
Sat Mar 24 09:27:08 CET 2012


Module: ppl/ppl
Branch: sparse_matrices
Commit: 4c0a1c632c26d17c741c38ad334ac102586e1de8
URL:    http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=4c0a1c632c26d17c741c38ad334ac102586e1de8

Author: Enea Zaffanella <zaffanella at cs.unipr.it>
Date:   Sat Mar 24 09:23:17 2012 +0100

Weaken assertion in Linear_System<Row>::shift_space_dimensions().
The variable argument is not required to be a space dimension of the system
(it can be off-by-one).
Removed a couple of useless inclusions.

---

 src/Linear_System.templates.hh |    8 +++-----
 src/Matrix.templates.hh        |    4 ----
 2 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/src/Linear_System.templates.hh b/src/Linear_System.templates.hh
index 23ac1a9..f19f111 100644
--- a/src/Linear_System.templates.hh
+++ b/src/Linear_System.templates.hh
@@ -24,10 +24,6 @@ site: http://bugseng.com/products/ppl/ . */
 #ifndef PPL_Linear_System_templates_hh
 #define PPL_Linear_System_templates_hh 1
 
-// TODO: Remove this.
-// It was added to please KDevelop4.
-#include "Linear_System.defs.hh"
-
 #include "Bit_Matrix.defs.hh"
 #include "Linear_Expression.defs.hh"
 #include "Scalar_Products.defs.hh"
@@ -373,7 +369,9 @@ Linear_System<Row>::remove_space_dimensions(const Variables_Set& vars) {
 template <typename Row>
 void
 Linear_System<Row>::shift_space_dimensions(Variable v, dimension_type n) {
-  PPL_ASSERT(v.space_dimension() <= space_dimension());
+  // NOTE: v.id() may be equal to the space dimension of the system
+  // (when no space dimension need to be shifted).
+  PPL_ASSERT(v.id() <= space_dimension());
   for (dimension_type i = rows.size(); i-- > 0; )
     rows[i].shift_space_dimensions(v, n);
   space_dimension_ += n;
diff --git a/src/Matrix.templates.hh b/src/Matrix.templates.hh
index 09fc47d..d000eea 100644
--- a/src/Matrix.templates.hh
+++ b/src/Matrix.templates.hh
@@ -24,10 +24,6 @@ site: http://bugseng.com/products/ppl/ . */
 #ifndef PPL_Matrix_templates_hh
 #define PPL_Matrix_templates_hh 1
 
-// TODO: Remove this.
-// It was added to please KDevelop4.
-#include "Matrix.defs.hh"
-
 namespace Parma_Polyhedra_Library {
 
 template <typename Row>




More information about the PPL-devel mailing list