Details on Casting Functions
Description
‘broadcast’ provides several "casting" functions.
These can facility complex forms of broadcasting that would normally not be possible.
But these "casting" functions also have their own merit, beside empowering complex broadcasting.
The following casting functions are available:
-
acast:
casts group-based subsets of an array into a new dimension.
Useful for, for example, performing grouped broadcasted operations. -
cast_hier2dim:
casts a nested/hierarchical list into a dimensional list (i.e. array of typelist
).
Useful because one cannot broadcast through nesting, but one can broadcast along dimensions. -
cast_dim2hier:
casts a dimensional list into a nested/hierarchical list; the opposite of cast_hier2dim. -
cast_dim2flat:
casts a dimensional list into a flattened list, but with names that indicate their original dimensional positions.
Mostly useful for printing or summarizing dimensional lists. -
dropnests:
drop redundant nesting in lists; mostly used for facilitating the above casting functions.