Test if Rich Text looks better: Since this has a mistake it is hard to reconstruct what I did wrong. This represents what I was doing:
ic2=: [: , j./&i:/@+. ic2 [: , j./&i:/@+. ([: , j./&i:/@+.)2 _2 _1 0 1 2 f=: 13 :',j./&i:/+.y' f 2 _2 _1 0 1 2 5!:4 <'ic2' -- [: +- , --+ -- / --- j. │ -- / --- & -+- i: L- @ -+- +. ic2 [: , j./&i:/@+. 5!:4 <'f' -- [: +- , --+ -- [: │ │ -- / --- j. L----+- / --- & -+- i: L- +. f [: , [: j./&i:/ +. ([: , [: j./&i:/ +.)2 _2 _1 0 1 2 g=: 13 :'j./ i:+.y' g 2 _2 _1 0 1 2 5!:4 <'g' -- [: +- / --- j. --+ │ -- [: L-----+- i: L- +. At this point I thought everything was fine. In the middle of writing an e-mail I realized I hadn't tested complex numbers. When I did I found and reported my error. The problem is 1j2. g 1j2 0j2 _1 0 1 0 0 _2j_2 _1j_1 0 1j1 2j2 ic 1j2 0j2 _1j_2 _1j_1 _1 _1j1 _1j2 _1j_2 _1j_1 _1 _1j1 _1j2 0j_2 0j_1 0 0j1 0j2 0j_2 0j_1 0 0j1 0j2 1j_2 1j_1 1 1j1 1j2 1j_2 1j_1 1 1j1 1j2 0j_2 0j_1 0 0j1 0j2 0j_2 0j_1 0 0j1 0j2 0j_2 0j_1 0 0j1 0j2 0j_2 0j_1 0 0j1 0j2 0j_2 0j_1 0 0j1 0j2 0j_2 0j_1 0 0j1 0j2 ic2 1j2 0j2 _1j_2 _1j_1 _1 _1j1 _1j2 0j_2 0j_1 0 0j1 0j2 1j_2 1j_1 1 1j1 1j2 0j_2 0j_1 0 0j1 0j2 0 0 0 0 0 0 0 0 0 0 (ic-:ic2)&>1j2 0j2 1 1 However, I do not understand how ic and ic2 agree when they don't! ic [: , ([: i: 9&o.) j./ [: i: 11&o. ic2 [: , j./&i:/@+. g [: j./ [: i: +. Since all you asked was how I arrived at my solution, there you have it! Hopefully you'll make sense of it. Linda -----Original Message----- From: programming-boun...@forums.jsoftware.com [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Dan Bron Sent: Sunday, January 20, 2013 10:44 PM To: programm...@jsoftware.com Subject: Re: [Jprogramming] [Jprogrammingou Hermitian from triangular Linda wrote: > ic=:[: , ([: i: 9&o.) j./ ([: i: 11&o.) > ic2=: [: , j./&i:/@+. > ic3=: 13 :'j./ i:+.y' Please post a description, in English, of the algorithm behind ic3. What is that verb attempting to accomplish? In operational terms, how does it transform its input to its output? If you can provide an analysis, similar to the one I posted yesterday, where you describe how you came to believe that ic3 is equivalent to ic (or ic2, whichever), that would be most helpful. Barring that, please provide a description of the algorithm behind ic (or ic2), as you understand it, which we could compare/contrast to your description of the algorithm underlying ic3. In short: from my perspective, ic and ic3 are different verbs, and I have no reason to believe that given identical inputs, they will produce identical outputs (and, as you noticed, the J interpreter shares this perspective, at least for certain inputs). I would like to understand why you believe differently. Bear in mind I ask this not in order to help you repair ic3 (which is trivial), but in order to understand your general approach to programming in J. I would honestly like to teach you to fish, as it were, rather than forcing you to continue to rely on others to catch fish for you. My first attempt at that was taking time and effort to write-up a formal procedure for transforming ic to ic2, to see if it could help you meet your goals of educating with J. I'm certainly willing to continue that effort in good faith - if you are. -Dan ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm