Alex, At the risk of going off-topic it would be good to know how you solved the multi-level problem using linear algebra in J. (ie multi-level with common subassy) A ref to the appropriate wiki or J phrase would be enough.
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Alex Rufon Sent: Monday, 23 August 2010 12:10 To: Programming forum Subject: Re: [Jprogramming] Creating a matrix (some polish required) I remember identity matrix taught in my linear algebra class and wondering how to use it in "real life" situation. Because of J, I actually used this concept to compute for Raw Material Consumption and Material Requirement Planning for Shoes and Apparel manufacturing (and soon for the Fishing Industry). I remember doing RMC and MRP in VB+PL/SQL when I was still working in the Paper Industry and the code was mind boggling. I remember being confused where an IF-ENDIF block ends because of the multi-leveling. Learning J to implement identity matrix and matrix math is totally worth it. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Roger Hui Sent: Friday, August 20, 2010 9:55 PM To: Programming forum Subject: Re: [Jprogramming] Creating a matrix (some polish required) http://www.jsoftware.com/jwiki/Essays/Identity%20Matrix 34 ways to create the identity matrix. Adapt one to create the anti-diagonal matrix. e.g. method 23: a23=: |....@i. a23 5 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 ----- Original Message ----- From: Alex Gian <[email protected]> Date: Friday, August 20, 2010 3:42 Subject: [Jprogramming] Creating a matrix (some polish required) To: Programming forum <[email protected]> > The "flipped" identity matrix is quite interesting. (Basically it's > the identity matrix flipped or mirrored about either the vertical or > horizontal axis. IOW, for a 3x3: > 0 0 1 > 0 1 0 > 1 0 0 > I don't know if it has any special name, I stumbled on it by chance > while messing around with a simple FSA for a puzzle game. > Pre-multiplying by this matrix flips any same size matrix vertically, > post-multiplying flips it horizontally. Its square is obviously the > identity matrix. > > Now, I have created this matrix on various systems, (e.g. HP/RPL, > Scheme, TI-Basic), usually - if an id matrix is provided - just by > reversing its rows, otherwise just by starting off with the vector, > say, > 0 0 0 1, and then rotating the "1" each time and appending that vector > to a string, which is eventually converted to a matrix. > > I can do this using loops and explicit coding, but am looking for any > suggestions to make it into a J one-liner, such that: > flipidm 4 > 0 0 0 1 > 0 0 1 0 > 0 1 0 0 > 1 0 0 0 > > Hope my explanation was clear enough, TIA ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.851 / Virus Database: 271.1.1/3084 - Release Date: 08/21/10 04:35:00 ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
