External Issue: Make Random.choice() method support multi-dimensional array

17136, “prashanth018”, “Make Random.choice() method support multi-dimensional array”, “2021-02-09T19:45:45Z”

Summary of Problem

Have been going through random module and observed that the choice() method only supports 1-D array. I will update the feature specific details soon, but on a bigger picture the changes to _choiceUniform() look straight forward while changes to _choiceProbabilities() will need some tweaking.

Steps to Reproduce

Source Code:

use Random;
const vec = 1..7 by 2;
const vec1 = 2..8 by 3;
var D = {vec,vec1};
var A:[D] int;
A = 3;

var r = new owned PCGRandomStream(int);
writeln(r.choice(A));

Compile command:
chpl foo.chpl

Output:
Throws an error: says choice supports only 1-D array.