OpenVDB 13.1.0
Loading...
Searching...
No Matches
nanovdb::math Namespace Reference

Classes

struct  BaseBBox
class  BaseStencil
struct  BBox
struct  BBox< CoordT, false >
 Partial template specialization for integer coordinate types. More...
struct  BBox< Vec3T, true >
 Partial template specialization for floating point coordinate types. More...
class  BoxStencil
class  Coord
 Signed (i, j, k) 32-bit integer coordinate class, similar to openvdb::math::Coord. More...
class  Coord2
 Signed (i, j) 32-bit integer coordinate class, similar to openvdb::math::Coord. More...
class  CurvatureStencil
class  DDA
 A Digital Differential Analyzer. Unlike HDDA (defined above) this DDA uses a fixed step-size defined by the template parameter Dim! More...
struct  Delta
 Delta for small floating-point offsets. More...
struct  Delta< double >
struct  Delta< float >
class  DitherLUT
class  GradStencil
class  HDDA
 A Digital Differential Analyzer specialized for OpenVDB grids. More...
class  Mat2
class  Mat2x3
class  Mat3
class  Mat3x2
class  Mat4
class  MatBase
struct  Maximum
 Maximum floating-point values. More...
class  PointTreeMarcher
 A Tree Marcher for Point Grids. More...
class  Ray
class  Rgba8
 8-bit red, green, blue, alpha packed into 32 bit unsigned int More...
class  SampleFromVoxels
class  SampleFromVoxels< TreeOrAccT, 0, false >
 Nearest neighbor, i.e. zero order, interpolator without caching. More...
class  SampleFromVoxels< TreeOrAccT, 0, true >
 Nearest neighbor, i.e. zero order, interpolator with caching. More...
class  SampleFromVoxels< TreeOrAccT, 1, false >
 Template specialization that does not use caching of stencil points. More...
class  SampleFromVoxels< TreeOrAccT, 1, true >
 Template specialization with caching of stencil values. More...
class  SampleFromVoxels< TreeOrAccT, 2, false >
 Template specialization that does not use caching of stencil points. More...
class  SampleFromVoxels< TreeOrAccT, 2, true >
 Template specialization with caching of stencil values. More...
class  SampleFromVoxels< TreeOrAccT, 3, false >
class  SampleFromVoxels< TreeOrAccT, 3, true >
struct  Tolerance
 Tolerance for floating-point comparison. More...
struct  Tolerance< double >
struct  Tolerance< float >
class  TreeMarcher
 A Tree Marcher for Generic Grids. More...
class  TricubicSampler
 Tri-cubic sampler, i.e. third order, interpolator. More...
class  TrilinearSampler
 Tri-linear sampler, i.e. first order, interpolator. More...
class  TriquadraticSampler
 Tri-quadratic sampler, i.e. second order, interpolator. More...
class  Vec2
 A simple vector class with three components, similar to openvdb::math::Vec3. More...
class  Vec3
 A simple vector class with three components, similar to openvdb::math::Vec3. More...
class  Vec4
 A simple vector class with four components, similar to openvdb::math::Vec4. More...
class  WenoStencil
 This is a special 19-point stencil that supports optimal fifth-order WENO upwinding, second-order central differencing, Laplacian, and zero-crossing test. More...

Typedefs

using Coord3 = Coord
 Type alias for Coord so we have a consistent naming convention.
using Vec3d = Vec3<double>
using Vec3f = Vec3<float>
using Vec3i = Vec3<int32_t>
using Vec3u = Vec3<uint32_t>
using Vec3u8 = Vec3<uint8_t>
using Vec3u16 = Vec3<uint16_t>
using Vec4R = Vec4<double>
using Vec4d = Vec4<double>
using Vec4f = Vec4<float>
using Vec4i = Vec4<int>

Functions

template<typename RayT, typename AccT>
__hostdev__ bool zeroCrossing (RayT &ray, AccT &acc, Coord &ijk, typename AccT::ValueType &v, float &t)
 returns true if the ray intersects a zero-crossing at the voxel level of the grid in the accessor The empty-space ray-marching is performed at all levels of the tree using an HDDA. If an intersection is detected, then ijk is updated with the index coordinate of the closest voxel after the intersection point, v contains the grid values at ijk, and t is set to the time of the intersection along the ray.
