[Haskell-cafe] matrix computations based on the GSL

David Roundy droundy at physics.cornell.edu
Fri Jul 8 11:05:13 EDT 2005


On Fri, Jul 08, 2005 at 03:33:16PM +0200, Henning Thielemann wrote:
> 
> On Thu, 7 Jul 2005, David Roundy wrote:
> 
> > On the other hand, this is sort of a silly debate, since the API *I*
> > want is a subset of the API *you* want.
> 
> The API you want is certainly not just a subset of what I want. E.g. the
> singular value decomposition in your favorite API will probably return a
> 1xN matrix or a MxN diagonal matrix containing the singular values, while
> with my favorite API it will return a vector or a list. Right?

I don't particularly care what API you use for svd, since it's trivial to
convert from one API to the other.  It's matrix arithmetic I care about,
since that's the complicated part of the API.

On the other hand, the most natural return value for svd would be a
diagonal matrix, since that is what the objects are, right? svd returns
three matrices, which when multiplied together give the original
matrix... or at least that's how I think of it.  But I'll grant that a
diagonal matrix isn't the most convenient representation, and certain is
far from the most efficient, unless we introduce a diagonal matrix
constructor (which would certainly be nice).  I guess you'd prefer that svd
returns a list of doubles and two lists of vectors? Or a list of triplets
of a double and two vectors?

(Answering another email...) I certainly agree that fft is not a function
of a matrix.
-- 
David Roundy


More information about the Haskell-Cafe mailing list