Class BarrierLog

Inheritance Relationships

Base Type

Class Documentation

class Mechatronix::BarrierLog : public Mechatronix::RegularizedBase

Barrier function class

This class implement a smooth approximation of the ideal barrier class \( b(x) \) where ideal barrier satisfy \( b(x)=\infty \) for \( x<0 \) and \( b(x)=0 \) for \( x>0 \).

Inizialization

inline explicit BarrierLog()
virtual void setup(GenericContainer const &gc) override

Initialize regularization parameters with a GenericContainer. Expect to find gc("h") containing a real scalar.

void setup(real_type h)

Initialize regularization parameter \( h \).

Set the parameter \( h>0 \) for the barrier function.

This parameter is used to define barrier \( b(x) \) in such a way \( b(h)=1 \). Moreover \(b(h)=1\), \(b(0)=\infty\) and \( b(\infty) = 0 \).

inline void update_h(real_type h)

Update regularization parameter \( h \).

Evaluate

virtual real_type operator()(real_type x) const override

Evaluate barrier function

\[\begin{split} b(x) = \begin{cases} \textrm{NaN} & \textrm{for $x\leq 0$} \\[1em] 1-\log\frac{x}{h} & \textrm{for $0<x<h$} \\[1em] \displaystyle\frac{1}{1+\displaystyle\frac{x}{h}}+ \displaystyle\frac{1}{1+\displaystyle\left(\frac{x}{h}\right)^2} \end{cases} \end{split}\]

../_images/LOG_BARRIER_0.jpeg

virtual real_type D(real_type x) const override

First derivative of the barrier function

../_images/LOG_BARRIER_1.jpeg

virtual real_type DD(real_type x) const override

Second derivative of the barrier function

../_images/LOG_BARRIER_2.jpeg

Info

virtual string info() const override