template<typename RayT, typename AccT>
__hostdev__ bool ZeroCrossing (RayT &ray, AccT &acc, Coord &ijk, typename AccT::ValueType &v, float &t)
template<typename RayT, typename AccT>
__hostdev__ bool isoCrossing (RayT &ray, AccT &acc, Coord &ijk, typename AccT::ValueType &v, float &t, const typename AccT::ValueType &iso=0.0f)
template<typename RayT, typename NodeT>
__hostdev__ bool zeroCrossingNode (RayT &ray, const NodeT &node, float v0, nanovdb::math::Coord &ijk, float &v, float &t)
template<typename RayT, typename NodeT>
__hostdev__ bool ZeroCrossingNode (RayT &ray, const NodeT &node, float v0, nanovdb::math::Coord &ijk, float &v, float &t)
template<typename RayT, typename AccT>
__hostdev__ bool firstActive (RayT &ray, AccT &acc, Coord &ijk, float &t)
 returns true if the ray intersects an active value at any level of the grid in the accessor. The empty-space ray-marching is performed at all levels of the tree using an HDDA. If an intersection is detected, then ijk is updated with the index coordinate of the first active voxel or tile, and t is set to the time of its intersection along the ray.
template<typename T>
__hostdev__ constexpr T pi ()
 Pi constant taken from Boost to match old behaviour.
template<>
__hostdev__ constexpr float pi ()
template<>
__hostdev__ constexpr double pi ()
template<>
__hostdev__ constexpr long double pi ()
template<typename Type>
__hostdev__ bool isApproxZero (const Type &x)
template<typename Type>
__hostdev__ Type Min (Type a, Type b)
__hostdev__ int32_t Min (int32_t a, int32_t b)
__hostdev__ uint32_t Min (uint32_t a, uint32_t b)
__hostdev__ float Min (float a, float b)
__hostdev__ double Min (double a, double b)
template<typename Type>
__hostdev__ Type Max (Type a, Type b)
__hostdev__ int32_t Max (int32_t a, int32_t b)
__hostdev__ uint32_t Max (uint32_t a, uint32_t b)
__hostdev__ float Max (float a, float b)
__hostdev__ double Max (double a, double b)
__hostdev__ float Clamp (float x, float a, float b)
__hostdev__ double Clamp (double x, double a, double b)
__hostdev__ float Fract (float x)
__hostdev__ double Fract (double x)
__hostdev__ int32_t Floor (float x)
__hostdev__ int32_t Floor (double x)
__hostdev__ int32_t Ceil (float x)
__hostdev__ int32_t Ceil (double x)
template<typename T>
__hostdev__Pow2 (T x)
template<typename T>
__hostdev__Pow3 (T x)
template<typename T>
__hostdev__Pow4 (T x)
template<typename T>
__hostdev__Abs (T x)
template<>
__hostdev__ float Abs (float x)
template<>
__hostdev__ double Abs (double x)
template<>
__hostdev__ int Abs (int x)
template<typename CoordT, typename RealT, template< typename > class Vec3T>
__hostdev__ CoordT Round (const Vec3T< RealT > &xyz)
template<typename CoordT, template< typename > class Vec3T>
__hostdev__ CoordT Round (const Vec3T< float > &xyz)
template<typename CoordT, template< typename > class Vec3T>
__hostdev__ CoordT Round (const Vec3T< double > &xyz)
template<typename CoordT, typename RealT, template< typename > class Vec3T>
__hostdev__ CoordT RoundDown (const Vec3T< RealT > &xyz)
__hostdev__ float Sqrt (float x)
 Return the square root of a floating-point value.
__hostdev__ double Sqrt (double x)
template<typename T>
__hostdev__Sign (const T &x)
 Return the sign of the given value as an integer (either -1, 0 or 1).
template<typename Vec3T>
__hostdev__ int MinIndex (const Vec3T &v)
template<typename Vec3T>
__hostdev__ int MaxIndex (const Vec3T &v)
template<uint64_t wordSize>
__hostdev__ uint64_t AlignUp (uint64_t byteCount)
 round up byteSize to the nearest wordSize, e.g. to align to machine word: AlignUp<sizeof(size_t)(n)
template<typename T1, typename T2>
__hostdev__ Vec2< T2 > operator* (T1 scalar, const Vec2< T2 > &vec)
template<typename T1, typename T2>
__hostdev__ Vec2< T2 > operator/ (T1 scalar, const Vec2< T2 > &vec)
template<typename T>
__hostdev__ Mat2< T > operator* (const T &s, const Mat2< T > &m)
 Multiply a scalar by a 2x2 matrix, result is a 2x2 matrix.
template<typename T>
__hostdev__ Mat2< T > operator* (const Mat2x3< T > &lhs, const Mat3x2< T > &rhs)
 Multiply a 2x3 matrix by a 3x2 matrix, result is a 2x2 matrix.
template<typename T>
__hostdev__ Mat2x3< T > operator* (const Mat3< T > &lhs, const Mat2x3< T > &rhs)
 Multiply a 3x3 matrix by a 2x3 matrix, result is a 2x3 matrix.
template<typename T>
__hostdev__ Mat2x3< T > operator* (const Mat2x3< T > &lhs, const Mat3< T > &rhs)
 Multiply a 2x3 matrix by a 3x3 matrix, result is a 2x3 matrix.
template<typename T>
__hostdev__ Mat3x2< T > operator* (const Mat3x2< T > &lhs, const Mat2< T > &rhs)
 Multiply a 3x2 matrix by a 2x2 matrix, result is a 3x2 matrix.
template<typename T>
__hostdev__ Mat2x3< T > operator* (const Mat2< T > &lhs, const Mat2x3< T > &rhs)
 Multiply a 2x2 matrix by a 2x3 matrix, result is a 2x3 matrix.
template<typename T>
__hostdev__ Mat3< T > operator* (const Mat3x2< T > &lhs, const Mat2x3< T > &rhs)
 Multiply a 3x2 matrix by a 2x3 matrix, result is a 3x3 matrix.
template<typename T1, typename T2>
__hostdev__ Vec3< T2 > operator* (T1 scalar, const Vec3< T2 > &vec)
template<typename T1, typename T2>
__hostdev__ Vec3< T2 > operator/ (T1 scalar, const Vec3< T2 > &vec)
template<typename T1, typename T2>
__hostdev__ Vec4< T2 > operator* (T1 scalar, const Vec4< T2 > &vec)
template<typename T1, typename T2>
__hostdev__ Vec4< T2 > operator/ (T1 scalar, const Vec4< T2 > &vec)
template<typename T>
__hostdev__ Vec4< T > operator* (const Mat4< T > &m, const Vec4< T > &v)
 Return the matrix vector product of a 4x4 matrix and a 4d vector.
template<typename Vec3T>
__hostdev__ Vec3T matMult (const float *mat, const Vec3T &xyz)
 Multiply a 3x3 matrix and a 3d vector using 32bit floating point arithmetics.
template<typename Vec3T>
__hostdev__ Vec3T matMult (const double *mat, const Vec3T &xyz)
 Multiply a 3x3 matrix and a 3d vector using 64bit floating point arithmetics.
template<typename Vec3T>
__hostdev__ Vec3T matMult (const float *mat, const float *vec, const Vec3T &xyz)
 Multiply a 3x3 matrix to a 3d vector and add another 3d vector using 32bit floating point arithmetics.
template<typename Vec3T>
__hostdev__ Vec3T matMult (const double *mat, const double *vec, const Vec3T &xyz)
 Multiply a 3x3 matrix to a 3d vector and add another 3d vector using 64bit floating point arithmetics.
template<typename Vec3T>
__hostdev__ Vec3T matMultT (const float *mat, const Vec3T &xyz)
 Multiply the transposed of a 3x3 matrix and a 3d vector using 32bit floating point arithmetics.
template<typename Vec3T>
__hostdev__ Vec3T matMultT (const double *mat, const Vec3T &xyz)
 Multiply the transposed of a 3x3 matrix and a 3d vector using 64bit floating point arithmetics.
template<typename Vec3T>
__hostdev__ Vec3T matMultT (const float *mat, const float *vec, const Vec3T &xyz)
template<typename Vec3T>
__hostdev__ Vec3T matMultT (const double *mat, const double *vec, const Vec3T &xyz)
template<typename Vec3T>
__hostdev__ Vec3T closestPointOnSegmentToPoint (const Vec3T &v0, const Vec3T &v1, const Vec3T &p)
 Returns the closest point on the line segment [v0,v1] to p.
template<typename Vec3T>
__hostdev__ Vec3T closestPointOnTriangleToPoint (const Vec3T &v0, const Vec3T &v1, const Vec3T &v2, const Vec3T &p, typename Vec3T::ValueType &t0, typename Vec3T::ValueType &t1)
 Returns the closest point on triangle [v0,v1,v2] to p, and (via t0, t1) the barycentric coordinates of that point: closest = v0 + t0*(v1-v0) + t1*(v2-v0).
template<typename Vec3T>
__hostdev__ Vec3T::ValueType pointToTriangleDistSqr (const Vec3T &v0, const Vec3T &v1, const Vec3T &v2, const Vec3T &p)
 Returns the squared distance from p to the closest point on triangle [v0,v1,v2].
template<int Order, typename TreeOrAccT, bool UseCache = true>
SampleFromVoxels< TreeOrAccT, Order, UseCache > createSampler (const TreeOrAccT &acc)
 Factory free-function for a sampler of specific polynomial orders.
template<typename CoordT, typename RealT, template< typename > class Vec3T>
CoordT Floor (Vec3T< RealT > &xyz)
 Utility function that returns the Coord of the round-down of xyz and redefined (xyz) as the fractional part, ie xyz-in = return-value + xyz-out.
template<typename CoordT, template< typename > class Vec3T>
CoordT Floor (Vec3T< float > &xyz)
 Template specialization of Floor for Vec3<float>
template<typename CoordT, template< typename > class Vec3T>
CoordT Floor (Vec3T< double > &xyz)
 Template specialization of Floor for Vec3<float>
template<typename ValueType, typename RealT = ValueType>
__hostdev__ ValueType WENO5 (const ValueType &v1, const ValueType &v2, const ValueType &v3, const ValueType &v4, const ValueType &v5, RealT scale2=1.0)
 Implementation of nominally fifth-order finite-difference WENO.
template<typename RealT>
__hostdev__ RealT GodunovsNormSqrd (bool isOutside, RealT dP_xm, RealT dP_xp, RealT dP_ym, RealT dP_yp, RealT dP_zm, RealT dP_zp)
template<typename RealT>
__hostdev__ RealT GodunovsNormSqrd (bool isOutside, const Vec3< RealT > &gradient_m, const Vec3< RealT > &gradient_p)

Typedef Documentation

◆ Coord3

using Coord3 = Coord

Type alias for Coord so we have a consistent naming convention.

◆ Vec3d

using Vec3d = Vec3<double>

◆ Vec3f

using Vec3f = Vec3<float>

◆ Vec3i

using Vec3i = Vec3<int32_t>

◆ Vec3u

using Vec3u = Vec3<uint32_t>

◆ Vec3u16

using Vec3u16 = Vec3<uint16_t>

◆ Vec3u8

using Vec3u8 = Vec3<uint8_t>

◆ Vec4d

using Vec4d = Vec4<double>

◆ Vec4f

using Vec4f = Vec4<float>

◆ Vec4i

using Vec4i = Vec4<int>

◆ Vec4R

using Vec4R = Vec4<double>

Function Documentation

◆ Abs() [1/4]

template<>
__hostdev__ double Abs ( double x)
inline

◆ Abs() [2/4]

template<>
__hostdev__ float Abs ( float x)
inline

◆ Abs() [3/4]

template<>
__hostdev__ int Abs ( int x)
inline

◆ Abs() [4/4]

template<typename T>
__hostdev__ T Abs ( T x)
inline

◆ AlignUp()

template<uint64_t wordSize>
__hostdev__ uint64_t AlignUp ( uint64_t byteCount)
inline

round up byteSize to the nearest wordSize, e.g. to align to machine word: AlignUp<sizeof(size_t)(n)

both wordSize and byteSize are in byte units

◆ Ceil() [1/2]

__hostdev__ int32_t Ceil ( double x)
inline

◆ Ceil() [2/2]

__hostdev__ int32_t Ceil ( float x)
inline

◆ Clamp() [1/2]

__hostdev__ double Clamp ( double x,
double a,
double b )
inline

◆ Clamp() [2/2]

__hostdev__ float Clamp ( float x,
float a,
float b )
inline

◆ closestPointOnSegmentToPoint()

template<typename Vec3T>
__hostdev__ Vec3T closestPointOnSegmentToPoint ( const Vec3T & v0,
const Vec3T & v1,
const Vec3T & p )
inline

Returns the closest point on the line segment [v0,v1] to p.

   The result lies on the closed segment (t clamped to [0,1]).
Template Parameters
Vec3TAny Vec3 type supporting arithmetic and dot().

◆ closestPointOnTriangleToPoint()

template<typename Vec3T>
__hostdev__ Vec3T closestPointOnTriangleToPoint ( const Vec3T & v0,
const Vec3T & v1,
const Vec3T & v2,
const Vec3T & p,
typename Vec3T::ValueType & t0,
typename Vec3T::ValueType & t1 )
inline

Returns the closest point on triangle [v0,v1,v2] to p, and (via t0, t1) the barycentric coordinates of that point: closest = v0 + t0*(v1-v0) + t1*(v2-v0).

Uses Voronoi-region decomposition (Ericson, "Real-Time Collision Detection", Sec. 5.1.5). Degenerate triangles (zero area, collinear or coincident vertices) are handled implicitly: the face-interior test naturally fails and the code falls through to the nearest edge or vertex result.

Template Parameters
Vec3TAny Vec3 type supporting arithmetic and dot().

◆ createSampler()

template<int Order, typename TreeOrAccT, bool UseCache = true>
SampleFromVoxels< TreeOrAccT, Order, UseCache > createSampler ( const TreeOrAccT & acc)

Factory free-function for a sampler of specific polynomial orders.

This allows for the compact syntax:

auto acc = grid.getAccessor();
SampleFromVoxels< TreeOrAccT, Order, UseCache > createSampler(const TreeOrAccT &acc)
Factory free-function for a sampler of specific polynomial orders.
Definition SampleFromVoxels.h:50

◆ firstActive()

template<typename RayT, typename AccT>
__hostdev__ bool firstActive ( RayT & ray,
AccT & acc,
Coord & ijk,
float & t )
inline

returns true if the ray intersects an active value at any level of the grid in the accessor. The empty-space ray-marching is performed at all levels of the tree using an HDDA. If an intersection is detected, then ijk is updated with the index coordinate of the first active voxel or tile, and t is set to the time of its intersection along the ray.

◆ Floor() [1/5]

__hostdev__ int32_t Floor ( double x)
inline

◆ Floor() [2/5]

__hostdev__ int32_t Floor ( float x)
inline

◆ Floor() [3/5]

template<typename CoordT, template< typename > class Vec3T>
CoordT Floor ( Vec3T< double > & xyz)
inline

Template specialization of Floor for Vec3<float>

◆ Floor() [4/5]

template<typename CoordT, template< typename > class Vec3T>
CoordT Floor ( Vec3T< float > & xyz)
inline

Template specialization of Floor for Vec3<float>

◆ Floor() [5/5]

template<typename CoordT, typename RealT, template< typename > class Vec3T>
CoordT Floor ( Vec3T< RealT > & xyz)
inline

Utility function that returns the Coord of the round-down of xyz and redefined (xyz) as the fractional part, ie xyz-in = return-value + xyz-out.

◆ Fract() [1/2]

__hostdev__ double Fract ( double x)
inline

◆ Fract() [2/2]

__hostdev__ float Fract ( float x)
inline

◆ GodunovsNormSqrd() [1/2]

template<typename RealT>
__hostdev__ RealT GodunovsNormSqrd ( bool isOutside,
const Vec3< RealT > & gradient_m,
const Vec3< RealT > & gradient_p )
inline

◆ GodunovsNormSqrd() [2/2]

template<typename RealT>
__hostdev__ RealT GodunovsNormSqrd ( bool isOutside,
RealT dP_xm,
RealT dP_xp,
RealT dP_ym,
RealT dP_yp,
RealT dP_zm,
RealT dP_zp )
inline

◆ isApproxZero()

template<typename Type>
__hostdev__ bool isApproxZero ( const Type & x)
inline

◆ isoCrossing()

template<typename RayT, typename AccT>
__hostdev__ bool isoCrossing ( RayT & ray,
AccT & acc,
Coord & ijk,
typename AccT::ValueType & v,
float & t,
const typename AccT::ValueType & iso = 0.0f )
inline

◆ matMult() [1/4]

template<typename Vec3T>
__hostdev__ Vec3T matMult ( const double * mat,
const double * vec,
const Vec3T & xyz )
inline

Multiply a 3x3 matrix to a 3d vector and add another 3d vector using 64bit floating point arithmetics.

