Featured operators
From Impure Wiki
Contents |
addition
Addition is a typical example of a polymorphic operator. That means it is able to deal with different types of data structures. Depending on the data structures it receives, it will perform a different operation, always representing the idea of 'addition' as it makes sense in each particular case.
These are a few examples of different possible combinations of inputs and their result:
- Number + Number ► Number
- Number + NumberList ► NumberList (adds the first number to all values on the NumberList)
- String + String ► String (concatenates the two strings)
- String + StringList ► StringList (concatenates the first string to each of the strings in the StringList)
- Point + Polygon2D ► Polygon2D (vector sum of the Point to every Point in the Polygon2D)
identity
configurableListOperator
This operator is useful when you have to perform substitutions within a large List. You can define pairs of replacements (each of them consisting of replaced element and replacing element), and use configurableListOperator to perform all applicable replacements at once. The pairs should be stored as a pairs table.
createNetworkFromPairsTable
This operator is a handy way to create a Network in many situations, specifically when you have a table listing pairs of related elements. That is what we call a pairs table. It can also be considered as two Lists of the same length, the first one containing the source nodes and the second the destination nodes for the connections.
The operator will create a Network with Nodes for each distinct element in the input Table, and a relation for each row / element pair.
You can optionally set weights for the relations. There are two ways to do this: pass the weights as a NumberList on the second inlet, or provide it as a third column in the original pairs Table. You can even decide to create links for relation weights that are above a certain threshold, if you provide it as a numeric value in the third inlet.
After transforming a set of pairs into a Network, you will be able to use one of the several Network visualizators available to get a representation of the relations structure.
getElementFromList
This operator lets you pick a single element from any kind of List according to its position.