File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed
inst/include/RcppArmadilloExtensions Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 55 * configure.ac: Idem
66 * configure: Idem
77
8+ * inst/include/RcppArmadilloExtensions/fixprob.h: Replace deprecated
9+ arma::is_finite(val) with std::isfinite(val)
10+
8112025-08-23 Dirk Eddelbuettel <
[email protected] >
912
1013 * DESCRIPTION (Description): Rewritten and updated, add mention of
Original file line number Diff line number Diff line change 1- // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
2- /* :tabSize=4:indentSize=4:noTabs=false:folding=explicit:collapseFolds=1: */
3- //
4- // fixprob.h: helper function for Rcpp/Armadillo random number draws, including sample().
1+
2+ // fixprob.h: helper function for Rcpp/Armadillo random number draws, including sample().
53// Copyright (C) 2012 - 2014 Christian Gunning
64// Copyright (C) 2013 Romain Francois
5+ // Copyright (C) 2025 Dirk Eddelbuettel
76//
87// This file is part of RcppArmadillo.
98//
2524#include < RcppArmadillo.h>
2625namespace Rcpp {
2726 namespace RcppArmadillo {
28-
27+
2928 void FixProb (arma::vec &prob, const int size, const bool replace) {
30- // prob is modified in-place.
29+ // prob is modified in-place.
3130 double sum = 0.0 ;
3231 int ii, nPos = 0 ;
3332 int nn = prob.size ();
3433 for (ii = 0 ; ii < nn; ii++) {
3534 // pop stack
3635 double prob_value = prob (ii);
37-
38- if (!arma::is_finite (prob_value)) // does this work??
36+
37+ if (!std::isfinite (prob_value)) // does this work??
3938 throw std::range_error ( " NAs not allowed in probability" ) ;
4039 if (prob_value < 0.0 )
4140 throw std::range_error ( " Negative probabilities not allowed" ) ;
You can’t perform that action at this time.
0 commit comments