SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.matrix.doubles.matrixtype
Class HilbertMatrix

java.lang.Object
  extended by com.numericalmethod.suanshu.matrix.doubles.matrixtype.MatrixMathImpl<T>
      extended by com.numericalmethod.suanshu.matrix.doubles.matrixtype.MatrixStorageImpl<SymmetricMatrix>
          extended by com.numericalmethod.suanshu.matrix.doubles.matrixtype.dense.triangle.SymmetricMatrix
              extended by com.numericalmethod.suanshu.matrix.doubles.matrixtype.HilbertMatrix
All Implemented Interfaces:
DeepCopyable, AbelianGroup<Matrix>, Monoid<Matrix>, Ring<Matrix>, Matrix, MatrixAccessor, MatrixRing, Densifiable, MatrixDimension

public class HilbertMatrix
extends SymmetricMatrix

A Hilbert matrix, H, is a symmetric matrix with entries being the unit fractions

H[i][j] = 1 / (i + j -1)

See Also:
Wikipedia: Hilbert matrix

Field Summary
 
Fields inherited from class com.numericalmethod.suanshu.matrix.doubles.matrixtype.dense.triangle.SymmetricMatrix
dim
 
Constructor Summary
HilbertMatrix(int dim)
          Construct a Hilbert matrix of dimension dim * dim.
 
Method Summary
 double det()
          The determinant of a Hilbert matrix is the reciprocal of an integer.
 java.math.BigInteger invdet()
          One over the determinant of H.
 
Methods inherited from class com.numericalmethod.suanshu.matrix.doubles.matrixtype.dense.triangle.SymmetricMatrix
add, deepCopy, equals, get, getColumn, getRow, hashCode, minus, ONE, scaled, set, t, toDense, toString, ZERO
 
Methods inherited from class com.numericalmethod.suanshu.matrix.doubles.matrixtype.MatrixStorageImpl
getMatrixData, setMatrixData
 
Methods inherited from class com.numericalmethod.suanshu.matrix.doubles.matrixtype.MatrixMathImpl
add, call, getSample, minus, multiply, multiply, nCols, nRows, opposite, setColumn, setColumn, setRow, setRow
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HilbertMatrix

public HilbertMatrix(int dim)
Construct a Hilbert matrix of dimension dim * dim.

Parameters:
dim - Hilbert matrix dimension, i.e., the number of rows or number of columns
Method Detail

invdet

public java.math.BigInteger invdet()
One over the determinant of H.
   1
 -----
  |H|
 

Returns:
one over the determinant of H

det

public double det()
The determinant of a Hilbert matrix is the reciprocal of an integer.

Returns:
the determinant
See Also:
OEIS: sequence A005249

SuanShu, a Java numerical and statistical library

Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.