cyclic reduction algorithm for solving 1D PDEs