Actual source code: ex27.c

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

  3: #include <petscsys.h>
  4: #include <petscviewer.h>

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

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