Order locations accorder to priority, then apply function.
prioritize_and_execute(.f, A, prioritized_locations, ...)
A function taking a vector as first argument.
A matrix, e.g. containing counts or baselines. Rows represent time (ordered from most recent to most distant), columns represent locations (numbered from 1 and up).
Further arguments passed to .f
.
A matrix of the same dimension as A
.