Math API nvidia_logo_transpbg.gif Up
mi::math Namespace Reference

Namespace for the Math API. More...

Namespaces

namespace  functor
 Namespace for basic math functors in the Math API.
 
namespace  general
 Namespace for generic functions in the Math API.
 

Classes

class  Bbox
 Axis-aligned N-dimensional bounding box class template of fixed dimension. More...
 
struct  Bbox_struct
 Storage class for an axis-aligned N-dimensional bounding box class template of fixed dimension. More...
 
class  Color
 Standard RGBA color class with floating point elements and operations. More...
 
struct  Color_struct
 Generic storage class template for an RGBA color representation storing four floating points elements. More...
 
class  Matrix
 NxM-dimensional matrix class template of fixed dimensions. More...
 
struct  Matrix_struct
 Storage class for a NxM-dimensional matrix class template of fixed dimensions. More...
 
struct  Matrix_struct<T, 1, 1>
 Specialization for 1x1-matrix. More...
 
struct  Matrix_struct<T, 1, 2>
 Specialization for 1x2-matrix. More...
 
struct  Matrix_struct<T, 1, 3>
 Specialization for 1x3-matrix. More...
 
struct  Matrix_struct<T, 1, 4>
 Specialization for 1x4-matrix. More...
 
struct  Matrix_struct<T, 2, 1>
 Specialization for 2x1-matrix. More...
 
struct  Matrix_struct<T, 2, 2>
 Specialization for 2x2-matrix. More...
 
struct  Matrix_struct<T, 2, 3>
 Specialization for 2x3-matrix. More...
 
struct  Matrix_struct<T, 2, 4>
 Specialization for 2x4-matrix. More...
 
struct  Matrix_struct<T, 3, 1>
 Specialization for 3x1-matrix. More...
 
struct  Matrix_struct<T, 3, 2>
 Specialization for 3x2-matrix. More...
 
struct  Matrix_struct<T, 3, 3>
 Specialization for 3x3-matrix. More...
 
struct  Matrix_struct<T, 3, 4>
 Specialization for 3x4-matrix. More...
 
struct  Matrix_struct<T, 4, 1>
 Specialization for 4x1-matrix. More...
 
struct  Matrix_struct<T, 4, 2>
 Specialization for 4x2-matrix. More...
 
struct  Matrix_struct<T, 4, 3>
 Specialization for 4x3-matrix. More...
 
struct  Matrix_struct<T, 4, 4>
 Specialization for 4x4-matrix. More...
 
class  Spectrum
 Spectrum with floating point elements and operations. More...
 
struct  Spectrum_struct
 Generic storage class template for a Spectrum representation storing three floating point elements. More...
 
class  Vector
 Fixed-size math vector class template with generic operations. More...
 
struct  Vector_struct
 Generic storage class template for math vector representations storing DIM elements of type T. More...
 
struct  Vector_struct<T, 1>
 Specialization for dimension 1 to create x member. More...
 
struct  Vector_struct<T, 2>
 Specialization for dimension 2 to create x and y member. More...
 
struct  Vector_struct<T, 3>
 Specialization for dimension 3 to create x, y, and z members. More...
 
struct  Vector_struct<T, 4>
 Specialization for dimension 4 to create x, y, z, and w members. More...
 

Enumerations

enum  Clip_mode {
  CLIP_RGB ,
  CLIP_ALPHA ,
  CLIP_RAW
}
 Supported clipping modes. More...
 
enum  From_iterator_tag { FROM_ITERATOR }
 Enum used for initializing a vector from an iterator. More...
 

Functions

template<typename T , Size DIM>
Bbox<T, DIM> operator+ (const Bbox<T, DIM> &bbox, T value)
 Returns a bounding box that is the bbox increased by a constant value at each face, i.e., value is added to bbox.max and subtracted from bbox.min. More...
 
template<typename T , Size DIM>
Bbox<T, DIM> operator- (const Bbox<T, DIM> &bbox, T value)
 Returns a bounding box that is the bbox shrunk by a constant value at each face, i.e., value is subtracted from bbox.max and added to bbox.min. More...
 
template<typename T , Size DIM>
Bbox<T, DIM> operator* (const Bbox<T, DIM> &bbox, T factor)
 Returns a bounding box that is a version of bbox scaled by factor, i.e., bbox.max and bbox.min are multiplied by factor. More...
 
template<typename T , Size DIM>
Bbox<T, DIM> operator/ (const Bbox<T, DIM> &bbox, T divisor)
 Returns a bounding box that is a version of bbox divided by divisor, i.e., bbox.max and bbox.min are divided by divisor. More...
 
template<typename T , Size DIM>
Bbox<T, DIM> & operator+= (Bbox<T, DIM> &bbox, T value)
 Increases bbox by a constant value at each face, i.e., value is added to bbox.max and subtracted from bbox.min. More...
 
template<typename T , Size DIM>
Bbox<T, DIM> & operator-= (Bbox<T, DIM> &bbox, T value)
 Shrinks bbox by a constant value at each face, i.e., value is subtracted from bbox.max and added to bbox.min. More...
 
template<typename T , Size DIM>
Bbox<T, DIM> & operator*= (Bbox<T, DIM> &bbox, T factor)
 Scales bbox by factor, i.e., bbox.max and bbox.min are multiplied by factor. More...
 
template<typename T , Size DIM>
Bbox<T, DIM> & operator/= (Bbox<T, DIM> &bbox, T divisor)
 Divide bbox by divisor, i.e., bbox.max and bbox.min are divided by divisor. More...
 
template<typename T , Size DIM>
bool operator== (const Bbox<T, DIM> &lhs, const Bbox<T, DIM> &rhs)
 Returns true if lhs is elementwise equal to rhs. More...
 
template<typename T , Size DIM>
bool operator!= (const Bbox<T, DIM> &lhs, const Bbox<T, DIM> &rhs)
 Returns true if lhs is elementwise not equal to rhs. More...
 
template<typename T , Size DIM>
bool operator< (const Bbox<T, DIM> &lhs, const Bbox<T, DIM> &rhs)
 Returns true if lhs is lexicographically less than rhs. More...
 
template<typename T , Size DIM>
bool operator<= (const Bbox<T, DIM> &lhs, const Bbox<T, DIM> &rhs)
 Returns true if lhs is lexicographically less than or equal to rhs. More...
 
template<typename T , Size DIM>
bool operator> (const Bbox<T, DIM> &lhs, const Bbox<T, DIM> &rhs)
 Returns true if lhs is lexicographically greater than rhs. More...
 
template<typename T , Size DIM>
bool operator>= (const Bbox<T, DIM> &lhs, const Bbox<T, DIM> &rhs)
 Returns true if lhs is lexicographically greater than or equal to rhs. More...
 
template<typename T , Size DIM>
Bbox<T, DIM> lerp (const Bbox<T, DIM> &bbox1, const Bbox<T, DIM> &bbox2, T t)
 Returns the linear interpolation between bbox1 and bbox2, i.e., it returns (1-t) * bbox1 + t * bbox2. More...
 
template<typename T , Size DIM>
Bbox<T, DIM> clip (const Bbox<T, DIM> &bbox1, const Bbox<T, DIM> &bbox2)
 Clip bbox1 at bbox2 and return the result. More...
 
template<typename TT , typename T>
Bbox<T, 3> transform_point (const Matrix<TT, 4, 4> &mat, const Bbox<T, 3> &bbox)
 Returns the 3D bounding box transformed by a matrix. More...
 
template<typename TT , typename T>
Bbox<T, 3> transform_vector (const Matrix<TT, 4, 4> &mat, const Bbox<T, 3> &bbox)
 Returns the 3D bounding box transformed by a matrix. More...
 
bool operator== (const Color &lhs, const Color &rhs)
 Returns true if lhs is elementwise equal to rhs. More...
 
bool operator!= (const Color &lhs, const Color &rhs)
 Returns true if lhs is elementwise not equal to rhs. More...
 
bool operator< (const Color &lhs, const Color &rhs)
 Returns true if lhs is lexicographically less than rhs. More...
 
bool operator<= (const Color &lhs, const Color &rhs)
 Returns true if lhs is lexicographically less than or equal to rhs. More...
 
bool operator> (const Color &lhs, const Color &rhs)
 Returns true if lhs is lexicographically greater than rhs. More...
 
bool operator>= (const Color &lhs, const Color &rhs)
 Returns true if lhs is lexicographically greater than or equal to rhs. More...
 
Coloroperator+= (Color &lhs, const Color &rhs)
 Adds rhs elementwise to lhs and returns the modified lhs. More...
 
Coloroperator-= (Color &lhs, const Color &rhs)
 Subtracts rhs elementwise from lhs and returns the modified lhs. More...
 
Coloroperator*= (Color &lhs, const Color &rhs)
 Multiplies rhs elementwise with lhs and returns the modified lhs. More...
 
Coloroperator/= (Color &lhs, const Color &rhs)
 Divides lhs elementwise by rhs and returns the modified lhs. More...
 
Color operator+ (const Color &lhs, const Color &rhs)
 Adds lhs and rhs elementwise and returns the new result. More...
 
