pub fn sobol_sample_float(a: i64, dimension: i32, scramble: u32) -> Float {
    assert!(
        dimension < NUM_SOBOL_DIMENSIONS as i32,
        "Integrator has consumed too many Sobol' dimensions; \
         you may want to use a Sampler without a dimension limit like \"02sequence.\""
    );
    let mut a: i64 = a;
    let mut v: u32 = scramble;
    // for (int i = dimension * SobolMatrixSize; a != 0; a >>= 1, i++)
    let mut i: usize = dimension as usize * SOBOL_MATRIX_SIZE as usize;
    while a != 0 {
        if a & 1 > 0 {
            v ^= SOBOL_MATRICES_32[i];
        }
        a >>= 1;
        i += 1_usize;
    }
    //#ifndef PBRT_HAVE_HEX_FP_CONSTANTS
    // let x = (2.0 as f32).powi(-32 as i32); // 0x1p-32f: 1/2^32
    // (v as Float * x).min(FLOAT_ONE_MINUS_EPSILON)
    //#else
    (v as Float * hexf32!("0x1.0p-32") as Float).min(FLOAT_ONE_MINUS_EPSILON)
    //#endif
}
/// Takes a 64 bit index and 32x52 matrices to calculate sample values.
Takes a 64 bit index and 32x52 matrices to calculate sample values.
Takes a 64 bit index and 32x52 matrices to calculate sample values .
pub fn sobol_sample_float(a: i64, dimension: i32, scramble: u32) -> Float {
    assert!(
        dimension < NUM_SOBOL_DIMENSIONS as i32,
        "Integrator has consumed too many Sobol' dimensions; \
         you may want to use a Sampler without a dimension limit like \"02sequence.\""
    );
    let mut a: i64 = a;
    let mut v: u32 = scramble;
    // for (int i = dimension * SobolMatrixSize; a != 0; a >>= 1, i++)
    let mut i: usize = dimension as usize * SOBOL_MATRIX_SIZE as usize;
    while a != 0 {
        if a & 1 > 0 {
            v ^= SOBOL_MATRICES_32[i];
        }
        a >>= 1;
        i += 1_usize;
    }
    //#ifndef PBRT_HAVE_HEX_FP_CONSTANTS
    // let x = (2.0 as f32).powi(-32 as i32); // 0x1p-32f: 1/2^32
    // (v as Float * x).min(FLOAT_ONE_MINUS_EPSILON)
    //#else
    (v as Float * hexf32!("0x1.0p-32") as Float).min(FLOAT_ONE_MINUS_EPSILON)
    //#endif
}
pub fn sobol_sample_float ( a : i64 , dimension : i32 , scramble : u32 ) -> Float { assert ! ( dimension NUM_SOBOL_DIMENSIONS as i32 " \
 \" \" " ) ; let mut a : i64 = a ; let mut v : u32 = scramble ; // for (int i = dimension * SobolMatrixSize; a != 0; a >>= 1, i++) let mut i : usize = dimension as usize * SOBOL_MATRIX_SIZE as usize ; while a != 0 { if a & 1 > 0 { v ^= SOBOL_MATRICES_32 [ i ] ; } a >>= 1 ; i += 1_usize ; } //#ifndef PBRT_HAVE_HEX_FP_CONSTANTS // let x = (2.0 as f32).powi(-32 as i32); // 0x1p-32f: 1/2^32 // (v as Float * x).min(FLOAT_ONE_MINUS_EPSILON) //#else ( v as Float * hexf32 ! ( " " ) as Float ) . min ( FLOAT_ONE_MINUS_EPSILON ) //#endif }
Takes a 64 bit index and 32x52 matrices to calculate sample values.
Takes a 64 bit index and 32x52 matrices to calculate sample values .
a
i64
dimension
i32
scramble
u32