pub fn van_der_corput(
    n_samples_per_pixel_sample: i32,
    n_pixel_samples: i32,
    samples: &mut [Float],
    rng: &mut Rng,
) {
    let scramble: u32 = rng.uniform_uint32();
    let c_van_der_corput: [u32; 32] = [
        0x8000_0000,
        0x4000_0000,
        0x2000_0000,
        0x1000_0000,
        0x0800_0000,
        0x0400_0000,
        0x0200_0000,
        0x0100_0000,
        0x0080_0000,
        0x0040_0000,
        0x0020_0000,
        0x0010_0000,
        0x80000,
        0x40000,
        0x20000,
        0x10000,
        0x8000,
        0x4000,
        0x2000,
        0x1000,
        0x800,
        0x400,
        0x200,
        0x100,
        0x80,
        0x40,
        0x20,
        0x10,
        0x8,
        0x4,
        0x2,
        0x1,
    ];
    let total_samples: i32 = n_samples_per_pixel_sample * n_pixel_samples;
    gray_code_sample_1d(c_van_der_corput, total_samples as u32, scramble, samples);
    // randomly shuffle 1D sample points
    for i in 0..n_pixel_samples as usize {
        shuffle(
            &mut samples[(i * n_samples_per_pixel_sample as usize)..],
            n_samples_per_pixel_sample,
            1,
            rng,
        );
    }
    shuffle(
        &mut samples[..],
        n_pixel_samples,
        n_samples_per_pixel_sample,
        rng,
    );
}
/// Generates a number of scrambled 1D sample values using the Gray
/// code-based sampling machinery.
Generates a number of scrambled 1D sample values using the Gray
code-based sampling machinery.
Generates a number of scrambled 1D sample values using the Gray code - based sampling machinery .
pub fn van_der_corput(
    n_samples_per_pixel_sample: i32,
    n_pixel_samples: i32,
    samples: &mut [Float],
    rng: &mut Rng,
) {
    let scramble: u32 = rng.uniform_uint32();
    let c_van_der_corput: [u32; 32] = [
        0x8000_0000,
        0x4000_0000,
        0x2000_0000,
        0x1000_0000,
        0x0800_0000,
        0x0400_0000,
        0x0200_0000,
        0x0100_0000,
        0x0080_0000,
        0x0040_0000,
        0x0020_0000,
        0x0010_0000,
        0x80000,
        0x40000,
        0x20000,
        0x10000,
        0x8000,
        0x4000,
        0x2000,
        0x1000,
        0x800,
        0x400,
        0x200,
        0x100,
        0x80,
        0x40,
        0x20,
        0x10,
        0x8,
        0x4,
        0x2,
        0x1,
    ];
    let total_samples: i32 = n_samples_per_pixel_sample * n_pixel_samples;
    gray_code_sample_1d(c_van_der_corput, total_samples as u32, scramble, samples);
    // randomly shuffle 1D sample points
    for i in 0..n_pixel_samples as usize {
        shuffle(
            &mut samples[(i * n_samples_per_pixel_sample as usize)..],
            n_samples_per_pixel_sample,
            1,
            rng,
        );
    }
    shuffle(
        &mut samples[..],
        n_pixel_samples,
        n_samples_per_pixel_sample,
        rng,
    );
}
pub fn van_der_corput ( n_samples_per_pixel_sample : i32 , n_pixel_samples : i32 , samples : & mut [ Float ] , rng : & mut Rng , ) { let scramble : u32 = rng . uniform_uint32 ( ) ; let c_van_der_corput : [ u32 ; 32 ] = [ 0x8000_0000 , 0x4000_0000 , 0x2000_0000 , 0x1000_0000 , 0x0800_0000 , 0x0400_0000 , 0x0200_0000 , 0x0100_0000 , 0x0080_0000 , 0x0040_0000 , 0x0020_0000 , 0x0010_0000 , 0x80000 , 0x40000 , 0x20000 , 0x10000 , 0x8000 , 0x4000 , 0x2000 , 0x1000 , 0x800 , 0x400 , 0x200 , 0x100 , 0x80 , 0x40 , 0x20 , 0x10 , 0x8 , 0x4 , 0x2 , 0x1 , ] ; let total_samples : i32 = n_samples_per_pixel_sample * n_pixel_samples ; gray_code_sample_1d ( c_van_der_corput , total_samples as u32 , scramble , samples ) ; // randomly shuffle 1D sample points for i in 0 .. n_pixel_samples as usize { shuffle ( & mut samples [ ( i * n_samples_per_pixel_sample as usize ) .. ] , n_samples_per_pixel_sample , 1 , rng , ) ; } shuffle ( & mut samples [ .. ] , n_pixel_samples , n_samples_per_pixel_sample , rng , ) ; }
Generates a number of scrambled 1D sample values using the Gray
code-based sampling machinery.
Generates a number of scrambled 1D sample values using the Gray code - based sampling machinery .
n_samples_per_pixel_sample
i32
n_pixel_samples
i32
samples
&mut [Float]
rng
&mut Rng