Re: [R] Adding comment in C++ code for debugging purpose

2022-12-17 Thread Rui Barradas
Às 13:38 de 17/12/2022, Christofer Bogaso escreveu: Hi, Below is the position of Rcout and underlying C++ function #ifdef _OPENMP #include #endif // [[Rcpp::depends(RcppProgress)]] #include #include "cpploss.h" #include #include #include using namespace Rcpp; // [[Rcpp::export]] SEXP GC

Re: [R] Adding comment in C++ code for debugging purpose

2022-12-17 Thread Christofer Bogaso
Hi, Below is the position of Rcout and underlying C++ function #ifdef _OPENMP #include #endif // [[Rcpp::depends(RcppProgress)]] #include #include "cpploss.h" #include #include #include using namespace Rcpp; // [[Rcpp::export]] SEXP GCPM_cpploss(SEXP default_distr_a,SEXP link_function_a,

Re: [R] Adding comment in C++ code for debugging purpose

2022-12-17 Thread Rui Barradas
Às 11:05 de 17/12/2022, Christofer Bogaso escreveu: Hi Rui, Unfortunately, the code Rcpp::Rcout << "-->.My values" << "\n"; still not printing the value. Regarding your second suggestion, R_Print("My values\n"); - where should I put this statement? On Sat, Dec 17, 2022 at 11:39 AM

Re: [R] Adding comment in C++ code for debugging purpose

2022-12-17 Thread Christofer Bogaso
Hi Rui, Unfortunately, the code Rcpp::Rcout << "-->.My values" << "\n"; still not printing the value. Regarding your second suggestion, R_Print("My values\n"); - where should I put this statement? On Sat, Dec 17, 2022 at 11:39 AM Rui Barradas wrote: > > Às 23:32 de 16/12/2022, Chris

Re: [R] Adding comment in C++ code for debugging purpose

2022-12-17 Thread Christofer Bogaso
Hi Ivan, This is a very nice point. I will check this out. Thanks and regards, On Sat, Dec 17, 2022 at 1:53 PM Ivan Krylov wrote: > > On Sat, 17 Dec 2022 05:02:33 +0530 > Christofer Bogaso wrote: > > > I am using an R package where there are some C++ code. > > > > To check some intermediate va

Re: [R] Adding comment in C++ code for debugging purpose

2022-12-17 Thread Ivan Krylov
On Sat, 17 Dec 2022 05:02:33 +0530 Christofer Bogaso wrote: > I am using an R package where there are some C++ code. > > To check some intermediate values generated by that C++ code, I added > a line like > > std::cout << "My values"; A more efficient way of debugging C++ code running under R

Re: [R] Adding comment in C++ code for debugging purpose

2022-12-16 Thread Rui Barradas
Às 23:32 de 16/12/2022, Christofer Bogaso escreveu: Hi, I am using an R package where there are some C++ code. To check some intermediate values generated by that C++ code, I added a line like std::cout << "My values"; Now with this modification, I next build a modified package (source) using

Re: [R] Adding comment in C++ code for debugging purpose

2022-12-16 Thread Jeff Newmiller
a) This is not the Rcpp help list. b) Writing to stdout without going through R is not supported in packages. Do read the Writing R Extensions manual. On December 16, 2022 3:32:33 PM PST, Christofer Bogaso wrote: >Hi, > >I am using an R package where there are some C++ code. > >To check some i

[R] Adding comment in C++ code for debugging purpose

2022-12-16 Thread Christofer Bogaso
Hi, I am using an R package where there are some C++ code. To check some intermediate values generated by that C++ code, I added a line like std::cout << "My values"; Now with this modification, I next build a modified package (source) using R CMD build Next I install this modified package us