1 static char help[] = "Tests PetscMergeIntArray\n";
2
3 #include <petscsys.h>
4 #include <petscviewer.h>
5
main(int argc,char ** argv)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;
10
11 PetscFunctionBeginUser;
12 PetscCall(PetscInitialize(&argc, &argv, NULL, 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