23#include "pism/util/array/Scalar.hh"
24#include "pism/util/error_handling.hh"
25#include "pism/util/petscwrappers/Vec.hh"
29namespace connected_components {
31void label_serial(
double *image,
int nrows,
int ncols,
bool mark_isolated_components,
int reachable,
36 array output(image, nrows, ncols);
38 bool assign_final_labels =
true;
40 assign_final_labels, output);
31void label_serial(
double *image,
int nrows,
int ncols,
bool mark_isolated_components,
int reachable, {
…}
54 auto grid = mask.
grid();
58 if (grid->rank() == 0) {
62 static_cast<int>(grid->Mx()), mark_isolated_components,
63 reachable, min_label);
void failed()
Indicates a failure of a parallel section.
void get_from_proc0(petsc::Vec &onp0)
Gets a local Array2 from processor 0.
std::shared_ptr< const Grid > grid() const
std::shared_ptr< petsc::Vec > allocate_proc0_copy() const
void put_on_proc0(petsc::Vec &onp0) const
Puts a local array::Scalar on processor 0.
Adds "foregrdound" and "attached" concepts to an "array".
Wrapper around VecGetArray and VecRestoreArray.
void label(array::Scalar1 &mask)
void label_serial(double *image, int nrows, int ncols, bool mark_isolated_components, int reachable, int min_label)