I am trying to initialize a non-square matrix (i.e. a nested array) using Enoki's RNG. When I run the following code, I notice that the values are repeated across the array.
using FloatP = enoki::Packet<enoki::Array<float, 3>, 2>;
using RNG_2x3 = enoki::PCG32<FloatP>;
RNG_2x3 my_rng;
FloatP value = my_rng.next_float32();
std::cout << "RNG VALUE:\n" << value << std::endl;
So it appears that the RNG is only working on the outer dimension and is copying values to the other dimensions. Is there a way to use a single RNG to initialize random values for each element of a nested loop? Of course it is possible to do this with an explicit for loop, but I was curious if there is a way in the API to do this in one call.
I am trying to initialize a non-square matrix (i.e. a nested array) using Enoki's RNG. When I run the following code, I notice that the values are repeated across the array.
This gives the output:
So it appears that the RNG is only working on the outer dimension and is copying values to the other dimensions. Is there a way to use a single RNG to initialize random values for each element of a nested loop? Of course it is possible to do this with an explicit for loop, but I was curious if there is a way in the API to do this in one call.