ncol,gpuMatrix-method {gpuMagic} | R Documentation

## gpuMatrix class

### Description

gpuMatrix class

### Usage

    ## S4 method for signature 'gpuMatrix'
    ncol(x)

### Arguments

`x` | an gpuMatrix object

### Details

`gpuMatrix()`: Create a matrix in an openCL device

`gpuEmptMatrix()`: Create an empty matrix without initialization in an openCL device

`upload()`: The function will automatically be called when an gpuMatrix object is created. It is only needed when you want to update value of the matrix.

`download()`: Get the data from the device. You should explicitly call it when you want to collect the data from the device.

`nrow()`,`ncol()`: return the number of rows or columns present in `x`

`dim()`: Retrieve the dimension of an gpuMatrix object

`length()`: Get the length of an gpuMatrix object.

'getSize()': Get the matrix size in byte

### Value

`gpuMatrix()`: A gpuMatrix object

`gpuEmptMatrix()`: A gpuMatrix object

### Examples

    n=10
    m=20
    A=matrix(runif(n*m),n,m)
    #Create a 64 bit floating point GPU matrix
    A_dev=gpuMatrix(A,'double')

    #Create an empty matrix
    B_dev=gpuEmptMatrix(row=n,col=m)

[Package gpuMagic version 1.10.0 Index]