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 complicated multiplication rule for the basis vectors which requires manipulation of the indices (basically taking symmetric difference of the two index sets).
On Tue, 26 Nov 2019, 10:20 Don Kelly, <[email protected]> wrote: > 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. november 2019 19.45.04 CET skrev Raul Miller < > [email protected]>: > > > > 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, > > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
