xref: /petsc/src/sys/tests/ex27.c (revision 73fdd05bb67e49f40fd8fd311695ff6fdf0b9b8a)
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