Function lower_bound (o2scl)

O2scl : Function List

inline double o2scl::lower_bound(double x, double center, double width, double height)

Constrain x to be greater than the value given by center.

Defining \( c= \) center, \( w= \) width, \( h= \) height, this returns \( h(1+|x-c|/w) \) if \( x<c \) and zero otherwise. The value at \( x=c \) is \( h \) , while the value at \( x=c-w \) is \( 2 h \) .

It is important to note that, for large distances of x from center, this only scales linearly. If you are trying to constrain a function which decreases more than linearly by making x far from center, then a minimizer may ignore this constraint.