import scipy.sparse as sparse
def computeAdjoint(A,measure):
"""Compute the adjoint matrix our inner product space by multiplying
with the kernel of integration/weighting function inverse on the left
and weighting function itself on the right"""
Minv=sparse.diags(1./measure)
M=sparse.diags(measure)
return Minv*A.transpose()*M
计算矩阵的伴随矩阵a非常简单。在
如果你的内积空间是用矩阵M加权的,你只需计算M^-1a^tmm,其中T是(共轭)转置,第一项是矩阵M的逆。在
在稀疏矩阵的代码中,这将是:
(还要注意,*代表矩阵乘法,A.multiple(M)代表分量乘法)
相关问题 更多 >
编程相关推荐