def left_multiplied_operator(J, d):
 J = aslinearoperator(J)
 def matvec(x):
  return (d * J.matvec(x))
 def matmat(X):
  return (d * J.matmat(X))
 def rmatvec(x):
  return J.rmatvec((x.ravel() * d))
 return LinearOperator(J.shape, matvec=matvec, matmat=matmat, rmatvec=rmatvec)

def left_multiplied_operator ( J , d ) : J = aslinearoperator ( J ) def matvec ( x ) : return ( d * J . matvec ( x ) ) def matmat ( X ) : return ( d * J . matmat ( X ) ) def rmatvec ( x ) : return J . rmatvec ( ( x . ravel ( ) * d ) ) return LinearOperator ( J . shape , matvec = matvec , matmat = matmat , rmatvec = rmatvec )
return diag(d) j as linearoperator .