From 80c0c74cdc8684fc2411bac3fdb35bb96a80c80e Mon Sep 17 00:00:00 2001 From: Jonathan Robey Date: Thu, 28 Jul 2016 10:46:49 -0700 Subject: [PATCH] Remove bind2nd calls in source --- source/distributed/grid_refinement.cc | 5 +++-- source/dofs/dof_tools_constraints.cc | 2 +- source/fe/fe.cc | 5 +++-- source/grid/grid_in.cc | 2 +- source/grid/grid_reordering.cc | 2 +- source/grid/tria.cc | 17 +++++++++-------- source/grid/tria_objects.cc | 3 ++- source/hp/dof_handler.cc | 9 ++++++--- source/lac/sparsity_pattern.cc | 2 +- source/lac/sparsity_tools.cc | 5 +++-- source/multigrid/mg_transfer_block.cc | 10 ++++++---- source/multigrid/mg_transfer_component.cc | 5 +++-- 12 files changed, 39 insertions(+), 28 deletions(-) diff --git a/source/distributed/grid_refinement.cc b/source/distributed/grid_refinement.cc index 0c772583a8..b599a59d18 100644 --- a/source/distributed/grid_refinement.cc +++ b/source/distributed/grid_refinement.cc @@ -294,8 +294,9 @@ namespace unsigned int my_count = std::count_if (criteria.begin(), criteria.end(), - std::bind2nd (std::greater(), - test_threshold)); + std_cxx11::bind (&std::greater, + std_cxx11::_1, + test_threshold)); unsigned int total_count; MPI_Reduce (&my_count, &total_count, 1, MPI_UNSIGNED, diff --git a/source/dofs/dof_tools_constraints.cc b/source/dofs/dof_tools_constraints.cc index 8cb4a96b87..84fa2ff72d 100644 --- a/source/dofs/dof_tools_constraints.cc +++ b/source/dofs/dof_tools_constraints.cc @@ -3199,7 +3199,7 @@ namespace DoFTools // now compute the requested representation const types::global_dof_index n_global_parm_dofs = std::count_if (weight_mapping.begin(), weight_mapping.end(), - std::bind2nd (std::not_equal_to (), numbers::invalid_dof_index)); + std_cxx11::bind (std::not_equal_to(), std_cxx11::_1, numbers::invalid_dof_index)); // first construct the inverse mapping of weight_mapping std::vector inverse_weight_mapping (n_global_parm_dofs, diff --git a/source/fe/fe.cc b/source/fe/fe.cc index a1f110493d..c55b400ae6 100644 --- a/source/fe/fe.cc +++ b/source/fe/fe.cc @@ -89,8 +89,9 @@ FiniteElement (const FiniteElementData &fe_data, { this->set_primitivity(std::find_if (n_nonzero_components_table.begin(), n_nonzero_components_table.end(), - std::bind2nd(std::not_equal_to(), - 1U)) + std_cxx11::bind (std::not_equal_to(), + std_cxx11::_1, + 1U)) == n_nonzero_components_table.end()); diff --git a/source/grid/grid_in.cc b/source/grid/grid_in.cc index d45513556e..95d71d46c0 100644 --- a/source/grid/grid_in.cc +++ b/source/grid/grid_in.cc @@ -2530,7 +2530,7 @@ void GridIn::skip_empty_lines (std::istream &in) // if not put the whole thing // back and return if (std::find_if (line.begin(), line.end(), - std::bind2nd (std::not_equal_to(),' ')) + std_cxx11::bind (std::not_equal_to(),std_cxx11::_1,' ')) != line.end()) { in.putback ('\n'); diff --git a/source/grid/grid_reordering.cc b/source/grid/grid_reordering.cc index 95b9da28c7..6bdfed9d34 100644 --- a/source/grid/grid_reordering.cc +++ b/source/grid/grid_reordering.cc @@ -352,7 +352,7 @@ namespace internal for (int i = 0; i<4; ++i) { std::transform(inquads.begin(),inquads.end(), - std::back_inserter(sides), std::bind2nd(QuadSide(),i)); + std::back_inserter(sides), std_cxx11::bind(QuadSide(),std_cxx11::_1,i)); } //Change each edge so that v0cells.used.begin(), triangulation.levels[level+1]->cells.used.end(), - std::bind2nd (std::equal_to(), true)); + std_cxx11::bind (std::equal_to(), std_cxx11::_1, true)); // reserve space for the used_cells cells already existing // on the next higher level as well as for the @@ -4444,8 +4444,9 @@ namespace internal // vertices are already in use needed_vertices += std::count_if (triangulation.vertices_used.begin(), triangulation.vertices_used.end(), - std::bind2nd (std::equal_to(), - true)); + std_cxx11::bind (std::equal_to(), + std_cxx11::_1, + true)); // if we need more vertices: create them, if not: leave the // array as is, since shrinking is not really possible because // some of the vertices at the end may be in use @@ -4741,7 +4742,7 @@ namespace internal const unsigned int used_cells = std::count_if (triangulation.levels[level+1]->cells.used.begin(), triangulation.levels[level+1]->cells.used.end(), - std::bind2nd (std::equal_to(), true)); + std_cxx11::bind (std::equal_to(), std_cxx11::_1, true)); // reserve space for the used_cells cells already existing @@ -4777,7 +4778,7 @@ namespace internal // add to needed vertices how many vertices are already in use needed_vertices += std::count_if (triangulation.vertices_used.begin(), triangulation.vertices_used.end(), - std::bind2nd (std::equal_to(), true)); + std_cxx11::bind (std::equal_to(), std_cxx11::_1, true)); // if we need more vertices: create them, if not: leave the // array as is, since shrinking is not really possible because // some of the vertices at the end may be in use @@ -5146,7 +5147,7 @@ namespace internal const unsigned int used_cells = std::count_if (triangulation.levels[level+1]->cells.used.begin(), triangulation.levels[level+1]->cells.used.end(), - std::bind2nd (std::equal_to(), true)); + std_cxx11::bind (std::equal_to(), std_cxx11::_1, true)); // reserve space for the used_cells cells already existing @@ -5221,7 +5222,7 @@ namespace internal // add to needed vertices how many vertices are already in use needed_vertices += std::count_if (triangulation.vertices_used.begin(), triangulation.vertices_used.end(), - std::bind2nd (std::equal_to(), true)); + std_cxx11::bind (std::equal_to(), std_cxx11::_1, true)); // if we need more vertices: create them, if not: leave the // array as is, since shrinking is not really possible because // some of the vertices at the end may be in use @@ -11709,7 +11710,7 @@ unsigned int Triangulation::n_used_vertices () const { return std::count_if (vertices_used.begin(), vertices_used.end(), - std::bind2nd (std::equal_to(), true)); + std_cxx11::bind (std::equal_to(), std_cxx11::_1, true)); } diff --git a/source/grid/tria_objects.cc b/source/grid/tria_objects.cc index 0beb8f79f0..41f1bd9ea4 100644 --- a/source/grid/tria_objects.cc +++ b/source/grid/tria_objects.cc @@ -14,6 +14,7 @@ // --------------------------------------------------------------------- #include +#include #include #include #include @@ -170,7 +171,7 @@ namespace internal const unsigned int new_size = new_hexes + std::count_if (used.begin(), used.end(), - std::bind2nd (std::equal_to(), true)); + std_cxx11::bind (std::equal_to(), std_cxx11::_1, true)); // see above... if (new_size>cells.size()) diff --git a/source/hp/dof_handler.cc b/source/hp/dof_handler.cc index da115ac68c..097e0ec4bb 100644 --- a/source/hp/dof_handler.cc +++ b/source/hp/dof_handler.cc @@ -3235,13 +3235,16 @@ namespace hp std::transform (tria->levels[i]->cells.children.begin (), tria->levels[i]->cells.children.end (), has_children_level->begin (), - std::bind2nd (std::not_equal_to(), -1)); + std_cxx11::bind(std::not_equal_to(), + std_cxx11::_1, + -1)); else std::transform (tria->levels[i]->cells.refinement_cases.begin (), tria->levels[i]->cells.refinement_cases.end (), has_children_level->begin (), - std::bind2nd (std::not_equal_to(), - static_cast(RefinementCase::no_refinement))); + std_cxx11::bind (std::not_equal_to(), + std_cxx11::_1, + static_cast(RefinementCase::no_refinement))); has_children.push_back (has_children_level); } diff --git a/source/lac/sparsity_pattern.cc b/source/lac/sparsity_pattern.cc index 79dbf8b04d..b7d60c7cce 100644 --- a/source/lac/sparsity_pattern.cc +++ b/source/lac/sparsity_pattern.cc @@ -397,7 +397,7 @@ SparsityPattern::compress () const std::size_t nonzero_elements = std::count_if (&colnums[rowstart[0]], &colnums[rowstart[rows]], - std::bind2nd(std::not_equal_to(), invalid_entry)); + std_cxx11::bind(std::not_equal_to(), std_cxx11::_1, invalid_entry)); // now allocate the respective memory size_type *new_colnums = new size_type[nonzero_elements]; diff --git a/source/lac/sparsity_tools.cc b/source/lac/sparsity_tools.cc index c7a77cab53..55cc166cdb 100644 --- a/source/lac/sparsity_tools.cc +++ b/source/lac/sparsity_tools.cc @@ -226,8 +226,9 @@ namespace SparsityTools last_round_dofs[i] = numbers::invalid_size_type; std::remove_if (last_round_dofs.begin(), last_round_dofs.end(), - std::bind2nd(std::equal_to(), - numbers::invalid_size_type)); + std_cxx11::bind(std::equal_to(), + std_cxx11::_1, + numbers::invalid_size_type)); // now if no valid points remain: find dof with lowest coordination number if (last_round_dofs.empty()) diff --git a/source/multigrid/mg_transfer_block.cc b/source/multigrid/mg_transfer_block.cc index 67a97e29de..05ab9872cb 100644 --- a/source/multigrid/mg_transfer_block.cc +++ b/source/multigrid/mg_transfer_block.cc @@ -527,8 +527,9 @@ void MGTransferBlockSelect::build_matrices ( // copy_indices. const types::global_dof_index n_active_dofs = std::count_if (temp_copy_indices.begin(), temp_copy_indices.end(), - std::bind2nd(std::not_equal_to(), - numbers::invalid_dof_index)); + std_cxx11::bind (std::not_equal_to(), + std_cxx11::_1, + numbers::invalid_dof_index)); copy_indices[selected_block][level].resize (n_active_dofs); types::global_dof_index counter = 0; for (types::global_dof_index i=0; i::build_matrices ( const types::global_dof_index n_active_dofs = std::count_if (temp_copy_indices[block].begin(), temp_copy_indices[block].end(), - std::bind2nd(std::not_equal_to(), - numbers::invalid_dof_index)); + std_cxx11::bind (std::not_equal_to(), + std_cxx11::_1, + numbers::invalid_dof_index)); copy_indices[block][level].resize (n_active_dofs); types::global_dof_index counter = 0; for (types::global_dof_index i=0; i::build_matrices ( // global to level dofs const types::global_dof_index n_active_dofs = std::count_if (temp_copy_indices.begin(), temp_copy_indices.end(), - std::bind2nd(std::not_equal_to(), - numbers::invalid_dof_index)); + std_cxx11::bind (std::not_equal_to(), + std_cxx11::_1, + numbers::invalid_dof_index)); copy_to_and_from_indices[level].resize (n_active_dofs); types::global_dof_index counter = 0; for (types::global_dof_index i=0; i