From: Chih-Jen Lin Date: Sun, 24 Dec 2017 01:52:27 +0000 (+0800) Subject: move l2r_lr_fun::get_diagH(double *M) to an earlier place to be consistent X-Git-Tag: v221~15 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fc9b5a305b710c7036a20cf8ab0795af1e4e3013;p=liblinear move l2r_lr_fun::get_diagH(double *M) to an earlier place to be consistent with l2r_l2_svc_fun::get_diagH(double *M) --- diff --git a/linear.cpp b/linear.cpp index 9b49892..746192b 100644 --- a/linear.cpp +++ b/linear.cpp @@ -170,6 +170,27 @@ int l2r_lr_fun::get_nr_variable(void) return prob->n; } +void l2r_lr_fun::get_diagH(double *M) +{ + int i; + int l = prob->l; + int w_size=get_nr_variable(); + feature_node **x = prob->x; + + for (i=0; iindex!=-1) + { + M[s->index-1] += s->value*s->value*C[i]*D[i]; + s++; + } + } +} + void l2r_lr_fun::Hv(double *s, double *Hs) { int i; @@ -192,27 +213,6 @@ void l2r_lr_fun::Hv(double *s, double *Hs) Hs[i] = s[i] + Hs[i]; } -void l2r_lr_fun::get_diagH(double *M) -{ - int i; - int l = prob->l; - int w_size=get_nr_variable(); - feature_node **x = prob->x; - - for (i=0; iindex!=-1) - { - M[s->index-1] += s->value*s->value*C[i]*D[i]; - s++; - } - } -} - void l2r_lr_fun::Xv(double *v, double *Xv) { int i;