Actual source code: ex27.c

  1: static char help[] = "Tests PetscMergeIntArray()\n";

  3: #include <petscsys.h>

  5: int main(int argc, char **argv)
  6: {
  7:   const PetscInt first[] = {0, 2, 3, 5, 8}, second[] = {1, 3, 4, 8, 10, 11};
  8:   PetscInt      *result, n;

 10:   PetscFunctionBeginUser;
 11:   PetscCall(PetscInitialize(&argc, &argv, NULL, help));
 12:   PetscCall(PetscMergeIntArray(5, first, 6, second, &n, &result));
 13:   PetscCall(PetscIntView(n, result, PETSC_VIEWER_STDOUT_SELF));
 14:   PetscCall(PetscFinalize());
 15:   return 0;
 16: }