powered by
bbatch calculates batch sizes in 1..N so that they have rather balanced sizes than very different sizes.
bbatch
bbatch(N, B)
a list with components:
b: the batch size
nb: the number of batches
rb: the size of the rest
total size in 0..integer_max
desired batch size in 1..integer_max
Jens Oehlschlägel
Tries to have rb == 0 or rb as close to b as possible while guaranteeing that rb < b && (b - rb) <= min(nb, b)
rb == 0
rb
b
rb < b && (b - rb) <= min(nb, b)
repfromto(), ff::ffvecapply()
repfromto()
ff::ffvecapply()
bbatch(100, 24)
Run the code above in your browser using DataLab