Learn R Programming

pbdDMAT (version 0.2-3)

Hilbert: Generate Hilbert Matrices

Description

Methods for constructing Hilbert matrices: H[i,j] = 1/(i+j-1)

Usage

Hilbert(n, type="matrix", ..., bldim=.BLDIM, ICTXT=.ICTXT)

Arguments

n
number of rows and columns.
type
"matrix" or "ddmatrix".
...
Additional arguments.
bldim
blocking dimension.
ICTXT
BLACS context number.

Value

  • Returns a matrix or a distributed matrix.

Details

This constructs the square Hilbert matrix of order n. The return is either a matrix or a distributed matrix depending on the argument type=.

See Also

as.ddmatrix

Examples

Run this code
# Save code in a file "demo.r" and run with 2 processors by
# > mpiexec -np 2 Rscript demo.r

library(pbdDMAT, quiet = TRUE)
init.grid()

dx <- Hilbert(100, type="ddmatrix")

print(dx)

finalize()

Run the code above in your browser using DataLab