#NEWLINE# def check_precond_dummy( solver , case ) : #NEWLINE# #INDENT# tol = 1e-08 #NEWLINE# def identity( b , which = None ) : #NEWLINE# #INDENT# 'trivial preconditioner' #NEWLINE# return b #NEWLINE# #UNINDENT# A = case . A #NEWLINE# ( M , N ) = A . shape #NEWLINE# D = spdiags ( [ ( 1.0 / A . diagonal ( ) ) ] , [ 0 ] , M , N ) #NEWLINE# b = arange ( A . shape [ 0 ] , dtype = float ) #NEWLINE# x0 = ( 0 * b ) #NEWLINE# precond = LinearOperator ( A . shape , identity , rmatvec = identity ) #NEWLINE# if ( solver is qmr ) : #NEWLINE# #INDENT# ( x , info ) = solver ( A , b , M1 = precond , M2 = precond , x0 = x0 , tol = tol ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( x , info ) = solver ( A , b , M = precond , x0 = x0 , tol = tol ) #NEWLINE# #UNINDENT# assert_equal ( info , 0 ) #NEWLINE# assert_normclose ( A . dot ( x ) , b , tol ) #NEWLINE# A = aslinearoperator ( A ) #NEWLINE# A . psolve = identity #NEWLINE# A . rpsolve = identity #NEWLINE# ( x , info ) = solver ( A , b , x0 = x0 , tol = tol ) #NEWLINE# assert_equal ( info , 0 ) #NEWLINE# assert_normclose ( ( A * x ) , b , tol = tol )