<a href="http://hackage.haskell.org/package/hmatrix-0.8.1.1">http://hackage.haskell.org/package/hmatrix-0.8.1.1</a><br><br>it wraps gls, blas and lapack (so you need to install the libraries).<br><br><div class="gmail_quote">
On Tue, Feb 2, 2010 at 4:08 PM, Job Vranish <span dir="ltr">&lt;<a href="mailto:jvranish@gmail.com">jvranish@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I have a little haskell matrix library for fixed sized matricies on github:<br><a href="http://github.com/jvranish/VectorMatix" target="_blank">http://github.com/jvranish/VectorMatix</a><br>which I&#39;ve just realized is horribly out of date...I&#39;ll update it tonight and probably push it to hackage too...<br>

<br>but if you&#39;re really want to stick with the [[Double]] type, <br>you can add a Foldable and Traversable instance to ZipLists and do this:<br><br>instance Foldable ZipList where<br>  foldMap f (ZipList x) = foldMap f x<br>

 <br>instance Traversable ZipList where<br>  traverse f (ZipList x) = ZipList &lt;$&gt; traverse f x<br><br>toZipList a = ZipList $ fmap ZipList a<br>fromZipList a = getZipList $ fmap getZipList a<br><br>multMM :: (Num a) =&gt; [[a]] -&gt; [[a]] -&gt; [[a]]<br>

multMM a b = fromZipList $ multMMA (toZipList a) (toZipList b)<br><br>-- I about fell off my chair when I discovered you could do matrix multiplication like this:<br>multMMA :: (Traversable f, Num a, Applicative f, Applicative row, Applicative col, Traversable col) =&gt;<br>

           row (f a) -&gt; f (col a) -&gt; row (col a)<br>multMMA a b = traverse (liftA2 dot a . pure) (sequenceA b)<br><br>dot :: (Foldable t, Num a, Applicative t) =&gt; t a -&gt; t a -&gt; a<br>dot a b = sum $ pure (*) &lt;*&gt; a &lt;*&gt; b<br>

 <br><br>My matrix library uses a Gaussian elimination function (which operates on lists) as well as det and inv functions which should be easily adaptable to work on lists.<br><br>I&#39;ll make sure to push the updated code up tonight.<br>
<font color="#888888">
<br>- Job<br><br><br><br><br><br></font><div class="gmail_quote"><div><div></div><div class="h5">On Tue, Feb 2, 2010 at 7:15 AM, 조광래 <span dir="ltr">&lt;<a href="mailto:kwangraecho@gmail.com" target="_blank">kwangraecho@gmail.com</a>&gt;</span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">
<div>define functions</div>
<div> </div>
<div>type Matrix=[[Double]]</div>
<div> </div>
<div>multMM :: Matrix -&gt; Matrix -&gt; Matrix --multiplies two matrices<br></div>
<div>det :: Matrix -&gt; Double --computes the determinant of a matrix<br></div>
<div>inv :: Matrix -&gt; Matrix --inverts a matrix</div>
<div> </div>
<div>i stuck on those problems </div>
<div> </div>
<div>can any one help me out?</div>
<br></div></div><div class="im">_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br></div></blockquote></div><br>
<br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>happy hacking... man<br>