Hi Elias, the ISO standard (taking the monadic case for simplicity) says: Z ← f ⍣ y B ... If y is a scalar, set y1 to ,y. Otherwise set y1 to y. If y1 is not a vector, signal domain-error. If y1 has more than three elements, signal length-error. If any element of y1 is not a near-integer, signal domain-error. Set y2 to ⌽3⍴⌽y1. Set y3 to the first-item in y2. Set y4 to the integer-nearest-to y3. If y4 exceeds the rank of B, set y5 to the rank of B, otherwise set y5 to y4. If y5 is negative, set y6 to 0⌈(y5 plus the rank of B), otherwise set y6 to y5. // () added by jsa Apply f to the rank-y6 cells of B. For y←¯1 that gives: y1 = ¯1 y2 - ¯1 ¯1 ¯1 y3 = ¯1 y4 = ¯1 y5 = ¯1 y6 = ¯1 + ⍴⍴B = ¯1 + 2 = +1 For y←+1 it gives: y1 = 1 y2 - 1 1 1 y3 = 1 y4 = 1 y5 = 1 y6 = +1 Both cases give the same y6 (and hence the same results) are the same. In Dyalog terms: for y←1 you take the rank-1-cells and for j←¯1 you take the rank-(2+¯1)-cells which are also the rank-1-cells when the rank of B is 2. The dyadic case is similar except that the computation above is performed independently for A and B. /// Jürgen On 05/06/2016 03:32 PM, Elias Mårtenson
wrote:
|
- Re: [Bug-apl] Supporting negative ranks for ⍤ operato... Jay Foad
- Re: [Bug-apl] Supporting negative ranks for ⍤ op... Elias Mårtenson
- Re: [Bug-apl] Supporting negative ranks for ⍤ op... Jay Foad
- Re: [Bug-apl] Supporting negative ranks for ... Louis de Forcrand
- Re: [Bug-apl] Supporting negative ranks ... Louis de Forcrand
- Re: [Bug-apl] Supporting negative ra... Juergen Sauermann
- Re: [Bug-apl] Supporting negati... Alexey Veretennikov
- Re: [Bug-apl] Supporting negative ranks for ⍤ operato... Juergen Sauermann
- Re: [Bug-apl] Supporting negative ranks for ⍤ op... Jay Foad
- Re: [Bug-apl] Supporting negative ranks for ... Elias Mårtenson
- Re: [Bug-apl] Supporting negative ranks ... Juergen Sauermann
- Re: [Bug-apl] Supporting negative ranks ... Alexey Veretennikov
- Re: [Bug-apl] Supporting negative ra... Louis de Forcrand