Description Usage Arguments Value See Also
Using the iterative Conjugate Gradient Solver from the Eigen C++ library
it solves a linear system A * x = b
. Currently, it uses a diagonal
preconditioner.
1 | sparse_cg(A, b, x0, maxiter = 10000L, tol = 1e-06)
|
A |
Sparse double matrix of class dgCMatrix. |
b |
Numeric vector with length equal to number of rows of |
x0 |
Numeric vector with same length as |
maxiter |
Integer scalar that sets the maximum number of iterations allowed by the solver. Default is 10,000. |
tol |
Sets the tolerance threshold (upper bound to the relative residual error) used by the stopping criteria. |
sparse_cg
returns a list with several components:
coefficients |
a vector with the estimated coefficients |
itr |
a scalar denoting the number of iterations at convergence |
err |
a scalar denoting the relative error at convergance |
See Eigen Library for more documentation on solver used and other available solvers.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.