Two-Stage Barrier

template <typename T = double>
class TwoStageBarrier : public ipc::BarrierBase<double>;

Inheritance diagram for ipc::TwoStageBarrier:

digraph { graph [bgcolor="#00000000"] node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2] edge [color="#1414CE"] "2" [label="ipc::BarrierBase< T >" tooltip="ipc::BarrierBase< T >"] "1" [label="ipc::TwoStageBarrier< T >" tooltip="ipc::TwoStageBarrier< T >" fillcolor="#BFBFBF"] "1" -> "2" [dir=forward tooltip="public-inheritance"] }

Collaboration diagram for ipc::TwoStageBarrier:

digraph { graph [bgcolor="#00000000"] node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2] edge [color="#1414CE"] "2" [label="ipc::BarrierBase< T >" tooltip="ipc::BarrierBase< T >"] "1" [label="ipc::TwoStageBarrier< T >" tooltip="ipc::TwoStageBarrier< T >" fillcolor="#BFBFBF"] "1" -> "2" [dir=forward tooltip="public-inheritance"] }

2-Stage activation function from [Chen et al. 2025].

Public Functions

TwoStageBarrier() = default;
virtual T operator()(const T dconst T dhat) const override;

Two-stage activation barrier.

\[\begin{split} b(d) = \begin{cases} \infty & d \le 0\\ -\frac{\hat{d}^2}{4} \left(\ln\left(\frac{2d}{\hat{d}}\right) - \tfrac{1}{2}\right) & d < \frac{\hat{d}}{2}\\ \tfrac{1}{2} (\hat{d} - d)^2 & d < \hat{d}\\ 0 & d \ge \hat{d} \end{cases} \end{split}\]

Parameters:
const T d

The distance.

const T dhat

Activation distance of the barrier.

Returns:

The value of the barrier function at d.

virtual T first_derivative(const T dconst T dhat) const override;

Derivative of the barrier function.

\[\begin{split} b'(d) = \begin{cases} 0 & d \le 0\\ -\frac{\hat{d}^2}{4d} & d < \frac{\hat{d}}{2}\\ d - \hat{d} & d < \hat{d}\\ 0 & d \ge \hat{d} \end{cases} \end{split}\]

Parameters:
const T d

The distance.

const T dhat

Activation distance of the barrier.

Returns:

The derivative of the barrier wrt d.

virtual T second_derivative(const T dconst T dhat) const override;

Second derivative of the barrier function.

\[\begin{split} b''(d) = \begin{cases} 0 & d \le 0\\ \frac{\hat{d}^2}{4d^2} & d < \frac{\hat{d}}{2}\\ 1 & d < \hat{d}\\ 0 & d \ge \hat{d} \end{cases} \end{split}\]

Parameters:
const T d

The distance.

const T dhat

Activation distance of the barrier.

Returns:

The second derivative of the barrier wrt d.

inline virtual T units(const T dhat) const override;

Get the units of the barrier function.

Parameters:
const T dhat

The activation distance of the barrier.

Returns:

The units of the barrier function.