From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: * X-Spam-Status: No, score=2.0 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,d45251e6e639e463 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.190.104 with SMTP id gp8mr14073025pbc.4.1340650420546; Mon, 25 Jun 2012 11:53:40 -0700 (PDT) Path: l9ni19161pbj.0!nntp.google.com!news1.google.com!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: "Nasser M. Abbasi" Newsgroups: comp.lang.ada Subject: Re: questions on using the array component iterator for 2012 Date: Mon, 25 Jun 2012 13:53:38 -0500 Organization: Aioe.org NNTP Server Message-ID: References: <42e9adf6-5928-4742-b066-e3ec2b96e8cb@googlegroups.com> Reply-To: nma@12000.org NNTP-Posting-Host: KdJUrTuvv3Zv/s8pPxNluw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2012-06-25T13:53:38-05:00 List-Id: On 6/25/2012 1:19 PM, Adam Beneschan wrote: > On Saturday, June 23, 2012 5:02:18 AM UTC-7, Nasser M. Abbasi wrote: > That wouldn't even work, I think. ... > > New_A(i,j) := (1/4) ( A(i-1,j)+A(i+1,j)+A(i,j-1)+A(i,j+1) > For the LHS, there is a jacobi iteration, which needs a temporary matrix, like you have above, and there is gauss-siedel iteration, which uses the same (in place) matrix. There are many other types of iterations (called relaxations methods such as sor, gauss-siedel with red/black variation, sor with chebyshev, and may be more). But that is all not really important. What I was asking for, is using the new iterator, if one can use it to access elements outside its "sphere of influence", ie. to access 1-off it, or 2-off of it, up and down, etc. i.e. convert it to an index locally so as to visits elements other than it somehow. But after thinking about it, I do not think this is practical to do. If I wanted to do the above type iteration, I'll just normal loops and use normal indices, not the new iterator. > (you left the ",j" off the index of the left-hand side) > yes, sure. I was writing things on the fly. > and then A := New_A after all elements are computed. > Yes. For Jacobi. I've written all these algorithms many times before in Matlab and in Mathematica. If you interested in the code, Check my Mathematica applets here http://12000.org/my_notes/mma_demos/index.htm #25 in the table implements many solvers including Jacboi. You can run in it the browser. (need plugin, free of charge, see link there if interested). Firefox, etc.. but no plugin for Linux yet, but free player yes, can be downloaded from Wolfram research. regards, --Nasser