1. Don't know without further investigations.
*@:(+/ .*) is a good workaround because +/ .*
has been worked on much more extensively
than +./ . *. and is probably faster, works on
larger arguments, and is more robust.
Other inner products u . v fall back on the
general definition u@(v"(1+lv,_)) .
2. The sparse element ("zero") has to be an atom.
In ($.i.4){i.4 2 the zero in the sparse array results
in the vector 0 1, which is not an atom.
----- Original Message -----
From: John Randall <[email protected]>
Date: Sunday, May 8, 2011 6:47
Subject: [Jprogramming] Sparse array question
To: 'Programming forum' <[email protected]>
> I have been running into problems with sparse arrays.
> Since I cannot
> reproduce them except in a large example, I am looking for the
> wisdom of
> the community on a couple of issues.
>
> 1. Boolean matrix multiplication (+./ .*.). This
> seems to work some but
> not all of the time, and then I get a nonce error. I have
> been using
> *@:(+/ .*) as a substitute.
>
> 2. Non-unique sparse elements. I get this error from
> time to time when I
> think I have been doing legitimate sparse array
> operations. I would have
> more of a clue if I knew what it meant. The example in the
> list of error
> messages is
>
> ($.i.4){i.4 2
>
> with explanation "the sparse element of a sparse array must be
> an atom".
> Can anyone relate this to the example? The simplest one of
> this type that
> produces the error is ($.i.2){i.2 2 .
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm