If I were to re implement sparse (which I won't) only the leading axes can
be sparse, but the current implementation allows any and all axes to be
sparse.  Arrays which differ only in which axes are sparse, are supposed to
match.

On Tue, Dec 15, 2020 at 10:38 AM David Lambert <b49p23t...@gmail.com> wrote:

> Fine comb reading the (nu)voc sparse pages doesn't indicate.   Is it true
> that only the leading dimensions of an array can be sparse?  For example f
> and g produce different results when the only difference between them is
> the choice of sparse axis.  Thanks, Dave.
>
> f=: 4 : 0
>  i=. #y
>  lc=.(0,.~#\i.i) y} 1$.(x,2);1;0
>  tail=. {: y
>  lu=. tail { lc
>  while. i < x do.
>   tail=. ((0 ~: {:) { (0 , -/)) lu
>   i =. >: i
>   lu=. i , {. tail { lc
>   lc=. lu tail} lc
>  end.
>  tail
> )
>
> g=: 4 : 0
>  i=. #y
>  lc=.(0,.~#\i.i) y} 1$.(x,2);0;0
>  tail=. {: y
>  lu=. tail { lc
>  while. i < x do.
>   tail=. ((0 ~: {:) { (0 , -/)) lu
>   i =. >: i
>   lu=. i , {. tail { lc
>   lc=. lu tail} lc
>  end.
>  tail
> )
>
>
>    10(f,g)1 2 3
> 0 6
>
>    JVERSION
> Engine: j902/j64avx2/windows
> Release-a: commercial/2020-12-05T13:36:01
> Library: 9.02.08
> Platform: Win 64
> Installer: J902 install
> InstallPath: c:/program files/j902
> Contact: www.jsoftware.com
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to