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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,83d867c7a987cc31 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-07-04 10:22:29 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!193.174.75.178!news-fra1.dfn.de!news.esoc.esa.de!not-for-mail From: Colin Paul Gloster Newsgroups: comp.lang.ada Subject: Re: Help with translation: Fortran77 => Ada95 Date: Wed, 04 Jul 2001 19:17:12 +0200 Organization: not from Colin Paul Gloster if posted after 28th September 2001 Message-ID: <3B434F98.49B5EDF4@ACM.org> References: <9hun38$t0m$1@ulysses.noc.ntua.gr> Reply-To: Colin_Paul_Gloster@ACM.org NNTP-Posting-Host: cgloster.esoc.esa.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.51 [en] (Win95; U) X-Accept-Language: en Xref: archiver1.google.com comp.lang.ada:9435 Date: 2001-07-04T19:17:12+02:00 List-Id: Sorry, I am tired and am not going to look through all of that now nor really think of it in terms of the mathematical problem domain which could produce a more elegant solution...especially the latter since it may just be neater to forget about porting the FORTRAN and just write a function which does as required. However I have a suggestion, bearing in mind abhorrance of goto. Depending on how mistaken I am, in F77 the continue keyword on line 110 is part of the looping construct of do on line 105. I.e. m starts at one and each time it is incremented it is incremented by the value of n (so m is not necessarily just increased by one each time) and the loop is to be run one hundred and ten times with continue signalling each next iteration. -- more FORTRAN 77 -- Look for a small subdiagonal element. -- 105 do 110 m=l,n if(m.eq.n) goto 120 if(abs(e(m)).le.eps*(abs(zero(m))+abs(zero(m+1)))) goto 120 110 continue 120 p=zero(l) -- more FORTRAN 77 So in your Ada95 version you could try something like (tidy this up in to proper compilable Ada when you have decided what you will go for) -- more F77 to be ported MAX_LOOP_ITERATIONS := 110; loop_iterations_so_far := 1; -- or 0, you may change this in your translating m := 1; while loop_iterations_so_far <= MAX_LOOP_ITERATIONS and m /= n and ( abs(e(m)) <= eps*(abs(zero(m))+abs(zero(m+1))) ) loop m := m + n; end loop; -- more F77 to be ported Bye, Colin Paul Gloster