Learn R Programming

gmatrix (version 0.3)

gouter: GPU generalized outer product.

Description

This function calculates the outer product of two gvectors.

Usage

gouter(x, y, FUN = "*", normalOrder = TRUE)

Arguments

x
a 'vector' or gvector object
y
a 'vector' or gvector object
FUN
one of the following characters '*', '+', '-', '/' or '^'
normalOrder
logical input determining which order the operation should be performed in.

Value

returns a gmatrix with the specified operation performed

Details

This function is similar to the outer function in R base. It performs the specified operation on all posible combinations of elements from the first vector with the second. This function does not behave the same as R base when operating on matrices. Also, the operator %o% may be used as in the R base package.

See Also

outer, %o%

Examples

Run this code
gouter(grnorm(10), grnorm(10), FUN="-")

Run the code above in your browser using DataLab