Files
haskell-math/test/GF2test.hs
2026-01-16 19:27:16 +01:00

30 lines
646 B
Haskell

module GF2test (run) where
import LinearAlgebra.GF2
( fromBools
, gaussianEliminationIndices
)
run :: IO ()
run = do
putStrLn "GF2 Gaussian elimination test"
let rowsBools =
[ [True, False, True]
, [False, True, True]
, [True, True, False]
, [True, True, True]
]
nCols = length (head rowsBools)
rowsBits = map fromBools rowsBools
let maybeIndices = gaussianEliminationIndices nCols rowsBits
case maybeIndices of
Nothing -> putStrLn "No combination found."
Just idxs -> putStrLn $ "Rows: " ++ show idxs
putStrLn "GF2 Test Done."