matplotlib 3.5.1

ParametersReturns
_cg(A, b, x0=None, tol=1e-10, maxiter=1000)

Parameters

A : _Sparse_Matrix_coo

A must have been compressed before by compress_csc or compress_csr method.

b : array

Right hand side of the linear system.

x0 : array, optional

Starting guess for the solution. Defaults to the zero vector.

tol : float, optional

Tolerance to achieve. The algorithm terminates when the relative residual is below tol. Default is 1e-10.

maxiter : int, optional

Maximum number of iterations. Iteration will stop after maxiter steps even if the specified tolerance has not been achieved. Defaults to 1000.

Returns

x : array

The converged solution.

err : float

The absolute error np.linalg.norm(A.dot(x) - b)

Use Preconditioned Conjugate Gradient iteration to solve A x = b A simple Jacobi (diagonal) preconditionner is used.

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /matplotlib/tri/triinterpolate.py#1286
type: <class 'function'>
Commit: