Learn R Programming

gmatrix (version 0.3)

convertType: Convert the type of a GPU object

Description

This function is used to convert the type (i.e. "double", "single", "integer" or "logical") of a gmatrix or gvector object.

Usage

convertType(x, to, dup = TRUE)

Arguments

x
A GPU object of class gvector or gmatrix
to
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.
dup
This may be set to 'FALSE' to avoid duplicating x in the event the original type and the to type are the same

Value

Returns the x after converting it to a new type.

See Also

type

Examples

Run this code

x=gseq(1,10)
y=convertType(x,'d')
type(y)

Run the code above in your browser using DataLab