I want to compile this function:
fun = With[{a = Range[-300, -200]},
Compile[{{t, _Integer}, {window, _Integer, 2}},
Pick[a + t, #, 1] & /@ window,
CompilationTarget -> "C", RuntimeOptions -> "Speed"]];
but
CompilePrint[fun]
returns MainEvaluate at Pick. Is there a workaround and is Pick not compilable in C?
edit: window is a sparse array and fun is actually a more complicated function that contains Pick.
Pickwith packed arrays is already extremely fast, especially when the filtering function is optimized for packed arrrays, likeUnitize,UnitStepetc. Compiling it would not give much boost. – Marius Ladegård Meyer Feb 01 '19 at 14:18Compile. – Henrik Schumacher Feb 01 '19 at 15:10