[Haskell-cafe] Re: haskell blas bindings: does iomatrix gemv transposing of matrix a?

Patrick O'Regan Perry patperry at stanford.edu
Wed Sep 17 10:50:40 EDT 2008


Hi Anatoly,

I made the decision to make "herm" an O(1) operation.  This means you don't have to pass transpose arguments to the multiplication routines.  When you do, for example:

> let a = listMatrix (2,3) [1..6]
>     x = listVector 2 [1, -1]
> in herm a <*> x

this gets implemented as a call to gemv with transa set to "ConjTrans".

BLAS actually supports "NoTrans", "Trans", and "ConjTrans".  For real data types, "Trans" is the same as "ConjTrans".  For complex data types, they are different.  Unfortunately, it is impossible to call a routine with "Trans" in the blas bindings.  I explicitly did not want people to have to pass extra parameters to indicate transpose/conjugacy information, and I wanted "conjugate transpose" to be an O(1) operation.  Ideally, "transpose" would be O(1), as well.  However, since BLAS doesn't have an option to conjugate the input matrix but not transpose it, only one of "herm" and "trans" can be O(1).

I think in hmatrix, "trans" is O(1), but not "herm".


Patrick

p.s. I've been busy with other work lately, and I probably won't make a release soon, but I did a pretty big overhaul of the library to support operations in the ST monad.  For impure operations, the functions of all the operations are mostly the same, but the types are all different.  (For pure operations, there are only minor changes.)  If you want the development version, you can get the darcs repo at http://stat.stanford.edu/~patperry/code/blas .  

The new version is pretty typeclass-heavy, since that's the only way I know how to support both ST and IO.  Consequently, there have been some performance regressions.  I have some optimization ideas (in the "TODO") file, but I do not have time to implement them right now.  If you or anyone else would like to help with this or anything else, I would be glad to have you aboard the development "team".



----- Original Message -----
From: "Anatoly Yakovenko" <aeyakovenko at gmail.com>
To: patperry at stanford.edu
Cc: "haskell" <haskell-cafe at haskell.org>
Sent: Tuesday, September 16, 2008 8:46:02 PM GMT -05:00 US/Canada Eastern
Subject: haskell blas bindings: does iomatrix gemv transposing of matrix a?

Hey Patric,

Thanks for your great work on the blas bidnings.  I have a question on
gemv.  I thought its possible for blas to transpose the input matrix
before doing the multiplication.  Is it possible to do that with the
haskell bindings?  Or am I mistaken in how gemv is used

Thanks,
Anatoly


More information about the Haskell-Cafe mailing list