From: Chih-Jen Lin Date: Sat, 7 Nov 2020 08:51:37 +0000 (+0800) Subject: minor fixes: X-Git-Tag: v243~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=65115f742683b21ed10582c1664829e0146fcaec;p=liblinear minor fixes: - COPYRIGHT year - return var instead of return (var) for constancy --- diff --git a/COPYRIGHT b/COPYRIGHT index cd06ed7..3efc024 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (c) 2007-2019 The LIBLINEAR Project. +Copyright (c) 2007-2020 The LIBLINEAR Project. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/linear.cpp b/linear.cpp index 59c23ed..e52aa45 100644 --- a/linear.cpp +++ b/linear.cpp @@ -56,7 +56,7 @@ public: ret += x->value*x->value; x++; } - return (ret); + return ret; } static double dot(const double *s, const feature_node *x) @@ -67,7 +67,7 @@ public: ret += s[x->index-1]*x->value; x++; } - return (ret); + return ret; } static double sparse_dot(const feature_node *x1, const feature_node *x2) @@ -89,7 +89,7 @@ public: ++x1; } } - return (ret); + return ret; } static void axpy(const double a, const feature_node *x, double *y) @@ -164,7 +164,7 @@ double l2r_erm_fun::fun(double *w) f += C_times_loss(i, wx[i]); f = f + 0.5 * wTw; - return(f); + return f; } int l2r_erm_fun::get_nr_variable(void) @@ -2747,7 +2747,6 @@ static void train_one(const problem *prob, const parameter *param, double *w, do newton_obj.set_print_string(liblinear_print_string); newton_obj.newton(w); break; - } case L2R_L1LOSS_SVR_DUAL: { diff --git a/newton.cpp b/newton.cpp index bb2c3b1..0fe3ccf 100644 --- a/newton.cpp +++ b/newton.cpp @@ -242,7 +242,7 @@ int NEWTON::pcg(double *g, double *M, double *s, double *r) delete[] Hd; delete[] z; - return(cg_iter); + return cg_iter; } void NEWTON::set_print_string(void (*print_string) (const char *buf))