Exemple #1
0
def linear_terms(draw):
    coef = draw(coefficients())
    return (coef, C.Linear)
Exemple #2
0
def constant_terms(draw):
    coef = draw(coefficients())
    return coef, M.Constant
Exemple #3
0
def concave_terms(draw):
    coef = draw(coefficients())
    if coef < 0:
        return (coef, C.Convex)
    else:
        return (coef, C.Concave)
Exemple #4
0
def nonincreasing_terms(draw):
    coef = draw(coefficients())
    if coef < 0:
        return coef, M.Nondecreasing
    return coef, M.Nonincreasing