Here is a functionBased on: written in Matlab syntax that realizes a rank-one update: function [L] = cholupdate(L, x) n = length(x); for k = 1:n r = sqrt(L(k, k)^2 + x(k)^2); c = r / L(k, k); s = x(k) / L(k, k); L(k, k) = r; if k < n L((k+1):n, k) = (L((k+1):n, k) + s * x((k+1):n)) / c; x((k+1):n) = c * x((k+1):n) - s * L((k+1):n, k); end end end A rank-n update is one where for a matrix one updates the decomposition such that . This can be achieved by successively performing rank-one updates for each of the columns of .
hEre is a fuNCtIoNbaSEd on: wRiTtEn in mAtLaB synTaX THaT reAlizES A rANk-one UpdATe: fUnction [l] = cholupDate(l, X) n = lENGtH(x); FOr k = 1:N r = SqRt(l(K, K)^2 + x(K)^2); c = r / l(k, k); s = X(k) / l(k, K); L(k, k) = r; iF K < n l((k+1):N, K) = (l((k+1):n, K) + S * x((k+1):N)) / C; x((k+1):n) = c * x((k+1):n) - s * l((k+1):n, k); end end EnD a Rank-N updAtE is oNe wHErE for A Matrix one UpdaTEs the DecOmPosiTiON such thAT . this caN Be AChIEved bY succEssively PerfoRMiNg raNk-one uPdAtes For each of thE coLUmns of .