Note
This corresponds to an affine transformation, i.e a linear mapping followed by a translation. e.g. scale/rotation and translation
Template Parameters
Vec3TTemplate type of the input and output 3d vectors
Parameters
matpointer to an array of floats with the 3x3 matrix
vec3d vector to be added AFTER the matrix multiplication
xyzinput vector to be multiplied by the matrix and a translated by vec
Returns
result of affine transformation, i.e. (mat x xyz) + vec

◆ matMult() [2/4]

template<typename Vec3T>
__hostdev__ Vec3T matMult ( const double * mat,
const Vec3T & xyz )
inline

Multiply a 3x3 matrix and a 3d vector using 64bit floating point arithmetics.

Note
This corresponds to a linear mapping, e.g. scaling, rotation etc.
Template Parameters
Vec3TTemplate type of the input and output 3d vectors
Parameters
matpointer to an array of floats with the 3x3 matrix
xyzinput vector to be multiplied by the matrix
Returns
result of matrix-vector multiplication, i.e. mat x xyz

◆ matMult() [3/4]

template<typename Vec3T>
__hostdev__ Vec3T matMult ( const float * mat,
const float * vec,
const Vec3T & xyz )
inline

Multiply a 3x3 matrix to a 3d vector and add another 3d vector using 32bit floating point arithmetics.

Note
This corresponds to an affine transformation, i.e a linear mapping followed by a translation. e.g. scale/rotation and translation
Template Parameters
Vec3TTemplate type of the input and output 3d vectors
Parameters
matpointer to an array of floats with the 3x3 matrix
vec3d vector to be added AFTER the matrix multiplication
xyzinput vector to be multiplied by the matrix and a translated by vec
Returns
result of affine transformation, i.e. (mat x xyz) + vec

◆ matMult() [4/4]

template<typename Vec3T>
__hostdev__ Vec3T matMult ( const float * mat,
const Vec3T & xyz )
inline

Multiply a 3x3 matrix and a 3d vector using 32bit floating point arithmetics.

Note
This corresponds to a linear mapping, e.g. scaling, rotation etc.
Template Parameters
Vec3TTemplate type of the input and output 3d vectors
Parameters
matpointer to an array of floats with the 3x3 matrix
xyzinput vector to be multiplied by the matrix
Returns
result of matrix-vector multiplication, i.e. mat x xyz

◆ matMultT() [1/4]

template<typename Vec3T>
__hostdev__ Vec3T matMultT ( const double * mat,
const double * vec,
const Vec3T & xyz )
inline

◆ matMultT() [2/4]

template<typename Vec3T>
__hostdev__ Vec3T matMultT ( const double * mat,
const Vec3T & xyz )
inline

Multiply the transposed of a 3x3 matrix and a 3d vector using 64bit floating point arithmetics.

Note
This corresponds to an inverse linear mapping, e.g. inverse scaling, inverse rotation etc.
Template Parameters
Vec3TTemplate type of the input and output 3d vectors
Parameters
matpointer to an array of floats with the 3x3 matrix
xyzinput vector to be multiplied by the transposed matrix
Returns
result of matrix-vector multiplication, i.e. mat^T x xyz

◆ matMultT() [3/4]

template<typename Vec3T>
__hostdev__ Vec3T matMultT ( const float * mat,
const float * vec,
const Vec3T & xyz )
inline

◆ matMultT() [4/4]

template<typename Vec3T>
__hostdev__ Vec3T matMultT ( const float * mat,
const Vec3T & xyz )
inline

Multiply the transposed of a 3x3 matrix and a 3d vector using 32bit floating point arithmetics.

Note
This corresponds to an inverse linear mapping, e.g. inverse scaling, inverse rotation etc.
Template Parameters
Vec3TTemplate type of the input and output 3d vectors
Parameters
matpointer to an array of floats with the 3x3 matrix
xyzinput vector to be multiplied by the transposed matrix
Returns
result of matrix-vector multiplication, i.e. mat^T x xyz

◆ Max() [1/5]

__hostdev__ double Max ( double a,
double b )
inline

◆ Max() [2/5]

__hostdev__ float Max ( float a,
float b )
inline

◆ Max() [3/5]

__hostdev__ int32_t Max ( int32_t a,
int32_t b )
inline

◆ Max() [4/5]

template<typename Type>
__hostdev__ Type Max ( Type a,
Type b )
inline

◆ Max() [5/5]

