]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Get rid of an obscure exception with a poor message. 1734/head
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Sun, 11 Oct 2015 22:31:30 +0000 (17:31 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Sun, 11 Oct 2015 22:31:30 +0000 (17:31 -0500)
Instead, use a widely use variant.

include/deal.II/lac/chunk_sparse_matrix.h
include/deal.II/lac/sparse_matrix.h
include/deal.II/lac/sparse_matrix.templates.h

index 039741a9560a390e69b93d7d8eaaeb612390b22f..e27c1bbe804b2d107aab3369af360648727c8eac 100644 (file)
@@ -1303,12 +1303,6 @@ public:
   /**
    * Exception
    */
-  DeclException1 (ExcInvalidIndex1,
-                  int,
-                  << "The index " << arg1 << " is not in the allowed range.");
-  /**
-   * Exception
-   */
   DeclException0 (ExcDifferentChunkSparsityPatterns);
   /**
    * Exception
@@ -1580,7 +1574,7 @@ number ChunkSparseMatrix<number>::diag_element (const size_type i) const
 {
   Assert (cols != 0, ExcNotInitialized());
   Assert (m() == n(),  ExcNotQuadratic());
-  Assert (i<m(), ExcInvalidIndex1(i));
+  AssertIndexRange(i, m());
 
   // Use that the first element in each row of a quadratic matrix is the main
   // diagonal of the chunk sparsity pattern
index e6ac726f5c99f1de8cbac4e32eff904b9c173b3f..5d80079c8279dbd33743e4dc6fd76ed600b50b4a 100644 (file)
@@ -1527,12 +1527,6 @@ public:
   /**
    * Exception
    */
-  DeclException1 (ExcInvalidIndex1,
-                  int,
-                  << "The index " << arg1 << " is not in the allowed range.");
-  /**
-   * Exception
-   */
   DeclExceptionMsg (ExcDifferentSparsityPatterns,
                     "When copying one sparse matrix into another, "
                     "or when adding one sparse matrix to another, "
@@ -1884,7 +1878,7 @@ number SparseMatrix<number>::diag_element (const size_type i) const
 {
   Assert (cols != 0, ExcNotInitialized());
   Assert (m() == n(),  ExcNotQuadratic());
-  Assert (i<m(), ExcInvalidIndex1(i));
+  AssertIndexRange(i, m());
 
   // Use that the first element in each row of a quadratic matrix is the main
   // diagonal
@@ -1899,7 +1893,7 @@ number &SparseMatrix<number>::diag_element (const size_type i)
 {
   Assert (cols != 0, ExcNotInitialized());
   Assert (m() == n(),  ExcNotQuadratic());
-  Assert (i<m(), ExcInvalidIndex1(i));
+  AssertIndexRange(i, m());
 
   // Use that the first element in each row of a quadratic matrix is the main
   // diagonal
index d4030662fc840e1afdc13b8d3490aa9ecdcb71a7..5a992bac277890bb50267bc355634039befeefe1 100644 (file)
@@ -638,7 +638,7 @@ SparseMatrix<number>::set (const size_type  row,
                            const bool       elide_zero_values)
 {
   Assert (cols != 0, ExcNotInitialized());
-  Assert (row < m(), ExcInvalidIndex1(row));
+  AssertIndexRange(row, m());
 
   // First, search all the indices to find
   // out which values we actually need to

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.