Re: [Jprogramming] Geometric algebra

2019-11-25 Thread Arnab Chakraborty
Thank you all so much for all your excellent suggestions. In fact, Bo's idea was what I started with. But two things (not mentioned in my original mail) prevented me from using that approach. First, my vector space has 32 dimensions, and most of my vectors will be sparse. Second, I have a somewhat

Re: [Jprogramming] Geometric algebra

2019-11-25 Thread Don Kelly
you can also look at the base vectors using complex numbers +. +/ 2.3 0j3.9 3.1 5.4 3.9 Don Kelly On 2019-11-25 1:39 p.m., 'Bo Jacoby' via Programming wrote: Enumerate your base vectors 1 0 and 0 1 etc.    (2.3*1 0)+(3.9*0 1)+(3.1*1 0) 5.4 3.9 Thanks. Bo.Den mandag den 25. novem

Re: [Jprogramming] Geometric algebra

2019-11-25 Thread 'Bo Jacoby' via Programming
Enumerate your base vectors 1 0 and 0 1 etc.    (2.3*1 0)+(3.9*0 1)+(3.1*1 0) 5.4 3.9 Thanks.  Bo.Den mandag den 25. november 2019 19.45.04 CET skrev Raul Miller : Or, slightly more efficient (if that matters):   V1=: |:(2 3 4;2.3),(1 2;3.9),: 2 3 4;3.1   V2=: (~.@{.,:+/&.:>/./)V1

Re: [Jprogramming] Geometric algebra

2019-11-25 Thread Raul Miller
Or, slightly more efficient (if that matters): V1=: |:(2 3 4;2.3),(1 2;3.9),: 2 3 4;3.1 V2=: (~.@{.,:+/&.:>/./)V1 V2-:|:(2 3 4;5.4),: 1 2;3.9 (Caution: email clients have become hostile to copy&paste, and may not represent code accurately.) Thanks, -- Raul On Mon, Nov 25, 2019 at 1:1

Re: [Jprogramming] Geometric algebra

2019-11-25 Thread 'Mike Day' via Programming
You've already got a good reply from Raul,  but I'll offer these variants, having spent a little while looking at the problem. The first one possibly overuses what I think of as each (&.>)  and every (&>)   :     f1 =: (({: every) ((~.@[);~each ((+/)/.)) >@({.every) ) It does the key operation

Re: [Jprogramming] (no subject)

2019-11-25 Thread Raul Miller
Definitely. But, also, it's a fill error in an intermediate result used by the implementation. It's not a fill error in user code. Thanks, -- Raul On Mon, Nov 25, 2019 at 12:00 PM Henry Rich wrote: > > I think it's a fill error as someone (Louis?) noted. > > Henry Rich > > On 11/25/2019 11:1

Re: [Jprogramming] Geometric algebra

2019-11-25 Thread Raul Miller
Your approach is exactly what my f does! That said, there's other ways of phrasing this. Also, for this specific calculation, it would be easier to work with a representation of the form V1=: |:|.@> v1 V2=: |:|.@> v2 Then: V2-:(~.@{.,:+&.>//./)V1 1 It may help to use the dissect utilit

Re: [Jprogramming] Geometric algebra

2019-11-25 Thread Arnab Chakraborty
Thanks, Raul. You are always so prompt with your help! I am yet to decipher your solution, but your suggestion regarding 2 column table is bang on point. My own approach was something like this: find nub of the 2nd column, then for each element in the nub collect all occurences of it, and sum over

Re: [Jprogramming] (no subject)

2019-11-25 Thread Henry Rich
I think it's a fill error as someone (Louis?) noted. Henry Rich On 11/25/2019 11:16 AM, Raul Miller wrote: In n=:6 6$'O' '='((<0; 0 1 2 3),(<1; 2 3),< 2 4 ; 5)}n |domain error that domain error smells like an implementation error. That said, I might be overlooking some relevant part o

Re: [Jprogramming] Geometric algebra

2019-11-25 Thread Raul Miller
Yes, definitely. For example, consider: <"1 ({:"1 (+&.>/@:({."1), (<0 1){])/. ])>v1 Or, f=: 13 :'<"1 ({:"1 (+&.>/@:({."1), (<0 1){])/. ])>y' f v1 That said, this example may fall apart for your general case? (I don't know what that is...) Specifically, I don't know why the top level str

Re: [Jprogramming] (no subject)

2019-11-25 Thread Raul Miller
In n=:6 6$'O' '='((<0; 0 1 2 3),(<1; 2 3),< 2 4 ; 5)}n |domain error that domain error smells like an implementation error. That said, I might be overlooking some relevant part of the dictionary. Thanks, -- Raul On Sat, Nov 23, 2019 at 2:19 PM Jimmy Gauvin wrote: > > Hi, > > is there

[Jprogramming] Geometric algebra

2019-11-25 Thread Arnab Chakraborty
Dear all, I am trying to implement a geometric algebra system in J. I have done much of the stuff, but is getting stuck at one point. Hence this email. Basically, I have a list of boxes like v1=: (<2.3; 2 3 4), (<3.9; 1 2), <3.1; 2 3 4 This represents a (multi)vector whose math representatio

Re: [Jprogramming] Explicit vs tacit with assignment

2019-11-25 Thread Kirk Iverson
Anyone following this thread may be interested in a short discussion between Igor Zhuravlov, Raul Miller, and myself on Raul's user_talk wiki page: https://code.jsoftware.com/wiki/User_talk:Raul_Miller /K > Date: Sun, 24 Nov 2019 15:59:29 -0500 > From: Jose Mario Quintana > To: Programming for

Re: [Jprogramming] Yahoo stock quotes

2019-11-25 Thread 'Mike Day' via Programming
Interesting... I don’t wish to waste Jprogramming bandwidth with non-J issues, but perhaps you won’t mind my just asking whether there’s a similar get-round for current, or at least close of play daily data? I gave up trying to keep my J script using gethttp on yahoo prices working when they