Skip to content

Coordinating required changes for (Rcpp)Armadillo 14.4.0(-0) #462

Closed

Description

Image for: Description

Armadillo 14.4.0 has been released, and it brings the usual set of incremental improvements.

@conradsnicta and I have been examining a series of reverse-dependency checks leading up to it. Relative to the by-now rather large number of over 1200 reverse-dependencies, we found a fairly small number of packages requiring minor changes to accomodate both 14.2.* and 14.4.0. We plan link a set of pull requests or patches here allowing those packages to update at CRAN before we start publishing the 14.4.* series there. We will edit and update this issue to track this.

  • circlus no public repo repo, mirror, patch to version 0.0.1 below, emailed 2025-02-17, committed 2025-02-17, version 0.0.2 on CRAN 2025-02-19
  • fdasrvf repo, pull request fdasrvf_R/#56 made 2025-02-17, merged 2025-02-17, new version 2.3.6 on CRAN 2025-02-17
  • MSTest repo, pull request MSTest/#2 made 2025-02-17, pr closed 2025-02-24, version 0.1.5 on CRAN 2025-02-24
  • OSFD no public repo, mirror, patch to version 3.0 below, emailed 2025-02-17, release 3.1 on CRAN 2025-03-03
  • PAGFL repo, pull request PAGLF/#1 made 2025-02-17, merged 2025-02-18, release 1.1.3 on CRAN 2025-02-20
  • TSLA no public repo, mirror, patch to version 0.1.1 below, emailed 2025-02-17, release 0.1.2 on CRAN 2025-03-17
  • UComp no public repo, mirror, patch to version 5.0.5 below. emailed 2025-02-17, release 5.0.6 on CRAN 2025-02-28
  • watson repo, fix committed 2025-02-17, release 0.6.0 on CRAN 2025-02-19

Patch for circlus

diff -ru circlus.orig/src/rpkbd.cpp circlus/src/rpkbd.cpp
--- circlus.orig/src/rpkbd.cpp	2024-09-30 16:01:01.000000000 +0200
+++ circlus/src/rpkbd.cpp	2025-02-17 15:05:12.670055188 +0100
@@ -17,7 +17,7 @@
 // [[Rcpp::export]]
 arma::mat rPKBD_ACG(int n, double rho, arma::vec &mu){
   double lambda = 2*rho/(1+rho*rho);
-  double norm = as_scalar(sum(pow(mu,2)));
+  double norm = arma::as_scalar(sum(pow(mu,2)));
   int p = mu.n_elem;
   arma::mat A(n, p);
   if(lambda == 0 || norm == 0){/*uniform*/
diff -ru circlus.orig/src/sCauchy.cpp circlus/src/sCauchy.cpp
--- circlus.orig/src/sCauchy.cpp	2024-10-07 16:45:02.000000000 +0200
+++ circlus/src/sCauchy.cpp	2025-02-17 15:05:58.904572081 +0100
@@ -85,7 +85,7 @@
 //' @export
 // [[Rcpp::export]]
 arma::mat rspcauchy(int n, double rho, arma::vec &mu){
-  double norm = as_scalar(sum(pow(mu,2)));
+  double norm = arma::as_scalar(sum(pow(mu,2)));
   int p = mu.n_elem;
   arma::mat A(n, p);
   A = normalise(A.randn(),2,1);

Patch for OSFD

diff -ru OSFD.orig/src/OSFD.cpp OSFD/src/OSFD.cpp
--- OSFD.orig/src/OSFD.cpp	2025-01-13 05:09:45.000000000 +0100
+++ OSFD/src/OSFD.cpp	2025-02-17 18:05:05.733625385 +0100
@@ -183,7 +183,7 @@
     Z_norm(i) = arma::norm(Z.row(i));// the norm of the Z vector
   }
   Z = Z / (Z_norm * Ones);
-  U = pow(U, 1./p);
+  U = arma::pow(U, 1./p);
   out = (U * Ones) % Z;
   return (out);
 }
@@ -414,9 +414,7 @@
   int intrinsic_dim = std::min(p, q);
   // double out_vol = arma::sum(arma::pow(filldist_out, intrinsic_dim)) * 
   //   std::pow(M_PI, intrinsic_dim/2.0) / std::tgamma(intrinsic_dim/2.0 + 1);
-  double alpha = arma::as_scalar(arma::pow(arma::mean(arma::pow(filldist_out, intrinsic_dim)), 1.0/intrinsic_dim)) /
-    arma::as_scalar(arma::pow(arma::mean(arma::pow(filldist_in, p)), 1.0/p));
-  
+  double alpha = std::pow(arma::as_scalar(arma::mean(arma::pow(filldist_out, intrinsic_dim))), 1.0/intrinsic_dim) / std::pow(arma::as_scalar(arma::mean(arma::pow(filldist_in, p))), 1.0/p);
   arma::vec balance_cri = lambda * filldist_in + (1-lambda) * filldist_out / alpha;
   
   // Find the index with the maximum balance criterion

Patch for TSLA

diff -ru TSLA.orig/src/SPGlinear.cpp TSLA/src/SPGlinear.cpp
--- TSLA.orig/src/SPGlinear.cpp	2023-11-30 17:01:35.000000000 +0100
+++ TSLA/src/SPGlinear.cpp	2025-02-17 18:58:22.419621673 +0100
@@ -20,7 +20,7 @@
   int V = g_idx.n_rows;
   for(int v = 0; v < V; v ++) {
     arma::vec idx = g_idx.row(v).cols(0, 1).t();
-    arma::vec unorm = max(ones(1), sqrt(sum(pow(u.rows(idx(0) - 1, idx(1) - 1), 2))));
+    arma::vec unorm = max(ones(1), arma::vec{ sqrt(sum(pow(u.rows(idx(0) - 1, idx(1) - 1), 2))) } );
     R.rows(idx(0) - 1, idx(1) - 1) = u.rows(idx(0) - 1, idx(1) - 1) / as_scalar(unorm);
   }
   return(R);

Patch for UComp

diff -ru UComp.orig/src/stats.h UComp/src/stats.h
--- UComp.orig/src/stats.h	2024-07-07 12:05:45.000000000 +0200
+++ UComp/src/stats.h	2025-02-17 19:12:12.180827684 +0100
@@ -404,9 +404,9 @@
   int nNan, n = y.n_elem;
   vec yn = removeNans(y, nNan);
   yn = yn - mean(yn);
-  vec media3 = mean(pow(yn, 3));
-  vec media4 = mean(pow(yn, 4));
-  vec stdb = sqrt(mean(pow(yn, 2)));
+  vec media3; media3 = mean(pow(yn, 3));
+  vec media4; media4 = mean(pow(yn, 4));
+  vec stdb; stdb = sqrt(mean(pow(yn, 2)));
   vec skew = media3 / pow(stdb, 3);
   vec kurto = media4 / pow(stdb, 4) - 3;
   bj = (n - nNan) / 6 * (pow(as_scalar(skew), 2) + pow(as_scalar(kurto), 2) / 4);

Metadata

Image for: Metadata

Metadata

Image for: Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Image for: Issue actions