function [R] = lohc(A)
%lohc Cholesky factorization with inversed indexing
%   R = lohc(A) calculates the Cholesky factor of positive definite matrix
%   A, such that R is upper triangular and A = R*R'.

reverse_idx_func = @(X) X(end:-1:1, end:-1:1);
R = reverse_idx_func(chol(reverse_idx_func(A)))';
end

