## `linalg::invhilbert` -- inverse of a Hilbert matrix

#### Introduction

`linalg::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>)`

#### Parameters

`n` | - | the dimension of the matrix: a positive integer
`R` | - | the component ring: a domain of category `Cat::Rng`; default: `Dom::ExpressionField()`

#### Returns

an n x n matrix of the domain `Dom::Matrix(R)`.

#### Related Functions

`linalg::hilbert`

#### Details

- `linalg::invhilbert` uses an explicit formula for the inverse.
- Note that the entries of the inverse of a Hilbert matrix are integers. But the returned matrix is defined over the standard component domain `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 1

We 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)

#### Background

- Hilbert matrices of large dimension are notoriously ill-conditioned, challenging any numerical inversion scheme.
- `linalg::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.

#### Changes

- new function

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000