mitsuba-af602c6fd98a/src/samplers/halton.cpp
/// Inverse integer version of the scrambled radical inverse function
Inverse integer version of the scrambled radical inverse function
Inverse integer version of the scrambled radical inverse function
uint64_t inverseScrambledRadicalInverse(int base, uint64_t inverse, uint64_t digits, uint16_t *invPerm) {
		uint64_t index = 0;
		while (digits) {
			uint64_t digit = inverse % base;
			if (invPerm)
				digit = (uint64_t ) invPerm[digit];
			inverse /= base;
			index = index * base + digit;
			--digits;
		}
		return index;
	}
uint64_t inverseScrambledRadicalInverse ( int base , uint64_t inverse , uint64_t digits , uint16_t * invPerm ) { uint64_t index = 0 ; while ( digits ) { uint64_t digit = inverse % base ; if ( invPerm ) digit = ( uint64_t ) invPerm [ digit ] ; inverse /= base ; index = index * base + digit ; -- digits ; } return index ; }
Inverse integer version of the scrambled radical inverse function
Inverse integer version of the scrambled radical inverse function