Atom-outer-product is a project mainly written in Haskell, it's free.
A demonstration of a linear algebra outer product in the Atom Haskell eDSL
Atom Outer Product Pat Hickey 24 Oct 2010
I wrote this code[1] to play with Tom Hawkins's[2] Atom[3,4], an embedded Haskell DSL. This is a simple example project which generates C code to calculate the outer product of a vector with itself; that is, a^T * a, which multiplies each element of a by each element of a. Presently the code is implemented for a length 4 input.
I have implemented this simple algorithm in two ways:
I've provided two C wrappers for the compiled Atom code:
I've also included a third implementation of the algorithm, 'op_triangle', which was an attempt to use an imperative style intermediate variable to store the result of the input multiplication, and assign that value to multiple outputs. This code turns out to be impossible to write with the Atom language, because assignments (<==) are carried out at the end of rule execution, so they cannot cause a side effect during rule execution.
LICENSE You may do whatever you like with this code.
[1] http://github.com/pchickey/atom-outer-product [2] http://tomahawkins.org [3] http://github.com/tomahawkins/atom [4] http://hackage.haskell.org/package/atom-1.0.7