| gpuSolve {gputools} | R Documentation |
This function estimates the solution to an equation of the form x * b = y where x is a matrix, b is an unkown vector, and y is a known vector. It does much calculation on a GPU.
gpuSolve(x, y)
x |
a matrix of floating point numbers. |
y |
a vector of floating point numbers of length nrow(x). |
a vector of floating point numbers of length ncol(x) which is an estimate of the b from x * b = y.
Bjorck, Ake (1996) Numerical methods for least squares problems. SIAM.
# get some random data of any shape at all
x <- matrix(runif(1000), 50, 20)
y <- runif(50)
b <- gpuSolve(x, y)
cat("Solution:\n")
print(b)
cat("x * b\n")
print(x %*% b)
cat("original y\n")
print(y)