[Rcpp-devel] MatrixRow.h printout

Dirk Eddelbuettel edd at debian.org
Mon Apr 1 21:56:37 CEST 2013

Hi Kevin,

On 1 April 2013 at 12:37, Kevin Heins wrote:
| I just recently updated to the new version of  R and Rcpp (I don't recall the
| previous version of Rcpp that I was using, but it was several months old; just
| updated from R 2.15.2 to 2.15.3). Anyway, previously I had no problems but now
| whenever I try to something akin to:
| some_matrix(i,_) = some_vector;
| I get a ton of printouts, one for every element of some_matrix. I was able to
| trace the issue to the MatrixRow.h file, and in particular line 168 (http://
| dirk.eddelbuettel.com/code/rcpp/html/MatrixRow_8h_source.html), which I have

Wow, that's a first. :-)  

Sources really do live in SVN, or alternatively in the distribution tarballs.
The html view is not that helpful for code maintenance.

The file in question is inst/include/Rcpp/vector/MatrixRow.h and the function
now reads

    inline int get_parent_index(int i) const { 
        RCPP_DEBUG_4( "MatrixRow<%d>::get_parent_index(int = %d), parent_nrow = %d >> %d\n", RTYPE, i, parent_nrow, i*parent_nrow )
        return i * parent_nrow ;

| included below:
| 166  inline int get_parent_index(int i) const {
| 167        RCPP_DEBUG_4( "MatrixRow<%d>[%p]::get_parent_index(%d) = %d",
| RTYPE, this, i, i*parent_nrow)
| 168 Rprintf( "MatrixRow::get_parent_index(int = %d), parent_nrow = %d >> %d\n",
| i, parent_nrow, i*parent_nrow ) ;
| 169 return i * parent_nrow ;
| However, I have no idea how to read that. Am I doing something wrong? What is
| causing this printout? How can I avoid getting it?

This has previously been discussed, and fixed by Romain in SVN rev 4294 on
March 27.  The printf was simply a leftover debugging statement he had left
in by accident, and which should have been conditional. 

If you comment that line out, or delete it, and reinstall your local copy,
the line noise will go away.

Hope this helps, Dirk

| Thanks,
| -Kevin
| Am
| ----------------------------------------------------------------------
| _______________________________________________
| Rcpp-devel mailing list
| Rcpp-devel at lists.r-forge.r-project.org
| https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com

More information about the Rcpp-devel mailing list