On 5/14/2020 3:37 AM, Henry Rich wrote:
> It's failing inside vvv, probably something related to the _. used when
> the assert. fails.  Please narrow it down to the simplest failure inside
> vvv.

I see a hang occurring before a call to 'vvv' : the second 'try.' within 
'testptsvE' calls 'dptsv', which
calls 'assert.' and that hangs. 'dptsv' monad gets two linked complex vectors, 
there is no NaN there.

Below is the simplest version of script without any external dependencies. Any 
further reduction returns
the correct behavior. Even if this is done below the problem line e.g. in 
'berr=. ...' within the fourth 'try.'.

NB. === start of script ~user/temp/hang.ijs ===
negneg=: -@]^:(0>[)

dhs2liso=: 1&$: :({.@] + (negneg~ {.) * i.@(negneg/)@])

diagliso=: 0 0 _&$: :(4 : 0)
  'd h s'=. x=. ((i. 3) < (# x))} 0 0 _ ,: x
  'm n'=. y=. 2 $ y
  H=. n (-@*^:(0 > ])) d
  S=. 0 >. <./ y , <. -: (n + m - | n - m + +: d)
  (h ,: s <. S) ];.0 (>: n) dhs2liso H , S
)

diag=: ((<0 1)&|:) :((diagliso $) ({,) ])

setdiag=: 4 : 0
  'e dhs'=. x
  dhs=. ((i. 3) < (# dhs))} 0 0 _ ,: dhs
  liso=. dhs diagliso $ y
  e (liso"_)} y
)

idmat=: a:&$: :((1;[) setdiag (0 $~ 2 $ ]))

dptsv=: 3 : 0
echo '0'
  'd e'=. y
echo '1'
  assert. 0  NB. hangs here
echo '2'
  d ; e
)

testptsvE=: 3 : 0
  try. argy=. ((diag ; _1&diag)@(0&{::)) y catch. argy=. _. end.
  try. 't s'=. timespacex 'ret=. dptsv argy' catch. t=. s=. ret=. _. end.
  try. out=. vgeto ret catch. out=. _. end.
  try. berr=. y (1: ((setdiag~ ;&_1)~ idmat@#)&>/@}:) out catch. berr=. _. end.
  EMPTY
)
NB. === end of script ===

# start of session log
user2@host2:~/j901> ./jconsole.sh
   load '~user/temp/hang.ijs'
   testptsvE (j./ 2 5 5 ?@$ 0) ; (j./ 2 5 3 ?@$ 0)
0
1
# hangs here, process was killed manually
# end of session log

-- 
Regards
Igor



----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to