In Topological Tree Analyszer user-defined expressions are used to calculate the actual data (e.g., distances between trees) from basic topological values. A set of functions is available to formulate such expressions and to access the basic values. An unlimited number of user expressions can be defined and will be written to a results table at the end of an analysis. It is also possible to reference results from one user expression from another one and reuse the result there.
Functions to access basic topological values
Functions to access results of other expressions
Operators
The following list contains all valid operators. Each operator binds as strong or more than all operators listed below. The right columns indicate which types the operands need to have.
Name: |
Operator: |
Numeric: |
Textual: |
Boolean: |
Example: |
Power |
^ |
|
|
|
10^-2 (= 0.02) |
Unary plus |
+ |
|
|
|
+4 |
Unary minus |
- |
|
|
|
-4 |
Modulo |
% |
|
|
|
10 % 4 (= 2) |
Division |
/ |
|
|
|
getValue(LENGTH) / 2 |
Multiplication |
* |
|
|
|
getValue("id1") * 100 |
Addition |
+ |
|
|
|
getValue("id1") + 10
"Two " + "words"
|
Less or equal |
<= |
|
|
|
if(treeUserValue("someValue") <= 100, treeUserValue("someValue"), 100) |
Greater or equal |
>= |
|
|
|
if(treeUserValue("someValue") <= 100, "A", "B") |
Less then |
< |
|
|
|
if(treeUserValue("someValue") < 100, treeUserValue("someValue"), 100) |
Greater then |
> |
|
|
|
if(treeUserValue("someValue") < 100, "A", "B") |
Equal |
= |
|
|
|
if(treeUserValue("value1") = 100, treeUserValue("value2"), treeUserValue("value3")) |
Not equal |
!= |
|
|
|
if(treeUserValue("value1") != "empty", treeUserValue("value2"), 0) |
And |
&& |
|
|
|
if(treeUserValue("value1") < 100 && treeUserValue("value1") > 50, treeUserValue("value2"), "") |
Or |
|| |
|
|
|
if(treeUserValue("value1") < 100 || treeUserValue("value2") < 100, treeUserValue("value3"), "undefined") |
Text functions
General mathematical functions
General constants