__hostdev__ uint32_t Max ( uint32_t a,
uint32_t b )
inline

◆ MaxIndex()

template<typename Vec3T>
__hostdev__ int MaxIndex ( const Vec3T & v)
inline

◆ Min() [1/5]

__hostdev__ double Min ( double a,
double b )
inline

◆ Min() [2/5]

__hostdev__ float Min ( float a,
float b )
inline

◆ Min() [3/5]

__hostdev__ int32_t Min ( int32_t a,
int32_t b )
inline

◆ Min() [4/5]

template<typename Type>
__hostdev__ Type Min ( Type a,
Type b )
inline

◆ Min() [5/5]

__hostdev__ uint32_t Min ( uint32_t a,
uint32_t b )
inline

◆ MinIndex()

template<typename Vec3T>
__hostdev__ int MinIndex ( const Vec3T & v)
inline

◆ operator*() [1/11]

template<typename T>
__hostdev__ Mat2x3< T > operator* ( const Mat2< T > & lhs,
const Mat2x3< T > & rhs )

Multiply a 2x2 matrix by a 2x3 matrix, result is a 2x3 matrix.

◆ operator*() [2/11]

template<typename T>
__hostdev__ Mat2x3< T > operator* ( const Mat2x3< T > & lhs,
const Mat3< T > & rhs )

Multiply a 2x3 matrix by a 3x3 matrix, result is a 2x3 matrix.

◆ operator*() [3/11]

template<typename T>
__hostdev__ Mat2< T > operator* ( const Mat2x3< T > & lhs,
const Mat3x2< T > & rhs )

Multiply a 2x3 matrix by a 3x2 matrix, result is a 2x2 matrix.

◆ operator*() [4/11]

template<typename T>
__hostdev__ Mat2x3< T > operator* ( const Mat3< T > & lhs,
const Mat2x3< T > & rhs )

Multiply a 3x3 matrix by a 2x3 matrix, result is a 2x3 matrix.

◆ operator*() [5/11]

template<typename T>
__hostdev__ Mat3x2< T > operator* ( const Mat3x2< T > & lhs,
const Mat2< T > & rhs )

Multiply a 3x2 matrix by a 2x2 matrix, result is a 3x2 matrix.

◆ operator*() [6/11]

template<typename T>
__hostdev__ Mat3< T > operator* ( const Mat3x2< T > & lhs,
const Mat2x3< T > & rhs )

Multiply a 3x2 matrix by a 2x3 matrix, result is a 3x3 matrix.

◆ operator*() [7/11]

template<typename T>
__hostdev__ Vec4< T > operator* ( const Mat4< T > & m,
const Vec4< T > & v )
inline

Return the matrix vector product of a 4x4 matrix and a 4d vector.

Parameters
m4x4 matrix
v4d vector
Returns
result of matrix-vector multiplication, i.e. m x v

◆ operator*() [8/11]

template<typename T>
__hostdev__ Mat2< T > operator* ( const T & s,
const Mat2< T > & m )

Multiply a scalar by a 2x2 matrix, result is a 2x2 matrix.

◆ operator*() [9/11]

template<typename T1, typename T2>
__hostdev__ Vec2< T2 > operator* ( T1 scalar,
const Vec2< T2 > & vec )
inline

◆ operator*() [10/11]

template<typename T1, typename T2>
__hostdev__ Vec3< T2 > operator* ( T1 scalar,
const Vec3< T2 > & vec )
inline

◆ operator*() [11/11]

template<typename T1, typename T2>
__hostdev__ Vec4< T2 > operator* ( T1 scalar,
const Vec4< T2 > & vec )
inline

◆ operator/() [1/3]

template<typename T1, typename T2>
__hostdev__ Vec2< T2 > operator/ ( T1 scalar,
const Vec2< T2 > & vec )
inline

◆ operator/() [2/3]

template<typename T1, typename T2>
__hostdev__ Vec3< T2 > operator/ ( T1 scalar,
const Vec3< T2 > & vec )
inline

◆ operator/() [3/3]

template<typename T1, typename T2>
__hostdev__ Vec4< T2 > operator/ ( T1 scalar,
const Vec4< T2 > & vec )
inline

◆ pi() [1/4]

template<typename T>
__hostdev__ constexpr T pi ( )
inlineconstexpr

Pi constant taken from Boost to match old behaviour.

