From 711675ae91635ebab044cbb5e852de912c5002f4 Mon Sep 17 00:00:00 2001 From: naoaki Date: Mon, 16 Feb 2009 06:58:11 +0000 Subject: [PATCH] Added one more experimental code. git-svn-id: file:///home/svnrepos/software/liblbfgs/trunk@34 ecf4c44f-38d1-4fa4-9757-a0b4dd0349fc --- lib/lbfgs.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/lbfgs.c b/lib/lbfgs.c index 43dd61a..49eab8f 100644 --- a/lib/lbfgs.c +++ b/lib/lbfgs.c @@ -603,6 +603,14 @@ int lbfgs( j = (j + 1) % m; /* if (++j == m) j = 0; */ } + if (param.orthantwise_c != 0.) { + vecdot(&gnorm, d, pg, n); + if (gnorm > 0) { + vecncpy(gp, pg, n); + owlqn_project(d, gp, 0, n); + } + } + /* Now the search direction d is ready. We try step = 1 first. */