bundles / scipy latest / scipy / linalg / _special_matrices / invhilbert
function
scipy.linalg._special_matrices:invhilbert
Signature
def invhilbert ( n , exact = False ) Summary
Compute the inverse of the Hilbert matrix of order n.
Extended Summary
The entries in the inverse of a Hilbert matrix are integers. When n is greater than 14, some entries in the inverse exceed the upper limit of 64 bit integers. The exact argument provides two options for dealing with these large integers.
Parameters
n: intThe order of the Hilbert matrix.
exact: bool, optionalIf False, the data type of the array that is returned is np.float64, and the array is an approximation of the inverse. If True, the array is the exact integer inverse array. To represent the exact inverse when n > 14, the returned array is an object array of long integers. For n <= 14, the exact inverse is returned as an array with data type np.int64.
Returns
invh: (n, n) ndarrayThe data type of the array is np.float64 if
exactis False. Ifexactis True, the data type is either np.int64 (for n <= 14) or object (for n > 14). In the latter case, the objects in the array will be long integers.
Notes
Examples
from scipy.linalg import invhilbert invhilbert(4)✓
invhilbert(4, exact=True) invhilbert(16)[7,7]✗
invhilbert(16, exact=True)[7,7]
✓See also
- hilbert
Create a Hilbert matrix.
Aliases
-
scipy.linalg.invhilbert