Skip to content

Commit

Permalink
Add BugReports and add argument to matrixStats::rowRanks()
Browse files Browse the repository at this point in the history
Add BugReports to DESCRIPTION and explicitly specify argument 'tied.method' when calling matrixStats::rowRanks()
  • Loading branch information
handcock committed Apr 18, 2024
1 parent 9649deb commit a450f91
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ License: GPL-3 + file LICENSE
License_is_FOSS: yes
License_restricts_use: no
URL: https://github.com/handcock/rpm
BugReports: https://github.com/handcock/rpm/issues
LinkingTo: Rcpp, RcppArmadillo
Depends:
R (>= 4.0.0),
Expand All @@ -35,4 +36,4 @@ Imports:
doFuture,
foreach
Encoding: UTF-8
RoxygenNote: 7.3.1
RoxygenNote: 7.2.3
8 changes: 4 additions & 4 deletions R/Gale_Shapley.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#' \emph{A Practical Revealed Preference Model for Separating Preferences and Availability Effects in Marriage Formation},
#' \emph{Journal of the Royal Statistical Society}, A. \doi{10.1093/jrsssa/qnad031}
#'
#' Dagsvik, John K. (2000) \emph{Aggregation in Matching Markets} \emph{International Economic Review},, Vol. 41, 27-57.
#' Dagsvik, John K. (2000) \emph{Aggregation in Matching Markets} \emph{International Economic Review}, Vol. 41, 27-57.
#' JSTOR: https://www.jstor.org/stable/2648822, \doi{10.1111/1468-2354.00054}
#'
#' Menzel, Konrad (2015).
Expand All @@ -51,11 +51,11 @@ Gale_Shapley <- function(U,V,return.data.frame=FALSE, cpp=TRUE, nmax=10*nrow(U))

if(cpp){
# These are the integer versions
Ua <- matrixStats::rowRanks(U)
Ua <- matrixStats::rowRanks(U, ties.method = "max")
U <- sweep(Ua[,-1],1,Ua[,1],"-")
O=t(apply(-U,1,order))
Ua <- matrixStats::rowRanks(-U[,-1])
V <- matrixStats::rowRanks(V)
Ua <- matrixStats::rowRanks(-U[,-1], ties.method = "max")
V <- matrixStats::rowRanks(V, ties.method = "max")
V <- sweep(V[,-1],1,V[,1],"-")
storage.mode(U) <- "integer"
storage.mode(V) <- "integer"
Expand Down

0 comments on commit a450f91

Please sign in to comment.