sgcrf.py 文件源码

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

项目:sgcrfpy 作者: dswah 项目源码 文件源码
def check_pd(A, lower=True):
    """
    Checks if A is PD.
    If so returns True and Cholesky decomposition,
    otherwise returns False and None
    """
    try:
        return True, np.tril(cho_factor(A, lower=lower)[0])
    except LinAlgError as err:
        if 'not positive definite' in str(err):
            return False, None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号