commands → kaczmarz

kaczmarz(A,B,n)

The kaczmarz command finds an approximate solution to A*X = B by sweeping over the rows of A and projecting n times. The system must be full rank or overdetermined, in which case X will approximate a least-squares solution.

Examples

A = randommatrix(10,4,4);
B = randomvector(10,4);
X = kaczmarz(A,B,500);
A*X-B;  # compute the residual
	[-1.53865631347117e-09, 3.85157991811269e-06, -3.42209421404505e-05, 1.19012976682598e-05]

Algorithm

The Kaczmarz algorithm is effective at finding low precision solutions to large sparse systems.

References

Link to the Kaczmarz method on Wikipedia