GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
#include"typedef.h"1/**************************************************************************\2@---------------------------------------------------------------------------3@---------------------------------------------------------------------------4@ FILE: reduction_sort.c5@---------------------------------------------------------------------------6@---------------------------------------------------------------------------7@8\**************************************************************************/91011/**************************************************************************\12@---------------------------------------------------------------------------13@ void reduction_sort(G,T,n)14@ int **G, **T, n;15@16@ make simultaneous row and colum permutations on the twodimensional17@ array G of size n x n such that G[i][i] <= G[j][j] for 0<=i<=j<n.18@ Simultaneously the row operations are applied to T, that19@ has to be an array of the same size or NULL20@---------------------------------------------------------------------------21@22\**************************************************************************/23void reduction_sort(G,T,n)24int **G, **T, n;25{26int i,j,k;27int minpos, min;28int *tmp;29int merk;30for(i=0;i<n;i++)31{32min = G[i][i];33minpos = i;34for(j=i+1;j<n;j++)35{36if(G[j][j] < min)37{ min = G[j][j]; minpos = j;}38}39if(minpos != i)40{41tmp = G[i]; G[i] = G[minpos]; G[minpos] = tmp;42if(T != NULL)43{ tmp = T[i]; T[i] = T[minpos]; T[minpos] = tmp;}44for(j=0;j<n;j++)45{ merk = G[j][i]; G[j][i] = G[j][minpos]; G[j][minpos] = merk;}46}47}48}495051