A method for solving a system of linear equations efficiently in order to optimise theanalysis code