I'm trying to avoid MainEvaluate in CompiledFunction. I've tried below but I couldn't get rid of it. I'd appreciate any help!!
Here f1 and f2 will be rank 1 list with real type.
decision[f1_, f2_] := And @@ Thread[LessEqual[f1, f2]] && Or @@ Thread[Less[f1, f2]];
dominates = Compile[{{f1, _Real, 1}, {f2, _Real, 1}},
decision[f1, f2], {{decision[_, _], True | False}},
CompilationOptions ->{"InlineCompiledFunctions" -> True}];
<< CompiledFunctionTools`
CompilePrint[dominates]
decision[]
is not compilable. Try rewriting it usingUnitStep[]
. $\endgroup$f1
less than or equal to the corresponding element off2
and at least one the pairs unequal? $\endgroup$