From fc0b22fea54877c591cdb0aeb6b77a3bf62b5a40 Mon Sep 17 00:00:00 2001 From: Tyrone Rees Date: Wed, 12 Jun 2019 16:23:20 +0100 Subject: [PATCH 1/7] Change H_i to \nabla^2 r_i --- libRALFit/doc/Fortran/howtouse.rst | 2 +- libRALFit/doc/common/subroutines.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libRALFit/doc/Fortran/howtouse.rst b/libRALFit/doc/Fortran/howtouse.rst index e496882f..b1604838 100644 --- a/libRALFit/doc/Fortran/howtouse.rst +++ b/libRALFit/doc/Fortran/howtouse.rst @@ -257,7 +257,7 @@ For evaluating the function :math:`P({\bm x},{\bm y}) := ( H_1({\bm x}){\bm y} \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ A subroutine may be supplied to calculate -:math:`P({\bm x},{\bm y}) := ( H_1({\bm x}){\bm y} \dots H_m({\bm x}){\bm y})` for +:math:`P({\bm x},{\bm y}) := ( \nabla^2 r_1({\bm x}){\bm y} \dots \nabla^2 r_m({\bm x}){\bm y})` for given vectors :math:`{\bm x}, {\bm y} \in \mathbb{R}^n`. The subroutine must implement the following interface: diff --git a/libRALFit/doc/common/subroutines.rst b/libRALFit/doc/common/subroutines.rst index b05066ce..b9c24943 100644 --- a/libRALFit/doc/common/subroutines.rst +++ b/libRALFit/doc/common/subroutines.rst @@ -18,7 +18,7 @@ .. |weights| replace:: If present, this holds the square-roots of the diagonal entries of the weighting matrix, :math:`{\bm W}`. If absent, then the norm in the least squares problem is taken to be the 2-norm, that is, :math:`{\bm W} = I`. -.. |eval_HP_desc| replace:: If present, this is a routine that, given vectors :math:`{\bm x}, {\bm y} \in \mathbb{R}^m`, returns the matrix :math:`P({\bm x},{\bm y}) := ( H_1({\bm x}){\bm y} \dots H_m({\bm x}){\bm y})`. Further details of the format required are given in |eval_HP| in :ref:`user-routines`. This is only referenced if ``model = 4`` in |nlls_options|. +.. |eval_HP_desc| replace:: If present, this is a routine that, given vectors :math:`{\bm x}, {\bm y} \in \mathbb{R}^m`, returns the matrix :math:`P({\bm x},{\bm y}) := ( \nabla^2 r_1({\bm x}){\bm y} \dots \nabla^2 r_m({\bm x}){\bm y})`. Further details of the format required are given in |eval_HP| in :ref:`user-routines`. This is only referenced if ``model = 4`` in |nlls_options|. .. |iterate_X| replace:: on the first call it must hold the initial guess for :math:`\bm x`. On return it holds the value of :math:`\bm x` at the current iterate, and must be passed unaltered to any subsequent call to |nlls_iterate|. From 1bcd106d04508a76d85f02a220434aafd0a052d3 Mon Sep 17 00:00:00 2001 From: Tyrone Rees Date: Wed, 12 Jun 2019 16:47:10 +0100 Subject: [PATCH 2/7] H_i->\nabla --- libRALFit/doc/Fortran/howtouse.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libRALFit/doc/Fortran/howtouse.rst b/libRALFit/doc/Fortran/howtouse.rst index b1604838..096288a1 100644 --- a/libRALFit/doc/Fortran/howtouse.rst +++ b/libRALFit/doc/Fortran/howtouse.rst @@ -253,7 +253,7 @@ subroutine must implement the following interface: :p params_base_type params [in]: |eval_Hf_params| -For evaluating the function :math:`P({\bm x},{\bm y}) := ( H_1({\bm x}){\bm y} \dots H_m({\bm x}){\bm y})` +For evaluating the function :math:`P({\bm x},{\bm y}) := ( \nabla^2 r_1({\bm x}){\bm y} \dots \nabla^2 r_m({\bm x}){\bm y})` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ A subroutine may be supplied to calculate From 8d50fc17ad77fdd973393dc257c943cd8b70a02d Mon Sep 17 00:00:00 2001 From: Tyrone Rees Date: Wed, 12 Jun 2019 16:48:42 +0100 Subject: [PATCH 3/7] H_i -> \nabla^2 r_i --- libRALFit/doc/common/subroutines.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libRALFit/doc/common/subroutines.rst b/libRALFit/doc/common/subroutines.rst index b9c24943..29523ff6 100644 --- a/libRALFit/doc/common/subroutines.rst +++ b/libRALFit/doc/common/subroutines.rst @@ -72,6 +72,6 @@ .. |eval_HP_y| replace:: holds :math:`{\bm y}`, the vector which multiplies each Hessian. -.. |eval_HP_HP| replace:: must be set by the routine to hold the matrix :math:`P({\bm x},{\bm y}) := ( H_1({\bm x}){\bm y} \dots H_m({\bm x}){\bm y})`, held by columns as a vector. +.. |eval_HP_HP| replace:: must be set by the routine to hold the matrix :math:`P({\bm x},{\bm y}) := ( \nabla^2 r_1({\bm x}){\bm y} \dots \nabla^2 r_m({\bm x}){\bm y})`, held by columns as a vector. .. |eval_HP_status| replace:: is initialised to ``0`` before the routine is called. If it is set to a non-zero value by the routine, then |nlls_solve| / |nlls_iterate| will exit with error. From a29c84a325392fc18657a88bac89ee82f296612a Mon Sep 17 00:00:00 2001 From: Tyrone Rees Date: Thu, 13 Jun 2019 09:00:40 +0100 Subject: [PATCH 4/7] Remove W from description of Hf --- libRALFit/doc/Fortran/howtouse.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libRALFit/doc/Fortran/howtouse.rst b/libRALFit/doc/Fortran/howtouse.rst index 096288a1..28bca2f6 100644 --- a/libRALFit/doc/Fortran/howtouse.rst +++ b/libRALFit/doc/Fortran/howtouse.rst @@ -212,7 +212,7 @@ A subroutine must be supplied to calculate :p params_base_type params [in]: |eval_J_params| -For evaluating the function :math:`Hf = \sum_{i=1}^m r_i( {\bm x} ) {\bm W} \nabla^2 r_i( {\bm x} )` +For evaluating the function :math:`Hf = \sum_{i=1}^m r_i( {\bm x} ) \nabla^2 r_i( {\bm x} )` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ A subroutine must be supplied to calculate From ef04820425da05913109c8944219720634a93a72 Mon Sep 17 00:00:00 2001 From: Tyrone Rees Date: Thu, 13 Jun 2019 09:09:36 +0100 Subject: [PATCH 5/7] Remove W from Hf C docs --- libRALFit/doc/C/howtouse.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libRALFit/doc/C/howtouse.rst b/libRALFit/doc/C/howtouse.rst index 4eccaa95..1db5d643 100644 --- a/libRALFit/doc/C/howtouse.rst +++ b/libRALFit/doc/C/howtouse.rst @@ -196,8 +196,8 @@ It must have the following signature: :param status: |eval_J_status| -For evaluating the function :math:`Hf = \sum_{i=1}^m r_i( {\bm x} ) {\bm W} \nabla^2 r_i( {\bm x} )` -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +For evaluating the function :math:`Hf = \sum_{i=1}^m r_i( {\bm x} ) \nabla^2 r_i( {\bm x} )` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ A subroutine must be supplied to calculate :math:`Hf = \sum_{i=1}^m ( {\bm r} )_i \nabla^2 r_i( {\bm x} )` for From 7bacd352a2ef94f6304d0dcb941043aee47f1e50 Mon Sep 17 00:00:00 2001 From: Tyrone Rees Date: Thu, 13 Jun 2019 13:03:41 +0100 Subject: [PATCH 6/7] update definition of J() --- libRALFit/doc/common/subroutines.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libRALFit/doc/common/subroutines.rst b/libRALFit/doc/common/subroutines.rst index 29523ff6..d8296279 100644 --- a/libRALFit/doc/common/subroutines.rst +++ b/libRALFit/doc/common/subroutines.rst @@ -44,7 +44,7 @@ .. |eval_J_X| replace:: holds the current point :math:`{\bm x}_{k}^{}` at which to evaluate :math:`{\bm J} ( {\bm x} _{k}^{})`. -.. |eval_J_r| replace:: must be set by the routine to hold the Jacobian of the residual function evaluated at the current point :math:`{\bm x}_{k}^{}`, :math:`{\bm r} ( {\bm x} _{k}^{})`. ``J(i*m+j)`` must be set to hold :math:`\nabla_{x_j} r_i( {\bm x} _{k}^{})`. +.. |eval_J_r| replace:: must be set by the routine to hold the Jacobian of the residual function evaluated at the current point :math:`{\bm x}_{k}^{}`, :math:`{\bm r} ( {\bm x} _{k}^{})`. ``J((i-1)*n+j)`` must be set to hold :math:`\nabla_{x_j} r_i( {\bm x} _{k}^{})`. .. |eval_J_status| replace:: is initialised to ``0`` before the routine is called. If it is set to a non-zero value by the routine, then |nlls_solve| / |nlls_iterate| will exit with error. From 833825db81bc850b1c30d85d72bfe669adde5651 Mon Sep 17 00:00:00 2001 From: Tyrone Rees Date: Fri, 14 Jun 2019 09:52:56 +0100 Subject: [PATCH 7/7] Fix the wording of the jacobian --- libRALFit/doc/C/howtouse.rst | 2 +- libRALFit/doc/Fortran/howtouse.rst | 2 +- libRALFit/doc/common/subroutines.rst | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libRALFit/doc/C/howtouse.rst b/libRALFit/doc/C/howtouse.rst index 1db5d643..7412312c 100644 --- a/libRALFit/doc/C/howtouse.rst +++ b/libRALFit/doc/C/howtouse.rst @@ -191,7 +191,7 @@ It must have the following signature: :param x: |eval_J_X| - :param J: |eval_J_r| + :param J: |eval_J_r| ``J(i*n+j)`` must be set to hold :math:`\nabla_{x_{j+1}} r_{i+1}( {\bm x} _{k}^{})`. :param status: |eval_J_status| diff --git a/libRALFit/doc/Fortran/howtouse.rst b/libRALFit/doc/Fortran/howtouse.rst index 28bca2f6..bc3ac7ab 100644 --- a/libRALFit/doc/Fortran/howtouse.rst +++ b/libRALFit/doc/Fortran/howtouse.rst @@ -207,7 +207,7 @@ A subroutine must be supplied to calculate :p real X(n) [in]: |eval_J_X| - :p real J(m*n) [out]: |eval_J_r| + :p real J(m*n) [out]: |eval_J_r| ``J((i-1)*n+j)`` must be set to hold :math:`\nabla_{x_j} r_i( {\bm x} _{k}^{})` if the option ``Fortran_Jacobian=.true.``. :p params_base_type params [in]: |eval_J_params| diff --git a/libRALFit/doc/common/subroutines.rst b/libRALFit/doc/common/subroutines.rst index d8296279..3628d96b 100644 --- a/libRALFit/doc/common/subroutines.rst +++ b/libRALFit/doc/common/subroutines.rst @@ -44,7 +44,7 @@ .. |eval_J_X| replace:: holds the current point :math:`{\bm x}_{k}^{}` at which to evaluate :math:`{\bm J} ( {\bm x} _{k}^{})`. -.. |eval_J_r| replace:: must be set by the routine to hold the Jacobian of the residual function evaluated at the current point :math:`{\bm x}_{k}^{}`, :math:`{\bm r} ( {\bm x} _{k}^{})`. ``J((i-1)*n+j)`` must be set to hold :math:`\nabla_{x_j} r_i( {\bm x} _{k}^{})`. +.. |eval_J_r| replace:: must be set by the routine to hold the Jacobian of the residual function evaluated at the current point :math:`{\bm x}_{k}^{}`, :math:`{\bm r} ( {\bm x} _{k}^{})`. .. |eval_J_status| replace:: is initialised to ``0`` before the routine is called. If it is set to a non-zero value by the routine, then |nlls_solve| / |nlls_iterate| will exit with error.