Learn R Programming

CVXR (version 1.9.1)

Xor: Logical XOR

Description

For two arguments: result is 1 iff exactly one is 1. For n arguments: result is 1 iff an odd number are 1 (parity).

Usage

Xor(..., id = NULL)

Value

A Xor expression.

Arguments

...

Two or more boolean Variables or logic expressions.

id

Optional integer ID (internal use).

Details

Note: R's ^ operator is used for power(), so Xor is functional syntax only.

See Also

Not(), And(), Or(), implies(), iff()

Examples

Run this code
if (FALSE) {
x <- Variable(boolean = TRUE)
y <- Variable(boolean = TRUE)
exclusive <- Xor(x, y)
}

Run the code above in your browser using DataLab