转自:http://m.blog.csdn.net/blog/caiqi1123/9192237
7.9 Summary of HDevelop operations
Functionality | HDevelop Operation | HALCON operator |
| ||
concatenation | [t1,t2] | |
number of elements | |t| | |
select tuple element | t[i] | |
select tuple slice | t[i1:i2] | |
select elements | subset(t,i) | |
remove tuple elements | remove(t,i) | |
lookup tuple values | find(t1,t2) | |
unify tuple elements | uniq(t) | |
tuple creation | gen_tuple_const(i1,i2) | |
| ||
division | a1 / a2 | |
multiplication | a1 * a2 | |
modulo | a1 % a2 | |
addition | a1 + a2 | |
subtraction | a1 - a2 | |
negation | -a | |
| ||
left shift | lsh(i1,i2) | |
right shift | rsh(i1,i2) | |
bitwise and | i1 band i2 | |
bitwise xor | i1 bxor i2 | |
bitwise or | i1 bor i2 | |
bitwise complement | bnot i | |
| ||
string conversion | v$s | |
string concatenation | v1 + v2 | |
search character | strchr(s1,s2) | |
search character (reverse) | strrchr(s1,s2) | |
search string | strstr(s1,s2) | |
search string (reverse) | strrstr(s1,s2) | |
length of string | strlen(s) | |
select character | s{i} | |
select substring | s{i1:i2} | |
split string | split(s1,s2) | |
regular expression match | regexp_match(s1,s2) | |
regular expression replace | regexp_replace(s1,s2,s3) | |
regular expression select | regexp_select(s1,s2) | |
regular expression test | regexp_test(s1,s2) | |
| ||
less than | t1 < t2 | |
greater than | t1 > t2 | |
less or equal | t1 <= t2 | |
greater or equal | t1 >= t2 | |
equal | t1 = t2 | |
not equal | t1 # t2 | |
| ||
logical and | l1 and l2 | |
logical xor | l1 xor l2 | |
logical or | l1 or l2 | |
negation | not l | |
| ||
sine | sin(a) | |
cosine | cos(a) | |
tangent | tan(a) | |
arc sine | asin(a) | |
arc cosine | acos(a) | |
arc tangent | atan(a) | |
arc tangent2 | atan2(a1,a2) | |
hyperbolic sine | sinh(a) | |
hyperbolic cosine | cosh(a) | |
hyperbolic tangent | tanh(a) | |
| ||
exponential function | exp(a) | |
natural logarithm | log(a) | |
decadic logarithm | log10(a) | |
power function | pow(a1,a2) | |
ldexp function | ldexp(a1,a2) | |
| ||
minimum | min(t) | |
element-wise minimum | min2(t1,t2) | |
maximum | max(t) | |
element-wise maximum | max2(t1,t2) | |
sum function | sum(t) | |
mean value | mean(a) | |
standard deviation | deviation(a) | |
cumulative sum | cumul(a) | |
median | median(a) | |
element rank | select_rank(a,i) | |
square root | sqrt(a) | |
radians to degrees | deg(a) | |
degrees to radians | rad(a) | |
integer to real | real(a) | |
real to integer | int(a) | |
real to integer | round(a) | |
absolute value | abs(a) | |
floating absolute value | fabs(a) | |
ceiling function | ceil(a) | |
floor function | floor(a) | |
fractional part | fmod(a1,a2) | |
element-wise sign | sgn(a) | |
| ||
sort elements | sort(t) | |
sort elements (returns index) | sort_index(t) | |
reverse element order | inverse(t) | |
test for numeric value | is_number(v) | |
string to number | number(v) | |
environment variable | environment(s) | |
character to ASCII number | ord(a) | |
ASCII number to character | chr(a) | |
tuple of strings to ASCII numbers | ords(s) | |
tuple of integers to string | chrt(i) | |
random number | rand(a) | |
|
|
|
tuple_uniq discards all but one of successive identical elements from the input tuple Tuple and returns the remaining elements in Uniq. For example, if Tuple contains the values [0,0,1,1,1,2,0,1], the output tuple Uniq will contain the values [0,1,2,0,1]. It is allowed to mix strings and numbers in the input tuple. To delete really all identical elements of the input tuple, use first the operator tuple_sort.