Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
math.h File Reference

Go to the source code of this file.

Namespaces

 math
 

Macros

#define __MITSUBA_CORE_MATH_H_
 

Functions

MTS_EXPORT_CORE Float math::erf (Float x)
 Cross-platform implementation of the error function. More...
 
MTS_EXPORT_CORE Float math::erfinv (Float x)
 Cross-platform implementation of the inverse error function. More...
 
MTS_EXPORT_CORE float math::hypot2 (float a, float b)
 sqrt(a^2 + b^2) without range issues (like 'hypot' on compilers that support C99, single precision) More...
 
MTS_EXPORT_CORE double math::hypot2 (double a, double b)
 sqrt(a^2 + b^2) without range issues (like 'hypot' on compilers that support C99, double precision) More...
 
MTS_EXPORT_CORE float math::log2 (float value)
 Base-2 logarithm (single precision) More...
 
MTS_EXPORT_CORE double math::log2 (double value)
 Base-2 logarithm (double precision) More...
 
template<typename Scalar >
Scalar math::clamp (Scalar value, Scalar min, Scalar max)
 Generic clamping function. More...
 
template<typename Scalar >
Scalar math::lerp (Scalar t, Scalar v1, Scalar v2)
 Linearly interpolate between two values. More...
 
template<typename Scalar >
Scalar math::smoothStep (Scalar min, Scalar max, Scalar value)
 S-shaped smoothly varying interpolation between two values. More...
 
int32_t math::modulo (int32_t a, int32_t b)
 Always-positive modulo function (assumes b > 0) More...
 
int64_t math::modulo (int64_t a, int64_t b)
 Always-positive modulo function (assumes b > 0) More...
 
float math::modulo (float a, float b)
 Always-positive modulo function, single precision version (assumes b > 0) More...
 
double math::modulo (double a, double b)
 Always-positive modulo function, double precision version (assumes b > 0) More...
 
template<typename Scalar >
int math::floorToInt (Scalar value)
 Integer floor function (single precision) More...
 
template<typename Scalar >
int math::ceilToInt (Scalar value)
 Integer ceil function (single precision) More...
 
int math::roundToInt (float value)
 Integer round function (single precision) More...
 
int math::roundToInt (double value)
 Integer round function (double precision) More...
 
MTS_EXPORT_CORE int math::log2i (uint32_t value)
 Base-2 logarithm (32-bit integer version) More...
 
MTS_EXPORT_CORE int math::log2i (uint64_t value)
 Base-2 logarithm (64-bit integer version) More...
 
bool math::isPowerOfTwo (uint32_t i)
 Check if an integer is a power of two (unsigned 32 bit version) More...
 
bool math::isPowerOfTwo (int32_t i)
 Check if an integer is a power of two (signed 32 bit version) More...
 
bool math::isPowerOfTwo (uint64_t i)
 Check if an integer is a power of two (64 bit version) More...
 
bool math::isPowerOfTwo (int64_t i)
 Check if an integer is a power of two (signed 64 bit version) More...
 
MTS_EXPORT_CORE uint32_t math::roundToPowerOfTwo (uint32_t i)
 Round an integer to the next power of two. More...
 
MTS_EXPORT_CORE uint64_t math::roundToPowerOfTwo (uint64_t i)
 Round an integer to the next power of two (64 bit version) More...
 
float math::fastexp (float value)
 
double math::fastexp (double value)
 
float math::fastlog (float value)
 
double math::fastlog (double value)
 
void math::sincos (float theta, float *_sin, float *_cos)
 
void math::sincos (double theta, double *_sin, double *_cos)
 
float math::safe_asin (float value)
 Arcsine variant that gracefully handles arguments > 1 that are due to roundoff errors. More...
 
double math::safe_asin (double value)
 Arcsine variant that gracefully handles arguments > 1 that are due to roundoff errors. More...
 
float math::safe_acos (float value)
 Arccosine variant that gracefully handles arguments > 1 that are due to roundoff errors. More...
 
double math::safe_acos (double value)
 Arccosine variant that gracefully handles arguments > 1 that are due to roundoff errors. More...
 
float math::safe_sqrt (float value)
 Square root variant that gracefully handles arguments < 0 that are due to roundoff errors. More...
 
double math::safe_sqrt (double value)
 Square root variant that gracefully handles arguments < 0 that are due to roundoff errors. More...
 
Float math::signum (Float value)
 Simple signum function – note that it returns the FP sign of the input (and never zero) More...
 
float math::castflt_up (float val)
 Cast to single precision and round up if not exactly representable (passthrough) More...
 
float math::castflt_up (double val)
 Cast to single precision and round up if not exactly representable. More...
 
float math::castflt_down (float val)
 Cast to single precision and round down if not exactly representable (passthrough) More...
 
float math::castflt_down (double val)
 Cast to single precision and round down if not exactly representable. More...
 

Macro Definition Documentation

#define __MITSUBA_CORE_MATH_H_