Color operator- (const Color &lhs, const Color &rhs)
 Subtracts rhs elementwise from lhs and returns the new result. More...
 
Color operator* (const Color &lhs, const Color &rhs)
 Multiplies rhs elementwise with lhs and returns the new result. More...
 
Color operator/ (const Color &lhs, const Color &rhs)
 Divides rhs elementwise by lhs and returns the new result. More...
 
Color operator- (const Color &c)
 Negates the color c elementwise and returns the new result. More...
 
Coloroperator*= (Color &c, Float32 s)
 Multiplies the color c elementwise with the scalar s and returns the modified color c. More...
 
Coloroperator/= (Color &c, Float32 s)
 Divides the color c elementwise by the scalar s and returns the modified color c. More...
 
Color operator* (const Color &c, Float32 s)
 Multiplies the color c elementwise with the scalar s and returns the new result. More...
 
Color operator* (Float32 s, const Color &c)
 Multiplies the color c elementwise with the scalar s and returns the new result. More...
 
Color operator/ (const Color &c, Float32 s)
 Divides the color c elementwise by the scalar s and returns the new result. More...
 
Color abs (const Color &c)
 Returns a color with the elementwise absolute values of the color c. More...
 
Color acos (const Color &c)
 Returns a color with the elementwise arc cosine of the color c. More...
 
bool all (const Color &c)
 Returns true if all elements of c are not equal to zero. More...
 
bool any (const Color &c)
 Returns true if any element of c is not equal to zero. More...
 
Color asin (const Color &c)
 Returns a color with the elementwise arc sine of the color c. More...
 
Color atan (const Color &c)
 Returns a color with the elementwise arc tangent of the color c. More...
 
Color atan2 (const Color &c, const Color &d)
 Returns a color with the elementwise arc tangent of the color c / d. More...
 
Color ceil (const Color &c)
 Returns a color with the elementwise smallest integral value that is not less than the element in color c. More...
 
Color clamp (const Color &c, const Color &low, const Color &high)
 Returns the color c elementwise clamped to the range [low, high]. More...
 
Color clamp (const Color &c, const Color &low, Float32 high)
 Returns the color c elementwise clamped to the range [low, high]. More...
 
Color clamp (const Color &c, Float32 low, const Color &high)
 Returns the color c elementwise clamped to the range [low, high]. More...
 
Color clamp (const Color &c, Float32 low, Float32 high)
 Returns the color c elementwise clamped to the range [low, high]. More...
 
Color cos (const Color &c)
 Returns a color with the elementwise cosine of the color c. More...
 
Color degrees (const Color &c)
 Converts elementwise radians in c to degrees. More...
 
Color elementwise_max (const Color &lhs, const Color &rhs)
 Returns elementwise max for each element in color lhs that is less than the corresponding element in color rhs. More...
 
Color elementwise_min (const Color &lhs, const Color &rhs)
 Returns elementwise min for each element in color lhs that is less than the corresponding element in color rhs. More...
 
Color exp (const Color &c)
 Returns a color with elementwise e to the power of the element in the color c. More...
 
Color exp2 (const Color &c)
 Returns a color with elementwise 2 to the power of the element in the color c. More...
 
Color floor (const Color &c)
 Returns a color with the elementwise largest integral value that is not greater than the element in color c. More...
 
Color fmod (const Color &a, const Color &b)
 Returns elementwise a modulo b, in other words, the remainder of a/b. More...
 
Color fmod (const Color &a, Float32 b)
 Returns elementwise a modulo b, in other words, the remainder of a/b. More...
 
Color frac (const Color &c)
 Returns a color with the elementwise positive fractional part of the color c. More...
 
Color gamma_correction (const Color &color, Float32 gamma_factor)
 Returns a gamma corrected color. More...
 
bool is_approx_equal (const Color &lhs, const Color &rhs, Float32 e)
 Compares the two given values elementwise for equality within the given epsilon. More...
 
Color lerp (const Color &c1, const Color &c2, const Color &t)
 Returns the elementwise linear interpolation between c1 and c2, i.e., it returns (1-t) * c1 + t * c2. More...
 
Color lerp (const Color &c1, const Color &c2, Float32 t)
 Returns the linear interpolation between c1 and c2, i.e., it returns (1-t) * c1 + t * c2. More...
 
Color log (const Color &c)
 Returns a color with elementwise natural logarithm of the color c. More...
 
Color log2 (const Color &c)
 Returns a color with elementwise base 2 logarithm of the color c. More...
 
Color log10 (const Color &c)
 Returns a color with elementwise base 10 logarithm of the color c. More...
 
Color modf (const Color &c, Color &i)
 Returns the elementwise fractional part of c and stores the elementwise integral part of c in i. More...
 
Color pow (const Color &a, const Color &b)
 Returns the color a elementwise to the power of b. More...
 
Color pow (const Color &a, Float32 b)
 Returns the color a elementwise to the power of b. More...
 
Color radians (const Color &c)
 Converts elementwise degrees in c to radians. More...
 
Color round (const Color &c)
 Returns a color with the elements of color c rounded to nearest integers. More...
 
Color rsqrt (const Color &c)
 Returns the reciprocal of the square root of each element of c. More...
 
Color saturate (const Color &c)
 Returns the color c clamped elementwise to the range [0,1]. More...
 
Color sign (const Color &c)
 Returns the elementwise sign of color c. More...
 
Color sin (const Color &c)
 Returns a color with the elementwise sine of the color c. More...
 
void sincos (const Color &a, Color &s, Color &c)
 Computes elementwise the sine s and cosine c of angles a simultaneously. More...
 
Color smoothstep (const Color &a, const Color &b, const Color &c)
 Returns 0 if c is less than a and 1 if c is greater than b in an elementwise fashion. More...
 
Color smoothstep (const Color &a, const Color &b, Float32 x)
 Returns 0 if c is less than a and 1 if c is greater than b in an elementwise fashion. More...
 
Color sqrt (const Color &c)
 Returns the square root of each element of c. More...
 
Color step (const Color &a, const Color &c)
 Returns elementwise 0 if c is less than a and 1 otherwise. More...
 
Color tan (const Color &c)
 Returns a color with the elementwise tangent of the color c. More...
 
bool isfinite (const Color &c)
 Indicates whether all components of the color are finite. More...
 
bool isinfinite (const Color &c)
 Indicates whether any component of the color is infinite. More...
 
bool isnan (const Color &c)
 Indicates whether any component of the color is "not a number". More...
 
MI_HOST_DEVICE_INLINE void to_rgbe (const Color &color, Uint32 &rgbe)
 Encodes a color into RGBE representation. More...
 
MI_HOST_DEVICE_INLINE void to_rgbe (const Color &color, Uint8 rgbe[4])
 Encodes a color into RGBE representation. More...
 
MI_HOST_DEVICE_INLINE void from_rgbe (const Uint8 rgbe[4], Color &color)
 Decodes a color from RGBE representation. More...
 
MI_HOST_DEVICE_INLINE void from_rgbe (const Uint32 rgbe, Color &color)
 Decodes a color from RGBE representation. More...
 
Float32 exp (Float32 s)
 Returns the constant e to the power of s (exponential function). More...
 
Float64 exp (Float64 s)
 Returns the constant e to the power of s (exponential function). More...
 
Float32 log (Float32 s)
 Returns the natural logarithm of s. More...
 
Float64 log (Float64 s)
 Returns the natural logarithm of s. More...
 
Float32 fast_sqrt (Float32 i)
 A fast implementation of sqrt(x) for floats. More...
 
Float32 fast_exp (Float32 x)
 A fast implementation of exp for floats. More...
 
Float32 fast_pow2 (Float32 x)
 A fast implementation of pow(2,x) for floats. More...
 
Float32 fast_log2 (Float32 i)
 A fast implementation of log2(x) for floats. More...
 
Float32 fast_pow (Float32 b, Float32 e)
 A fast implementation of pow(x,y) for floats. More...
 
Float32 acos (Float32 s)
 Returns the arc cosine of s in radians. More...
 
Float64 acos (Float64 s)
 Returns the arc cosine of s in radians. More...
 
bool all (Uint8 v)
 Returns true if v is not equal to zero. More...
 
bool all (Uint16 v)
 Returns true if v is not equal to zero. More...
 
bool all (Uint32 v)
 Returns true if v is not equal to zero. More...
 
bool all (Uint64 v)
 Returns true if v is not equal to zero. More...
 
bool all (Sint8 v)
 Returns true if v is not equal to zero. More...
 
bool all (Sint16 v)
 Returns true if v is not equal to zero. More...
 
bool all (Sint32 v)
 Returns true if v is not equal to zero. More...
 
bool all (Sint64 v)
 Returns true if v is not equal to zero. More...
 
bool all (Float32 v)
 Returns true if v is not equal to zero. More...
 
bool all (Float64 v)
 Returns true if v is not equal to zero. More...
 
bool any (Uint8 v)
 Returns true if v is not equal to zero. More...
 
bool any (Uint16 v)
 Returns true if v is not equal to zero. More...
 
bool any (Uint32 v)
 Returns true if v is not equal to zero. More...
 
