]> granicus.if.org Git - liblinear/commitdiff
initialize Gnorm1_init with NAN
authorYu-Chin <guestwalk@gmail.com>
Tue, 26 Aug 2014 03:46:27 +0000 (11:46 +0800)
committerYu-Chin <guestwalk@gmail.com>
Tue, 26 Aug 2014 03:46:27 +0000 (11:46 +0800)
linear.cpp

index 684383347890084231332c4b38f6cda686744124..73405f924bdc24b08ee8ab7bdefa5fd9026821df 100644 (file)
@@ -1010,7 +1010,7 @@ static void solve_l2r_l1l2_svr(
        double d, G, H;
        double Gmax_old = INF;
        double Gmax_new, Gnorm1_new;
-       double Gnorm1_init;
+       double Gnorm1_init = NAN;
        double *beta = new double[l];
        double *QD = new double[l];
        double *y = prob->y;
@@ -1409,7 +1409,7 @@ static void solve_l1r_l2_svc(
        double d, G_loss, G, H;
        double Gmax_old = INF;
        double Gmax_new, Gnorm1_new;
-       double Gnorm1_init;
+       double Gnorm1_init = NAN;
        double d_old, d_diff;
        double loss_old, loss_new;
        double appxcond, cond;
@@ -1699,7 +1699,7 @@ static void solve_l1r_lr(
        double sigma = 0.01;
        double w_norm, w_norm_new;
        double z, G, H;
-       double Gnorm1_init;
+       double Gnorm1_init = NAN;
        double Gmax_old = INF;
        double Gmax_new, Gnorm1_new;
        double QP_Gmax_old = INF;