linalg::invhilbert -- inverse
of a Hilbert matrix
Introductionlinalg::invhilbert(n) returns the inverse
of the n x n Hilbert matrix H. The n x
n Hilbert matrix H is defined by H[i,j]:=
1/(i+j-1).
Call(s)linalg::invhilbert(n <, R>)
Parametersn |
- | the dimension of the matrix: a positive integer |
R |
- | the component ring: a domain of category Cat::Rng; default: Dom::ExpressionField() |
Returnsan n x n matrix of the domain Dom::Matrix(R).
Related
Functions
Detailslinalg::invhilbert uses an explicit formula for the
inverse.Dom::ExpressionField() so that no
conversion is necessary when working with other functions that expect
or return matrices over that component domain.linalg::invhilbert(n,Dom::Integer)
returns the inverse of the n x n Hilbert matrix defined over
the integers.
Example
1We compute the inverse of the 3 x 3 Hilbert matrix:
>> A := linalg::invhilbert(3)
+- -+
| 9, -36, 30 |
| |
| -36, 192, -180 |
| |
| 30, -180, 180 |
+- -+
This is a matrix of the domain
Dom::Matrix().
If you prefer a different component ring, the matrix may be
converted into the desired domain afterwards (see convert, for example).
Alternatively, one can specify the component ring when calling
linalg::invhilbert, for example the domain Dom::Float:
>> A := linalg::invhilbert(3, Dom::Float)
+- -+
| 9.0, -36.0, 30.0 |
| |
| -36.0, 192.0, -180.0 |
| |
| 30.0, -180.0, 180.0 |
+- -+
>> domtype( A )
Dom::Matrix(Dom::Float)
Backgroundlinalg::invhilbert uses the formula
inverseH[i,j]=(-1)^(i+j)*c[i]*c[j]/(i+j-1),
c[i]=(n+i-1)!/(n-i)!/((i-1)!)^2
for the inverse of the n x n Hilbert matrix H
(N.J. Higham, Accuracy and Stability of Numerical Algorithms,
SIAM 1996). All entries of are integers.