Basic Examples (3)
Have the second argument be a constant:
It works on expressions with unequal lengths ("ragged"):
Apply f to the corresponding values of associations, copying values where necessary:
Scope (3)
Apply to a list of lists with varying depths and lengths:
The final results are ragged:
Apply at level 1 means that {a,b} from the final list is considered a single value:
Apply at level 2 means interpreting {a,b} as separate values, and copying all the other values:
Create an operator of GeneralizedMapThread:
Use the operator on some data:
Applications (2)
Subtract the vector {a,b} from a list of vectors:
Apply a list of functions to a single argument without pure functions:
This can also be achieved using Through:
Properties and Relations (3)
When the arrays are of equal length, MapThread and GeneralizedMapThread give the same result:
MapThread cannot handle lists with elements of unequal length ("ragged"):
GeneralizedMapThread can handle these cases:
Thread can handle arrays with different depths:
GeneralizedMapThread can also do this but the syntax of GeneralizedMapThread follows the syntax of MapThread:
Possible Issues (4)
Associations must have the same keys:
Associations and lists can not be mixed:
Values with another head, such as List or Association, or an incorrect length will get copied:
For the case of unequal length, the longest list is taken as the actual length. Here the last list is the longest; the first list is copied:
Here the first list is the longest; the last list is copied:
An extra bracket around the second list will make it the shortest:
One can also give it a different head, which prevent it from being interpreted as a list:
Neat Examples (2)
Interpret the entries as three levels deep, copying them all:
Create a complex ragged array with different depths:
Apply the function f five levels deep, with the second argument set constant to a: