sign-methods: Sign Properties

sign-methodsR Documentation

Sign Properties

Description

Determine if an expression is positive, negative, or zero.

Usage

is_zero(object)

is_nonneg(object)

is_nonpos(object)

Arguments

object

An Expression object.

Value

A logical value.

Examples

pos <- Constant(1)
neg <- Constant(-1)
zero <- Constant(0)
unknown <- Variable()

is_zero(pos)
is_zero(-zero)
is_zero(unknown)
is_zero(pos + neg)

is_nonneg(pos + zero)
is_nonneg(pos * neg)
is_nonneg(pos - neg)
is_nonneg(unknown)

is_nonpos(-pos)
is_nonpos(pos + neg)
is_nonpos(neg * zero)
is_nonpos(neg - pos)

CVXR documentation built on June 27, 2024, 5:11 p.m.