¨function a=rlu(a)
¨[m,n]=size(a);
¨mn = min(m,n);
¨if mn > 1
¨ nl =
bitshift(mn,-1);
¨% lu on left part
¨
a(1:m,1:nl)= rlu(a(1:m,1:nl));
¨% trangular solve
¨
a(1:nl,nl+1:n) =
(tril(a(1:nl,1:nl))-diag(diag(a(1:nl,1:nl)))+eye(nl))\a(1:nl,nl+1:n);
¨% matrix multiple
¨
a(nl+1:m,nl+1:n) = a(nl+1:m,nl+1:n) -
a(nl+1:m,1:nl)*a(1:nl,nl+1:n);
¨% lu on right part
¨
a(nl+1:m,nl+1:n) = rlu(a(nl+1:m,nl+1:n));
¨else
¨% mx1 case
¨
a(2:m,:) = a(2:m,:)/a(1,1);
¨end
¨return
¨
¨