Two-Stage Barrier

class TwoStageBarrier : public ipc::Barrier;

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::Barrier" tooltip="ipc::Barrier"] "1" [label="ipc::TwoStageBarrier" tooltip="ipc::TwoStageBarrier" 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::Barrier" tooltip="ipc::Barrier"] "1" [label="ipc::TwoStageBarrier" tooltip="ipc::TwoStageBarrier" fillcolor="#BFBFBF"] "1" -> "2" [dir=forward tooltip="public-inheritance"] }

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

Public Functions

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

Two-stage activation barrier.

\[\begin{split} b(d) = \begin{cases} -\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 double d

The distance.

const double dhat

Activation distance of the barrier.

Returns:

The value of the barrier function at d.

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

Derivative of the barrier function.

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

Parameters:
const double d

The distance.

const double dhat

Activation distance of the barrier.

Returns:

The derivative of the barrier wrt d.

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

Second derivative of the barrier function.

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

Parameters:
const double d

The distance.

const double dhat

Activation distance of the barrier.

Returns:

The second derivative of the barrier wrt d.

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

Get the units of the barrier function.

Parameters:
const double dhat

The activation distance of the barrier.

Returns:

The units of the barrier function.