介绍[ 1,2 ]、[ 3,4 ] ] mod7=[ 5,1 ]、[ 5,3 ] [ mod7]
sage(www.sagemath.org ) as
矩阵(集成(7)、[ 1,2 ]、[ 3,4 ].inverse ) ) ) )。
python一代KDD xn/pimportnumpyfromsympyimportmatrixdefmatinvmod (vmnp,mod ) : NR=vmnp.shape [0] NC=vmnp.shape [ 1 exiting'(exit ) ) VMsym=matrix ) vmnp ) vmsyminv=VMsym.inv_mod ) vmnpinv=numpy.array (vmsyminv ) print n ' ) k just a2-dlistvmtestinv=VM sym * vmsyminvforiinrange ) k : #print i,j,vmtrx2[i,j ] % mod VM test [ I ] [ j ]=vmtest j ] % mod print (testv MK * vk inv % mod (n 3360 VM test ) returnvmnpinvif _ _ name _=' _ main _ ' : # p=271 mat