bool any (Uint64 v)
 Returns true if v is not equal to zero. More...
 
bool any (Sint8 v)
 Returns true if v is not equal to zero. More...
 
bool any (Sint16 v)
 Returns true if v is not equal to zero. More...
 
bool any (Sint32 v)
 Returns true if v is not equal to zero. More...
 
bool any (Sint64 v)
 Returns true if v is not equal to zero. More...
 
bool any (Float32 v)
 Returns true if v is not equal to zero. More...
 
bool any (Float64 v)
 Returns true if v is not equal to zero. More...
 
Float32 asin (Float32 s)
 Returns the arc sine of s in radians. More...
 
Float64 asin (Float64 s)
 Returns the arc sine of s in radians. More...
 
Float32 atan (Float32 s)
 Returns the arc tangent of s. More...
 
Float64 atan (Float64 s)
 Returns the arc tangent of s. More...
 
Float32 atan2 (Float32 s, Float32 t)
 Returns the arc tangent of s / t. More...
 
Float64 atan2 (Float64 s, Float64 t)
 Returns the arc tangent of s / t. More...
 
Float32 ceil (Float32 s)
 Returns the smallest integral value that is not less than s. More...
 
Float64 ceil (Float64 s)
 Returns the smallest integral value that is not less than s. More...
 
Uint8 clamp (Uint8 s, Uint8 low, Uint8 high)
 Returns the value s if it is in the range [low, high], the value low if s < low, or the value high if s > high. More...
 
Uint16 clamp (Uint16 s, Uint16 low, Uint16 high)
 Returns the value s if it is in the range [low, high], the value low if s < low, or the value high if s > high. More...
 
Uint32 clamp (Uint32 s, Uint32 low, Uint32 high)
 Returns the value s if it is in the range [low, high], the value low if s < low, or the value high if s > high. More...
 
Uint64 clamp (Uint64 s, Uint64 low, Uint64 high)
 Returns the value s if it is in the range [low, high], the value low if s < low, or the value high if s > high. More...
 
Sint8 clamp (Sint8 s, Sint8 low, Sint8 high)
 Returns the value s if it is in the range [low, high], the value low if s < low, or the value high if s > high. More...
 
Sint16 clamp (Sint16 s, Sint16 low, Sint16 high)
 Returns the value s if it is in the range [low, high], the value low if s < low, or the value high if s > high. More...
 
Sint32 clamp (Sint32 s, Sint32 low, Sint32 high)
 Returns the value s if it is in the range [low, high], the value low if s < low, or the value high if s > high. More...
 
Sint64 clamp (Sint64 s, Sint64 low, Sint64 high)
 Returns the value s if it is in the range [low, high], the value low if s < low, or the value high if s > high. More...
 
Float32 clamp (Float32 s, Float32 low, Float32 high)
 Returns the value s if it is in the range [low, high], the value low if s < low, or the value high if s > high. More...
 
Float64 clamp (Float64 s, Float64 low, Float64 high)
 Returns the value s if it is in the range [low, high], the value low if s < low, or the value high if s > high. More...
 
Float32 cos (Float32 a)
 Returns the cosine of a. The angle a is specified in radians. More...
 
Float64 cos (Float64 a)
 Returns the cosine of a. The angle a is specified in radians. More...
 
Float32 degrees (Float32 r)
 Converts radians r to degrees. More...
 
Float64 degrees (Float64 r)
 Converts radians r to degrees. More...
 
Float32 exp2 (Float32 s)
 Returns the constant 2 to the power of s (exponential function). More...
 
Float64 exp2 (Float64 s)
 Returns the constant 2 to the power of s (exponential function). More...
 
Float32 floor (Float32 s)
 Returns the largest integral value that is not greater than s. More...
 
Float64 floor (Float64 s)
 Returns the largest integral value that is not greater than s. More...
 
Float32 fmod (Float32 a, Float32 b)
 Returns a modulo b, in other words, the remainder of a/b. More...
 
Float64 fmod (Float64 a, Float64 b)
 Returns a modulo b, in other words, the remainder of a/b. More...
 
Float32 frac (Float32 s)
 Returns the positive fractional part of s. More...
 
Float64 frac (Float64 s)
 Returns the positive fractional part of s. More...
 
bool is_approx_equal (Float32 left, Float32 right, Float32 e)
 Compares the two given values for equality within the given epsilon. More...
 
bool is_approx_equal (Float64 left, Float64 right, Float64 e)
 Compares the two given values for equality within the given epsilon. More...
 
Uint32 leading_zeros (Uint32 v)
 Returns the number of leading zeros of v, 32-bit version. More...
 
Uint32 leading_zeros (Uint64 v)
 Returns the number of leading zeros of v, 64-bit version. More...
 
Float32 lerp (Float32 s1, Float32 s2, Float32 t)
 Returns the linear interpolation between s1 and s2, i.e., it returns (1-t) * s1 + t * s2. More...
 
Float64 lerp (Float64 s1, Float64 s2, Float64 t)
 Returns the linear interpolation between s1 and s2, i.e., it returns (1-t) * s1 + t * s2. More...
 
Float32 log2 (Float32 s)
 Returns the base 2 logarithm of s. More...
 
Float64 log2 (Float64 s)
 Returns the base 2 logarithm of s. More...
 
Sint32 log2_int (const Uint32 v)
 Returns the integer log2 of v. More...
 
Sint32 log2_int (const Uint64 v)
 Returns the integer log2 of v. More...
 
Sint32 log2_int (const Float32 v)
 Returns the integer log2 of v. More...
 
Sint32 log2_int (const Float64 v)
 Returns the integer log2 of v. More...
 
template<typename Integer>
Sint32 log2_int_ceil (const Integer v)
 Returns the integer log2 of v, i.e., rounded up to the next integer. More...
 
Float32 log10 (Float32 s)
 Returns the base 10 logarithm of s. More...
 
Float64 log10 (Float64 s)
 Returns the base 10 logarithm of s. More...
 
Float32 modf (Float32 s, Float32 &i)
 Returns the fractional part of s and stores the integral part of s in i. More...
 
Float64 modf (Float64 s, Float64 &i)
 Returns the fractional part of s and stores the integral part of s in i. More...
 
Uint32 pow (Uint32 a, Uint32 b)
 Returns a to the power of b. More...
 
Uint64 pow (Uint64 a, Uint64 b)
 Returns a to the power of b. More...
 
Sint32 pow (Sint32 a, Sint32 b)
 Returns a to the power of b. More...
 
Sint64 pow (Sint64 a, Sint64 b)
 Returns a to the power of b. More...
 
Float32 pow (Float32 a, Float32 b)
 Returns a to the power of b. More...
 
Float64 pow (Float64 a, Float64 b)
 Returns a to the power of b. More...
 
Float32 radians (Float32 d)
 Converts degrees d to radians. More...
 
Float64 radians (Float64 d)
 Converts degrees d to radians. More...
 
Float32 round (Float32 s)
 Returns s rounded to the nearest integer value. More...
 
Float64 round (Float64 s)
 Returns s rounded to the nearest integer value. More...
 
Float32 rsqrt (Float32 s)
 Returns the reciprocal of the square root of s. More...
 
Float64 rsqrt (Float64 s)
 Returns the reciprocal of the square root of s. More...
 
Float32 saturate (Float32 s)
 Returns the value s clamped to the range [0,1]. More...
 
Float64 saturate (Float64 s)
 Returns the value s clamped to the range [0,1]. More...
 
Sint8 sign (Sint8 s)
 Returns -1 if s<0, 0 if s==0, and +1 if s>0. More...
 
Sint16 sign (Sint16 s)
 Returns -1 if s<0, 0 if s==0, and +1 if s>0. More...
 
Sint32 sign (Sint32 s)
 Returns -1 if s<0, 0 if s==0, and +1 if s>0. More...
 
Sint64 sign (Sint64 s)
 Returns -1 if s<0, 0 if s==0, and +1 if s>0. More...
 
Float32 sign (Float32 s)
 Returns -1 if s<0, 0 if s==0, and +1 if s>0. More...
 
Float64 sign (Float64 s)
 Returns -1 if s<0, 0 if s==0, and +1 if s>0. More...
 
bool sign_bit (Sint8 s)
 Returns true if s<0 and false if s>= 0. More...
 
bool sign_bit (Sint16 s)
 Returns true if s<0 and false if s>= 0. More...
 
bool sign_bit (Sint32 s)
 Returns true if s<0 and false if s>= 0. More...
 
bool sign_bit (Sint64 s)
 Returns true if s<0 and false if s>= 0. More...
 
bool sign_bit (Float32 s)
 Extracts the sign bit of a single-precision floating point number. More...
 
bool sign_bit (Float64 s)
 Extracts the sign bit of a double-precision floating point number. More...
 
bool isinfinite (const Float32 x)
 Checks a single-precision floating point number for "infinity". More...
 
bool isinfinite (const Float64 x)
 Checks a double-precision floating point number for "infinity". More...
 
Float32 sin (Float32 a)
 Returns the sine of a. The angle a is specified in radians. More...
 
Float64 sin (Float64 a)
 Returns the sine of a. The angle a is specified in radians. More...
 
void sincos (Float32 a, Float32 &s, Float32 &c)
 Computes the sine s and cosine c of angle a simultaneously. More...
 
void sincos (Float64 a, Float64 &s, Float64 &c)
 Computes the sine s and cosine c of angle a simultaneously. More...
 
Float32 smoothstep (Float32 a, Float32 b, Float32 x)
 Returns 0 if x is less than a and 1 if x is greater than b. More...
 
Float64 smoothstep (Float64 a, Float64 b, Float64 x)
 Returns 0 if x is less than a and 1 if x is greater than b. More...
 
Float32 sqrt (Float32 s)
 Returns the square root of s. More...
 
Float64 sqrt (Float64 s)
 Returns the square root of s. More...
 
Float32 step (Float32 a, Float32 x)
 Returns 0 if x is less than a and 1 otherwise. More...
 
Float64 step (Float64 a, Float64 x)
 Returns 0 if x is less than a and 1 otherwise. More...
 
Float32 tan (Float32 a)
 Returns the tangent of a. The angle a is specified in radians. More...
 
Float64 tan (Float64 a)
 Returns the tangent of a. The angle a is specified in radians. More...
 
MI_HOST_DEVICE_INLINE void to_rgbe (const Float32 color[3], Uint32 &rgbe)
 Encodes a color into RGBE representation. More...
 
MI_HOST_DEVICE_INLINE void to_rgbe (const Float32 color[3], Uint8 rgbe[4])
 Encodes a color into RGBE representation. More...
 
MI_HOST_DEVICE_INLINE void from_rgbe (const Uint8 rgbe[4], Float32 color[3])
 Decodes a color from RGBE representation. More...
 
MI_HOST_DEVICE_INLINE void from_rgbe (const Uint32 rgbe, Float32 color[3])
 Decodes a color from RGBE representation. More...
 
Sint32 dot (Sint32 a, Sint32 b)
 Returns the inner product (a.k.a. dot or scalar product) of two integers. More...
 
Float32 dot (Float32 a, Float32 b)
 Returns the inner product (a.k.a. dot or scalar product) of two scalars. More...
 
Float64 dot (Float64 a, Float64 b)
 Returns the inner product (a.k.a. dot or scalar product) of two scalars. More...
 
template<class V>
V::value_type dot (const V &lhs, const V &rhs)
 Returns the inner product (a.k.a. dot or scalar product) of two vectors. More...
 
template<class V>
V::value_type square_length (const V &v)
 Returns the squared Euclidean norm of the vector v. More...
 
Float32 length (Float32 a)
 Returns the Euclidean norm of the scalar a (its absolute value). More...
 
Float64 length (Float64 a)
 Returns the Euclidean norm of the scalar a (its absolute value). More...
 
template<class V>
V::value_type length (const V &v)
 Returns the Euclidean norm of the vector v. More...
 
template<class V>
V::value_type square_euclidean_distance (const V &lhs, const V &rhs)
 Returns the squared Euclidean distance from the vector lhs to the vector rhs. More...
 
template<class V>
V::value_type euclidean_distance (const V &lhs, const V &rhs)
 Returns the Euclidean distance from the vector lhs to the vector rhs. More...
 
template<class V>
void set_bounds (V &v, const V &low, const V &high)
 Bounds the value of vector v elementwise to the given low and high vector values. More...
 
template<class V>
bool is_equal (const V &lhs, const V &rhs)
 Returns true if vector lhs is elementwise equal to vector rhs, and false otherwise. More...
 
template<class V>
bool is_not_equal (const V &lhs, const V &rhs)
 Returns true if vector lhs is elementwise not equal to vector rhs, and false otherwise. More...
 
template<class V>
bool lexicographically_less (const V &lhs, const V &rhs)
 Returns true if vector lhs is lexicographically less than vector rhs, and false otherwise. More...
 
template<class V>
bool lexicographically_less_or_equal (const V &lhs, const V &rhs)
 Returns true if vector lhs is lexicographically less than or equal to vector rhs, and false otherwise. More...
 
template<class V>
bool lexicographically_greater (const V &lhs, const V &rhs)
 Returns true if vector lhs is lexicographically greater than vector rhs, and false otherwise. More...
 
template<class V>
bool lexicographically_greater_or_equal (const V &lhs, const V &rhs)
 Returns true if vector lhs is lexicographically greater than or equal to vector rhs, and false otherwise. More...
 
template<class V>
Comparison_result lexicographically_compare (const V &lhs, const V &rhs)
 Compares two vectors lexicographically. More...
 
template<typename T , Size ROW, Size COL>
T * matrix_base_ptr (Matrix_struct<T, ROW, COL> &mat)
 Returns the base pointer to the matrix data. More...
 
template<typename T , Size ROW, Size COL>
const T * matrix_base_ptr (const Matrix_struct<T, ROW, COL> &mat)
 Returns the base pointer to the matrix data. More...
 
template<typename T , Size ROW, Size COL>
bool operator== (const Matrix<T, ROW, COL> &lhs, const Matrix<T, ROW, COL> &rhs)
 Returns true if lhs is elementwise equal to rhs. More...
 
template<typename T , Size ROW, Size COL>
bool operator!= (const Matrix<T, ROW, COL> &lhs, const Matrix<T, ROW, COL> &rhs)
 Returns true if lhs is elementwise not equal to rhs. More...
 
template<typename T , Size ROW, Size COL>
bool operator< (const Matrix<T, ROW, COL> &lhs, const Matrix<T, ROW, COL> &rhs)
 Returns true if lhs is lexicographically less than rhs. More...
 
template<typename T , Size ROW, Size COL>
bool operator<= (const Matrix<T, ROW, COL> &lhs, const Matrix<T, ROW, COL> &rhs)
 Returns true if lhs is lexicographically less than or equal to rhs. More...
 
template<typename T , Size ROW, Size COL>
bool operator> (const Matrix<T, ROW, COL> &lhs, const Matrix<T, ROW, COL> &rhs)
 Returns true if lhs is lexicographically greater than rhs. More...
 
template<typename T , Size ROW, Size COL>
bool operator>= (const Matrix<T, ROW, COL> &lhs, const Matrix<T, ROW, COL> &rhs)
 Returns true if lhs is lexicographically greater than or equal to rhs. More...
 
template<typename T , Size ROW, Size COL>
Matrix<T, ROW, COL> & operator+= (Matrix<T, ROW, COL> &lhs, const Matrix<T, ROW, COL> &rhs)
 Adds rhs elementwise to lhs and returns the modified lhs. More...
 
template<typename T , Size ROW, Size COL>
Matrix<T, ROW, COL> & operator-= (Matrix<T, ROW, COL> &lhs, const Matrix<T, ROW, COL> &rhs)
 Subtracts rhs elementwise from lhs and returns the modified lhs. More...
 
template<typename T , Size ROW, Size COL>
Matrix<T, ROW, COL> operator+ (const Matrix<T, ROW, COL> &lhs, const Matrix<T, ROW, COL> &rhs)
 Adds lhs and rhs elementwise and returns the new result. More...
 
template<typename T , Size ROW, Size COL>
Matrix<T, ROW, COL> operator- (const Matrix<T, ROW, COL> &lhs, const Matrix<T, ROW, COL> &rhs)
 Subtracts rhs elementwise from lhs and returns the new result. More...
 
template<typename T , Size ROW, Size COL>
Matrix<T, ROW, COL> operator- (const Matrix<T, ROW, COL> &mat)
 Negates the matrix mat elementwise and returns the new result. More...
 
template<typename T , Size ROW, Size COL>
Matrix<T, ROW, COL> & operator*= (Matrix<T, ROW, COL> &lhs, const Matrix<T, COL, COL> &rhs)
 Performs matrix multiplication, lhs times rhs, assigns it to lhs, and returns the modified lhs. More...
 
template<typename T , Size ROW1, Size COL1, Size ROW2, Size COL2>
Matrix<T, ROW1, COL2> operator* (const Matrix<T, ROW1, COL1> &lhs, const Matrix<T, ROW2, COL2> &rhs)
 Performs matrix multiplication, lhs times rhs, and returns the new result. More...
 
template<typename T , Size ROW, Size COL, Size DIM>
Vector<T, ROW> operator* (const Matrix<T, ROW, COL> &mat, const Vector<T, DIM> &vec)
 Multiplies the (column) vector vec from the right with the matrix mat and returns the resulting vector. More...
 
template<Size DIM, typename T , Size ROW, Size COL>
Vector<T, COL> operator* (const Vector<T, DIM> &vec, const Matrix<T, ROW, COL> &mat)
 Multiplies the (row) vector vec from the left with the matrix mat and returns the resulting vector. More...
 
template<typename T , Size ROW, Size COL>
Matrix<T, ROW, COL> & operator*= (Matrix<T, ROW, COL> &mat, T factor)
 Multiplies the matrix mat elementwise with the scalar factor and returns the modified matrix mat. More...
 
template<typename T , Size ROW, Size COL>
Matrix<T, ROW, COL> operator* (const Matrix<T, ROW, COL> &mat, T factor)
 Multiplies the matrix mat elementwise with the scalar factor and returns the new result. More...
 
template<typename T , Size ROW, Size COL>
Matrix<T, ROW, COL> operator* (T factor, const Matrix<T, ROW, COL> &mat)
 Multiplies the matrix mat elementwise with the scalar factor and returns the new result. More...
 
template<Size NEW_ROW, Size NEW_COL, typename T , Size ROW, Size COL>
Matrix< T, NEW_ROW, NEW_COLsub_matrix (const Matrix<T, ROW, COL> &mat)
 Returns the upper-left sub-matrix of size NEW_ROW times NEW_COL. More...
 
template<typename T , Size ROW, Size COL>
Matrix<T, COL, ROW> transpose (const Matrix<T, ROW, COL> &mat)
 Returns the transpose of the matrix mat by exchanging rows and columns. More...
 
template<typename T , typename U>
transform_point (const Matrix<T, 4, 4> &mat, const U &point)
 Returns a transformed 1D point by applying the full transformation in the 4x4 matrix mat on the 1D point point, which includes the translation. More...
 
template<typename T , typename U>
Vector<U, 2> transform_point (const Matrix<T, 4, 4> &mat, const Vector<U, 2> &point)
 Returns a transformed 2D point by applying the full transformation in the 4x4 matrix mat on the 2D point point, which includes the translation. More...
 
template<typename T , typename U>
Vector<U, 3> transform_point (const Matrix<T, 4, 3> &mat, const Vector<U, 3> &point)
 Returns a transformed 3D point by applying the full transformation in the 4x3 matrix mat on the 3D point point, which includes the translation. More...
 
template<typename T , typename U>
Vector<U, 3> transform_point (const Matrix<T, 4, 4> &mat, const Vector<U, 3> &point)
 Returns a transformed 3D point by applying the full transformation in the 4x4 matrix mat on the 3D point point, which includes the translation. More...
 
template<typename T , typename U>
Vector<U, 4> transform_point (const Matrix<T, 4, 4> &mat, const Vector<U, 4> &point)
 Returns a transformed 4D point by applying the full transformation in the 4x4 matrix mat on the 4D point point, which includes the translation. More...
 
template<typename T , typename U>
transform_vector (const Matrix<T, 4, 4> &mat, const U &vector)
 Returns a transformed 1D vector by applying the 1x1 linear sub-transformation in the 4x4 matrix mat on the 1D vector vector, which excludes the translation. More...
 
template<typename T , typename U>
Vector<U, 2> transform_vector (const Matrix<T, 4, 4> &mat, const Vector<U, 2> &vector)
 Returns a transformed 2D vector by applying the 2x2 linear sub-transformation in the 4x4 matrix mat on the 2D vector vector, which excludes the translation. More...
 
template<typename T , typename U>
Vector<U, 3> transform_vector (const Matrix<T, 3, 3> &mat, const Vector<U, 3> &vector)
 Returns a transformed 3D vector by applying the 3x3 matrix mat transformation on the 3D vector vector. More...
 
template<typename T , typename U>
Vector<U, 3> transform_vector (const Matrix<T, 4, 3> &mat, const Vector<U, 3> &vector)
 Returns a transformed 3D vector by applying the 3x3 linear sub-transformation in the 4x3 matrix mat on the 3D vector vector, which excludes the translation. More...
 
template<typename T , typename U>
Vector<U, 3> transform_vector (const Matrix<T, 4, 4> &mat, const Vector<U, 3> &vector)
 Returns a transformed 3D vector by applying the 3x3 linear sub-transformation in the 4x4 matrix mat on the 3D vector vector, which excludes the translation. More...
 
template<typename T , typename U>
Vector<U, 3> transform_normal_inv (const Matrix<T, 3, 3> &inv_mat, const Vector<U, 3> &normal)
 Returns an inverse transformed 3D normal vector by applying the 3x3 transposed linear transformation in the matrix inv_mat on the 3D normal vector normal. More...
 
template<typename T , typename U>
Vector<U, 3> transform_normal_inv (const Matrix<T, 4, 4> &inv_mat, const Vector<U, 3> &normal)
 Returns an inverse transformed 3D normal vector by applying the 3x3 transposed linear sub-transformation in the 4x4 matrix inv_mat on the 3D normal vector normal. More...
 
template<typename T , typename U>
Vector<U, 3> transform_normal (const Matrix<T, 4, 4> &mat, const Vector<U, 3> &normal)
 Returns a transformed 3D normal vector by applying the 3x3 transposed linear sub-transformation in the inverse of the 4x4 matrix mat on the 3D normal vector normal. More...
 
bool operator== (const Spectrum &lhs, const Spectrum &rhs)
 Returns true if lhs is elementwise equal to rhs. More...
 
bool operator!= (const Spectrum &lhs, const Spectrum &rhs)
 Returns true if lhs is elementwise not equal to rhs. More...
 
bool operator< (const Spectrum &lhs, const Spectrum &rhs)
 Returns true if lhs is lexicographically less than rhs. More...
 
bool operator<= (const Spectrum &lhs, const Spectrum &rhs)
 Returns true if lhs is lexicographically less than or equal to rhs. More...
 
bool operator> (const Spectrum &lhs, const Spectrum &rhs)
 Returns true if lhs is lexicographically greater than rhs. More...
 
bool operator>= (const Spectrum &lhs, const Spectrum &rhs)
 Returns true if lhs is lexicographically greater than or equal to rhs. More...
 
Spectrumoperator+= (Spectrum &lhs, const Spectrum &rhs)
 Adds rhs elementwise to lhs and returns the modified lhs. More...
 
Spectrumoperator-= (Spectrum &lhs, const Spectrum &rhs)
 Subtracts rhs elementwise from lhs and returns the modified lhs. More...
 
Spectrumoperator*= (Spectrum &lhs, const Spectrum &rhs)
 Multiplies rhs elementwise with lhs and returns the modified lhs. More...
 
Spectrumoperator/= (Spectrum &lhs, const Spectrum &rhs)
 Divides lhs elementwise by rhs and returns the modified lhs. More...
 
Spectrum operator+ (const Spectrum &lhs, const Spectrum &rhs)
 Adds lhs and rhs elementwise and returns the new result. More...
 
Spectrum operator- (const Spectrum &lhs, const Spectrum &rhs)
 Subtracts rhs elementwise from lhs and returns the new result. More...
 
Spectrum operator* (const Spectrum &lhs, const Spectrum &rhs)
 Multiplies rhs elementwise with lhs and returns the new result. More...
 
Spectrum operator/ (const Spectrum &lhs, const Spectrum &rhs)
 Divides rhs elementwise by lhs and returns the new result. More...
 
Spectrum operator- (const Spectrum &c)
 Negates the spectrum c elementwise and returns the new result. More...
 
Spectrumoperator*= (Spectrum &c, Float32 s)
 Multiplies the spectrum c elementwise with the scalar s and returns the modified spectrum c. More...
 
Spectrumoperator/= (Spectrum &c, Float32 s)
 Divides the spectrum c elementwise by the scalar s and returns the modified spectrum c. More...
 
Spectrum operator* (const Spectrum &c, Float32 s)
 Multiplies the spectrum c elementwise with the scalar s and returns the new result. More...
 
Spectrum operator* (Float32 s, const Spectrum &c)
 Multiplies the spectrum c elementwise with the scalar s and returns the new result. More...
 
Spectrum operator/ (const Spectrum &c, Float32 s)
 Divides the spectrum c elementwise by the scalar s and returns the new result. More...
 
Spectrum abs (const Spectrum &c)
 Returns a spectrum with the elementwise absolute values of the spectrum c. More...
 
Spectrum acos (const Spectrum &c)
 Returns a spectrum with the elementwise arc cosine of the spectrum c. More...
 
bool all (const Spectrum &c)
 Returns true if all elements of c are not equal to zero. More...
 
bool any (const Spectrum &c)
 Returns true if any element of c is not equal to zero. More...
 
Spectrum asin (const Spectrum &c)
 Returns a spectrum with the elementwise arc sine of the spectrum c. More...
 
Spectrum atan (const Spectrum &c)
 Returns a spectrum with the elementwise arc tangent of the spectrum c. More...
 
Spectrum atan2 (const Spectrum &c, const Spectrum &d)
 Returns a spectrum with the elementwise arc tangent of the spectrum c / d. More...
 
Spectrum ceil (const Spectrum &c)
 Returns a spectrum with the elementwise smallest integral value that is not less than the element in spectrum c. More...
 
Spectrum clamp (const Spectrum &c, const Spectrum &low, const Spectrum &high)
 Returns the spectrum c elementwise clamped to the range [low, high]. More...
 
Spectrum clamp (const Spectrum &c, const Spectrum &low, Float32 high)
 Returns the spectrum c elementwise clamped to the range [low, high]. More...
 
Spectrum clamp (const Spectrum &c, Float32 low, const Spectrum &high)
 Returns the spectrum c elementwise clamped to the range [low, high]. More...
 
Spectrum clamp (const Spectrum &c, Float32 low, Float32 high)
 Returns the spectrum c elementwise clamped to the range [low, high]. More...
 
Spectrum cos (const Spectrum &c)
 Returns a spectrum with the elementwise cosine of the spectrum c. More...
 
Spectrum degrees (const Spectrum &c)
 Converts elementwise radians in c to degrees. More...
 
Spectrum elementwise_max (const Spectrum &lhs, const Spectrum &rhs)
 Returns elementwise max for each element in spectrum lhs that is less than the corresponding element in spectrum rhs. More...
 
Spectrum elementwise_min (const Spectrum &lhs, const Spectrum &rhs)
 Returns elementwise min for each element in spectrum lhs that is less than the corresponding element in spectrum rhs. More...
 
Spectrum exp (const Spectrum &c)
 Returns a spectrum with elementwise e to the power of the element in the spectrum c. More...
 
Spectrum exp2 (const Spectrum &c)
 Returns a spectrum with elementwise 2 to the power of the element in the spectrum c. More...
 
Spectrum floor (const Spectrum &c)
 Returns a spectrum with the elementwise largest integral value that is not greater than the element in spectrum c. More...
 
Spectrum fmod (const Spectrum &a, const Spectrum &b)
 Returns elementwise a modulo b, in other words, the remainder of a/b. More...
 
Spectrum fmod (const Spectrum &a, Float32 b)
 Returns elementwise a modulo b, in other words, the remainder of a/b. More...
 
Spectrum frac (const Spectrum &c)
 Returns a spectrum with the elementwise positive fractional part of the spectrum c. More...
 
Spectrum gamma_correction (const Spectrum &spectrum, Float32 gamma_factor)
 Returns a gamma corrected spectrum. More...
 
bool is_approx_equal (const Spectrum &lhs, const Spectrum &rhs, Float32 e)
 Compares the two given values elementwise for equality within the given epsilon. More...
 
Spectrum lerp (const Spectrum &c1, const Spectrum &c2, const Spectrum &t)
 Returns the elementwise linear interpolation between c1 and c2, i.e., it returns (1-t) * c1 + t * c2. More...
 
Spectrum lerp (const Spectrum &c1, const Spectrum &c2, Float32 t)
 Returns the linear interpolation between c1 and c2, i.e., it returns (1-t) * c1 + t * c2. More...
 
Spectrum log (const Spectrum &c)
 Returns a spectrum with elementwise natural logarithm of the spectrum c. More...
 
Spectrum log2 (const Spectrum &c)
 Returns a spectrum with elementwise base 2 logarithm of the spectrum c. More...
 
Spectrum log10 (const Spectrum &c)
 Returns a spectrum with elementwise base 10 logarithm of the spectrum c. More...
 
Spectrum modf (const Spectrum &c, Spectrum &i)
 Returns the elementwise fractional part of c and stores the elementwise integral part of c in i. More...
 
Spectrum pow (const Spectrum &a, const Spectrum &b)
 Returns the spectrum a elementwise to the power of b. More...
 
Spectrum pow (const Spectrum &a, Float32 b)
 Returns the spectrum a elementwise to the power of b. More...
 
Spectrum radians (const Spectrum &c)
 Converts elementwise degrees in c to radians. More...
 
Spectrum round (const Spectrum &c)
 Returns a spectrum with the elements of spectrum c rounded to nearest integers. More...
 
Spectrum rsqrt (const Spectrum &c)
 Returns the reciprocal of the square root of each element of c. More...
 
Spectrum saturate (const Spectrum &c)
 Returns the spectrum c clamped elementwise to the range [0,1]. More...
 
Spectrum sign (const Spectrum &c)
 Returns the elementwise sign of spectrum c. More...
 
Spectrum sin (const Spectrum &c)
 Returns a spectrum with the elementwise sine of the spectrum c. More...
 
void sincos (const Spectrum &a, Spectrum &s, Spectrum &c)
 Computes elementwise the sine s and cosine c of angles a simultaneously. More...
 
Spectrum smoothstep (const Spectrum &a, const Spectrum &b, const Spectrum &c)
 Returns 0 if c is less than a and 1 if c is greater than b in an elementwise fashion. More...
 
Spectrum smoothstep (const Spectrum &a, const Spectrum &b, Float32 x)
 Returns 0 if c is less than a and 1 if c is greater than b in an elementwise fashion. More...
 
Spectrum sqrt (const Spectrum &c)
 Returns the square root of each element of c. More...
 
Spectrum step (const Spectrum &a, const Spectrum &c)
 Returns elementwise 0 if c is less than a and 1 otherwise. More...
 
Spectrum tan (const Spectrum &c)
 Returns a spectrum with the elementwise tangent of the spectrum c. More...
 
bool isfinite (const Spectrum &c)
 Indicates whether all components of the spectrum are finite. More...
 
bool isinfinite (const Spectrum &c)
 Indicates whether any component of the spectrum is infinite. More...
 
bool isnan (const Spectrum &c)
 Indicates whether any component of the spectrum is "not a number". More...
 
MI_HOST_DEVICE_INLINE void to_rgbe (const Spectrum &c, Uint32 &rgbe)
 Encodes a spectrum into RGBE representation. More...
 
MI_HOST_DEVICE_INLINE void to_rgbe (const Spectrum &c, Uint8 rgbe[4])
 Encodes a spectrum into RGBE representation. More...
 
MI_HOST_DEVICE_INLINE void from_rgbe (const Uint8 rgbe[4], Spectrum &c)
 Decodes a color from RGBE representation. More...
 
MI_HOST_DEVICE_INLINE void from_rgbe (const Uint32 rgbe, Spectrum &c)
 Decodes a color from RGBE representation. More...
 
template<typename T , Size DIM>
T * vector_base_ptr (Vector_struct<T, DIM> &vec)
 Returns the base pointer to the vector data. More...
 
template<typename T , Size DIM>
const T * vector_base_ptr (const Vector_struct<T, DIM> &vec)
 Returns the base pointer to the vector data. More...
 
template<typename T>
T * vector_base_ptr (Vector_struct<T, 1> &vec)
 Returns the base pointer to the vector data, specialization for DIM==1. More...
 
template<typename T>
const T * vector_base_ptr (const Vector_struct<T, 1> &vec)
 Returns the base pointer to the vector data, specialization for DIM==1. More...
 
template<typename T>
T * vector_base_ptr (Vector_struct<T, 2> &vec)
 Returns the base pointer to the vector data, specialization for DIM==2. More...
 
template<typename T>
const T * vector_base_ptr (const Vector_struct<T, 2> &vec)
 Returns the base pointer to the vector data, specialization for DIM==2. More...
 
template<typename T>
T * vector_base_ptr (Vector_struct<T, 3> &vec)
 Returns the base pointer to the vector data, specialization for DIM==3. More...
 
template<typename T>
const T * vector_base_ptr (const Vector_struct<T, 3> &vec)
 Returns the base pointer to the vector data, specialization for DIM==3. More...
 
template<typename T>
T * vector_base_ptr (Vector_struct<T, 4> &vec)
 Returns the base pointer to the vector data, specialization for DIM==4. More...
 
template<typename T>
const T * vector_base_ptr (const Vector_struct<T, 4> &vec)
 Returns the base pointer to the vector data, specialization for DIM==4. More...
 
template<typename T , Size DIM>
Vector<T, DIM> & operator+= (Vector<T, DIM> &lhs, const Vector_struct<T, DIM> &rhs)
 Adds rhs elementwise to lhs and returns the modified lhs. More...
 
template<typename T , Size DIM>
Vector<T, DIM> & operator-= (Vector<T, DIM> &lhs, const Vector_struct<T, DIM> &rhs)
 Subtracts rhs elementwise from lhs and returns the modified lhs. More...
 
template<typename T , Size DIM>
Vector<T, DIM> & operator*= (Vector<T, DIM> &lhs, const Vector_struct<T, DIM> &rhs)
 Multiplies rhs elementwise with lhs and returns the modified lhs. More...
 
template<typename T , Size DIM>
Vector<T, DIM> & operator%= (Vector<T, DIM> &lhs, const Vector_struct<T, DIM> &rhs)
 Computes lhs modulo rhs elementwise and returns the modified lhs. More...
 
template<typename T , typename U , Size DIM>
Vector<T, DIM> & operator/= (Vector<T, DIM> &lhs, const Vector_struct<U, DIM> &rhs)
 Divides lhs elementwise by rhs and returns the modified lhs. More...
 
template<typename T , Size DIM>
Vector<T, DIM> operator+ (const Vector_struct<T, DIM> &lhs, const Vector_struct<T, DIM> &rhs)
 Adds lhs and rhs elementwise and returns the new result. More...
 
template<typename T , Size DIM>
Vector<T, DIM> operator- (const Vector_struct<T, DIM> &lhs, const Vector_struct<T, DIM> &rhs)
 Subtracts rhs elementwise from lhs and returns the new result. More...
 
template<typename T , Size DIM>
Vector<T, DIM> operator* (const Vector_struct<T, DIM> &lhs, const Vector_struct<T, DIM> &rhs)
 Multiplies rhs elementwise with lhs and returns the new result. More...
 
template<typename T , Size DIM>
Vector<T, DIM> operator% (const Vector_struct<T, DIM> &lhs, const Vector_struct<T, DIM> &rhs)
 Computes lhs modulo rhs elementwise and returns the new result. More...
 
template<typename T , typename U , Size DIM>
Vector<T, DIM> operator/ (const Vector_struct<T, DIM> &lhs, const Vector_struct<U, DIM> &rhs)
 Divides rhs elementwise by lhs and returns the new result. More...
 
template<typename T , Size DIM>
Vector<T, DIM> operator- (const Vector_struct<T, DIM> &v)
 Negates the vector v elementwise and returns the new result. More...
 
template<typename T , Size DIM>
Vector<T, DIM> & operator+= (Vector<T, DIM> &lhs, const Vector<T, DIM> &rhs)
 Adds rhs elementwise to lhs and returns the modified lhs. More...
 
template<typename T , Size DIM>
Vector<T, DIM> & operator-= (Vector<T, DIM> &lhs, const Vector<T, DIM> &rhs)
 Subtracts rhs elementwise from lhs and returns the modified lhs. More...
 
template<typename T , Size DIM>
Vector<T, DIM> & operator*= (Vector<T, DIM> &lhs, const Vector<T, DIM> &rhs)
 Multiplies rhs elementwise with lhs and returns the modified lhs. More...
 
template<typename T , Size DIM>
Vector<T, DIM> & operator%= (Vector<T, DIM> &lhs, const Vector<T, DIM> &rhs)
 Computes lhs modulo rhs elementwise and returns the modified lhs. More...
 
template<typename T , typename U , Size DIM>
Vector<T, DIM> & operator/= (Vector<T, DIM> &lhs, const Vector<U, DIM> &rhs)
 Divides lhs elementwise by rhs and returns the modified lhs. More...
 
template<typename T , Size DIM>
Vector<T, DIM> operator+ (const Vector<T, DIM> &lhs, const Vector<T, DIM> &rhs)
 Adds lhs and rhs elementwise and returns the new result. More...
 
template<typename T , Size DIM>
Vector<T, DIM> operator- (const Vector<T, DIM> &lhs, const Vector<T, DIM> &rhs)
 Subtracts rhs elementwise from lhs and returns the new result. More...
 
template<typename T , Size DIM>
Vector<T, DIM> operator* (const Vector<T, DIM> &lhs, const Vector<T, DIM> &rhs)
 Multiplies rhs elementwise with lhs and returns the new result. More...
 
template<typename T , Size DIM>
Vector<T, DIM> operator% (const Vector<T, DIM> &lhs, const Vector<T, DIM> &rhs)
 Computes lhs modulo rhs elementwise and returns the new result. More...
 
template<typename T , typename U , Size DIM>
Vector<T, DIM> operator/ (const Vector<T, DIM> &lhs, const Vector<U, DIM> &rhs)
 Divides rhs elementwise by lhs and returns the new result. More...
 
template<typename T , Size DIM>
Vector<T, DIM> operator- (const Vector<T, DIM> &v)
 Negates the vector v elementwise and returns the new result. More...
 
template<typename T , typename TT , Size DIM>
Vector<T, DIM> & operator*= (Vector<T, DIM> &v, TT s)
 Multiplies the vector v elementwise with the scalar s and returns the modified vector v. More...
 
template<typename T , typename TT , Size DIM>
Vector<T, DIM> & operator%= (Vector<T, DIM> &v, TT s)
 Computes v modulo s elementwise and returns the modified vector v. More...
 
template<typename T , typename TT , Size DIM>
Vector<T, DIM> & operator/= (Vector<T, DIM> &v, TT s)
 Divides the vector v elementwise by the scalar s and returns the modified vector v. More...
 
template<typename T , typename TT , Size DIM>
Vector<T, DIM> operator* (const Vector_struct<T, DIM> &v, TT s)
 Multiplies the vector v elementwise with the scalar s and returns the new result. More...
 
template<typename T , typename TT , Size DIM>
Vector<T, DIM> operator* (TT s, const Vector_struct<T, DIM> &v)
 Multiplies the vector v elementwise with the scalar s and returns the new result. More...
 
template<typename T , typename TT , Size DIM>
Vector<T, DIM> operator% (const Vector_struct<T, DIM> &v, TT s)
 Computes v modulo s elementwise and returns the new result. More...
 
template<typename T , typename TT , Size DIM>
Vector<T, DIM> operator/ (const Vector_struct<T, DIM> &v, TT s)
 Divides the vector v elementwise by the scalar s and returns the new result. More...
 
template<typename T , Size DIM>
Vector<T, DIM> & operator++ (Vector<T, DIM> &vec)
 Pre-increments all elements of vec and returns the result. Modifies vec. More...
 
template<typename T , Size DIM>
Vector<T, DIM> & operator-- (Vector<T, DIM> &vec)
 Pre-decrements all elements of vec and returns the result. Modifies vec. More...
 
template<Size DIM>
Vector<bool, DIM> operator&& (const Vector<bool, DIM> &lhs, const Vector<bool, DIM> &rhs)
 Returns the elementwise logical and of two boolean vectors. More...
 
template<Size DIM>
Vector<bool, DIM> operator&& (bool lhs, const Vector<bool, DIM> &rhs)
 Returns the elementwise logical and of a bool and a boolean vector. More...
 
template<Size DIM>
Vector<bool, DIM> operator&& (const Vector<bool, DIM> &lhs, bool rhs)
 Returns the elementwise logical and of a boolean vector and a bool. More...
 
template<Size DIM>
Vector<bool, DIM> operator|| (const Vector<bool, DIM> &lhs, const Vector<bool, DIM> &rhs)
 Returns the elementwise logical or of two boolean vectors. More...
 
template<Size DIM>
Vector<bool, DIM> operator|| (bool lhs, const Vector<bool, DIM> &rhs)
 Returns the elementwise logical or of a bool and a boolean vector. More...
 
template<Size DIM>
Vector<bool, DIM> operator|| (const Vector<bool, DIM> &lhs, bool rhs)
 Returns the elementwise logical or of a boolean vector and a bool. More...
 
template<Size DIM>
Vector<bool, DIM> operator^ (const Vector<bool, DIM> &lhs, const Vector<bool, DIM> &rhs)
 Returns the elementwise logical xor of two boolean vectors. More...
 
template<Size DIM>
Vector<bool, DIM> operator^ (bool lhs, const Vector<bool, DIM> &rhs)
 Returns the elementwise logical xor of a bool and a boolean vector. More...
 
template<Size DIM>
Vector<bool, DIM> operator^ (const Vector<bool, DIM> &lhs, bool rhs)
 Returns the elementwise logical xor of a boolean vector and a bool. More...
 
template<Size DIM>
Vector<bool, DIM> operator! (const Vector<bool, DIM> &vec)
 Returns the elementwise logical not of a boolean vector. More...
 
template<typename T , Size DIM>
Vector<bool, DIM> elementwise_is_equal (const Vector<T, DIM> &lhs, const Vector<T, DIM> &rhs)
 Returns the boolean vector result of an elementwise equality comparison. More...
 
template<typename T , Size DIM>
Vector<bool, DIM> elementwise_is_not_equal (const Vector<T, DIM> &lhs, const Vector<T, DIM> &rhs)
 Returns the boolean vector result of an elementwise inequality comparison. More...
 
template<typename T , Size DIM>
Vector<bool, DIM> elementwise_is_less_than (const Vector<T, DIM> &lhs, const Vector<T, DIM> &rhs)
 Returns the boolean vector result of an elementwise less-than comparison. More...
 
template<typename T , Size DIM>
Vector<bool, DIM> elementwise_is_less_than_or_equal (const Vector<T, DIM> &lhs, const Vector<T, DIM> &rhs)
 Returns the boolean vector result of an elementwise less-than-or-equal comparison. More...
 
template<typename T , Size DIM>
Vector<bool, DIM> elementwise_is_greater_than (const Vector<T, DIM> &lhs, const Vector<T, DIM> &rhs)
 Returns the boolean vector result of an elementwise greater-than comparison. More...
 
template<typename T , Size DIM>
Vector<bool, DIM> elementwise_is_greater_than_or_equal (const Vector<T, DIM> &lhs, const Vector<T, DIM> &rhs)
 Returns the boolean vector result of an elementwise greater-than-or-equal comparison. More...
 
template<typename T , Size DIM>
Vector<T, DIM> abs (const Vector_struct<T, DIM> &v)
 Returns a vector with the elementwise absolute values of the vector v. More...
 
template<typename T , Size DIM>
Vector<T, DIM> acos (const Vector_struct<T, DIM> &v)
 Returns a vector with the elementwise arc cosine of the vector v. More...
 
template<typename T , Size DIM>
bool all (const Vector_struct<T, DIM> &v)
 Returns true if all of all elements of v returns true. More...
 
template<typename T , Size DIM>
bool any (const Vector_struct<T, DIM> &v)
 Returns true if any of any element of v returns true. More...
 
template<typename T , Size DIM>
Vector<T, DIM> asin (const Vector_struct<T, DIM> &v)
 Returns a vector with the elementwise arc sine of the vector v. More...
 
template<typename T , Size DIM>
Vector<T, DIM> atan (const Vector_struct<T, DIM> &v)
 Returns a vector with the elementwise arc tangent of the vector v. More...
 
template<typename T , Size DIM>
Vector<T, DIM> atan2 (const Vector_struct<T, DIM> &v, const Vector_struct<T, DIM> &w)
 Returns a vector with the elementwise arc tangent of the vector v / w. More...
 
template<typename T , Size DIM>
Vector<T, DIM> ceil (const Vector_struct<T, DIM> &v)
 Returns a vector with the elementwise smallest integral value that is not less than the element in vector v. More...
 
template<typename T , Size DIM>
Vector<T, DIM> clamp (const Vector_struct<T, DIM> &v, const Vector_struct<T, DIM> &low, const Vector_struct<T, DIM> &high)
 Returns the vector v elementwise clamped to the range [low, high]. More...
 
template<typename T , Size DIM>
Vector<T, DIM> clamp (const Vector_struct<T, DIM> &v, const Vector_struct<T, DIM> &low, T high)
 Returns the vector v elementwise clamped to the range [low, high]. More...
 
template<typename T , Size DIM>
Vector<T, DIM> clamp (const Vector_struct<T, DIM> &v, T low, const Vector_struct<T, DIM> &high)
 Returns the vector v elementwise clamped to the range [low, high]. More...
 
template<typename T , Size DIM>
Vector<T, DIM> clamp (const Vector_struct<T, DIM> &v, T low, T high)
 Returns the vector v elementwise clamped to the range [low, high]. More...
 
template<typename T , Size DIM>
Vector<T, DIM> cos (const Vector_struct<T, DIM> &v)
 Returns a vector with the elementwise cosine of the vector v. More...
 
template<typename T , Size DIM>
Vector<T, DIM> degrees (const Vector_struct<T, DIM> &v)
 Converts elementwise radians in v to degrees. More...
 
template<typename T , Size DIM>
Vector<T, DIM> elementwise_max (const Vector_struct<T, DIM> &lhs, const Vector_struct<T, DIM> &rhs)
 Returns elementwise maximum of two vectors. More...
 
template<typename T , Size DIM>
Vector<T, DIM> elementwise_min (const Vector_struct<T, DIM> &lhs, const Vector_struct<T, DIM> &rhs)
 Returns elementwise minimum of two vectors. More...
 
template<typename T , Size DIM>
Vector<T, DIM> exp (const Vector_struct<T, DIM> &v)
 Returns a vector with elementwise e to the power of the element in the vector v. More...
 
template<typename T , Size DIM>
Vector<T, DIM> exp2 (const Vector_struct<T, DIM> &v)
 Returns a vector with elementwise 2 to the power of the element in the vector v. More...
 
template<typename T , Size DIM>
Vector<T, DIM> floor (const Vector_struct<T, DIM> &v)
 Returns a vector with the elementwise largest integral value that is not greater than the element in vector v. More...
 
template<typename T , Size DIM>
Vector<T, DIM> fmod (const Vector_struct<T, DIM> &a, const Vector_struct<T, DIM> &b)
 Returns elementwise a modulo b, in other words, the remainder of a/b. More...
 
template<typename T , Size DIM>
Vector<T, DIM> fmod (const Vector_struct<T, DIM> &a, T b)
 Returns elementwise a modulo b, in other words, the remainder of a/b. More...
 
template<typename T , Size DIM>
Vector<T, DIM> frac (const Vector_struct<T, DIM> &v)
 Returns a vector with the elementwise positive fractional part of the vector v. More...
 
template<typename T , Size DIM>
bool is_approx_equal (const Vector_struct<T, DIM> &left, const Vector_struct<T, DIM> &right, T e)
 Compares the two given values elementwise for equality within the given epsilon. More...
 
template<typename T , Size DIM>
Vector<T, DIM> lerp (const Vector_struct<T, DIM> &v1, const Vector_struct<T, DIM> &v2, const Vector_struct<T, DIM> &t)
 Returns the elementwise linear interpolation between v1 and v2, i.e., it returns (1-t) * v1 + t * v2. More...
 
template<typename T , Size DIM>
Vector<T, DIM> lerp (const Vector_struct<T, DIM> &v1, const Vector_struct<T, DIM> &v2, T t)
 Returns the linear interpolation between v1 and v2, i.e., it returns (1-t) * v1 + t * v2. More...
 
template<typename T , Size DIM>
Vector<T, DIM> log (const Vector_struct<T, DIM> &v)
 Returns a vector with the elementwise natural logarithm of the vector v. More...
 
template<typename T , Size DIM>
Vector<T, DIM> log2 (const Vector_struct<T, DIM> &v)
 Returns a vector with the elementwise base 2 logarithm of the vector v. More...
 
template<typename T , Size DIM>
Vector<T, DIM> log10 (const Vector_struct<T, DIM> &v)
 Returns a vector with the elementwise base 10 logarithm of the vector v. More...
 
template<typename T , Size DIM>
Vector<T, DIM> modf (const Vector_struct<T, DIM> &v, Vector<T, DIM> &i)
 Returns the elementwise fractional part of v and stores the elementwise integral part of v in i. More...
 
template<typename T , Size DIM>
Vector<T, DIM> pow (const Vector_struct<T, DIM> &a, const Vector_struct<T, DIM> &b)
 Returns the vector a elementwise to the power of b. More...
 
template<typename T , Size DIM>
Vector<T, DIM> pow (const Vector_struct<T, DIM> &a, T b)
 Returns the vector a elementwise to the power of b. More...
 
template<typename T , Size DIM>
Vector<T, DIM> radians (const Vector_struct<T, DIM> &v)
 Converts elementwise degrees in v to radians. More...
 
template<typename T , Size DIM>
Vector<T, DIM> round (const Vector_struct<T, DIM> &v)
 Returns a vector with the elements of vector v rounded to nearest integers. More...
 
template<typename T , Size DIM>
Vector<T, DIM> rsqrt (const Vector_struct<T, DIM> &v)
 Returns the reciprocal of the square root of each element of v. More...
 
template<typename T , Size DIM>
Vector<T, DIM> saturate (const Vector_struct<T, DIM> &v)
 Returns the vector v clamped elementwise to the range [0,1]. More...
 
template<typename T , Size DIM>
Vector<T, DIM> sign (const Vector_struct<T, DIM> &v)
 Returns the elementwise sign of vector v. More...
 
template<typename T , Size DIM>
Vector<T, DIM> sin (const Vector_struct<T, DIM> &v)
 Returns a vector with the elementwise sine of the vector v. More...
 
template<typename T , Size DIM>
void sincos (const Vector_struct<T, DIM> &a, Vector<T, DIM> &s, Vector<T, DIM> &c)
 Computes elementwise the sine s and cosine c of angles a simultaneously. More...
 
template<typename T , Size DIM>
Vector<T, DIM> smoothstep (const Vector_struct<T, DIM> &a, const Vector_struct<T, DIM> &b, const Vector_struct<T, DIM> &v)
 Returns 0 if v is less than a and 1 if v is greater than b in an elementwise fashion. More...
 
template<typename T , Size DIM>
Vector<T, DIM> smoothstep (const Vector_struct<T, DIM> &a, const Vector_struct<T, DIM> &b, T x)
 Returns 0 if x is less than a and 1 if x is greater than b in an elementwise fashion. More...
 
template<typename T , Size DIM>
Vector<T, DIM> sqrt (const Vector_struct<T, DIM> &v)
 Returns the square root of each element of v. More...
 
template<typename T , Size DIM>
Vector<T, DIM> step (const Vector_struct<T, DIM> &a, const Vector_struct<T, DIM> &v)
 Returns elementwise 0 if v is less than a and 1 otherwise. More...
 
template<typename T , Size DIM>
Vector<T, DIM> tan (const Vector_struct<T, DIM> &v)
 Returns a vector with the elementwise tangent of the vector v. More...
 
template<typename T>
cross (const Vector_struct<T, 2> &lhs, const Vector_struct<T, 2> &rhs)
 Returns the two-times-two determinant result for the two vectors lhs and rhs. More...
 
template<typename T>
Vector<T, 3> cross (const Vector_struct<T, 3> &lhs, const Vector_struct<T, 3> &rhs)
 Returns the three-dimensional cross product result for the two vectors lhs and rhs. More...
 
template<typename T>
void make_basis (const Vector<T, 3> &n, Vector<T, 3> *u, Vector<T, 3> *v)
 Computes a basis of 3D space with one given vector. More...
 
template<typename T>
void make_basis (const Vector<T, 3> &n, const Vector<T, 3> &u, const Vector<T, 3> &v, Vector<T, 3> *t, Vector<T, 3> *b)
 Computes a basis of 3D space with one given vector, plane, and direction. More...
 
template<typename T2 , Size DIM2, typename T1 , Size DIM1>
Vector<T2, DIM2> convert_vector (const Vector<T1, DIM1> &v, const T2 &fill=T2(0))
 Converts the vector v of type Vector<T1, DIM1> to a vector of type Vector<T2, DIM2>. More...
 

Detailed Description

Namespace for the Math API.