Re: [Bug-apl] inner product -.= bug

2018-04-21 Thread Juergen Sauermann
Hi David, thanks, fixed in SVN 1046. /// Jürgen On 04/20/2018 10:16 PM, David Tran wrote: Hi,   a ← 2 3 5 6   b ← 4 5 5 6   a -.= b ¯2

[Bug-apl] inner product -.= bug

2018-04-20 Thread David Tran
Hi, a ← 2 3 5 6 b ← 4 5 5 6 a -.= b ¯2 ⍝ bug? the value should be zero -/a=b 0 Version info: ~ $ apl --version BUILDTAG: - Project:GNU APL Version / SVN: 1.7 / Unversioned directory Build Date: 2017-10-05 09:52:49 UTC Build OS:

Re: [Bug-apl] inner product

2017-03-17 Thread Nick Lobachevsky
Thank you. Forgot to mention scalar extension. When a scalar is supplied as an argument, it's lengthened to match the inner dimension of the other argument. (3 4⍴'cattrattfatt') +.= 't' 2 2 2 (3 4⍴'cattrattfatt') +.= '' 2 2 2 'a' +.= 3 4⍴'catratfatbat' 1 1 1 1 'aaa' +.

Re: [Bug-apl] inner product

2017-03-17 Thread enztec
very nice work - thanks you for spending the time .. everthing here holds when replacing +.x with +.= (which is of more interest to me) On Fri, 17 Mar 2017 22:01:26 +0100 Nick Lobachevsky wrote: > The key to understanding inner product is that the inner dimensions of > the arguments have t

Re: [Bug-apl] inner product

2017-03-17 Thread Nick Lobachevsky
The key to understanding inner product is that the inner dimensions of the arguments have to be the same. The inner dimension here is 3. a←2 3⍴⍳6 b←3 4⍴⍳12 a 0 1 2 3 4 5 b 0 1 2 3 4 5 6 7 8 9 10 11 a+.×b 20 23 26 29 56 68 80 92 To solve this, first transpose th

Re: [Bug-apl] inner product

2017-03-17 Thread enztec
Hi I assume you mean the vectors both have same length as their single dimension (no first or last - the same) making them into 1 4⍴ arrays then requires the ⍉ use don't you treat vectors differntly in the gnuapl code from 'true arrays' with 2 (or more dimensions)? On Fri, 17 Mar 2017 18:1

Re: [Bug-apl] inner product

2017-03-17 Thread Juergen Sauermann
Hi, that would be more like an outer product:   a←b←5 3⍴⍳8   ⍴a∘.=b 5 3 5 3 The inner product reduces away the two middle axes of the outer product. In the ⍉b case you have   ⍴a∘.=⍉b 5 3 3 5

Re: [Bug-apl] inner product

2017-03-17 Thread Juergen Sauermann
Hi, yes. Because the first dimension of a is 4 and the last dimension of b is also 4. /// Jürgen On 03/17/2017 06:05 PM, enz...@gmx.com wrote: yes last dimension of a must be = to first dimension of b but then x←1 2

Re: [Bug-apl] inner product

2017-03-17 Thread enztec
thanks i have no clue how the result of a+.=⍉b as 5x5 result is obtained from a 5x3 array and 3x5 array shouldn't it be a 15x15 result ... but i guess i really just want to use +/a=b :) On Fri, 17 Mar 2017 12:26:42 -0400 Christian Robert wrote: >a+.=⍉b > 3 0 0 0 0 > 0 3 0 0 0

Re: [Bug-apl] inner product

2017-03-17 Thread enztec
yes last dimension of a must be = to first dimension of b but then x←1 2 3 4 y←1 3 3 3 x+.=y works On Fri, 17 Mar 2017 17:29:24 +0100 Juergen Sauermann wrote: > Hi, > > the number of columns in a must match the number of rows in b (or the other > way around, > I don't quite remember).

Re: [Bug-apl] inner product

2017-03-17 Thread Juergen Sauermann
Hi, the number of columns in a must match the number of rows in b (or the other way around, I don't quite remember). Try:   a+.=⍉b 3 0 0 0 0 0 3 0 0 0 0 0 3 0 0 0 0 0 3 0 0 0 0 0 3 /// Jürgen

Re: [Bug-apl] inner product

2017-03-17 Thread Christian Robert
a+.=⍉b 3 0 0 0 0 0 3 0 0 0 0 0 3 0 0 0 0 0 3 0 0 0 0 0 3 On 2017-03-17 12:17, enz...@gmx.com wrote: Hi what am i missing here? a←b←5 3⍴⍳8 a=b +/a=b a+.=b length error

[Bug-apl] inner product

2017-03-17 Thread enztec
Hi what am i missing here? a←b←5 3⍴⍳8 a=b +/a=b a+.=b length error

Re: [Bug-apl] inner product with dfn

2016-07-06 Thread Juergen Sauermann
Hi Xiao-Yong, thanks, fixed in SVN 771. /// Jürgen On 07/05/2016 10:12 PM, Xiao-Yong Jin wrote: Hi, here goes another micro error. 2 3+.{⍺×⍵}2 3 LENGTH ERROR μ-Z__A_LO_INNER_RO_B[5] (μ-IA μ-IB)←⊃μ-I[μ-N]

[Bug-apl] inner product with dfn

2016-07-05 Thread Xiao-Yong Jin
Hi, here goes another micro error. 2 3+.{⍺×⍵}2 3 LENGTH ERROR μ-Z__A_LO_INNER_RO_B[5] (μ-IA μ-IB)←⊃μ-I[μ-N] ^ ^ )reset 2 3{⍺+⍵}.{⍺×⍵}2 3 LENGTH ERROR μ-Z__A_LO_INNER_RO_B[5] (μ-IA μ-IB)←⊃μ-I[μ-N] ^ ^ )r

[Bug-apl] inner product

2016-05-25 Thread enztec
Al this gossip about outer product - I think inner product needs some exposure X ← 1 3 5 7 Y ← 2 3 6 7 X +.= Y 2

Re: [Bug-apl] inner product behaviour?

2015-08-16 Thread Juergen Sauermann
Hi, the standard says: If the last-item in the shape-list of A1 is not the same as the first-item in the shape-list of B1, signal length-error. Scalar A or B are turned into vectors, but vectors are not turned into matrices.

[Bug-apl] inner product behaviour?

2015-08-15 Thread alexweiner
Hi Bug APL,Does the inner product coerce a vector to a matrix only when (⍴right arg vector)≤ left arg number of columns (when it is a matrix)?      rotatemat←{2 2 ⍴ (2○⍵)(-1○⍵)(1○⍵)(2○⍵)}      rm←rotatmat 3VALUE ERROR      rm←rotatmat 3         ^      rm←rotatemat 3      rm¯0.9899924966 ¯0.14112000