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