scipy 1.8.0 Pypi GitHub Homepage
Other Docs
NotesParametersReturns
_woodbury_algorithm(A, ur, ll, b, k)

Notes

This algorithm works only for systems with banded matrix A plus a correction term U @ V.T, where the matrix U @ V.T gives upper right and lower left block of A The system is solved with the following steps: 1. New systems of linear equations are constructed: A @ z_i = u_i, u_i - columnn vector of U, i = 1, ..., k - 1 2. Matrix Z is formed from vectors z_i: Z = [ z_1 | z_2 | ... | z_{k - 1} ] 3. Matrix H = (1 + V.T @ Z)^{-1} 4. The system A' @ y = b is solved 5. x = y - Z @ (H @ V.T @ y) Also, n should be greater than k , otherwise corner block elements will intersect with diagonals.

Parameters

A : 2-D array, shape(k, n)

Matrix of diagonals of original matrix(see solve_banded documentation).

ur : 2-D array, shape(bs, bs)

Upper right block matrix.

ll : 2-D array, shape(bs, bs)

Lower left block matrix.

b : 1-D array, shape(n,)

Vector of constant terms of the system of linear equations.

k : int

B-spline degree.

Returns

c : 1-D array, shape(n,)

Solution of the original system of linear equations.

Solve a cyclic banded linear system with upper right and lower blocks of size (k-1) / 2 using the Woodbury formula

Examples

Consider the case of n = 8, k = 5 (size of blocks - 2 x 2). The matrix of a system: U: V: x x x * * a b a b 0 0 0 0 1 0 x x x x * * c 0 c 0 0 0 0 0 1 x x x x x * * 0 0 0 0 0 0 0 0 * x x x x x * 0 0 0 0 0 0 0 0 * * x x x x x 0 0 0 0 0 0 0 0 d * * x x x x 0 0 d 0 1 0 0 0 e f * * x x x 0 0 e f 0 1 0 0

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


GitHub : /scipy/interpolate/_bsplines.py#838
type: <class 'function'>
Commit: