Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
radical_inverse.h File Reference
#include "Math/math.h"
#include <Common/assertion.h>
#include <concepts>
#include <type_traits>
#include <climits>
#include <limits>

Go to the source code of this file.

Namespaces

namespace  ph
 The root for all renderer implementations.
 
namespace  ph::math
 Math functions and utilities.
 
namespace  ph::math::radical_inverse_detail
 

Functions

template<std::integral Value, std::integral Base>
constexpr Value ph::math::radical_inverse_detail::reverse_limit (const Value nextDigit, const Base base)
 The max value x such that x * base + nextDigit will not overflow its type.
 
template<std::floating_point Result, std::integral Base>
constexpr auto ph::math::radical_inverse_detail::num_meaningful_digits (const Base base)
 Number of reversed digits that will have effect on the type Result. Due to the limited precision of floating-point types, only a limited number of digits may have an effect on the final radical inversed value.
 
template<std::floating_point Result, std::unsigned_integral Value>
constexpr Result ph::math::radical_inverse_detail::base_2_scaler ()
 
template<auto BASE, std::floating_point Result, std::integral Value>
Result ph::math::radical_inverse (const Value value)
 Compute radical inverse of a value.
 
template<auto BASE, std::floating_point Result, std::integral Value, typename DigitPermuter >
Result ph::math::radical_inverse_permuted (const Value dimIndex, const Value value, DigitPermuter permuter)
 Same as radical_inverse(), with permutation ability. It is guaranteed that no more than radical_inverse_detail::num_meaningful_digits() digits will be processed during the radical inverse.