The curvature of an expression.

The curvature of an expression.

curvature(object)

# S4 method for Expression
curvature(object)

Arguments

object

An Expression object.

Value

A string indicating the curvature of the expression, either "CONSTANT", "AFFINE", "CONVEX, "CONCAVE", or "UNKNOWN".

A string indicating the curvature of the expression, either "CONSTANT", "AFFINE", "CONVEX", "CONCAVE", or "UNKNOWN".

Examples

x <- Variable()
c <- Constant(5)

curvature(c)
#> [1] "CONSTANT"
curvature(x)
#> [1] "AFFINE"
curvature(x^2)
#> [1] "CONVEX"
curvature(sqrt(x))
#> [1] "CONCAVE"
curvature(log(x^3) + sqrt(x))
#> [1] "UNKNOWN"