symforce.logic module#
Functions for dealing with logical operations represented by scalars
- logical_and(*args, unsafe=False)[source]#
Logical
and
of two or more ScalarsInput values are treated as true if they are positive, false if they are 0 or negative. The returned value is 1 for true, 0 for false.
If unsafe is True, the resulting expression is fewer ops but assumes the inputs are exactly 0 or 1; results for other (finite) inputs will be finite, but are otherwise undefined.
- logical_or(*args, unsafe=False)[source]#
Logical
or
of two or more ScalarsInput values are treated as true if they are positive, false if they are 0 or negative. The returned value is 1 for true, 0 for false.
If unsafe is True, the resulting expression is fewer ops but assumes the inputs are exactly 0 or 1; results for other (finite) inputs will be finite, but are otherwise undefined.
- logical_not(a, unsafe=False)[source]#
Logical
not
of a ScalarInput value is treated as true if it is positive, false if it is 0 or negative. The returned value is 1 for true, 0 for false.
If unsafe is True, the resulting expression is fewer ops but assumes the inputs are exactly 0 or 1; results for other (finite) inputs will be finite, but are otherwise undefined.