A class of direct methods for linear systems