Re: [racket-users] a matrix question

2018-03-26 Thread Tim Hanson
Many thanks, Jens Axel! That looks very good and includes several techniques that will help and inspire me, in particular for*/matrix, which I hadn't used yet. I'll try it out the next chance I get. -- You received this message because you are subscribed to the Google Groups "Racket Users" gr

Re: [racket-users] a matrix question

2018-03-25 Thread Jens Axel Søgaard
Hi Tim, Here is one way to do it: #lang typed/racket (require math/matrix math/array) (: columns->matrix (All (A) ((Listof (Matrix A)) -> (Matrix A (define (columns->matrix cs) (define m (matrix-num-rows (first cs))) (define n (length cs)) (: has-m-rows? : ((Matrix A) -> Boolean)) (d

[racket-users] a matrix question

2018-03-25 Thread Tim Hanson
hi, I'm trying out matrices (without typed racket, though I read the performance caveat -- I'm not worried about performance at the moment) and am trying to find the best idioms for a small function I'd like to build. Q1: is there an elegant away to assemble a matrix column-wise? (my first dra