Le 04/12/2014 17:57, Romain François a écrit :
Something like this:

template <typename T>
inline wrap( const arma::subview_col<double>& x ){
     return wrap( arma::Mat<T>( x ) ) ;
}
Interesting. If I do

inline SEXP wrap( const arma::vec& x ) {
    return wrap(Rcpp::NumericVector( x.begin(), x.end()));
}

then wrap(v) returns a vector to R, not a matrix n x 1
(v is a vec here) but wrap(v+1) still returns a matrix.
Is there a more universal way to say that any expression
resulting in vec should return a vector?

Serguei.
_______________________________________________
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to