Description Usage Arguments Value Examples
Solve linear system by Gauss-Seidel, Jacobi(sequential), or Jacobi(parallel) method
1 | solve_ols(A, b, cores = 1, method, iteration)
|
A |
n*n matrix of the input system Ax=b |
b |
n*1 vector of the input system Ax=b |
cores |
Number of cores used in parallel computing of Jacobi Mathod. If cores=1,use sequential method, otherwise use parallel computing. |
method |
Method to use. "GS"=Gauss-Seidel,"Jacobi"=Jacobi |
iteration |
Number of iterations |
x,n*1 vector, solution of the input system Ax=b
1 2 3 4 5 6 7 8 9 10 11 12 | n=10
L <- diag(0, n)
L[(row(L) - col(L)) == 1] <- -1
U <- diag(0, n)
U[(row(U) - col(U)) == -1] <- -1
D <- diag(2, n)
a <- L+D+U
v <- as.matrix(rep(1,10))
b=a%*%v
solve_ols(a,b,method = "GS",iteration = 100)
solve_ols(a,b,cores=1,method = "Jacobi",iteration=100)
solve_ols(a,b,cores=2,method = "Jacobi",iteration=100)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.