2

I have a matrix :: [[Int]] whose elements are all either zero or one.

How can I efficiently implement rref in GF(2)?

If LU decomposition can be used to calculate rref(matrix) in GF(2), any example or elaboration on the algorithm would be greatly appreciated.

Rob
  • 5,223
  • 5
  • 41
  • 62
  • 5
    You basically want an [LU decomposition](http://en.wikipedia.org/wiki/LU_decomposition), and that [is available](http://hackage.haskell.org/packages/archive/hmatrix/latest/doc/html/Numeric-LinearAlgebra-Algorithms.html#g:10). – leftaroundabout Aug 26 '13 at 00:49

1 Answers1

3
  1. I don't think it's possible to make an efficient GF(2) implementation using hmatrix, it was designed to handle "big" numbers, not bits.

  2. You definitely don't want to use a Double to encode a Bit, that's 64 times more memory than what you actually need.

  3. Have you searched for rref algorithms that are optimized for GF(2) ? A generic Gaussian elimination or LU decomposition might not be the best solution in GF(2).

Rob
  • 5,223
  • 5
  • 41
  • 62
Changaco
  • 790
  • 5
  • 12
  • 1
    A quick web search for "efficient GF(2) matrices" seems to return some potentially interesting results. – Changaco Sep 12 '13 at 16:00