madlib/madlib — pull request #244 by walkingsparrow (2012-10-05 23:23:55+00:00)
Title: Fix for Jira Madlib-574

Logistic regression: Fixed a minor problem with direction restart in cg

Jira: MADLIB-574

In the conjugate gradient method, the direction is restarted when
Polak-Ribière's beta <= 0 instead of <0.

Reason: In the Polak-Ribière (PR) fomula, beta is chosen as max(0,PR'beta),
so Hestenes-Stiefel's (HS) beta needs to be 0 when PR's beta <= 0 (not <0).
Otherwise, without the "=", HS's beta will blow up at the optimum solution.

Instead of comparing with 0, a small number is used.