I'm trying to create a convex optimization code in Matlab , to deal with inequality constraints I'm using logarithmic barrier.Suppose we have inequality $g(x) =< 0$ to satisfy,so I define $\varphi (x) = -log(-g(x))$,What if in an iteration $g(x)$ becomes positive? as $\varphi$ is not defined when $g(x) > 0$ ,the algorithm stuck in that $x$,I tried the code segment bellow but sometimes it cause the code to stuck in this" while" for ever:(beta is line search parameter)
while (g(x+ s*delta) > 0),
s = BETA*s;
end % first get feasible point ... then search minimum
Do you have any idea how to deal with this?