Learn R Programming

gmatrix (version 0.3)

type: Get or set the type of a GPU object

Description

These functions may be used to get or set the type of a GPU object. May be used as type(x) type(x)<-value

Arguments

x
A GPU object of class gvector or gmatrix
value
The type to convert the object to. There are three different ways to specify this. One may use the "double", "single", "integer" or "logical" notation. Alternatively the short form "d", "s", "i" or "s" notation may be used. Finally the internal integer representation of 0L, 1L, 2L or 3L may be used.

Value

type(x) returns the type of x type(x)<-value change the type of x

See Also

convertType

Examples

Run this code
x=g(1:4)
type(x)="d" #change the type from "integer" to "double"

Run the code above in your browser using DataLab