pub fn sobol_2d(
    n_samples_per_pixel_sample: i32,
    n_pixel_samples: i32,
    samples: &mut [Point2f],
    rng: &mut Rng,
) {
    let x: i32 = rng.uniform_uint32() as i32;
    let y: i32 = rng.uniform_uint32() as i32;
    let scramble: Point2i = Point2i { x, y };
    // define 2D Sobol$'$ generator matrices _c_sobol[2]_
    let c_sobol: [[u32; 32]; 2] = [
        [
            0x8000_0000_u32,
            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,
        ],
        [
            0x8000_0000_u32,
            0xc000_0000,
            0xa000_0000,
            0xf000_0000,
            0x8800_0000,
            0xcc00_0000,
            0xaa00_0000,
            0xff00_0000,
            0x8080_0000,
            0xc0c0_0000,
            0xa0a0_0000,
            0xf0f0_0000,
            0x8888_0000,
            0xcccc_0000,
            0xaaaa_0000,
            0xffff_0000,
            0x8000_8000,
            0xc000_c000,
            0xa000_a000,
            0xf000_f000,
            0x8800_8800,
            0xcc00_cc00,
            0xaa00_aa00,
            0xff00_ff00,
            0x8080_8080,
            0xc0c0_c0c0,
            0xa0a0_a0a0,
            0xf0f0_f0f0,
            0x8888_8888,
            0xcccc_cccc,
            0xaaaa_aaaa,
            0xffff_ffff,
        ],
    ];
    gray_code_sample_2d(
        &c_sobol[0],
        &c_sobol[1],
        (n_samples_per_pixel_sample * n_pixel_samples) as u32,
        scramble,
        samples,
    );
    for _i in 0..n_pixel_samples as usize {
        shuffle(samples, n_samples_per_pixel_sample, 1, rng);
    }
    shuffle(samples, n_pixel_samples, n_samples_per_pixel_sample, rng);
}
/// Similar to *van_der_corput()*, but uses two generator matrices to
/// generate the first two dimensions of Sobol' points.
Similar to *van_der_corput()*, but uses two generator matrices to
generate the first two dimensions of Sobol' points.
Similar to * van_der_corput () * but uses two generator matrices to generate the first two dimensions of Sobol ' points .
pub fn sobol_2d(
    n_samples_per_pixel_sample: i32,
    n_pixel_samples: i32,
    samples: &mut [Point2f],
    rng: &mut Rng,
) {
    let x: i32 = rng.uniform_uint32() as i32;
    let y: i32 = rng.uniform_uint32() as i32;
    let scramble: Point2i = Point2i { x, y };
    // define 2D Sobol$'$ generator matrices _c_sobol[2]_
    let c_sobol: [[u32; 32]; 2] = [
        [
            0x8000_0000_u32,
            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,
        ],
        [
            0x8000_0000_u32,
            0xc000_0000,
            0xa000_0000,
            0xf000_0000,
            0x8800_0000,
            0xcc00_0000,
            0xaa00_0000,
            0xff00_0000,
            0x8080_0000,
            0xc0c0_0000,
            0xa0a0_0000,
            0xf0f0_0000,
            0x8888_0000,
            0xcccc_0000,
            0xaaaa_0000,
            0xffff_0000,
            0x8000_8000,
            0xc000_c000,
            0xa000_a000,
            0xf000_f000,
            0x8800_8800,
            0xcc00_cc00,
            0xaa00_aa00,
            0xff00_ff00,
            0x8080_8080,
            0xc0c0_c0c0,
            0xa0a0_a0a0,
            0xf0f0_f0f0,
            0x8888_8888,
            0xcccc_cccc,
            0xaaaa_aaaa,
            0xffff_ffff,
        ],
    ];
    gray_code_sample_2d(
        &c_sobol[0],
        &c_sobol[1],
        (n_samples_per_pixel_sample * n_pixel_samples) as u32,
        scramble,
        samples,
    );
    for _i in 0..n_pixel_samples as usize {
        shuffle(samples, n_samples_per_pixel_sample, 1, rng);
    }
    shuffle(samples, n_pixel_samples, n_samples_per_pixel_sample, rng);
}
pub fn sobol_2d ( n_samples_per_pixel_sample : i32 , n_pixel_samples : i32 , samples : & mut [ Point2f ] , rng : & mut Rng , ) { let x : i32 = rng . uniform_uint32 ( ) as i32 ; let y : i32 = rng . uniform_uint32 ( ) as i32 ; let scramble : Point2i = Point2i { x , y } ; // define 2D Sobol$'$ generator matrices _c_sobol[2]_ let c_sobol : [ [ u32 ; 32 ] ; 2 ] = [ [ 0x8000_0000_u32 , 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 , ] , [ 0x8000_0000_u32 , 0xc000_0000 , 0xa000_0000 , 0xf000_0000 , 0x8800_0000 , 0xcc00_0000 , 0xaa00_0000 , 0xff00_0000 , 0x8080_0000 , 0xc0c0_0000 , 0xa0a0_0000 , 0xf0f0_0000 , 0x8888_0000 , 0xcccc_0000 , 0xaaaa_0000 , 0xffff_0000 , 0x8000_8000 , 0xc000_c000 , 0xa000_a000 , 0xf000_f000 , 0x8800_8800 , 0xcc00_cc00 , 0xaa00_aa00 , 0xff00_ff00 , 0x8080_8080 , 0xc0c0_c0c0 , 0xa0a0_a0a0 , 0xf0f0_f0f0 , 0x8888_8888 , 0xcccc_cccc , 0xaaaa_aaaa , 0xffff_ffff , ] , ] ; gray_code_sample_2d ( & c_sobol [ 0 ] , & c_sobol [ 1 ] , ( n_samples_per_pixel_sample * n_pixel_samples ) as u32 , scramble , samples , ) ; for _i in 0 .. n_pixel_samples as usize { shuffle ( samples , n_samples_per_pixel_sample , 1 , rng ) ; } shuffle ( samples , n_pixel_samples , n_samples_per_pixel_sample , rng ) ; }
Similar to *van_der_corput()*, but uses two generator matrices to
generate the first two dimensions of Sobol' points.
Similar to * van_der_corput () * but uses two generator matrices to generate the first two dimensions of Sobol ' points .
n_samples_per_pixel_sample
i32
n_pixel_samples
i32
samples
&mut [Point2f]
rng
&mut Rng