Storage and methods for GPU vector data.
Data is held in an external pointer.
new()gpuvecR6$new(card, size = 0, type = "double")
Class initializer. See also ?gpuvec.
resize()gpuvecR6$resize(size)
sizeThe new length.
Change the length of the vector object.
dupe()gpuvecR6$dupe()
Duplicate the vector in a deep copy.
info()gpuvecR6$info()
Print one-line information about the vector.
print()gpuvecR6$print(ndigits = 4)
ndigitsNumber of decimal digits to print.
Print the data.
fill_zero()gpuvecR6$fill_zero()
Fill all entries with zero.
fill_val()gpuvecR6$fill_val(v)
vValue to set all entries to.
Fill all entries with supplied value.
fill_linspace()gpuvecR6$fill_linspace(start, stop)
start, stopBeginning/end of the linear spacing.
Fill the vector (column-wise) with linearly-spaced values.
scale()gpuvecR6$scale(s)
sValue to scale all entries by.
Scale all entries by the supplied value.
pow()gpuvecR6$pow(s)
pValue to raise all entries to.
Exponentiate all entries by the supplied value.
rev()gpuvecR6$rev()
Reverse rows.
sum()gpuvecR6$sum()
Sum the vector.
Returns the sum.
min()gpuvecR6$min()
Finds the minimum value of the vector.
Returns the min.
max()gpuvecR6$max()
Finds the maximum value of the vector.
Returns the max.
get()gpuvecR6$get(i)
iIndex (0-based).
Get element from the vector.
set()gpuvecR6$set(i, v)
iIndex (0-based).
vValue.
Set element of the vector.
size()gpuvecR6$size()
Returns length of the vector.
get_card()gpuvecR6$get_card()
Returns the internal card object.
data_ptr()gpuvecR6$data_ptr()
Returns the external pointer data. For developers only.
get_type()gpuvecR6$get_type()
Returns the integer code for the underlying storage type. For developers only.
get_type_str()gpuvecR6$get_type_str()
Returns the string code for the underlying storage type. For developers only.
get_class()gpuvecR6$get_class()
Returns the integer code the class type, in this case CLASS_VEC.
to_robj()gpuvecR6$to_robj()
Returns an R vector containing a copy of the class data.
from_robj()gpuvecR6$from_robj(robj)
robjR vector.
Copies the values of the input to the class data. See also ?as_gpuvec.
clone()The objects of this class are cloneable with this method.
gpuvecR6$clone(deep = FALSE)
deepWhether to make a deep clone.