[[Rcpp::export]]
| 159 | |
| 160 | // [[Rcpp::export]] |
| 161 | NumericMatrix runit_NumericMatrix_cumsum( NumericMatrix input ){ |
| 162 | int nr = input.nrow(), nc = input.ncol() ; |
| 163 | NumericMatrix output(nr, nc) ; |
| 164 | NumericVector tmp( nr ); |
| 165 | for( int i=0; i<nc; i++){ |
| 166 | tmp = tmp + input.column(i) ; |
| 167 | NumericMatrix::Column target( output, i ) ; |
| 168 | std::copy( tmp.begin(), tmp.end(), target.begin() ) ; |
| 169 | } |
| 170 | return output ; |
| 171 | } |
| 172 | |
| 173 | // [[Rcpp::export]] |
| 174 | std::string runit_CharacterMatrix_column( CharacterMatrix m){ |