I would like to create a subset of the domain based on the conditional. I could do a loop, but I'm looking to see if I can use the built-in if.
Just re-creating the array d
looks like
var d = {1..8};
var e = [0.875, 0.625, 0.625, 1.0, 0.625, 0.875, 0.625, 0.625];
var p = 0.7;
var vs = for i in d do i;
writeln(" vs: ", vs);
However, I want to extract d
where e[d] < p
in vs
. Is there such an approach?
vs = [i in d where e[i] < p]
writeln(vs);
source
share