// A c program to calculate color vectors of braids to run in maple. #include #include int eqarray(short int *A,short int *B, int nops); int validcolorvectorsint(short *quandle, int quandlesize, short *knot, int braidindex, int nopsknot, short *validCvecs){ short quandleinv[quandlesize*quandlesize]; int temp; int tempscript=0; int numbcolors=0; int k; int contcoloring=0; short int color[nopsknot+2][braidindex]; // goes 1 to brind short int carryover[braidindex+2]; short int temparray[braidindex+2]; int colordiff=0; int i,j,h,jj,kk; int nCo=0; for(i=0;i 0){ for(h=1; h<=braidindex;h++){ if( h==abs(knot[j-1])) color[j+1][h]=color[j][h+1]; if( h==(abs(knot[j-1])+1)) color[j+1][h]=quandle[color[j][h-1]*quandlesize+color[j][h]]; if( h(abs(knot[j-1])+1)) color[j+1][h]=color[j][h]; } } else{ for(h=1; h<=braidindex;h++){ if( h==abs(knot[j-1])) color[j+1][h]=quandleinv[color[j][h]*quandlesize+color[j][h+1]]; if( h==(abs(knot[j-1])+1)) color[j+1][h]=color[j][h-1]; if( h(abs(knot[j-1])+1)) color[j+1][h]=color[j][h]; } } } colordiff=0; colordiff=eqarray(color[1],color[nopsknot+1],braidindex); if(colordiff){ // printf("\n\n"); for(jj=1;jj<=nopsknot+1;jj++){ for(kk=1;kk<=braidindex;kk++){ // printf("%d ",color[jj][kk]); tempscript=numbcolors*(nopsknot+1)*braidindex+((jj-1)*braidindex+kk); validCvecs[tempscript]= color[jj][kk]; } // printf("\n\n"); } numbcolors++; nCo++; } contcoloring=eqarray( color[1], temparray,braidindex); color[1][1]=color[1][1]+1; k=1; carryover[k]= color[1][k]/quandlesize; while(carryover[k]!=0&&k