Skip to content

Commit

Permalink
Remove white spaces at the end of the lines
Browse files Browse the repository at this point in the history
  • Loading branch information
amontoison authored and jfowkes committed Jan 16, 2024
1 parent 8187c9e commit 15c9a2a
Show file tree
Hide file tree
Showing 75 changed files with 2,162 additions and 2,162 deletions.
50 changes: 25 additions & 25 deletions doc/C/lsmr.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ LSMR - Sparse Least Squares LSMR Solver
Purpose
=======

This package uses the LSMR iterative method to solve sparse linear
This package uses the LSMR iterative method to solve sparse linear
equations and sparse least-squares problems of the form:

.. math::
Expand All @@ -20,15 +20,15 @@ equations and sparse least-squares problems of the form:
\mbox{minimize } \|x\|_2 \mbox{ subject to }Ax = b, \\
\mbox{2. Linear least squares:} & \mbox{minimize } \|Ax - b\|_2^2,\\
\mbox{3. Regularized least squares:} &
\mbox{minimize } \|Ax - b\|_2^2 + \lambda^2\|x\|_2^2,
\mbox{minimize } \|Ax - b\|_2^2 + \lambda^2\|x\|_2^2,
\end{array}
where the :math:`m \times n` matrix :math:`A` may be square or rectangular, and
may have any rank. The scalar :math:`\lambda` is a damping parameter. If
:math:`\lambda > 0`, the solution is regularized in the sense that a unique
soluton always exists, and :math:`\|x\|_2` is always bounded.

Preconditioning may be used to try to reduce the number of iterations.
Preconditioning may be used to try to reduce the number of iterations.
A suitable choice for the preconditioner depends on the user's knowledge of
:math:`A`. For a user-chosen :math:`n \times n` nonsingular matrix :math:`P`,
LSMR solves
Expand All @@ -40,7 +40,7 @@ LSMR solves
\mbox{minimize } \|Py\|_2 \mbox{ subject to }APy = b, \\
\mbox{2. Linear least squares:} & \mbox{minimize } \|APy - b\|_2^2 ,\\
\mbox{3. Regularized least squares:} &
\mbox{minimize } \|APy - b\|_2^2 + \lambda^2\|Py\|_2^2 ,
\mbox{minimize } \|APy - b\|_2^2 + \lambda^2\|Py\|_2^2 ,
\end{array}
The user must then recover the final solution :math:`x` by computing
Expand All @@ -50,11 +50,11 @@ significantly better conditioned than :math:`A`.
Reverse communication is used for preconditioning operations :math:`Pz` and
:math:`P^Tz` and matrix-vector products of the form :math:`Av` and :math:`A^Tu`.

The method used is based on the Golub-Kahan bidiagonalization process.
It is algebraically equivalent to applying MINRES to the normal
The method used is based on the Golub-Kahan bidiagonalization process.
It is algebraically equivalent to applying MINRES to the normal
equation :math:`(A^TA+\lambda^2I)x=A^Tb` (or
:math:`((AP)^T(AP)+\lambda^2I)y=(AP)^Tb`), but has better numerical properties,
especially if :math:`A` is ill-conditioned.
especially if :math:`A` is ill-conditioned.

Notation
--------
Expand Down Expand Up @@ -168,51 +168,51 @@ Derived types
Default is 20.
.. c:member:: int print_freq_itn
Frequency of printing status.
There is printing on each of the first `print_freq_itn` iterations and
then printing every `print_freq_itn` iterations.
Default is 10.
.. c:member:: int unit_diagnostics
Fortran unit for diagnostic
printing. Printing is suppressed if negative.
Default is 6.
.. c:member:: int unit_error
Fortran unit for printing error messages.
Printing is suppressed if negative.
Default is 6.
.. c:member:: double atol
Relative error in :math:`A`.
i.e. if :math:`A` is accurate to about 6 digits, set atol to 1.0e-6.
Only used if :c:member:`spral_lsmr_options.ctest` =3.
Default is ``sqrt(DBL_EPSILON)``.
.. c:member:: double btol
Relative error in :math:`b`.
i.e. if :math:`b` is accurate to about 6 digits, set btol to 1.0e-6.
Only used if :c:member:`spral_lsmr_options.ctest` =3.
Default is ``sqrt(DBL_EPSILON)``.
.. c:member:: double conlim
Upper limit on
:math:`cond(\bar{A})`, apparent condition number of :math:`\bar{A}`.
Only used if :c:member:`spral_lsmr_options.ctest` =3.
Default is ``1/(10*sqrt(DBL_EPSILON))``:
Default is ``1/(10*sqrt(DBL_EPSILON))``:
.. c:member:: int ctest
Convergence test to use. Options are:
+-------------+----------------------------------------------------------+
| 1 | User to test convergence (`action=3`). |
| | *Without* computation of norms in inform. |
Expand All @@ -233,11 +233,11 @@ Derived types
Default is -1.
.. c:member:: int itn_test
Number of iterations between user
convergence tests. If negative, use :math:`\min(n,10)`.
Default is -1.
.. c:member:: int localSize
Number of historical vectors to use for
Expand All @@ -249,23 +249,23 @@ Derived types
Information about progress of algorithm.
.. c:member:: double condAP
Estimate of :math:`cond(\bar{A})`. A very high value of
condAP may again indicate an error in the products with :math:`A`,
:math:`A^T`, :math:`P`, or :math:`P^T`. A negative value indicates that
no estimate is currently available.
This component is not used if :c:member:`spral_lsmr_options.ctest` =1.
.. c:member:: int flag
Exit status of algorithm. See table below.
.. c:member:: int itn
Number of iterations performed
.. c:member:: double normAP
Estimate of Frobenius norm of :math:`\bar{A}`. If
:math:`\lambda` is small and the columns of :math:`AP` have all been
scaled to have length 1.0, normAP should increase to roughly
Expand All @@ -276,28 +276,28 @@ Derived types
This component is not used if :c:member:`spral_lsmr_options.ctest` =1.
.. c:member:: double normAP
Estimate of :math:`\|\bar{A}^T\bar{r}\|_2`, (normal
equations residual). This should be small in all cases. Note that
normAPr will often be smaller than the true value.
A negative value indicates that no estimate is currently available.
This component is not used if :c:member:`spral_lsmr_options.ctest` =1.
.. c:member:: double normr
Estimate of :math:`\|\bar{r}\|_2`. This will be small
if :math:`Ax = b` has a solution. A negative value indicates that no
estimate is currently available.
This component is not used if :c:member:`spral_lsmr_options.ctest` =1.
.. c:member:: double normy
Estimate of :math:`\|y\|_2`. A negative value indicates that
no estimate is currently available.
This component is not used if :c:member:`spral_lsmr_options.ctest` =1.
.. c:member:: int stat
The Fortran stat parameter in the event of a failed
allocation.
Expand Down
2 changes: 1 addition & 1 deletion doc/C/random.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ preprocessor macro is defined.
Example of use:

.. code-block:: C
int state = SPRAL_RANDOM_INITIAL_SEED;
The user may change the seed at any time, for example to restore a previous
Expand Down
26 changes: 13 additions & 13 deletions doc/C/rutherford_boeing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Subroutines
.. c:function:: int spral_rb_read(const char *filename, void **handle, enum spral_matrix_type *matrix_type, int *m, int *n, int64_t **ptr, int **row, double **val, const struct spral_rb_read_options *options, char *title, char *identifier, int *state)
Reads a CSC matrix from a file stored in RB format.
.. warning::
Memory is allocated using Fortran routines and stored in `handle`.
The arrays describing the matrix are just pointers into this data
Expand Down Expand Up @@ -201,18 +201,18 @@ Derived types
Specify options for reading matrices.
.. c:member:: bool add_diagonal
Add any diagonal entries that are missing if true.
Default is false
.. c:member:: float extra_space
Proportion of extra space to allow in `row[]` and `val[]` arrays.
They are allocated to have size `options.extra_space * ptr[n]`.
Default is 1.0.
.. c:member:: int lwr_upr_full
Return lower triangle, upper triangle
or both for symmetric and skew-symmetric matrices. One of:
Expand All @@ -227,7 +227,7 @@ Derived types
Default is 1.
.. c:member:: int values
Whether to read and/or generate values. One of:
+-------------+---------------------------------------------------------+
Expand Down Expand Up @@ -260,15 +260,15 @@ Derived types
.. c:type:: struct spral_rb_write_options
Specify options for writing matrices.
.. c:member:: char val_format[20]
Fortran format string to use when writing values. Should not exceed 80
characters per line.
Default is "(3e24.16)".
.. note::
Formats for integer data will be automatically determined based on the
maximum values to be represented.
Expand All @@ -289,10 +289,10 @@ This produces the following output, when run on the file generated by the
Matrix 'SPRAL_RUTHERFORD_BOEING test matrix'
Real symmetric indefinite matrix, dimension 5x5 with 8 entries.
0: 2.0000E+00 1.0000E+00
0: 2.0000E+00 1.0000E+00
1: 1.0000E+00 4.0000E+00 1.0000E+00 8.0000E+00
2: 1.0000E+00 3.0000E+00 2.0000E+00
3: 2.0000E+00
2: 1.0000E+00 3.0000E+00 2.0000E+00
3: 2.0000E+00
4: 8.0000E+00 2.0000E+00
Writing a matrix
Expand All @@ -305,10 +305,10 @@ The following code writes a matrix to the file "matrix.rb":
This produces the following file::
SPRAL_RUTHERFORD_BOEING test matrix 0
SPRAL_RUTHERFORD_BOEING test matrix 0
5 1 1 3
rsa 5 5 8 0
(40i2) (40i2) (3e24.16)
(40i2) (40i2) (3e24.16)
1 3 6 8 8 9
1 2 2 3 5 3 4 5
0.2000000000000000E+01 0.1000000000000000E+01 0.4000000000000000E+01
Expand Down
Loading

0 comments on commit 15c9a2a

Please sign in to comment.