[Haskell-cafe] matrix computations based on the GSL

Jacques Carette carette at mcmaster.ca
Thu Jun 30 09:39:09 EDT 2005

Henning Thielemann wrote:

>I'm uncertain about how who want to put the different kinds of
>multiplication into one method, even with multi-parameter type classes.
>You need instances
> (*) :: Matrix -> Matrix -> Matrix
> (*) :: RowVector -> Matrix -> RowVector
[many other instances removed.]

Definitely not.  You could do:
Data Orientation = Row | Column
Data Vector a = Vector Orientation [a]
(well, the size should be in there too, but I'll skip that).  That 
easily takes care of most of the complexity.  And you can easily define 
operations that can choose to ignore Orientation if they wish (like 
inner product of vectors).

I said that this design works.  Of course, implementing it along the 
lines you suggested in this email would have been idiotic - there is a 
better way to do it.  If you go back to my original email, the sheer 
complexity of all the combinations possible (several thousand) should 
have given you a clue that your proposal above was a complete and utter 

>Is the design discussion related to linear algebra for Maple documented
Unfortunately not.  The design is documented, with some of the 
discussion captured, but those documents are still in internal papers to 
Maplesoft Inc.  There is no profit to be made in publishing it (in their 
estimation), so that information remains internal.


More information about the Haskell-Cafe mailing list