Skip to content

Commit

Permalink
docs stdlib/linalg: more RST formatting fixes
Browse files Browse the repository at this point in the history
(cherry picked from commit 5c82c3e)
  • Loading branch information
StefanKarpinski authored and tkelman committed Oct 24, 2015
1 parent 3686e15 commit 2cdef5d
Showing 3 changed files with 117 additions and 116 deletions.
26 changes: 13 additions & 13 deletions base/docs/helpdb.jl
Original file line number Diff line number Diff line change
@@ -7402,11 +7402,12 @@ doc"""
Uses :func:`eigs` underneath.
Inputs are:
* ``A``: Linear operator. It can either subtype of ``AbstractArray`` (e.g., sparse matrix) or duck typed. For duck typing ``A`` has to support ``size(A)``, ``eltype(A)``, ``A * vector`` and ``A' * vector``.
* ``nsv``: Number of singular values.
* ``ritzvec``: Whether to return the left and right singular vectors ``left_sv`` and ``right_sv``, default is ``true``. If ``false`` the singular vectors are omitted from the output.
* ``tol``: tolerance, see :func:`eigs`.
* ``maxiter``: Maximum number of iterations, see :func:`eigs`.
* ``A``: Linear operator. It can either subtype of ``AbstractArray`` (e.g., sparse matrix) or duck typed. For duck typing ``A`` has to support ``size(A)``, ``eltype(A)``, ``A * vector`` and ``A' * vector``.
* ``nsv``: Number of singular values.
* ``ritzvec``: Whether to return the left and right singular vectors ``left_sv`` and ``right_sv``, default is ``true``. If ``false`` the singular vectors are omitted from the output.
* ``tol``: tolerance, see :func:`eigs`.
* ``maxiter``: Maximum number of iterations, see :func:`eigs`.
**Example**::
@@ -7647,14 +7648,13 @@ straight line to the given points `(x, y)`, i.e., such that the squared error
between `y` and `a + b*x` is minimized.
**Example**:
```
using PyPlot
x = [1.0:12.0;]
y = [5.5, 6.3, 7.6, 8.8, 10.9, 11.79, 13.48, 15.02, 17.77, 20.81, 22.0, 22.99]
a, b = linreg(x, y) # Linear regression
plot(x, y, "o") # Plot (x, y) points
plot(x, [a+b*i for i in x]) # Plot line determined by linear regression
```
using PyPlot
x = [1.0:12.0;]
y = [5.5, 6.3, 7.6, 8.8, 10.9, 11.79, 13.48, 15.02, 17.77, 20.81, 22.0, 22.99]
a, b = linreg(x, y) # Linear regression
plot(x, y, "o") # Plot (x, y) points
plot(x, [a+b*i for i in x]) # Plot line determined by linear regression
"""
linreg(x,y)

92 changes: 46 additions & 46 deletions base/linalg/arnoldi.jl
Original file line number Diff line number Diff line change
@@ -11,29 +11,29 @@ Computes eigenvalues ``d`` of ``A`` using Lanczos or Arnoldi iterations for
real symmetric or general nonsymmetric matrices respectively.
The following keyword arguments are supported:
* ``nev``: Number of eigenvalues
* ``ncv``: Number of Krylov vectors used in the computation; should satisfy ``nev+1 <= ncv <= n`` for real symmetric problems and ``nev+2 <= ncv <= n`` for other problems, where ``n`` is the size of the input matrix ``A``. The default is ``ncv = max(20,2*nev+1)``.
Note that these restrictions limit the input matrix ``A`` to be of dimension at least 2.
* ``which``: type of eigenvalues to compute. See the note below.
========= ======================================================================================================================
``which`` type of eigenvalues
========= ======================================================================================================================
``:LM`` eigenvalues of largest magnitude (default)
``:SM`` eigenvalues of smallest magnitude
``:LR`` eigenvalues of largest real part
``:SR`` eigenvalues of smallest real part
``:LI`` eigenvalues of largest imaginary part (nonsymmetric or complex ``A`` only)
``:SI`` eigenvalues of smallest imaginary part (nonsymmetric or complex ``A`` only)
``:BE`` compute half of the eigenvalues from each end of the spectrum, biased in favor of the high end. (real symmetric ``A`` only)
========= ======================================================================================================================
* ``tol``: tolerance (:math:`tol \le 0.0` defaults to ``DLAMCH('EPS')``)
* ``maxiter``: Maximum number of iterations (default = 300)
* ``sigma``: Specifies the level shift used in inverse iteration. If ``nothing`` (default), defaults to ordinary (forward) iterations. Otherwise, find eigenvalues close to ``sigma`` using shift and invert iterations.
* ``ritzvec``: Returns the Ritz vectors ``v`` (eigenvectors) if ``true``
* ``v0``: starting vector from which to start the iterations
* ``nev``: Number of eigenvalues
* ``ncv``: Number of Krylov vectors used in the computation; should satisfy ``nev+1 <= ncv <= n`` for real symmetric problems and ``nev+2 <= ncv <= n`` for other problems, where ``n`` is the size of the input matrix ``A``. The default is ``ncv = max(20,2*nev+1)``.
Note that these restrictions limit the input matrix ``A`` to be of dimension at least 2.
* ``which``: type of eigenvalues to compute. See the note below.
========= ======================================================================================================================
``which`` type of eigenvalues
========= ======================================================================================================================
``:LM`` eigenvalues of largest magnitude (default)
``:SM`` eigenvalues of smallest magnitude
``:LR`` eigenvalues of largest real part
``:SR`` eigenvalues of smallest real part
``:LI`` eigenvalues of largest imaginary part (nonsymmetric or complex ``A`` only)
``:SI`` eigenvalues of smallest imaginary part (nonsymmetric or complex ``A`` only)
``:BE`` compute half of the eigenvalues from each end of the spectrum, biased in favor of the high end. (real symmetric ``A`` only)
========= ======================================================================================================================
* ``tol``: tolerance (:math:`tol \le 0.0` defaults to ``DLAMCH('EPS')``)
* ``maxiter``: Maximum number of iterations (default = 300)
* ``sigma``: Specifies the level shift used in inverse iteration. If ``nothing`` (default), defaults to ordinary (forward) iterations. Otherwise, find eigenvalues close to ``sigma`` using shift and invert iterations.
* ``ritzvec``: Returns the Ritz vectors ``v`` (eigenvectors) if ``true``
* ``v0``: starting vector from which to start the iterations
``eigs`` returns the ``nev`` requested eigenvalues in ``d``, the corresponding Ritz vectors ``v`` (only if ``ritzvec=true``), the number of converged eigenvalues ``nconv``, the number of iterations ``niter`` and the number of matrix vector multiplications ``nmult``, as well as the final residual vector ``resid``.
@@ -58,29 +58,29 @@ Computes generalized eigenvalues ``d`` of ``A`` and ``B`` using Lanczos or Arnol
real symmetric or general nonsymmetric matrices respectively.
The following keyword arguments are supported:
* ``nev``: Number of eigenvalues
* ``ncv``: Number of Krylov vectors used in the computation; should satisfy ``nev+1 <= ncv <= n`` for real symmetric problems and ``nev+2 <= ncv <= n`` for other problems, where ``n`` is the size of the input matrices ``A`` and ``B``. The default is ``ncv = max(20,2*nev+1)``.
Note that these restrictions limit the input matrix ``A`` to be of dimension at least 2.
* ``which``: type of eigenvalues to compute. See the note below.
========= ======================================================================================================================
``which`` type of eigenvalues
========= ======================================================================================================================
``:LM`` eigenvalues of largest magnitude (default)
``:SM`` eigenvalues of smallest magnitude
``:LR`` eigenvalues of largest real part
``:SR`` eigenvalues of smallest real part
``:LI`` eigenvalues of largest imaginary part (nonsymmetric or complex ``A`` only)
``:SI`` eigenvalues of smallest imaginary part (nonsymmetric or complex ``A`` only)
``:BE`` compute half of the eigenvalues from each end of the spectrum, biased in favor of the high end. (real symmetric ``A`` only)
========= ======================================================================================================================
* ``tol``: tolerance (:math:`tol \le 0.0` defaults to ``DLAMCH('EPS')``)
* ``maxiter``: Maximum number of iterations (default = 300)
* ``sigma``: Specifies the level shift used in inverse iteration. If ``nothing`` (default), defaults to ordinary (forward) iterations. Otherwise, find eigenvalues close to ``sigma`` using shift and invert iterations.
* ``ritzvec``: Returns the Ritz vectors ``v`` (eigenvectors) if ``true``
* ``v0``: starting vector from which to start the iterations
* ``nev``: Number of eigenvalues
* ``ncv``: Number of Krylov vectors used in the computation; should satisfy ``nev+1 <= ncv <= n`` for real symmetric problems and ``nev+2 <= ncv <= n`` for other problems, where ``n`` is the size of the input matrices ``A`` and ``B``. The default is ``ncv = max(20,2*nev+1)``.
Note that these restrictions limit the input matrix ``A`` to be of dimension at least 2.
* ``which``: type of eigenvalues to compute. See the note below.
========= ======================================================================================================================
``which`` type of eigenvalues
========= ======================================================================================================================
``:LM`` eigenvalues of largest magnitude (default)
``:SM`` eigenvalues of smallest magnitude
``:LR`` eigenvalues of largest real part
``:SR`` eigenvalues of smallest real part
``:LI`` eigenvalues of largest imaginary part (nonsymmetric or complex ``A`` only)
``:SI`` eigenvalues of smallest imaginary part (nonsymmetric or complex ``A`` only)
``:BE`` compute half of the eigenvalues from each end of the spectrum, biased in favor of the high end. (real symmetric ``A`` only)
========= ======================================================================================================================
* ``tol``: tolerance (:math:`tol \le 0.0` defaults to ``DLAMCH('EPS')``)
* ``maxiter``: Maximum number of iterations (default = 300)
* ``sigma``: Specifies the level shift used in inverse iteration. If ``nothing`` (default), defaults to ordinary (forward) iterations. Otherwise, find eigenvalues close to ``sigma`` using shift and invert iterations.
* ``ritzvec``: Returns the Ritz vectors ``v`` (eigenvectors) if ``true``
* ``v0``: starting vector from which to start the iterations
``eigs`` returns the ``nev`` requested eigenvalues in ``d``, the corresponding Ritz vectors ``v`` (only if ``ritzvec=true``), the number of converged eigenvalues ``nconv``, the number of iterations ``niter`` and the number of matrix vector multiplications ``nmult``, as well as the final residual vector ``resid``.
Loading

0 comments on commit 2cdef5d

Please sign in to comment.