From e07581495e6a092f60e3ff80606fc798996cca60 Mon Sep 17 00:00:00 2001 From: Dirk Eddelbuettel Date: Mon, 5 Sep 2022 00:41:43 +0200 Subject: [PATCH] Updating RcppArmadillo initialization These six one-line changes update RcppArmadillo from the now deprecated `<<` initialization to brace initialization allowed since C++11 and long been the minimal standard with R too. It would be great if you could merge this, and release and updated package "in the next little while" -- see the two prior emails I sent, and the transition log at RcppCore/RcppArmadillo#391 --- src/DCP.cpp | 2 +- src/DLP.cpp | 2 +- src/DNL.cpp | 2 +- src/DQP.cpp | 2 +- src/GPP.cpp | 2 +- src/RPP.cpp | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/DCP.cpp b/src/DCP.cpp index 8d97ac5..c43c018 100644 --- a/src/DCP.cpp +++ b/src/DCP.cpp @@ -406,7 +406,7 @@ CPS* DCP::cps(CTRL& ctrl){ dpdv->z = cList.sslb(dpdv->z, Lambda, false); ts = cList.smss(dpdv->s).max(); tz = cList.smss(dpdv->z).max(); - ss << 0.0 << ts << tz << endr; + ss = { 0.0, ts, tz }; tm = ss.max(); if(tm == 0.0){ step = 1.0; diff --git a/src/DLP.cpp b/src/DLP.cpp index 8615347..5bd45ac 100644 --- a/src/DLP.cpp +++ b/src/DLP.cpp @@ -474,7 +474,7 @@ CPS* DLP::cps(CTRL& ctrl){ tz = cList.smss(dpdv2->z).max(); tt = -dpdv2->tau / lg; tk = -dpdv2->kappa / lg; - ss << 0.0 << ts << tz << tt << tk << endr; + ss = { 0.0, ts, tz, tt, tk }; tm = ss.max(); if(tm == 0.0){ step = 1.0; diff --git a/src/DNL.cpp b/src/DNL.cpp index 1883c0a..ed84af5 100644 --- a/src/DNL.cpp +++ b/src/DNL.cpp @@ -314,7 +314,7 @@ CPS* DNL::cps(CTRL& ctrl){ dpdv->z = cList.sslb(dpdv->z, Lambda, false); ts = cList.smss(dpdv->s).max(); tz = cList.smss(dpdv->z).max(); - ss << 0.0 << ts << tz << endr; + ss = { 0.0, ts, tz }; tm = ss.max(); if(tm == 0.0){ step = 1.0; diff --git a/src/DQP.cpp b/src/DQP.cpp index ce214a7..d9d8192 100644 --- a/src/DQP.cpp +++ b/src/DQP.cpp @@ -337,7 +337,7 @@ CPS* DQP::cps(CTRL& ctrl){ ts = cList.smss(dpdv->s).max(); tz = cList.smss(dpdv->z).max(); - ss << 0.0 << ts << tz << endr; + ss = { 0.0, ts, tz }; tm = ss.max(); if(tm == 0.0){ step = 1.0; diff --git a/src/GPP.cpp b/src/GPP.cpp index c109f21..3d811f3 100644 --- a/src/GPP.cpp +++ b/src/GPP.cpp @@ -273,7 +273,7 @@ CPS* gpp(std::vector FList, std::vector gList, CONEC& cList, mat A, ma dpdv->z = cList.sslb(dpdv->z, Lambda, false); ts = cList.smss(dpdv->s).max(); tz = cList.smss(dpdv->z).max(); - ss << 0.0 << ts << tz << endr; + ss = { 0.0, ts, tz }; tm = ss.max(); if(tm == 0.0){ step = 1.0; diff --git a/src/RPP.cpp b/src/RPP.cpp index 8661268..9917658 100644 --- a/src/RPP.cpp +++ b/src/RPP.cpp @@ -222,7 +222,7 @@ CPS* rpp(mat x0, mat P, mat mrc, CTRL& ctrl){ dpdv->z = cList.sslb(dpdv->z, Lambda, false); ts = cList.smss(dpdv->s).max(); tz = cList.smss(dpdv->z).max(); - ss << 0.0 << ts << tz << endr; + ss = { 0.0, ts, tz }; tm = ss.max(); if(tm == 0.0){ step = 1.0;