Actual source code: spinver.c

      1: #define PETSCMAT_DLL

     3:  #include petsc.h

      5: /*
      6:   MatInvertPermutation_Private - Compute the inverse ordering of a permutation
      7:  */
     10: void MatInvertPermutation_Private(PetscInt n,PetscInt *perm,PetscInt *iperm)
     11: {
     12:   PetscInt i;

     15:   for (i=0; i<n; i++) {
     16:     iperm[*perm++] = i;
     17:   }
     18: }