1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/chunkutil.R
\name{bbatch}
\alias{bbatch}
\title{Balanced Batch sizes}
\usage{
bbatch(N, B)
}
\arguments{
\item{N}{total size in 0..integer_max}
\item{B}{desired batch size in 1..integer_max}
}
\value{
a list with components \item{ b }{ the batch size } \item{ nb }{ the
number of batches } \item{ rb }{ the size of the rest }
}
\description{
\command{bbatch} calculates batch sizes in 1..N so that they have rather balanced
sizes than very different sizes.
}
\details{
Tries to have \code{rb==0} or \code{rb} as close to \code{b} as possible
while guaranteeing that \code{rb < b && (b - rb) <= min(nb, b)}
}
\examples{
bbatch(100, 24)
}
\seealso{
\code{\link{repfromto}}, \code{\link[ff:ffapply]{ffvecapply}}
}
\author{
Jens Oehlschlägel
}
\keyword{IO}
\keyword{data}
|