#ifndef GR_GAUSS1_H
#define GR_GAUSS1_H

#include <values.h>

/* task dimension (matrix of Nx(N+1)) */
#ifndef N
#define N 512 /*5000*/
#endif

struct line {
    int x[(N+1+INTBITS-1)/INTBITS];
};


#define BIT_TEST(X,K)	((X)[(K)/INTBITS] & (1<<((K)%INTBITS)))
#define BIT_CLR(X,K)	((X)[(K)/INTBITS] &= ~(1<<((K)%INTBITS)))
#define BIT_XOR(X,K)	((X)[(K)/INTBITS] ^= (1<<((K)%INTBITS)))
#define BIT_SET(X,K)	((X)[(K)/INTBITS] |= (1<<((K)%INTBITS)))

inline void
line_xor (struct line *a, const struct line *b)
{
    int i;
    for (i = 0; i < (N+1+INTBITS-1)/INTBITS; i++) {
	a->x[i] ^= b->x[i];
    }
}

#endif /* GR_GAUSS1_H */