tft_mathprog_backend.py 文件源码

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

项目:FPTuner 作者: soarlab 项目源码 文件源码
def addVar (self, ve):
        assert(isinstance(ve, tft_expr.VariableExpr))

        vlabel = ve.label()
        vtype  = ve.type()
        lb     = None
        if (ve.hasLB()):
            lb = ve.lb().value()
        ub     = None
        if (ve.hasUB()):
            ub = ve.ub().value() 
        assert(vtype in [int, float, Fraction])

        if (vlabel not in self.variables.keys()):
            self.variables[vlabel] = [vtype, lb, ub]
        else:
            assert(vtype is self.variables[vlabel][0])
            assert(lb is self.variables[vlabel][1])
            assert(ub is self.variables[vlabel][2])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号