No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bench/HLinear
prof/HLinear
src/HLinear
test/HLinear
.gitignore
LICENSE
README.md
Setup.hs
hlinear.cabal
stack.yaml

README.md

HLinear

HLinear is a Haskell implementation of the PLE decomposition of matrices over division rings. It writes an arbitrary matrix as a product of a permutation matrix, a lower triangular matrix with diagonal entries 1, and an echelon matrix.

Features:

Installation

  1. Install stack.
  2. Install git.
  3. Install flint.
  4. Create a working directory for HLinear and its dependencies:
mkdir hlinear-all; cd hlinear-all
  1. Get natural-test:
git clone https://github.com/martinra/natural-test.git
  1. Get vector-test:
git clone https://github.com/martinra/vector-test.git
  1. Get algebraic-structures:
git clone https://github.com/martinra/algebraic-structures.git
  1. Get hflint:
git clone https://github.com/martinra/hflint.git
  1. Get HLinear:
git clone https://github.com/martinra/hlinear.git
  1. Build HLinear:
cd hlinear
stack build
  1. Test HLinear:
stack test

The log file with the test results can be found at .stack-work/logs/hlinear-0.0.1-test.log

  1. Run a simple benchmark:
stack bench

The log file with the benchmark results can be found at .stack-work/logs/hlinear-0.0.1-bench.log

How to use

This is just a sketchy illustration of how to interact with HLinear from Haskell. For details and code you can immediately start adapting to your needs, see HLinear-example.

(...various imports...)

main :: IO ()
main = do
  let m = M.fromListsUnsafe [[1,2,3],[4,5,6]] :: Matrix FMPQ
      hk = D.unPLEDecomposition $ FU.pleDecompositionFoldUnfold m
      e = Hk.echelonForm hk
      em = EF.toMatrix e
  putStrLn "echelon form:"
  print em

Output:

echelon form:
[ 1/1 2/1 3/1 ]
[ 0/1 1/1 2/1 ]

License

GPLv3, see LICENSE.