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

Reply via email to