From cfcf391d3481fc81aea2ae77afa0932700e5d347 Mon Sep 17 00:00:00 2001 From: Thomas Toulorge <thomas.toulorge@mines-paristech.fr> Date: Wed, 9 May 2012 15:37:58 +0000 Subject: [PATCH] Fixed problem with initial step length calculation in ALGLIB CG optimizer --- contrib/lbfgs/optimization.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/contrib/lbfgs/optimization.cpp b/contrib/lbfgs/optimization.cpp index 8cb580030d..833b33f352 100755 --- a/contrib/lbfgs/optimization.cpp +++ b/contrib/lbfgs/optimization.cpp @@ -3449,9 +3449,9 @@ INPUT PARAMETERS: A - matrix, array[N,N] IsUpper - (optional) storage type: * if True, symmetric matrix A is given by its upper - triangle, and the lower triangle isn�t used + triangle, and the lower triangle isn�t used * if False, symmetric matrix A is given by its lower - triangle, and the upper triangle isn�t used + triangle, and the upper triangle isn�t used * if not given, both lower and upper triangles must be filled. @@ -3496,9 +3496,9 @@ INPUT PARAMETERS: A - matrix, array[N,N] IsUpper - (optional) storage type: * if True, symmetric matrix A is given by its upper - triangle, and the lower triangle isn�t used + triangle, and the lower triangle isn�t used * if False, symmetric matrix A is given by its lower - triangle, and the upper triangle isn�t used + triangle, and the upper triangle isn�t used * if not given, both lower and upper triangles must be filled. @@ -6702,7 +6702,7 @@ lbl_24: * to the norm of DK */ v = ae_v_dotproduct(&state->dk.ptr.p_double[0], 1, &state->dk.ptr.p_double[0], 1, ae_v_len(0,n-1)); - state->laststep = ae_sqrt(v, _state); + state->laststep = 1.0/ae_sqrt(v, _state); } else { @@ -11553,9 +11553,9 @@ INPUT PARAMETERS: A - matrix, array[N,N] IsUpper - (optional) storage type: * if True, symmetric matrix A is given by its upper - triangle, and the lower triangle isn�t used + triangle, and the lower triangle isn�t used * if False, symmetric matrix A is given by its lower - triangle, and the upper triangle isn�t used + triangle, and the upper triangle isn�t used * if not given, both lower and upper triangles must be filled. -- GitLab