[Jprogramming] Matrix Transformations based on local submatrices

2012-11-13 Thread Alex Giannakopoulos
OK, I'm trying to do some work with matrices that involves transformations based on local properties of a matrix (neighbouring elements). This is the sort of thing you may find in image-processing edge-detection, etc, or in some cellular automata of the type of Conway's Life. In other words, I

Re: [Jprogramming] Matrix Transformations based on local submatrices

2012-11-13 Thread J. Patrick Harrington
Also, take a look at Marshall Lochbaum's code: http://www.jsoftware.com/jwiki/Community/Conference2012/Talks/ImageProcessing On Tue, 13 Nov 2012, Alex Giannakopoulos wrote: OK, I'm trying to do some work with matrices that involves transformations based on local properties of a matrix

Re: [Jprogramming] Matrix Transformations based on local submatrices

2012-11-13 Thread Linda Alvord
Here's a starter... m1=:1+i.3 3 1 2 3 4 5 6 7 8 9 m1=:1+i.3 3 Now I have to tackle the real problem Linda -Original Message- From: programming-boun...@forums.jsoftware.com [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Alex Giannakopoulos Sent: Tuesday,

Re: [Jprogramming] Matrix Transformations based on local submatrices

2012-11-13 Thread Roger Stokes
Brian, You are correct: the Rosetta Code produces a grid of constant size (which is the starting size.) I've just rechecked my script against the Rosetta site: there are only two lines in Rosetta and I've reproduced them both. The reason why your two expressions give different results is, I

Re: [Jprogramming] Matrix Transformations based on local submatrices

2012-11-13 Thread Raul Miller
Another option separates structure from data. Given an initial matrix M, build: DATA=: (,M),0 T=. 1 1}._1 _1}. i.2+$M NDX=: ($M) $1 T i.,2 T +2 0 ] 0, (2+$y) #. _1 ^ #: i. 4 Now, NDX { DATA will give you a 5 item list of matrices which represent the five desired sample points. Note

Re: [Jprogramming] Arc consistency in J

2012-11-13 Thread Linda Alvord
I can only give a personal response. Maybe it is because I'm left handed. When I look at ((@#)(i.n))@(0) at or -Original Message- From: programming-boun...@forums.jsoftware.com [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Mike Day Sent: Monday, November 12, 2012