Skip to content

Commit

Permalink
Fortran docs added
Browse files Browse the repository at this point in the history
  • Loading branch information
tyronerees committed Mar 26, 2020
1 parent b505268 commit 1f2cb14
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 19 deletions.
26 changes: 8 additions & 18 deletions libRALFit/doc/Fortran/howtouse.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ The user can then call one of the procedures:
|nlls_iterate| performs one iteration of the non-linear least squares
solver.

|nlls_setup_bounds| sets up a bound-constrained non-linear least squares problem.

The calling sequences of these subroutines are outlined in :ref:`arg-lists`.


Expand Down Expand Up @@ -69,7 +67,7 @@ To solve the non-linear least squares problem

.. include:: ../common/subroutines.rst

.. f:subroutine:: nlls_solve(n,m,X,eval_r,eval_J,eval_Hf,params,options,inform[,weights,eval_HP])
.. f:subroutine:: nlls_solve(n,m,X,eval_r,eval_J,eval_Hf,params,options,inform[,weights,eval_HP,lower_bounds,upper_bounds])
Solves the non-linear least squares problem.

Expand All @@ -95,17 +93,22 @@ To solve the non-linear least squares problem

:o procedure eval_HP: |eval_HP_desc|

:o real lower_bounds(n): |lower_bounds|

:o real upper_bounds(n): |upper_bounds|

To iterate once
^^^^^^^^^^^^^^^


.. f:subroutine:: nlls_iterate(n,m,X,eval_r,eval_J,eval_Hf,params,options,inform[,weights])
.. f:subroutine:: nlls_iterate(n,m,X,eval_r,eval_J,eval_Hf,params,options,inform[,weights,eval_HP,lower_bounds,upper_bounds])
A call of this form allows the user to step through the solution process one
iteration at a time.

**n**, **m**, **eval_F**, **eval_J**, **eval_HF**, **params**, **inform**,
**options** and **weights** are as in the desciption of |nlls_solve|.
**options**, **weights**, **eval_HP**, **lower_bounds** and **upper_bounds**
are as in the desciption of |nlls_solve|.

:p real X(n) [inout]: |iterate_X|

Expand All @@ -114,19 +117,6 @@ To iterate once
The user may use the components ``convergence_normf`` and
``convergence_normg`` and ``converge_norms`` in |nlls_inform| to determine whether the iteration has
converged.

To set up box constraints
^^^^^^^^^^^^^^^^^^^^^^^^^

.. f:subroutine:: nlls_setup_bounds(params,n,blx,bux,options,info)
A call of this form passes in information about box contraints that the solution should satisfy.

**n**, **params**, **options**, **info** are as in the description of |nlls_solve|

:p real blx(n) [in]: is used to pass in lower bounds on the solution.

:p real bux(n) [in]: is used to pass in upper bounds on the solution.


.. _user-routines:
Expand Down
6 changes: 5 additions & 1 deletion libRALFit/doc/common/subroutines.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
.. |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|.


.. |lower_bounds| replace:: If present, this contains the lower bounds on the solution.

.. |upper_bounds| replace:: If present, this contains the upper bounds on the solution.

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

.. |w| replace:: is used to store the current state of the iteration and should not be altered by the user.
Expand Down

0 comments on commit 1f2cb14

Please sign in to comment.