#include <deal.II/base/config.h>
+#include <deal.II/base/std_cxx1x/function.h>
#include <deal.II/dofs/dof_handler.h>
#include <boost/unordered_map.hpp>
#include <boost/unordered_set.hpp>
template <typename Iterator>
std::vector<std::vector<Iterator> > create_partitioning(Iterator const &begin,
typename identity<Iterator>::type const &end,
- std::vector<types::global_dof_index> (*get_conflict_indices) (Iterator const&))
+ std_cxx1x::function<std::vector<types::global_dof_index> (Iterator const &)>
+ const &get_conflict_indices)
{
std::vector<std::vector<Iterator> > partitioning(1,std::vector<Iterator> (1,begin));
// Number of iterators.
boost::unordered_map<types::global_dof_index,std::vector<Iterator> > indices_to_iterators;
for (Iterator it=begin; it!=end; ++it)
{
- std::vector<types::global_dof_index> conflict_indices = (*get_conflict_indices)(it);
+ std::vector<types::global_dof_index> conflict_indices = get_conflict_indices(it);
const unsigned int n_conflict_indices(conflict_indices.size());
for (unsigned int i=0; i<n_conflict_indices; ++i)
indices_to_iterators[conflict_indices[i]].push_back(it);
std::vector<Iterator> new_zone;
for (; vector_it!=vector_end; ++vector_it)
{
- std::vector<types::global_dof_index> conflict_indices = (*get_conflict_indices)(*vector_it);
+ std::vector<types::global_dof_index> conflict_indices = get_conflict_indices(*vector_it);
const unsigned int n_conflict_indices(conflict_indices.size());
for (unsigned int i=0; i<n_conflict_indices; ++i)
{
*/
template <typename Iterator>
std::vector<std::vector<Iterator> > make_dsatur_coloring(std::vector<Iterator> &partition,
- std::vector<types::global_dof_index> (*get_conflict_indices)(Iterator const&))
+ std_cxx1x::function<std::vector<types::global_dof_index> (Iterator const &)>
+ const &get_conflict_indices)
{
std::vector<std::vector<Iterator> > partition_coloring;
// Number of zones composing the partitioning.
// set_intersection can be used later.
for (unsigned int i=0; i<partition_size; ++i)
{
- conflict_indices[i] = (*get_conflict_indices)(partition[i]);
+ conflict_indices[i] = get_conflict_indices(partition[i]);
std::sort(conflict_indices[i].begin(),conflict_indices[i].end());
}
template <typename Iterator>
std::vector<std::vector<Iterator> >
make_graph_coloring(Iterator const &begin,typename identity<Iterator>::type const &end,
- std::vector<types::global_dof_index> (*get_conflict_indices)(Iterator const&))
+ std_cxx1x::function<std::vector<types::global_dof_index> (Iterator const &)>
+ const &get_conflict_indices)
{
// Create the partitioning.
std::vector<std::vector<Iterator> > partitioning = create_partitioning(begin,end,
template <int dim>
std::vector<types::global_dof_index> get_conflict_indices_cfem(
- typename DoFHandler<dim>::active_cell_iterator const &it)
+ typename DoFHandler<dim>::active_cell_iterator const &it)
{
std::vector<types::global_dof_index> local_dof_indices(it->get_fe().dofs_per_cell);
it->get_dof_indices(local_dof_indices);
// Create the coloring
std::vector<std::vector<typename DoFHandler<dim>::active_cell_iterator> > coloring(
graph_coloring::make_graph_coloring(dof_handler.begin_active(),dof_handler.end(),
- get_conflict_indices_cfem<dim>));
+ std_cxx1x::function<std::vector<types::global_dof_index> (typename
+ DoFHandler<dim>::active_cell_iterator const &)> (get_conflict_indices_cfem<dim>)));
// Output the coloring
for (unsigned int color=0; color<coloring.size(); ++color)