Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hp docs #41

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions libRALFit/doc/C/howtouse.rst
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,13 @@ 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|


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
Expand Down
8 changes: 4 additions & 4 deletions libRALFit/doc/Fortran/howtouse.rst
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,12 @@ 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|


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
Expand Down Expand Up @@ -253,11 +253,11 @@ 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
: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:

Expand Down
6 changes: 3 additions & 3 deletions libRALFit/doc/common/subroutines.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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|.

Expand All @@ -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}^{})`.

.. |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.

Expand Down Expand Up @@ -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.