Re: [Jprogramming] u} vs m}

2016-12-28 Thread David Koppenhoefer
Thank you - following this discussion has helped me a lot! Also I didn't look into NuVoc til now but rather limited myself to the old vocabulary simply because it is included in the installation. Ehm, since I mentioned it, here's my AoC 9 part I. Of course this does not use u} at all - that part g

Re: [Jprogramming] u} vs m}

2016-12-28 Thread Raul Miller
Note that linear indexes are mathematically equivalent to boxed indexes base (#.) array shape. The problem, though, is that they are atom indices, and not frame indices. -- Raul On Wed, Dec 28, 2016 at 12:56 PM, Brian Schott wrote: > To clarify NuVoc's explanation, first I think I created the

Re: [Jprogramming] u} vs m}

2016-12-28 Thread Brian Schott
To clarify NuVoc's explanation, first I think I created the index list for the current example. ,/>@{(i. 3);i. 2 0 0 0 1 1 0 1 1 2 0 2 1 Then pretending that y is i. 3 2, I applied the expression given in NuVoc and it produces the expected "atom numbers". ($i. 3 2)#. ,/>@{(i. 3);i. 2 0 1 2

Re: [Jprogramming] u} vs m}

2016-12-28 Thread Henry Rich
The Dictionary does discuss this, at http://www.jsoftware.com/help/dictionary/d530v.htm but unfortunately it doesn't mention that the result of u is the atom number. NuVoc in http://code.jsoftware.com/wiki/Vocabulary/curlyrtu#dyadic does describe the case correctly, though without the usual ex

Re: [Jprogramming] u} vs m}

2016-12-28 Thread bill lam
IIRC amend at that time used "linear index". x m} y is ($y) x m} ,y Ср, 28 дек 2016, Cliff Reiter написал(а): > A long, long, time ago in a J far away, indexing was done in i. order. So > indices to a 3 by 2 array would be given by > i.3 2 > > 0 1 > > 2 3 > > 4 5 > > Is it possible t

Re: [Jprogramming] u} vs m}

2016-12-28 Thread Don Guinn
I played with x u}y some more. It seems that y is treated as a vector (rank 1) no matter what rank it actually is. x and u must be either rank 0 or 1 and both the same. Also then number of items in x must match the number of items produced by u. Not sure what is going on. but it does not seem to wo

Re: [Jprogramming] u} vs m}

2016-12-28 Thread Cliff Reiter
A long, long, time ago in a J far away, indexing was done in i. order. So indices to a 3 by 2 array would be given by i.3 2 0 1 2 3 4 5 Is it possible that x u}y is an artifact from that era? On 12/27/2016 3:06 PM, Don Guinn wrote: Just played with the original expression a little a

Re: [Jprogramming] u} vs m}

2016-12-27 Thread 'Pascal Jasmin' via Programming
ce~ 2 4 (;"0) 0 2"_ ) 3 2 $ 0 2 2 0 0 4 4 2 4"_ amdt (0 2) 3 2 $ 0 2 4 0 0 2 4 >:@] amdt (0 2) 3 2 $ 1 2 2 1 1 2 2 From: Don Guinn To: Programming forum Sent: Tuesday, December 27, 2016 3:06 PM Subject: Re: [Jprogramming] u} vs m} Jus

Re: [Jprogramming] u} vs m}

2016-12-27 Thread Don Guinn
Just played with the original expression a little and got: 2 4 (0 2"_)}3 2$0 2 0 4 0 0 0 2 4 (0 3"_)}3 2$0 2 0 0 4 0 0 2 4 (0 4"_)}3 2$0 2 0 0 0 4 0 2 4 (0 5"_)}3 2$0 2 0 0 0 0 4 2 4 (0 6"_)}3 2$0 |index error | 2 4(0 6"_)}3 2$0 2 4 (0 _1"_)}3 2$0 2 0 0 0 0 4 On Tue, Dec 2

Re: [Jprogramming] u} vs m}

2016-12-27 Thread Raul Miller
The verb form is different from the gerund form, for whatever reasons. But this is documented in the dictionary (and in NuVoc, like Henry mentioned earlier). I'm not sure what other answer can be given, other than going into detailed explanations of how they are different, and/or why both forms ar

Re: [Jprogramming] u} vs m}

2016-12-27 Thread Devon McCormick
This seems to work as well and it's a bit simpler: (2 4) 0 1} 3 2$0 On Tue, Dec 27, 2016 at 2:20 PM, Brian Schott wrote: > This is what the OP needed, I think. > Except that instead of the u} form this is the gerund form. > So I don't think it is the answer, either. > >2 4 [`(0 1"_)`]} 3

Re: [Jprogramming] u} vs m}

2016-12-27 Thread Brian Schott
This is what the OP needed, I think. Except that instead of the u} form this is the gerund form. So I don't think it is the answer, either. 2 4 [`(0 1"_)`]} 3 2$0 2 4 2 4 0 0 On Tue, Dec 27, 2016 at 2:09 PM, Henry Rich wrote: > I have removed the deprecation - it was my misunderstanding of

Re: [Jprogramming] u} vs m}

2016-12-27 Thread Henry Rich
I have removed the deprecation - it was my misunderstanding of something Roger wrote. The gerund form would be, in simplest form, 2 4 [`0:`]} 3 2$0 With a table, you could refer to the first row by any of the following forms: 0 or <0 or <0; I looked in the original vocabulary and it tal

Re: [Jprogramming] u} vs m}

2016-12-27 Thread Don Guinn
I looked in the original vocabulary and it talked about gerunds and I confess I got lost. Your link to nuvoc is much clearer. And it said that this use of } has been depreciated. Then I tried applying the expression in pieces as described. z=.2 4(0 1"1)3 2$0 2 4 z} 3 2$0 2 4 2 4 0 0 z 0 1

Re: [Jprogramming] u} vs m}

2016-12-27 Thread Henry Rich
It's in the Dictionary. Also in NuVoc: http://code.jsoftware.com/wiki/Vocabulary/curlyrtu#dyadic Henry Rich On 12/27/2016 12:41 PM, Don Guinn wrote: I'm not really sure how to interpret your second example either. But (0 1"1) is a verb, where (0 1) is a noun. The dictionary doesn't say what h

Re: [Jprogramming] u} vs m}

2016-12-27 Thread Don Guinn
I'm not really sure how to interpret your second example either. But (0 1"1) is a verb, where (0 1) is a noun. The dictionary doesn't say what happens if the selection for amend is a verb. On Tue, Dec 27, 2016 at 10:26 AM, David Koppenhoefer < david.koppenhoe...@iconmobile.com> wrote: > Hi, > > I

[Jprogramming] u} vs m}

2016-12-27 Thread David Koppenhoefer
Hi, I want to replace items in a matrix like this: 2 4 (0 1)} 3 2 $ 0 2 4 2 4 0 0 but when using u} the following happens: 2 4 (0 1"_)} 3 2 $ 0 2 4 0 0 0 0 why is there a difference? Judging from the vocabulary example of u}, there is some method to it, but I haven't understood it yet.