Function lower_bound (o2scl)¶
-
inline double o2scl::lower_bound(double x, double center, double width, double height)¶
Constrain
x
to be greater than the value given bycenter
.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
fromcenter
, this only scales linearly. If you are trying to constrain a function which decreases more than linearly by makingx
far fromcenter
, then a minimizer may ignore this constraint.