[Jprogramming] Matrix reshaping (newbie)

2008-01-15 Thread Yoel Jacobsen
Hello, I want to implement matrix approximation using SVD. The SVD algorithm returns three boxed matrices of the shapes x x ; x y ; y y I want to chop and multiply back: Step 1: reshape as - x M; M M ; M y where M is a small value Step 2: Unbox and multiply (x M * M M * M y = x y) My current

Re: [Jprogramming] Matrix reshaping (newbie)

2008-01-15 Thread Devon McCormick
'x y M'=. 5 7 3 NB. Parameters $.s=. (i.x,x);(i.x,y);i.y,y NB. Fake s +---+---+---+ |5 5|5 7|7 7| +---+---+---+ 2\x,M,M,y NB. Shapes we want +---+---+---+ |5 3|3 3|3 7| +---+---+---+ (2\xx,M,M,yy){..s ++++ | 0 1 2| 0 1 2| 0 1 2 3 4