Or: Logical OR

OrR Documentation

Logical OR

Description

Returns 1 if and only if at least one argument equals 1, and 0 otherwise. For two operands, can also be written with the | operator: x | y.

Usage

Or(..., id = NULL)

Arguments

...

Two or more boolean Variables or logic expressions.

id

Optional integer ID (internal use).

Value

An Or expression.

See Also

Not(), And(), Xor(), implies(), iff()

Examples

x <- Variable(boolean = TRUE)
y <- Variable(boolean = TRUE)
z <- Variable(boolean = TRUE)
either <- x | y          # operator syntax
either <- Or(x, y)       # functional syntax
any3 <- Or(x, y, z)      # n-ary

CVXR documentation built on Oct. 19, 2026, 5:07 p.m.