SpeicalMatrix.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:Matrix-Analysis 作者: kingofspace0wzz 项目源码 文件源码
def isNormal(A, method = 'definition'):

    # use Schur inequality to determine whether it's normal
    if method == 'Schur':
        # initialize eigenValue
        eigenValue = la.eig(A)[0]

        if abs(np.sum(eigenValue**2) - la.norm(A, 'fro')**2) < 0.00001:
            return True
        else:
            return False
    # use definition
    else:
        if abs((A.conjugate().T.dot(A) - A.dot(A.conjugate().T)).all()) < 0.00001:
            return True
        else:
            return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号