gident: Create an identity matrix on the GPU.

Description Usage Arguments Value Author(s) See Also Examples

View source: R/01gmatrix.R

Description

Create an identity matrix on the GPU size

Usage

1
gident(n,val=1, type="d") 

Arguments

n

Integer specifying the dimensions of the matrix.

val

The constant number to put on the diagonal. 1 leads to an identity matrix

type

The type of matrix to return

Value

Returns and n x n matrix with zeros on the of diagonals.

Author(s)

Nathan Morris

See Also

as.gmatrix and as.numeric

Examples

1
2
3
ga = gident(40)
da = diag(40)
sum(h(ga) ==  da)

gmatrix documentation built on May 29, 2017, 2:20 p.m.