You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: