Problems: Convergence of the method? Is the final solution (
x
,
r
) non negative?
As for the second question modify
F
by asking
x
i
r
i
=
r
> 0 rather than
x
i
r
i
= = 0.