Re: [Jprogramming] 2-verb "Forking"

2012-08-19 Thread David Vaughan
g the [ verb to the left of the train (has to be [ and not ] because of the dyadic case): ([ f g) y <=> (f g) y The situation is similar for the dyadic case. ___________ David Vaughan On 19 Aug 2012, at 18:21, Owen Marschall wrote: > Hey all, J beginner here. In the

Re: [Jprogramming] Results listing line by line

2012-08-09 Thread David Vaughan
dictionary/dx009.htm _______ David Vaughan On 9 Aug 2012, at 10:23, "Papp Erik Tamás" wrote: > Dear Forum, > > Perhaps it is a beginners question, but somehow I cannot come up with a > correct answer. I made a program in J 602a for 3D similarity transf

[Jprogramming] Determining an 'alternating' binary array

2012-07-27 Thread David Vaughan
I have an array of shape (2 n), and I want to determine if it has a kind of alternating pattern, where 1s must appear on alternate rows, when reading from left to right. Some examples that do 'alternate': 1 0 0 1 0 1 0 1 0 0 1 0 0 1 0 1 0 1 0 1 0 1 0 0 1 0 0 0 0 1 1 0 0 0 1 0 0 0 Some exampl

[Jprogramming] Self-reference $:

2012-07-26 Thread David Vaughan
I was looking through the essay on the wiki about partitions, and I was looking at the verb pn: pn =: -/@(+/)@:($:"0)@rec ` (x:@(0&=)) @. (0>:]) M. rec =: - (-: (*"1) _1 1 +/ 3 * ]) @ (>:@i.@>.@%:@((2%3)&*)) I was a little confused about the way that $: works - does it re-execute the whole verb

Re: [Jprogramming] Verbs that contain nouns

2012-07-22 Thread David Vaughan
noun will be reevaluate d each time. > On Jul 22, 2012 1:32 PM, "David Vaughan" wrote: > >> I have a noun called paths, whose value changes at various points, and a >> verb g that uses paths. The problem is, it only works for the initial value >> of path

[Jprogramming] Verbs that contain nouns

2012-07-22 Thread David Vaughan
I have a noun called paths, whose value changes at various points, and a verb g that uses paths. The problem is, it only works for the initial value of paths. paths =: \:~&.> (;~ 0$0) , <\ 2+i.7 paths ┌┬┬─┬───┬─┬───┬─┬───┬─┐ │││2│3 2│4 3 2│5 4 3 2│6 5 4 3

Re: [Jprogramming] Power convergence within limited iterations

2012-07-20 Thread David Vaughan
; -Oorspronkelijk bericht- >> Van: programming-boun...@forums.jsoftware.com >> [mailto:programming-boun...@forums.jsoftware.com] Namens David Vaughan >> Verzonden: vrijdag 20 juli 2012 17:56 >> Aan: Programming forum >> Onderwerp: [Jprogramming] Power converg

[Jprogramming] Power convergence within limited iterations

2012-07-20 Thread David Vaughan
I am looking a for a combination of v^:_ and v^:n, such that n is the maximum number of iterations, but if convergence occurs sooner than that, it should terminate. This could easily be achieved using a while loop, but I would prefer to be able to write it in the most 'J'-like way. Thanks.