/* ------------------------------------------------------------------------------ gauss.c: Gaussian Elimination, other bitarray related stuff Bob Jenkins, 1996, Public Domain ------------------------------------------------------------------------------ */ #ifndef STANDARD #include "standard.h" #endif #ifndef BIT #include "bit.h" #endif #ifndef GAUSS #include "gauss.h" #endif /* x := y * m; * x: a bitvec of col values * y: a bitvec of row values * m: an array of row bitvecs of col values each * row: number of rows * col: number of columns */ void xym( x, y, m, row, col) bitvec *x; bitvec *y; bitvec **m; word row; word col; { word i; bitvclr(x,col); for (i=0; i= col) return i; /* linearly dependent */ } else { bitvec *temp = m[i]; m[i] = m[j]; m[j] = temp; } } /* do the elimination */ for (j=i+1; j