Re: [S] is there a cumouter() like function?

Jack Lewis (jlewis@imtsun.rsl.psw.fs.fed.us)
Mon, 24 Aug 1998 14:44:38 -0700


Fei Chen wrote:

> ps. can someone give me an example of unavoidable loop? and under what
> general conditions when this happens?hi all,

Here is a simple example that I think requires looping,
(although I'd be thrilled to find out I'm wrong).
Given a sequence a[i], i=0,1,2,...,n, and some constant k,
with 0 < k < 1, compute the sequence
b[i] = k*a[i-1] + a[i], i=1,2,...,n

It may be impossible to state general conditions in S-Plus
for unavoidable loops, because "avoidance" often just
means doing the looping with compiled code
(often internal to S-Plus) from another language
such as C or Fortran.

--
Jack Lewis                           Redwood Sciences Laboratory
707-825-2929 voice                   Pacific Southwest Research Station
707-825-2901 fax                     USDA Forest Service
jlewis/psw_rsl@fs.fed.us             http://www.rsl.psw.fs.fed.us

NOTE: jlewis@rsl.psw.fs.fed.us will be de-activated sometime this summer (1998). -------------------------------------------- Thought must be divided against itself before it can come to any knowledge of itself. (Aldous Huxley)

----------------------------------------------------------------------- This message was distributed by s-news@wubios.wustl.edu. To unsubscribe send e-mail to s-news-request@wubios.wustl.edu with the BODY of the message: unsubscribe s-news