This will bomb with sparse matrices. Adding `try: x = aslinearoperator(x); except TypeError: pass` to the top is perhaps better.