convertType: Convert the type of a GPU object

Description Usage Arguments Value Author(s) See Also Examples

Description

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

Usage

1
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.

Author(s)

Nathan Morris

See Also

type

Examples

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


Search within the gmatrix package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.