powered by
Split costs in consecutive blocks using a greedy algorithm that tries to find blocks of even total cost.
split_costs(costs, nb_split)
Vector of costs (e.g. proportional to computation time).
Number of blocks.
A matrix with 4 columns lower, upper, size and cost.
lower
upper
size
cost
# NOT RUN { split_costs(costs = 150:1, nb_split = 3) split_costs(costs = rep(1, 151), nb_split = 3) split_costs(costs = 150:1, nb_split = 30) # }
Run the code above in your browser using DataLab