I noticed that this works in Chapel. I can turn an integer array into a set by casting it to domain(int)
var x: [1..4] int = (4,5,6,6);
var d = x : domain(int);
writeln(x);
> {4,6,5}
This is extremely helpful, but I'm wondering if there are instances when it will fail, like in a distributed context.
Another feature I'm using is the de-duping of a set when cast to a domain.
var y = {11,13,15,15};
writeln(y);
> {15,11, 13}
Is there a more efficient way to do this or is this a preferred method? I was not able to time it since I don't have access to a large enough cluster A.T.M.