2 other brilliant 0s in J are:
1 : 'u' and ]
The first is not widely used, but through name assignment can be used either as
a simple annotation (for documentation or preprocessing) or as a build
qualifier by redefining a global name to either do nothing in production mode,
but something (usu
Or, more concisely,
A =: >:@[ %@:+ + -:@:* >:@:+
is considerably faster than
A =: >:@[ %@+ + -:@* >:@+
in this context.
Thanks,
--
Raul
On Sun, Feb 15, 2015 at 5:46 PM, Tikkanz wrote:
> I suspect that a significant reason for the speed increase is that the verb
> ranks of * and + are 0.
>
Cap, I served with zero. I knew zero. zero was a friend of mine. Cap,
you're no zero.
Just kidding :)
On Sun, Feb 15, 2015 at 5:56 PM, Kip Murray wrote:
> I regard cap as a brilliant invention, analagous to the invention of zero.
> "Does nothing" cap is analagous to "Adds nothing" zero. It
I regard cap as a brilliant invention, analagous to the invention of zero.
"Does nothing" cap is analagous to "Adds nothing" zero. It may help you
to read cap in trains as "the ... of ...", eg
[: %: [: +/ *:
is the square root of the sum of squares.
--Kip Murray
On Sunday, February 15, 2015,
I suspect that a significant reason for the speed increase is that the verb
ranks of * and + are 0.
* b. 0
+ b. 0
This means that %@+ for example will calculate % for each item of the right
argument, whereas if you use %@:+ then % will wait until all the items have
been processed and then calculat
Hello!
To see how J compares to other languages out there, I tried to implement
the spectral-norm [1] language benchmark in J. Part of my code [2] for
this looks like this:
NB. entry at x,y of infinite matrix A
A =: >:@:[ %@:+ -:@:(* >:)@:+
NB. get the first y by y elements of A
I enjoy decapitating capped forks in a flash using one of my favorite
wicked adverbs (decap),
( NoProblem=. see f.decap )
i.@:[ +/ i.@:(#~)
3 NoProblem 2
0 1 2
3 4 5
6 7 8
1 2 3
4 5 6
7 8 9
2 3 4
5 6 7
8 9 10
Decap replaces the form ([: u v) by (u@:v). If for whatever reason one