93 void read(
const std::string &fname);
95 void write(
const std::string &fname)
const;
195 GF2mat(
const bvec &x,
bool is_column =
true);
201 void set_size(
int m,
int n,
bool copy =
false);
212 inline bin get(
int i,
int j)
const;
218 inline void set(
int i,
int j,
bin s);
277 int rows()
const {
return nrows; }
280 int cols()
const {
return ncols; }
343 ivec &P,
int rank,
int r,
int c)
const;
367 ivec &P, bvec newcol)
const;
410 static const unsigned char shift_divisor = 3;
414 static const unsigned char rem_mask = (1 << shift_divisor) - 1;
426 it_file &
operator<<(it_file &f,
const GF2mat &X);
438 GF2mat
operator*(
const GF2mat &X,
const GF2mat &Y);
444 bvec
operator*(
const GF2mat &X,
const bvec &y);
450 GF2mat
operator+(
const GF2mat &X,
const GF2mat &Y);
456 std::ostream &
operator<<(std::ostream &os,
const GF2mat &X);
468 GF2mat
mult_trans(
const GF2mat &X,
const GF2mat &Y);
480 data(i, (j >> shift_divisor)) ^= (1 << (j & rem_mask));
487 return (data(i, (j >> shift_divisor)) >> (j & rem_mask)) & 1;
495 data(i, (j >> shift_divisor)) |= (1 << (j & rem_mask));
497 data(i, (j >> shift_divisor)) &= (~(1 << (j & rem_mask)));
502 #endif // #ifndef GF2MAT_H