xref: /petsc/src/sys/tests/ex27.c (revision 9371c9d470a9602b6d10a8bf50c9b2280a79e45a)
1 
2 static char help[] = "Tests PetscMergeIntArray\n";
3 
4 #include <petscsys.h>
5 #include <petscviewer.h>
6 
7 int main(int argc, char **argv) {
8   const PetscInt first[] = {0, 2, 3, 5, 8}, second[] = {1, 3, 4, 8, 10, 11};
9   PetscInt      *result, n;
10 
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 }
18