]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Make code slightly more elegant and also make it work with the PGI compiler at the...
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 4 Sep 2012 01:45:06 +0000 (01:45 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 4 Sep 2012 01:45:06 +0000 (01:45 +0000)
git-svn-id: https://svn.dealii.org/trunk@26226 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/lac/sparsity_tools.cc

index b49dfeefcae33f8584b0e27b3608528275f9df69..83ce108ca96796482ec9c145b08ac67fa99fdf1c 100644 (file)
@@ -104,7 +104,7 @@ namespace SparsityTools
                                      // Use recursive if the number of
                                      // partitions is less than or equal to 8
     if (n_partitions <= 8)
-      ierr = METIS_PartGraphRecursive(&n, &ncon, &int_rowstart[0], &int_colnums[0], 
+      ierr = METIS_PartGraphRecursive(&n, &ncon, &int_rowstart[0], &int_colnums[0],
                                      NULL, NULL, NULL,
                                      &nparts,NULL,NULL,&options[0],
                                      &dummy,&int_partition_indices[0]);
@@ -495,9 +495,9 @@ namespace SparsityTools
           MPI_Recv(&recv_buf[0], len, MPI_BYTE, status.MPI_SOURCE,
                    status.MPI_TAG, mpi_comm, &status);
 
-          unsigned int *ptr=&recv_buf[0];
-          unsigned int *end=&*(--recv_buf.end());
-          while (ptr<end)
+          std::vector<unsigned int>::const_iterator ptr = recv_buf.begin();
+          std::vector<unsigned int>::const_iterator end = recv_buf.end();
+          while (ptr+1<end)
             {
               unsigned int num=*(ptr++);
               unsigned int row=*(ptr++);

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.