From: David Wells Date: Tue, 5 Sep 2017 19:31:37 +0000 (-0400) Subject: Use the right types for iota and accumulate. X-Git-Tag: v9.0.0-rc1~1116^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F5030%2Fhead;p=dealii.git Use the right types for iota and accumulate. --- diff --git a/include/deal.II/dofs/dof_accessor.templates.h b/include/deal.II/dofs/dof_accessor.templates.h index 7dd36e996d..9387b9345b 100644 --- a/include/deal.II/dofs/dof_accessor.templates.h +++ b/include/deal.II/dofs/dof_accessor.templates.h @@ -1546,7 +1546,7 @@ namespace internal { // initialize original index locations std::vector idx(v_end-v_begin); - std::iota(idx.begin(), idx.end(), 0); + std::iota(idx.begin(), idx.end(), 0u); // sort indices based on comparing values in v std::sort(idx.begin(), idx.end(), diff --git a/source/distributed/tria.cc b/source/distributed/tria.cc index 3333a29ac6..0812303743 100644 --- a/source/distributed/tria.cc +++ b/source/distributed/tria.cc @@ -256,7 +256,7 @@ namespace const typename internal::p4est::types::locidx num_vtt = std::accumulate (vertex_touch_count.begin(), vertex_touch_count.end(), - 0); + 0u); (void)num_vtt; Assert (connectivity->ctt_offset[triangulation.n_vertices()] == num_vtt, @@ -2019,7 +2019,7 @@ namespace parallel const dealii::internal::p4est::types<2>::locidx num_vtt = std::accumulate (vertex_touch_count.begin(), vertex_touch_count.end(), - 0); + 0u); // now create a connectivity object with the right sizes for all // arrays. set vertex information only in debug mode (saves a few bytes @@ -2090,7 +2090,7 @@ namespace parallel const dealii::internal::p4est::types<2>::locidx num_vtt = std::accumulate (vertex_touch_count.begin(), vertex_touch_count.end(), - 0); + 0u); // now create a connectivity object with the right sizes for all // arrays. set vertex information only in debug mode (saves a few bytes @@ -2159,7 +2159,7 @@ namespace parallel const dealii::internal::p4est::types<2>::locidx num_vtt = std::accumulate (vertex_touch_count.begin(), vertex_touch_count.end(), - 0); + 0u); std::vector edge_touch_count; std::vector< @@ -2173,7 +2173,7 @@ namespace parallel const dealii::internal::p4est::types<2>::locidx num_ett = std::accumulate (edge_touch_count.begin(), edge_touch_count.end(), - 0); + 0u); // now create a connectivity object with the right sizes for all arrays const bool set_vertex_info diff --git a/source/grid/grid_refinement.cc b/source/grid/grid_refinement.cc index fde982e36f..338bdf9b6a 100644 --- a/source/grid/grid_refinement.cc +++ b/source/grid/grid_refinement.cc @@ -467,7 +467,7 @@ GridRefinement::refine_and_coarsen_optimize (Triangulation &tria, // get a decreasing order on the error indicator std::vector cell_indices(criteria.size()); - std::iota(cell_indices.begin(), cell_indices.end(), 0); + std::iota(cell_indices.begin(), cell_indices.end(), 0u); std::sort(cell_indices.begin(), cell_indices.end(), [&criteria](const unsigned int left, diff --git a/source/grid/grid_tools.cc b/source/grid/grid_tools.cc index 1b41e5927b..e492b2fef4 100644 --- a/source/grid/grid_tools.cc +++ b/source/grid/grid_tools.cc @@ -2258,7 +2258,8 @@ next_cell: indices.size(), DEAL_II_DOF_INDEX_MPI_TYPE, triangulation.get_communicator()); AssertThrowMPI(ierr); const types::global_vertex_index shift = std::accumulate(&indices[0], - &indices[0]+triangulation.locally_owned_subdomain(),0); + &indices[0]+triangulation.locally_owned_subdomain(), + types::global_vertex_index(0)); std::map::iterator global_index_it = local_to_global_vertex_index.begin(), diff --git a/source/grid/manifold.cc b/source/grid/manifold.cc index 6cc6f27786..c2d2238f51 100644 --- a/source/grid/manifold.cc +++ b/source/grid/manifold.cc @@ -105,7 +105,7 @@ get_new_point (const std::vector > &surrounding_points, // produce unique points even if get_intermediate_points is not // associative (as for the SphericalManifold). boost::container::small_vector permutation(n_points); - std::iota(permutation.begin(), permutation.end(), 0); + std::iota(permutation.begin(), permutation.end(), 0u); std::sort(permutation.begin(), permutation.end(), CompareWeights(weights)); // Now loop over points in the order of their associated weight diff --git a/source/multigrid/mg_tools.cc b/source/multigrid/mg_tools.cc index b848fbdf8e..e69cd338d3 100644 --- a/source/multigrid/mg_tools.cc +++ b/source/multigrid/mg_tools.cc @@ -1074,7 +1074,8 @@ namespace MGTools Assert (!dof_handler.get_fe().is_primitive() || std::accumulate (result[l].begin(), - result[l].end(), 0U) + result[l].end(), + types::global_dof_index(0)) == dof_handler.n_dofs(l), ExcInternalError()); diff --git a/source/multigrid/mg_transfer_block.cc b/source/multigrid/mg_transfer_block.cc index ebae1c360a..bde0a9cabc 100644 --- a/source/multigrid/mg_transfer_block.cc +++ b/source/multigrid/mg_transfer_block.cc @@ -58,7 +58,7 @@ namespace const unsigned int n_selected = std::accumulate(selected.begin(), selected.end(), - 0U); + 0u); if (ndofs.size() == 0) { diff --git a/source/multigrid/mg_transfer_component.cc b/source/multigrid/mg_transfer_component.cc index 1a3e5ec814..e663e69a1a 100644 --- a/source/multigrid/mg_transfer_component.cc +++ b/source/multigrid/mg_transfer_component.cc @@ -120,7 +120,7 @@ namespace const unsigned int n_selected = std::accumulate(selected.begin(), selected.end(), - 0U); + 0u); if (ndofs.size() == 0) {