A sweep operator for triangular matrices and its statistical applications ∗