cgen_utils.py 文件源码

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

项目:devito 作者: opesci 项目源码 文件源码
def ccode(expr, **settings):
    """Generate C++ code from an expression calling CodePrinter class

    :param expr: The expression
    :param settings: A dictionary of settings for code printing
    :returns: The resulting code as a string. If it fails, then it returns the expr
    """
    if isinstance(expr, Eq):
        return ccode_eq(expr)
    try:
        return CodePrinter(settings).doprint(expr, None)
    except:
        return expr
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号