◆ pi() [2/4]

template<>
__hostdev__ constexpr float pi ( )
inlineconstexpr

◆ pi() [3/4]

template<>
__hostdev__ constexpr double pi ( )
inlineconstexpr

◆ pi() [4/4]

template<>
__hostdev__ constexpr long double pi ( )
inlineconstexpr

◆ pointToTriangleDistSqr()

template<typename Vec3T>
__hostdev__ Vec3T::ValueType pointToTriangleDistSqr ( const Vec3T & v0,
const Vec3T & v1,
const Vec3T & v2,
const Vec3T & p )
inline

Returns the squared distance from p to the closest point on triangle [v0,v1,v2].

◆ Pow2()

template<typename T>
__hostdev__ T Pow2 ( T x)
inline

◆ Pow3()

template<typename T>
__hostdev__ T Pow3 ( T x)
inline

◆ Pow4()

template<typename T>
__hostdev__ T Pow4 ( T x)
inline

◆ Round() [1/3]

template<typename CoordT, template< typename > class Vec3T>
__hostdev__ CoordT Round ( const Vec3T< double > & xyz)
inline

◆ Round() [2/3]

template<typename CoordT, template< typename > class Vec3T>
__hostdev__ CoordT Round ( const Vec3T< float > & xyz)
inline

◆ Round() [3/3]

template<typename CoordT, typename RealT, template< typename > class Vec3T>
__hostdev__ CoordT Round ( const Vec3T< RealT > & xyz)
inline

◆ RoundDown()

template<typename CoordT, typename RealT, template< typename > class Vec3T>
__hostdev__ CoordT RoundDown ( const Vec3T< RealT > & xyz)
inline

◆ Sign()

template<typename T>
__hostdev__ T Sign ( const T & x)
inline

Return the sign of the given value as an integer (either -1, 0 or 1).

◆ Sqrt() [1/2]

__hostdev__ double Sqrt ( double x)
inline

◆ Sqrt() [2/2]

__hostdev__ float Sqrt ( float x)
inline

Return the square root of a floating-point value.

◆ WENO5()

template<typename ValueType, typename RealT = ValueType>
__hostdev__ ValueType WENO5 ( const ValueType & v1,
const ValueType & v2,
const ValueType & v3,
const ValueType & v4,
const ValueType & v5,
RealT scale2 = 1.0 )
inline

Implementation of nominally fifth-order finite-difference WENO.

This function returns the numerical flux. See "High Order Finite Difference and Finite Volume WENO Schemes and Discontinuous Galerkin Methods for CFD" - Chi-Wang Shu ICASE Report No 2001-11 (page 6). Also see ICASE No 97-65 for a more complete reference (Shu, 1997). Given v1 = f(x-2dx), v2 = f(x-dx), v3 = f(x), v4 = f(x+dx) and v5 = f(x+2dx), return an interpolated value f(x+dx/2) with the special property that ( f(x+dx/2) - f(x-dx/2) ) / dx = df/dx (x) + error, where the error is fifth-order in smooth regions: O(dx) <= error <=O(dx^5)

◆ ZeroCrossing()

template<typename RayT, typename AccT>
__hostdev__ bool ZeroCrossing ( RayT & ray,
AccT & acc,
Coord & ijk,
typename AccT::ValueType & v,
float & t )
inline

◆ zeroCrossing()

template<typename RayT, typename AccT>
__hostdev__ bool zeroCrossing ( RayT & ray,
AccT & acc,
Coord & ijk,
typename AccT::ValueType & v,
float & t )
inline

returns true if the ray intersects a zero-crossing at the voxel level of the grid in the accessor The empty-space ray-marching is performed at all levels of the tree using an HDDA. If an intersection is detected, then ijk is updated with the index coordinate of the closest voxel after the intersection point, v contains the grid values at ijk, and t is set to the time of the intersection along the ray.

◆ ZeroCrossingNode()

template<typename RayT, typename NodeT>
__hostdev__ bool ZeroCrossingNode ( RayT & ray,
const NodeT & node,
float v0,
nanovdb::math::Coord & ijk,
float & v,
float & t )
inline

◆ zeroCrossingNode()

template<typename RayT, typename NodeT>
__hostdev__ bool zeroCrossingNode ( RayT & ray,
const NodeT & node,
float v0,
nanovdb::math::Coord & ijk,
float & v,
float & t )
inline