You could create a similar effect simply by modding your indices by the
shape of the array:
4|i.5
0 1 2 3 0
For things well outside the range of the matrix this would give you awful
answers--put an assert in there--but for values essentially at the endpoints
it is reasonable.
Marshall
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Brian Schott
Sent: Sunday, January 23, 2011 12:12 PM
To: Programming forum
Subject: Re: [Jprogramming] Floating from
Ben,
Yes, ffrom seems like a nice verb.
Regarding your dislike for the _1e_7 at the beginning, would these ideas be
an alternative approach to the need for that edge condition?
Of course this is just an idea.
(,{.)i. 4
0 1 2 3 0
((,{.)&.|:)(,{.)i. 3 4
0 1 2 3 0
4 5 6 7 4
8 9 10 11 8
0 1 2 3 0
On Sun, Jan 23, 2011 at 11:37 AM, Ben Gorte - LR <[email protected]>
wrote:
> Hi,
>
> I believe I made a nice verb, called ffrom. It acts like { (from) :
>
[snip]
>
> I have no doubts that members in this forum can make it nicer.
> What i particularly do not like is the _e_7 at the beginning.
> Its only purpose is to allow for
>
> (n-1) ffrom i.n=.4
> 3
>
> which otherwise would interpolate between the 3rd and 4th element
> causing an index error. If I want to solve that in another way it gets
> messy. By the way,
>
> _1 _1.5 _2 ffrom i.4
> 3 2.5 1
>
> looks okay to me, and
>
> _0.3 ffrom i.4
> 0.9
>
> interpolates between the last and the first value, which also seems
> reasonable.
>
> Finally,
>
> (<?20$0) ffrom i.20#2
> 281616
>
> interpolates between the 1,048,576 vertices of a 20-dimensional
> hypercube :-)
>
> Of course improvements and other suggestions will be greatly appreciated.
> Perhaps it can end up in the wiki?
>
> Greetings,
> Ben
--
(B=)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm