NTrace
GPU ray tracing framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Math.hpp File Reference
#include "base/DLLImports.hpp"
#include <math.h>
#include <vector_types.h>
#include <stdio.h>

Go to the source code of this file.

Classes

class  FW::Vector< T, L >
 
class  FW::VectorBase< T, L, S >
 
class  FW::Vector< T, L >
 
class  FW::Vec2i
 
class  FW::Vec3i
 
class  FW::Vec4i
 
class  FW::Vec2f
 
class  FW::Vec3f
 
class  FW::Vec4f
 
class  FW::Vec2d
 
class  FW::Vec3d
 
class  FW::Vec4d
 
class  FW::MatrixBase
 
class  FW::Matrix< T, L >
 
class  FW::Mat2f
 
class  FW::Mat3f
 
class  FW::Mat4f
 
class  FW::Mat2d
 
class  FW::Mat3d
 
class  FW::Mat4d
 

Namespaces

 FW
 Scene class declarations.
 

Macros

#define MINMAX(T)
 

Functions

FW_CUDA_FUNC F32 FW::sqrt (F32 a)
 
FW_CUDA_FUNC F64 FW::sqrt (F64 a)
 
FW_CUDA_FUNC S32 FW::abs (S32 a)
 
FW_CUDA_FUNC S64 FW::abs (S64 a)
 
FW_CUDA_FUNC F32 FW::abs (F32 a)
 
FW_CUDA_FUNC F64 FW::abs (F64 a)
 
FW_CUDA_FUNC F64 FW::pow (F64 a, F64 b)
 
FW_CUDA_FUNC F64 FW::exp (F64 a)
 
FW_CUDA_FUNC F64 FW::log (F64 a)
 
FW_CUDA_FUNC F64 FW::sin (F64 a)
 
FW_CUDA_FUNC F64 FW::cos (F64 a)
 
FW_CUDA_FUNC F64 FW::tan (F64 a)
 
FW_CUDA_FUNC F32 FW::asin (F32 a)
 
FW_CUDA_FUNC F64 FW::asin (F64 a)
 
FW_CUDA_FUNC F32 FW::acos (F32 a)
 
FW_CUDA_FUNC F64 FW::acos (F64 a)
 
FW_CUDA_FUNC F32 FW::atan (F32 a)
 
FW_CUDA_FUNC F64 FW::atan (F64 a)
 
FW_CUDA_FUNC F64 FW::atan2 (F64 y, F64 x)
 
FW_CUDA_FUNC F32 FW::atan2 (F32 y, F32 x)
 
FW_CUDA_FUNC F32 FW::floor (F32 a)
 
FW_CUDA_FUNC F64 FW::floor (F64 a)
 
FW_CUDA_FUNC F32 FW::ceil (F32 a)
 
FW_CUDA_FUNC F64 FW::ceil (F64 a)
 
FW_CUDA_FUNC U64 FW::doubleToBits (F64 a)
 
FW_CUDA_FUNC F64 FW::bitsToDouble (U64 a)
 
F32 FW::pow (F32 a, F32 b)
 
F32 FW::exp (F32 a)
 
F32 FW::exp2 (F32 a)
 
F64 FW::exp2 (F64 a)
 
F32 FW::log (F32 a)
 
F32 FW::log2 (F32 a)
 
F64 FW::log2 (F64 a)
 
F32 FW::sin (F32 a)
 
F32 FW::cos (F32 a)
 
F32 FW::tan (F32 a)
 
U32 FW::floatToBits (F32 a)
 
F32 FW::bitsToFloat (U32 a)
 
F32 FW::exp2 (int a)
 
F32 FW::fastMin (F32 a, F32 b)
 
F32 FW::fastMax (F32 a, F32 b)
 
F64 FW::fastMin (F64 a, F64 b)
 
F64 FW::fastMax (F64 a, F64 b)
 
FW_CUDA_FUNC F32 FW::scale (F32 a, int b)
 
FW_CUDA_FUNC int FW::popc8 (U32 mask)
 
FW_CUDA_FUNC int FW::popc16 (U32 mask)
 
FW_CUDA_FUNC int FW::popc32 (U32 mask)
 
FW_CUDA_FUNC int FW::popc64 (U64 mask)
 
FW_CUDA_FUNC F32 FW::fastClamp (F32 v, F32 lo, F32 hi)
 
FW_CUDA_FUNC F64 FW::fastClamp (F64 v, F64 lo, F64 hi)
 
template<class T >
FW_CUDA_FUNCFW::sqr (const T &a)
 
template<class T >
FW_CUDA_FUNCFW::rcp (const T &a)
 
template<class A , class B >
FW_CUDA_FUNCFW::lerp (const A &a, const A &b, const B &t)
 
template<class T , int L, class S >
FW_CUDA_FUNCFW::lenSqr (const VectorBase< T, L, S > &v)
 
template<class T , int L, class S >
FW_CUDA_FUNCFW::length (const VectorBase< T, L, S > &v)
 
template<class T , int L, class S >
FW_CUDA_FUNCFW::normalize (const VectorBase< T, L, S > &v, T len=(T) 1)
 
template<class T , int L, class S >
FW_CUDA_FUNCFW::min (const VectorBase< T, L, S > &v)
 
template<class T , int L, class S >
FW_CUDA_FUNCFW::max (const VectorBase< T, L, S > &v)
 
template<class T , int L, class S >
FW_CUDA_FUNCFW::sum (const VectorBase< T, L, S > &v)
 
template<class T , int L, class S >
FW_CUDA_FUNCFW::abs (const VectorBase< T, L, S > &v)
 
template<class T , int L, class S >
FW_CUDA_FUNCFW::operator+ (const T &a, const VectorBase< T, L, S > &b)
 
template<class T , int L, class S >
FW_CUDA_FUNCFW::operator- (const T &a, const VectorBase< T, L, S > &b)
 
template<class T , int L, class S >
FW_CUDA_FUNCFW::operator* (const T &a, const VectorBase< T, L, S > &b)
 
template<class T , int L, class S >
FW_CUDA_FUNCFW::operator/ (const T &a, const VectorBase< T, L, S > &b)
 
template<class T , int L, class S >
FW_CUDA_FUNCFW::operator% (const T &a, const VectorBase< T, L, S > &b)
 
template<class T , int L, class S >
FW_CUDA_FUNCFW::operator& (const T &a, const VectorBase< T, L, S > &b)
 
template<class T , int L, class S >
FW_CUDA_FUNCFW::operator| (const T &a, const VectorBase< T, L, S > &b)
 
template<class T , int L, class S >
FW_CUDA_FUNCFW::operator^ (const T &a, const VectorBase< T, L, S > &b)
 
template<class T , int L, class S >
FW_CUDA_FUNCFW::operator<< (const T &a, const VectorBase< T, L, S > &b)
 
template<class T , int L, class S >
FW_CUDA_FUNCFW::operator>> (const T &a, const VectorBase< T, L, S > &b)
 
template<class T , int L, class S , class V >
FW_CUDA_FUNCFW::dot (const VectorBase< T, L, S > &a, const VectorBase< T, L, V > &b)
 
FW_CUDA_FUNC Vec2f FW::perpendicular (const Vec2f &v)
 
FW_CUDA_FUNC Vec2d FW::perpendicular (const Vec2d &v)
 
FW_CUDA_FUNC F32 FW::cross (const Vec2f &a, const Vec2f &b)
 
FW_CUDA_FUNC F64 FW::cross (const Vec2d &a, const Vec2d &b)
 
FW_CUDA_FUNC Vec3f FW::cross (const Vec3f &a, const Vec3f &b)
 
FW_CUDA_FUNC Vec3d FW::cross (const Vec3d &a, const Vec3d &b)
 
 FW::MINMAX (Vec2i) MINMAX(Vec3i) MINMAX(Vec4i) MINMAX(Vec2f) MINMAX(Vec3f) MINMAX(Vec4f) MINMAX(Vec2d) MINMAX(Vec3d) MINMAX(Vec4d) template< class T
 
template<class T , int L, class S >
FW_CUDA_FUNC Matrix< T, L > FW::outerProduct (const VectorBase< T, L, S > &a, const VectorBase< T, L, S > &b)
 
template<class T , int L, class S >
FW_CUDA_FUNCFW::det (const MatrixBase< T, L, S > &v)
 
template<class T , int L, class S >
FW_CUDA_FUNCFW::transpose (const MatrixBase< T, L, S > &v)
 
template<class T , int L, class S >
FW_CUDA_FUNCFW::invert (const MatrixBase< T, L, S > &v)
 
template<class T , int L, class S >
FW_CUDA_FUNCFW::operator+ (const T &a, const MatrixBase< T, L, S > &b)
 
template<class T , int L, class S >
FW_CUDA_FUNCFW::operator- (const T &a, const MatrixBase< T, L, S > &b)
 
template<class T , int L, class S >
FW_CUDA_FUNCFW::operator* (const T &a, const MatrixBase< T, L, S > &b)
 
template<class T , int L, class S >
FW_CUDA_FUNCFW::operator/ (const T &a, const MatrixBase< T, L, S > &b)
 
template<class T , int L, class S >
FW_CUDA_FUNCFW::operator% (const T &a, const MatrixBase< T, L, S > &b)
 
template<class T , int L, class S >
FW_CUDA_FUNCFW::operator& (const T &a, const MatrixBase< T, L, S > &b)
 
template<class T , int L, class S >
FW_CUDA_FUNCFW::operator| (const T &a, const MatrixBase< T, L, S > &b)
 
template<class T , int L, class S >
FW_CUDA_FUNCFW::operator^ (const T &a, const MatrixBase< T, L, S > &b)
 
template<class T , int L, class S >
FW_CUDA_FUNCFW::operator<< (const T &a, const MatrixBase< T, L, S > &b)
 
template<class T , int L, class S >
FW_CUDA_FUNCFW::operator>> (const T &a, const MatrixBase< T, L, S > &b)
 
template<class T , int L, class S >
FW_CUDA_FUNCFW::detImpl (const MatrixBase< T, L, S > &v)
 
template<class T , class S >
FW_CUDA_FUNCFW::detImpl (const MatrixBase< T, 1, S > &v)
 
template<class T , class S >
FW_CUDA_FUNCFW::detImpl (const MatrixBase< T, 2, S > &v)
 
template<class T , class S >
FW_CUDA_FUNCFW::detImpl (const MatrixBase< T, 3, S > &v)
 
template<class T , int L, class S >
Matrix< T, L > FW::outerProduct (const VectorBase< T, L, S > &a, const VectorBase< T, L, S > &b)
 

Variables

int FW::L
 
FW_CUDA_CONST int FW::c_popc8LUT []
 

Macro Definition Documentation

#define MINMAX (   T)
Value:
FW_CUDA_FUNC T min(const T& a, const T& b) { return a.min(b); } \
FW_CUDA_FUNC T min(T& a, T& b) { return a.min(b); } \
FW_CUDA_FUNC T max(const T& a, const T& b) { return a.max(b); } \
FW_CUDA_FUNC T max(T& a, T& b) { return a.max(b); } \
FW_CUDA_FUNC T min(const T& a, const T& b, const T& c) { return a.min(b).min(c); } \
FW_CUDA_FUNC T min(T& a, T& b, T& c) { return a.min(b).min(c); } \
FW_CUDA_FUNC T max(const T& a, const T& b, const T& c) { return a.max(b).max(c); } \
FW_CUDA_FUNC T max(T& a, T& b, T& c) { return a.max(b).max(c); } \
FW_CUDA_FUNC T min(const T& a, const T& b, const T& c, const T& d) { return a.min(b).min(c).min(d); } \
FW_CUDA_FUNC T min(T& a, T& b, T& c, T& d) { return a.min(b).min(c).min(d); } \
FW_CUDA_FUNC T max(const T& a, const T& b, const T& c, const T& d) { return a.max(b).max(c).max(d); } \
FW_CUDA_FUNC T max(T& a, T& b, T& c, T& d) { return a.max(b).max(c).max(d); } \
FW_CUDA_FUNC T clamp(const T& v, const T& lo, const T& hi) { return v.clamp(lo, hi); } \
FW_CUDA_FUNC T clamp(T& v, T& lo, T& hi) { return v.clamp(lo, hi); }
#define FW_CUDA_FUNC
Definition: Defs.hpp:74
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void p CUfunction unsigned int bytes CUtexref pTexRef CUtexref CUarray unsigned int Flags CUtexref int CUaddress_mode am CUtexref unsigned int Flags CUaddress_mode CUtexref int dim CUarray_format int CUtexref hTexRef CUfunction unsigned int numbytes CUfunction int float value CUfunction int CUtexref hTexRef CUfunction int int grid_height CUevent unsigned int Flags CUevent hEvent CUevent hEvent CUstream unsigned int Flags CUstream hStream GLuint bufferobj unsigned int CUdevice dev CUdeviceptr unsigned int CUmodule const char name CUdeviceptr unsigned int bytesize CUdeviceptr dptr void unsigned int bytesize void CUdeviceptr unsigned int ByteCount CUarray unsigned int CUdeviceptr unsigned int ByteCount CUarray unsigned int const void unsigned int ByteCount CUarray unsigned int CUarray unsigned int unsigned int ByteCount void CUarray unsigned int unsigned int CUstream hStream const CUDA_MEMCPY2D pCopy CUdeviceptr const void unsigned int CUstream hStream const CUDA_MEMCPY2D CUstream hStream CUdeviceptr unsigned char unsigned int N CUdeviceptr unsigned int unsigned int N CUdeviceptr unsigned int unsigned short unsigned int unsigned int Height CUarray const CUDA_ARRAY_DESCRIPTOR pAllocateArray CUarray const CUDA_ARRAY3D_DESCRIPTOR pAllocateArray unsigned int CUtexref CUdeviceptr unsigned int bytes CUcontext unsigned int CUdevice device GLenum texture GLenum GLuint buffer GLenum GLuint renderbuffer GLenum GLsizeiptr const GLvoid GLenum usage GLuint shader GLenum type GLsizei const GLuint framebuffers GLsizei const GLuint renderbuffers GLuint v
Definition: DLLImports.inl:329
FW_CUDA_FUNC T min(const VectorBase< T, L, S > &v)
Definition: Math.hpp:461
FW_CUDA_FUNC T max(const VectorBase< T, L, S > &v)
Definition: Math.hpp:462

Definition at line 486 of file Math.hpp.