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::ExpMaxOp< T > Struct Template Reference

Exponential smooth maximum 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 maximum.
 

Detailed Description

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

Exponential smooth maximum for blending two signed-distance values.

Evaluates s log(exp(a/s) + exp(b/s)), the counterpart of ExpMinOp for intersections and differences: approximates max(a, b) and approaches it as s → 0. Computed as max(a, b) + s log1p(exp(-|a - b| / s)), which cannot overflow. A trivially copyable function object.

Template Parameters
TFloating-point precision.

Member Function Documentation

◆ operator()()

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

Evaluate the exponential smooth maximum.

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

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