Scalar {gpuMagic} | R Documentation

## Create a scalar variable

### Description

The function will create a scalar variable, it is only useful in the openCL functions. It can also be called in R, but its argument will not take any effect.

### Usage

    Scalar(precision = GPUVar$default_float, constDef = FALSE)

### Arguments

`precision` | The variable type, please refer to `gpuMagic.getAvailableType()` to see the available data type.
`constDef` | Specify if the variable can be redefined. The package will automatically update the variable definition when it is needed, if you do not need this feature, you can manually turn the feature off. It is useful in some special cases such as turning off the auto update to do the integer division (By default, the package will convert the variable to the default float type before doing the division).

### Value

a variable initialize with 0.

### Examples

    a=Scalar(precision='double',constDef=FALSE)

[Package gpuMagic version 1.4.0 Index]