
Solve a matrix using iterative methods.
jacobi(A, b, tol = 1e-06, maxiter = 100)gaussseidel(A, b, tol = 1e-06, maxiter = 100)
cgmmatrix(A, b, tol = 1e-06, maxiter = 100)
a square matrix representing the coefficients of a linear system
a vector representing the right-hand side of the linear system
is a number representing the error tolerence
is the maximum number of iterations
the solution vector
jacobi
finds the solution using Jacobi iteration.
Jacobi iteration depends on the matrix being diagonally-dominate.
The tolerence is specified the norm of the solution vector.
gaussseidel
finds the solution using Gauss-Seidel iteration.
Gauss-Seidel iteration depends on the matrix being either
diagonally-dominate or symmetric and positive definite.
cgmmatrix
finds the solution using the conjugate gradient
method. The conjugate gradient method depends on the matrix being
symmetric and positive definite.
Other linear:
choleskymatrix()
,
detmatrix()
,
gdls()
,
invmatrix()
,
lumatrix()
,
refmatrix()
,
rowops
,
tridiagmatrix()
,
vecnorm()
# NOT RUN {
A <- matrix(c(5, 2, 1, 2, 7, 3, 3, 4, 8), 3)
b <- c(40, 39, 55)
jacobi(A, b)
# }
Run the code above in your browser using DataLab