Set, Comparison, And Boolean Operationsπ
Set Operationsπ
Operation | Meaning | HALCON operator |
---|---|---|
difference(t1,t2) |
difference set | tuple_difference |
intersection(t1,t2) |
intersection set | tuple_intersection |
symmdiff(t1,t2) |
symmetric difference set | tuple_symmdiff |
union(t1,t1) |
union set | tuple_union |
Comparison Operationsπ
Operation | Meaning | HALCON operator | Alternative notation |
---|---|---|---|
t1 < t2 |
less than | tuple_less |
|
t1 > t2 |
greater than | tuple_greater |
|
t1 <= t2 |
less or equal | tuple_less_equal |
|
t1 >= t2 |
greater of equal | tuple_greater_equal |
|
t1 == t2 |
equal | tuple_equal |
t1 = t2 (legacy) |
t1 != t2 |
not equal | tuple_not_equal |
t1 # t2 (legacy) |
Example
1st Operand | Operation | 2nd Operand | Result |
---|---|---|---|
1 |
== |
1.0 |
true |
[] |
== |
[] |
true |
'' |
== |
[] |
false |
[1,'2'] |
== |
[1,2] |
false |
[1,2,3] |
== |
[1,2] |
false |
[4711,'Hugo'] |
== |
[4711,'Hugo'] |
true |
'Hugo' |
== |
'hugo' |
false |
2 |
> |
1 |
true |
2 |
> |
1.0 |
true |
[5,4,1] |
> |
[5,4] |
true |
[2,1] |
> |
[2,0] |
true |
true |
> |
false |
true |
'Hugo' |
< |
'hugo' |
true |
Elementwise Comparison Operationsπ
Operation | Meaning | HALCON operator | Alternative notation |
---|---|---|---|
t1 [<] t2 |
less than | tuple_less_elem |
|
t1 [>] t2 |
greater than | tuple_greater_elem |
|
t1 [<=] t2 |
less or equal | tuple_less_equal_elem |
|
t1 [>=] t2 |
greater of equal | tuple_greater_equal_elem |
|
t1 [==] t2 |
equal | tuple_equal_elem |
t1 [=] t2 (legacy) |
t1 [!=] t2 |
not equal | tuple_not_equal_elem |
t1 [#] t2 (legacy) |
Example
1st Operand | Operation | 2nd Operand | Result |
---|---|---|---|
[1,2,3] |
[<] |
[3,2,1] |
[1,0,0] |
['a','b','c'] |
[==] |
'b' |
[0,1,0] |
['a','b','c'] |
[<] |
['b'] |
[1,0,0] |
Boolean Operationsπ
Operation | Meaning | HALCON operator |
---|---|---|
l1 and l2 |
logical βandβ | tuple_and |
l1 xor l2 |
logical βxorβ | tuple_xor |
l1 or l2 |
logical βorβ | tuple_or |
not l |
negation | tuple_not |