<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi Petr,<br>
<br>
It's not too hard to write an inverse for matrices<br>
<br>
<blockquote type="cite">inv :: (KnownNat n, (1 <=? n) ~ 'True)
=> Sq n -> Sq n<br>
inv m = fromJust $ linSolve m eye</blockquote>
But since hmatrix is LAPACK this is not going to help you with
GF(2).<br>
<br>
I wasn't aware of the 'tensor' package either but it does contain
some interesting ideas and by the looks of it should be able to
invert matrices even for finite fields. I'd be interested in its
performance. Perhaps you could write a benchmark and I can try it
with Yarr?<br>
<br>
Probably one could improve 'tensor' by using type level literals a
la the static part of hmatrix and maybe base it over Yarr for
performance. I note it is GPL which I am not a great fan of and has
no publicy available repository (at least I wasn't able to find
one).<br>
<br>
Good luck and please report back with anything interesting you
discover on your journey.<br>
<br>
Dominic.<br>
<br>
<div class="moz-cite-prefix">On 06/01/2016 20:12, Petr Pudlák wrote:<br>
</div>
<blockquote
cite="mid:CABSda-ei9BX_=hONwDyzeWsC2P-OMKK3qq=CNStFzSbEW1vVJQ@mail.gmail.com"
type="cite">
<div dir="ltr">Hi Dominic,
<div><br>
</div>
<div>thank you for the detailed answer! I'm looking for linear
algebra over finite fields (in particular GF(2)), and while
hmatrix has some support, it doesn't support inverting
matrices, which is something I need. So I'll need to look
further. Just a moment ago I discovered the 'tensor' package,
which is flexible enough to add a new representation.
Currently it offers Vector, I'll try it out, and perhaps it'd
be possible to include yarr too, if Vector won't perform well
enough.</div>
<div><br>
</div>
<div>All the best,</div>
<div>Petr</div>
<br>
<div class="gmail_quote">
<div dir="ltr">st 6. 1. 2016 v 10:50 odesílatel Dominic
Steinitz <<a moz-do-not-send="true"
href="mailto:dominic@steinitz.org" target="_blank">dominic@steinitz.org</a>>
napsal:<br>
</div>
</div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">A problem
with my email prevented this making it on to the mailing
list.<br>
<br>
Hi Petr,<br>
<br>
I am not actively developing Yarr but I would very much like
to. I keep<br>
it from bit-rotting. The problem as always is finding time.
On the other<br>
hand I don't think repa is very active e.g. upgrading to
vector-0.11<br>
took a while to happen although clearly more active than me
on Yarr!<br>
<br>
What I'd like is something like Python's numpy but safer and
faster. If<br>
you look at the static module in the hmatrix package<br>
(<a moz-do-not-send="true"
href="https://hackage.haskell.org/package/hmatrix-0.17.0.1/docs/Numeric-LinearAlgebra-Static.html"
rel="noreferrer" target="_blank">https://hackage.haskell.org/package/hmatrix-0.17.0.1/docs/Numeric-LinearAlgebra-Static.html</a>)<br>
you can see how type level literals can be used to prevent
e.g.<br>
multiplying two inconsistent matrices together at compile
time. I am<br>
sure we could do something better with either Yarr or repa
(repa will<br>
currently give out of bounds errors at runtime).<br>
<br>
For reasons I don't understand (I think a bug in Haddock)
the<br>
documentation does not get generated.<br>
<br>
There are examples of its use here:<br>
<a moz-do-not-send="true"
href="https://github.com/leventov/yarr/tree/master/tests"
rel="noreferrer" target="_blank">https://github.com/leventov/yarr/tree/master/tests</a>.
I wrote a blog using<br>
repa and Yarr here:<br>
<a moz-do-not-send="true"
href="https://idontgetoutmuch.wordpress.com/2013/08/06/planetary-simulation-with-excursions-in-symplectic-manifolds-6/"
rel="noreferrer" target="_blank">https://idontgetoutmuch.wordpress.com/2013/08/06/planetary-simulation-with-excursions-in-symplectic-manifolds-6/</a><br>
and compare performance. You can safely ignore the theory
and need only<br>
look at "Repa Implementation", "Yarr Implementation" and
"Performance".<br>
<br>
I think performance will depend on your application. I
believe (but<br>
haven't confirmed) that repa will outperform Yarr on e.g
grid based<br>
problems such as numerical methods for diffusions and
Poisson. In the<br>
case of planets (or stars or particles) where everything is
influenced<br>
by everything else then repa is a bad fit and Yarr
outperforms.<br>
<br>
If your application is linear algebra, I would think that
hmatrix would<br>
have what you want or could be extended to give what you
want since it<br>
is LAPACK under the covers.<br>
<br>
I am very excited that you are interested in this area; it
often feels<br>
very lonely.<br>
<br>
Best wishes, Dominic.<br>
<br>
On 06/01/2016 09:10, Petr Pudlák wrote:<br>
> Hi Dominic,<br>
><br>
> what is the current state of Yarr? Is it being actively
developed? Is<br>
> there some tutorial or documentation available?<br>
><br>
> I'm deciding between repa and yarr for some linear
algebra<br>
> computations. I found some references that yarr is more
performant,<br>
> but I couldn't find much documentation and the hackage
page [1] hasn't<br>
> indexed most modules for some reason, so there seems to
be no good<br>
> place to start from. And the last commit was 9 months
ago.<br>
><br>
> [1]<a moz-do-not-send="true"
href="https://hackage.haskell.org/package/yarr"
rel="noreferrer" target="_blank">https://hackage.haskell.org/package/yarr</a><br>
><br>
> Thank you,<br>
> Petr<br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a moz-do-not-send="true"
href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a moz-do-not-send="true"
href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe"
rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
</blockquote>
</div>
</div>
</blockquote>
<br>
</body>
</html>