Cyclic reduction algorithm for solving collocation systems