|
1 | 1 | #' 1D bin packing "First Fit (Decreasing)" algorithm |
2 | 2 | #' |
3 | | -#' @param x A numeric vector of item sizes to be fit into bins. Each value |
| 3 | +#' @param x [[numeric()]] A numeric vector of item sizes to be fit into bins. Each value |
4 | 4 | #' represents the size of an atomic item. If a value is `NA` it is |
5 | 5 | #' ignored and the corresponding result will also be `NA`. |
6 | | -#' @param cap Bin capacity in units of values in `x`. A scalar value. If |
7 | | -#' an individual item size is above `cap` a single bin is reserved |
| 6 | +#' @param cap \[`numeric(1)`\] A scalar value representing the bin capacity in units of values in `x`. |
| 7 | +#' If an individual item size is above `cap` a single bin is reserved |
8 | 8 | #' for this item. |
9 | | -#' @param sort Determines whether the input vector should be sorted in |
| 9 | +#' @param sort \[`logical(1)`\] Determines whether the input vector should be sorted in |
10 | 10 | #' decreasing order before applying the "First Fit" algorithm |
11 | 11 | #' ("First Fit Decreasing"). |
12 | | -#' @returns An integer vector of labels of the same length as `x`. The integer |
| 12 | +#' @returns [[integer()]] An integer vector of labels of the same length as `x`. The integer |
13 | 13 | #' label at position `i` determines the assignment of the `i`th item |
14 | 14 | #' with size `x[i]` to a bin. If the value `x[i]` is `NA` the result |
15 | 15 | #' label at position `i` will also be `NA`. |
16 | | -#' @details See [Wikipedia](https://en.wikipedia.org/wiki/First-fit_bin_packing) |
17 | | -#' for a concise introduction or |
18 | | -#' "The Art of Computer Programming Vol. 1" by Donald E. Knuth |
19 | | -#' (1997, ISBN: 0201896834) for more details. |
| 16 | +#' |
| 17 | +#' @details |
| 18 | +#' See [Wikipedia](https://en.wikipedia.org/wiki/First-fit_bin_packing) |
| 19 | +#' for a concise introduction or |
| 20 | +#' "The Art of Computer Programming Vol. 1" by Donald E. Knuth |
| 21 | +#' (1997, ISBN: 0201896834) for more details. |
20 | 22 | #' @examples |
21 | 23 | #' # Generate a vector of item sizes |
22 | 24 | #' x <- sample(100, 1000, replace = TRUE) |
|
0 commit comments