xnn.ffnn.models.reaxff_kernels.CGSolver#

class xnn.ffnn.models.reaxff_kernels.CGSolver(ptr, nbr, g, diag, b)[source]#

Bases: object

Jacobi-preconditioned conjugate gradients for the two right-hand sides of the EEM system on the CPU, from the half list’s matrix values (each pair once, its rows ptr, nbr): an iteration is two runs of prepared kernel launches (the product, its dot and the update in one parallel region; the new direction in another) with the scalars in small tensors.

Parameters:
solve(x0, tol)[source]#

From x0 until every relative residual is at most tol: the solution, the relative residuals (2,) and the iterations.

Parameters:
Return type:

tuple