]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Replace operator[] in dof_info.h where necessary 5917/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Fri, 16 Feb 2018 14:58:22 +0000 (15:58 +0100)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Sat, 17 Feb 2018 09:51:44 +0000 (10:51 +0100)
include/deal.II/matrix_free/dof_info.h

index 8456dbd74d5d7bbfd26a36a09d6ecaeca545f041..1ee78f453a0b7f415015d06b8a8b981b480616ae 100644 (file)
@@ -432,7 +432,9 @@ namespace internal
       AssertIndexRange (row, row_starts.size()-1);
       const unsigned int index = row_starts[row][0];
       AssertIndexRange(index, dof_indices.size()+1);
-      return dof_indices.empty() ? nullptr : &dof_indices[index];
+      return dof_indices.empty() ?
+             nullptr :
+             dof_indices.data()+index;
     }
 
 
@@ -444,7 +446,9 @@ namespace internal
       AssertIndexRange (row, row_starts.size()-1);
       const unsigned int index = row_starts[row+1][0];
       AssertIndexRange(index, dof_indices.size()+1);
-      return dof_indices.empty() ? nullptr : &dof_indices[index];
+      return dof_indices.empty() ?
+             nullptr :
+             dof_indices.data()+index;
     }
 
 
@@ -466,7 +470,9 @@ namespace internal
       AssertIndexRange (row, row_starts.size()-1);
       const unsigned int index = row_starts[row][1];
       AssertIndexRange (index, constraint_indicator.size()+1);
-      return constraint_indicator.empty() ? nullptr : &constraint_indicator[index];
+      return constraint_indicator.empty() ?
+             nullptr :
+             constraint_indicator.data()+index;
     }
 
 
@@ -478,7 +484,9 @@ namespace internal
       AssertIndexRange (row, row_starts.size()-1);
       const unsigned int index = row_starts[row+1][1];
       AssertIndexRange (index, constraint_indicator.size()+1);
-      return constraint_indicator.empty() ? nullptr : &constraint_indicator[index];
+      return constraint_indicator.empty() ?
+             nullptr :
+             constraint_indicator.data()+index;
     }
 
 
@@ -509,7 +517,9 @@ namespace internal
           AssertDimension (row_starts.size(), row_starts_plain_indices.size());
           const unsigned int index = row_starts_plain_indices[row];
           AssertIndexRange(index, plain_dof_indices.size()+1);
-          return plain_dof_indices.empty() ? nullptr : &plain_dof_indices[index];
+          return plain_dof_indices.empty() ?
+                 nullptr :
+                 plain_dof_indices.data()+index;
         }
     }
 

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.