Skip to content

Commit cf3a67d

Browse files
committed
use std::isfinite instead of arma::is_finite
1 parent 13e6a7b commit cf3a67d

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ BugReports: https://github.com/dcgerard/updog/issues
2626
URL: https://github.com/dcgerard/updog/
2727
Encoding: UTF-8
2828
LazyData: true
29-
RoxygenNote: 7.2.3
29+
RoxygenNote: 7.3.3
3030
LinkingTo: Rcpp,
3131
RcppArmadillo
3232
Imports:

man/updog-package.Rd

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

src/gradients.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ NumericVector grad_for_mu_sigma2_wrapper(arma::Col<double> muSigma2, NumericMatr
125125
// [[Rcpp::export]]
126126
double dpen_dh(double h, double mu_h, double sigma2_h) {
127127
double deriv;
128-
if (arma::is_finite(sigma2_h)) {
128+
if (std::isfinite(sigma2_h)) {
129129
deriv = -1.0 * (1.0 + (std::log(h) - mu_h) / sigma2_h) / h;
130130
} else {
131131
deriv = 0.0;
@@ -153,7 +153,7 @@ double dpen_dh(double h, double mu_h, double sigma2_h) {
153153
double dpen_deps(double eps, double mu_eps, double sigma2_eps) {
154154
double deriv;
155155

156-
if (arma::is_finite(sigma2_eps)) {
156+
if (std::isfinite(sigma2_eps)) {
157157
deriv = -1.0 * (1.0 - 2.0 * eps + (logit(eps) - mu_eps) / sigma2_eps) / (eps * (1.0 - eps));
158158
} else {
159159
deriv = 0.0;

src/objective.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ double pen_bias(double h, double mu_h, double sigma2_h) {
221221
}
222222

223223
double pen;
224-
if (arma::is_finite(sigma2_h)) {
224+
if (std::isfinite(sigma2_h)) {
225225
pen = -std::log(h) - std::pow(std::log(h) - mu_h, 2) / (2.0 * sigma2_h);
226226
} else {
227227
pen = 0.0;
@@ -256,7 +256,7 @@ double pen_seq_error(double eps, double mu_eps, double sigma2_eps) {
256256
}
257257

258258
double pen;
259-
if (arma::is_finite(sigma2_eps)) {
259+
if (std::isfinite(sigma2_eps)) {
260260
pen = -log(eps * (1.0 - eps)) - std::pow(logit(eps) - mu_eps, 2) / (2.0 * sigma2_eps);
261261
} else {
262262
pen = 0.0;

0 commit comments

Comments
 (0)