linear problem solver