Skip to content

Commit 27d6372

Browse files
Copilotosorensen
andcommitted
Fix documentation for precompute_topological_sorts function
Co-authored-by: osorensen <21175639+osorensen@users.noreply.github.com>
1 parent d4801c4 commit 27d6372

File tree

3 files changed

+33
-15
lines changed

3 files changed

+33
-15
lines changed

R/RcppExports.R

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
#' Precompute All Topological Sorts
55
#'
6-
#' This function precomputes all topological sorts for a given preference matrix and
7-
#' saves them to a specified output directory. It ensures the output directory exists
8-
#' and creates it if it does not.
6+
#' This function precomputes all topological sorts for a given preference matrix.
7+
#' Topological sorts are consistent orderings of items that respect the given
8+
#' pairwise preference constraints.
99
#'
1010
#' @param prefs A matrix representing the preference relations. This matrix
1111
#' must have two columns, the first of which represents the preferred item
@@ -15,9 +15,15 @@
1515
#'
1616
#' @details
1717
#' The function generates all possible topological sorts for the provided preference matrix
18-
#' and saves approximately `save_frac` of the sorts in a matrix which is returned.
19-
#'
20-
#' @return This function returns the number of topological sorts.
18+
#' and saves approximately \code{save_frac} of the sorts in a matrix which is returned.
19+
#'
20+
#' @return A list with two elements:
21+
#' \describe{
22+
#' \item{sort_count}{An integer giving the total number of topological sorts.}
23+
#' \item{sort_matrix}{A matrix where each column represents one topological sort.
24+
#' The number of columns is approximately \code{save_frac} times \code{sort_count}.
25+
#' If \code{save_frac = 0}, this is an empty matrix with dimensions \code{c(0, 0)}.}
26+
#' }
2127
#'
2228
#' @export
2329
#' @examples

man/precompute_topological_sorts.Rd

Lines changed: 10 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/all_topological_sorts.cpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ arma::imat Graph::alltopologicalSort(long long int& sort_count, double save_frac
8888

8989
//' Precompute All Topological Sorts
9090
//'
91-
//' This function precomputes all topological sorts for a given preference matrix and
92-
//' saves them to a specified output directory. It ensures the output directory exists
93-
//' and creates it if it does not.
91+
//' This function precomputes all topological sorts for a given preference matrix.
92+
//' Topological sorts are consistent orderings of items that respect the given
93+
//' pairwise preference constraints.
9494
//'
9595
//' @param prefs A matrix representing the preference relations. This matrix
9696
//' must have two columns, the first of which represents the preferred item
@@ -100,9 +100,15 @@ arma::imat Graph::alltopologicalSort(long long int& sort_count, double save_frac
100100
//'
101101
//' @details
102102
//' The function generates all possible topological sorts for the provided preference matrix
103-
//' and saves approximately `save_frac` of the sorts in a matrix which is returned.
103+
//' and saves approximately \code{save_frac} of the sorts in a matrix which is returned.
104104
//'
105-
//' @return This function returns the number of topological sorts.
105+
//' @return A list with two elements:
106+
//' \describe{
107+
//' \item{sort_count}{An integer giving the total number of topological sorts.}
108+
//' \item{sort_matrix}{A matrix where each column represents one topological sort.
109+
//' The number of columns is approximately \code{save_frac} times \code{sort_count}.
110+
//' If \code{save_frac = 0}, this is an empty matrix with dimensions \code{c(0, 0)}.}
111+
//' }
106112
//'
107113
//' @export
108114
//' @examples

0 commit comments

Comments
 (0)