[Jprogramming] a new question
Ric Sherlock
tikkanz at gmail.com
Sun Aug 28 19:47:49 HKT 2011
Here's one tacit approach to the tent function:
tent=: 0:`-:`(-:@-.)`0:@.(0 0.5 1&I.)"0
tent _0.1 0 0.1 0.2 0.3 0.5 0.7 0.8 0.9 1 1.1
0 0 0.05 0.1 0.15 0.25 0.15 0.1 0.05 0 0
Given it is rank 0 I expect its performance can be improved. Also
although dyadic I. appears to work in this case, it doesn't strictly
follow the 0<=x condition below.
On Sun, Aug 28, 2011 at 10:40 PM, mikel paternain <mikelpater at hotmail.es> wrote:
>
> How do you write in J a "tent" function:
>
> g(x)= x/2 if 0<=x<=1/2,
> (1-x)/2 if 1/2 < x < 1
>
> and, more important, How do you write in J a Takagi function with the "tent" function:
>
> h(x)= Sum [r=0 to infinite, g(2^r x)/2^r]
>
>
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
More information about the Programming
mailing list