[racket] Math library ready for testing

From: Neil Toronto (neil.toronto at gmail.com)
Date: Mon Dec 10 23:33:19 EST 2012

On 12/09/2012 04:52 AM, Jens Axel Søgaard wrote:
> The matrix library uses arrays to represent the matrices.
> An 2x3 matrix can be constructed as:
>
>     (matrix/dim 2 3
>                         1 2 3
>                         4 5 6)
>
>     (list->matrix '[[1 2 3] [4 5 6]])
>
>    (for/matrix: : Number 2 3 ([i (in-naturals)]) i)
>
> These expressions will all return the same 2D array.
>
> Given that the shape of a matrix is fixed, the problems
> with square parentheses in constructor notation disappear.
> That is, one could let  matrix  be a macro, and it could
> accept both kinds of parentheses:
>
>        (matrix [[1 2 3] [4 5 6]])
>        (matrix ((1 2 3) (4 5 6)))

I wouldn't mind having a special constructor like that for matrices.

BTW, I've just pushed the documentation for `math/statistics' v1.0, so 
it's ready for testing. That also means I'll be reviewing `math/matrix' 
soon. Woo hoo!

Neil ⊥


Posted on the users mailing list.