Skip to content

Commit

Permalink
use less ambiguous overload in matrix/scalar tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eddelbuettel committed May 8, 2016
1 parent 1ee6e38 commit 618f419
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2016-05-08 Dirk Eddelbuettel <edd@debian.org>

* inst/unitTests/cpp/Matrix.cpp: Made four scalar/matrix tests less
ambiguous for overloads by using double as scalar

2016-05-06 Dirk Eddelbuettel <edd@debian.org>

* R/loadRcppModules.R (loadRcppModules): Add call to .Deprecated
Expand Down
10 changes: 5 additions & 5 deletions inst/unitTests/cpp/Matrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// Matrix.cpp: Rcpp R/C++ interface class library -- Matrix unit tests
//
// Copyright (C) 2013 - 2014 Dirk Eddelbuettel, Romain Francois and Kevin Ushey
// Copyright (C) 2013 - 2016 Dirk Eddelbuettel, Romain Francois and Kevin Ushey
//
// This file is part of Rcpp.
//
Expand Down Expand Up @@ -313,21 +313,21 @@ CharacterMatrix transposeCharacter(const CharacterMatrix & x) {
}

// [[Rcpp::export]]
NumericMatrix matrix_scalar_plus(const NumericMatrix & x, int y) {
NumericMatrix matrix_scalar_plus(const NumericMatrix & x, double y) {
return x + y;
}

// [[Rcpp::export]]
NumericMatrix matrix_scalar_plus2(const NumericMatrix & x, int y) {
NumericMatrix matrix_scalar_plus2(const NumericMatrix & x, double y) {
return y + x;
}

// [[Rcpp::export]]
NumericMatrix matrix_scalar_divide(const NumericMatrix & x, int y) {
NumericMatrix matrix_scalar_divide(const NumericMatrix & x, double y) {
return x / y;
}

// [[Rcpp::export]]
NumericMatrix matrix_scalar_divide2(const NumericMatrix & x, int y) {
NumericMatrix matrix_scalar_divide2(const NumericMatrix & x, double y) {
return y / x;
}

0 comments on commit 618f419

Please sign in to comment.