EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
Loading...
Searching...
No Matches
Public Member Functions | List of all members
EBGeometry::ExpMinOp< T > Struct Template Reference

Exponential smooth minimum for blending two signed-distance values. More...

#include <EBGeometry_Blend.hpp>

Public Member Functions

T operator() (const T &a, const T &b, const T &s) const noexcept
 Evaluate the exponential smooth minimum.
 

Detailed Description

template<class T>
struct EBGeometry::ExpMinOp< T >

Exponential smooth minimum for blending two signed-distance values.

Evaluates -s log(exp(-a/s) + exp(-b/s)), which approximates min(a, b) with exponential weighting; the blend region width scales with s. Useful when a differentiable interface is required. Approaches min(a, b) as s → 0. Computed as min(a, b) - s log1p(exp(-|a - b| / s)), which equals the formula above but cannot overflow or underflow however far a and b are from zero. A trivially copyable function object, so it can be stored in a BVHSmoothUnion and evaluated on a device.

Template Parameters
TFloating-point precision.

Member Function Documentation

◆ operator()()

template<class T >
T EBGeometry::ExpMinOp< T >::operator() ( const T &  a,
const T &  b,
const T &  s 
) const
inlinenoexcept

Evaluate the exponential smooth minimum.

Parameters
[in]aFirst value.
[in]bSecond value.
[in]sSmoothing length (must be > 0).
Returns
Exponentially blended approximation of min(a, b).

The documentation for this struct was generated from the following file: