|
From: | Louis de Forcrand |
Subject: | Re: [Bug-apl] A couple of bugs, and a question on the power operator |
Date: | Sun, 14 Aug 2016 01:19:12 -0400 |
About the axis error: I’m pretty sure that what you’re getting isn’t entirely correct. Maybe the ISO standard differs, but what I read is that catenate with fractional axis means that a new axis is created between the two whole axis surrounding it. In addition, if the axis specified is less than one under the index origin or over the higher of the two ranks of its arguments, the result is formed by catenating the arguments along this new axis. In ⎕IO←1, the first axis is #1, so to catenate two matrices to form the planes of a “cube”, one would use ,[.5]. In ⎕IO←0, this would be ,[¯.5]. What I wanted to do is catenate two vectors along a new leading axis so as to form two-row a matrix where each row is one of the original vectors. ,[¯.5] would be the function to use then; ,[.5] would form a new tailing axis, so the argument vectors would be “zipped” together. In other words, if V1 and V2 are vectors, and ⎕IO←1, (V1,[.5]V2)≡⍉V1,[1.5]V2 If the ISO standard differs, then it is in conflict with Dyalog and NARS APL. Louis
|
[Prev in Thread] | Current Thread | [Next in Thread] |