Learn R Programming

CVXR (version 1.9.1)

Not: Logical NOT

Description

Returns 1 - x, flipping 0 to 1 and 1 to 0. Can also be written with the ! operator: !x.

Usage

Not(x, id = NULL)

Value

A Not expression.

Arguments

x

A boolean Variable or logic expression.

id

Optional integer ID (internal use).

See Also

And(), Or(), Xor(), implies(), iff()

Examples

Run this code
if (FALSE) {
x <- Variable(boolean = TRUE)
not_x <- !x          # operator syntax
not_x <- Not(x)      # functional syntax
}

Run the code above in your browser using DataLab