xref: /petsc/src/sys/tests/ex27.c (revision aaa8cc7d2a5c3913edcbb923e20f154fe9c4aa65)
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 {
9   const PetscInt first[] = {0, 2, 3, 5, 8}, second[] = {1, 3, 4, 8, 10, 11};
10   PetscInt      *result, n;
11 
12   PetscFunctionBeginUser;
13   PetscCall(PetscInitialize(&argc, &argv, (char *)0, help));
14   PetscCall(PetscMergeIntArray(5, first, 6, second, &n, &result));
15   PetscCall(PetscIntView(n, result, PETSC_VIEWER_STDOUT_SELF));
16   PetscCall(PetscFinalize());
17   return 0;
18 }
19