Least Squares LSMR library from Fong and Saunders, with modifications