Error-[CNST-SEOF] Constraint solver effort out failure - while generating unique elements of dynamic array
I have below function in one of my sequence, to generate unique elements within an array. The code works fine when array size is small, but when size is large ex[28] then seeing constraint solver error.
function void func_xyz ();
int unsigned array1[];
array1 = new[var_val]; //var_val = 28
void'(std::randomize(array1) with {
foreach (array1[i]) {
foreach(array1[j]) {
if (i != j) array1[j] != array1[i];
}
}
});
endfunction : func_xyz
While running the test, I am seeing error: Error-[CNST-SEOF] Constraint solver effort out failure. The solver has spent too much time in a single rand开发者_如何学编程omize call.
I also tried to use unique inside the function, still seeing same error. Let me know if there is any other way to resolve this Error. Thanks in advance.
精彩评论