comparison scripts/special-matrix/invhilb.m @ 10821:693e22af08ae

Grammarcheck documentation of m-files Add newlines between @item fields for readability.
author Rik <octave@nomad.inbox5.com>
date Mon, 26 Jul 2010 21:25:36 -0700
parents 3140cb7a05a1
children a4f482e66b65
comparison
equal deleted inserted replaced
10820:c44c786f87ba 10821:693e22af08ae
17 ## along with Octave; see the file COPYING. If not, see 17 ## along with Octave; see the file COPYING. If not, see
18 ## <http://www.gnu.org/licenses/>. 18 ## <http://www.gnu.org/licenses/>.
19 19
20 ## -*- texinfo -*- 20 ## -*- texinfo -*-
21 ## @deftypefn {Function File} {} invhilb (@var{n}) 21 ## @deftypefn {Function File} {} invhilb (@var{n})
22 ## Return the inverse of a Hilbert matrix of order @var{n}. This can be 22 ## Return the inverse of the Hilbert matrix of order @var{n}. This can be
23 ## computed exactly using 23 ## computed exactly using
24 ## @tex 24 ## @tex
25 ## $$\eqalign{ 25 ## $$\eqalign{
26 ## A_{ij} &= -1^{i+j} (i+j-1) 26 ## A_{ij} &= -1^{i+j} (i+j-1)
27 ## \left( \matrix{n+i-1 \cr n-j } \right) 27 ## \left( \matrix{n+i-1 \cr n-j } \right)
31 ## }$$ 31 ## }$$
32 ## where 32 ## where
33 ## $$ 33 ## $$
34 ## p(k) = -1^k \left( \matrix{ k+n-1 \cr k-1 } \right) 34 ## p(k) = -1^k \left( \matrix{ k+n-1 \cr k-1 } \right)
35 ## \left( \matrix{ n \cr k } \right) 35 ## \left( \matrix{ n \cr k } \right)
36 ##$$ 36 ## $$
37 ## @end tex 37 ## @end tex
38 ## @ifnottex 38 ## @ifnottex
39 ##
39 ## @example 40 ## @example
40 ## @group 41 ## @group
41 ## 42 ##
42 ## (i+j) /n+i-1\ /n+j-1\ /i+j-2\ 2 43 ## (i+j) /n+i-1\ /n+j-1\ /i+j-2\ 2
43 ## A(i,j) = -1 (i+j-1)( )( ) ( ) 44 ## A(i,j) = -1 (i+j-1)( )( ) ( )
45 ## 46 ##
46 ## = p(i) p(j) / (i+j-1) 47 ## = p(i) p(j) / (i+j-1)
47 ## 48 ##
48 ## @end group 49 ## @end group
49 ## @end example 50 ## @end example
51 ##
50 ## where 52 ## where
53 ##
51 ## @example 54 ## @example
52 ## @group 55 ## @group
53 ## k /k+n-1\ /n\ 56 ## k /k+n-1\ /n\
54 ## p(k) = -1 ( ) ( ) 57 ## p(k) = -1 ( ) ( )
55 ## \ k-1 / \k/ 58 ## \ k-1 / \k/
56 ## @end group 59 ## @end group
57 ## @end example 60 ## @end example
61 ##
58 ## @end ifnottex 62 ## @end ifnottex
59 ##
60 ## The validity of this formula can easily be checked by expanding 63 ## The validity of this formula can easily be checked by expanding
61 ## the binomial coefficients in both formulas as factorials. It can 64 ## the binomial coefficients in both formulas as factorials. It can
62 ## be derived more directly via the theory of Cauchy matrices: 65 ## be derived more directly via the theory of Cauchy matrices.
63 ## see J. W. Demmel, @cite{Applied Numerical Linear Algebra}, p. 92. 66 ## See J. W. Demmel, @cite{Applied Numerical Linear Algebra}, p. 92.
64 ## 67 ##
65 ## Compare this with the numerical calculation of @code{inverse (hilb (n))}, 68 ## Compare this with the numerical calculation of @code{inverse (hilb (n))},
66 ## which suffers from the ill-conditioning of the Hilbert matrix, and the 69 ## which suffers from the ill-conditioning of the Hilbert matrix, and the
67 ## finite precision of your computer's floating point arithmetic. 70 ## finite precision of your computer's floating point arithmetic.
68 ## @seealso{hankel, vander, sylvester_matrix, hilb, toeplitz} 71 ## @seealso{hilb, hankel, vander, sylvester_matrix, toeplitz}
69 ## @end deftypefn 72 ## @end deftypefn
70 73
71 ## Author: Dirk Laurie <dlaurie@na-net.ornl.gov> 74 ## Author: Dirk Laurie <dlaurie@na-net.ornl.gov>
72 75
73 function retval = invhilb (n) 76 function retval = invhilb (n)