-- you have earned Featured Contributor Badge Your exceptional post has been selected for our editorial column Staff Picks http://wolfr.am/StaffPicks and Your Profile is now distinguished by a Featured Contributor Badge and is displayed on the Featured Contributor Board. Thank you!
I am yet to dive in WPP but I want to help you live a For-free life :) hope you don't mind. Those are nothing but side notes.
For
a) Since matr is a sparse binary array you can do:
matr
hyperlist = matr["NonzeroPositions"]
And if it weren't sparse and binary you could use Position[matr, 1]. For sparse non binary: Position[ Normal @ matr, 1]
Position[matr, 1]
Position[ Normal @ matr, 1]
b)
shortestmaxradius = assoc // Map[Length] // Min
c) Dataplot, not exactly shorter but more idiomatic:
Dataplot = assoc[[All, 2 ;; shortestmaxradius]] // Values // MapIndexed[{#2[[2]], #} &, #, {2}] & // Apply[Join] // Prepend[{0, 0}]
Notice those lines lack of assoc length, 10, which was hardcoded.
assoc
10
d) Don't use sym := something unless you know you need :=, = is enough. If something is time intensive and sym is called multiple times this can make a difference.
sym := something
:=
=
something
sym
Again, nothing but side notes. Good luck.
Thank you for the great Input!