Determine if an atom is convex, concave, or affine.

is_atom_convex(object)

is_atom_concave(object)

is_atom_affine(object)

# S4 method for class 'Atom'
is_atom_convex(object)

# S4 method for class 'Atom'
is_atom_concave(object)

# S4 method for class 'Atom'
is_atom_affine(object)

# S4 method for class 'Atom'
is_atom_log_log_convex(object)

# S4 method for class 'Atom'
is_atom_log_log_concave(object)

# S4 method for class 'Atom'
is_atom_log_log_affine(object)

Arguments

object

A Atom object.

Value

A logical value.

Examples

x <- Variable()

is_atom_convex(x^2)
#> [1] TRUE
is_atom_convex(sqrt(x))
#> [1] FALSE
is_atom_convex(log(x))
#> [1] FALSE

is_atom_concave(-abs(x))
#> [1] TRUE
is_atom_concave(x^2)
#> [1] FALSE
is_atom_concave(sqrt(x))
#> [1] TRUE

is_atom_affine(2*x)
#> [1] TRUE
is_atom_affine(x^2)
#> [1] FALSE