<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial">I need to compute a kronecker product of two matrix, but the vector is out of the limit:<div><br></div><div> <i> Error in kronecker(X, as(Y, "TsparseMatrix"), FUN = FUN, make.dimnames = make.dimnames,  : </i><br><i>  Error in validityMethod(as(object, superClass)) : </i><br><i>  no support for long vectors£º../include/Rinlinedfuns.h:137</i></div><div><i><br></i></div><div>   So I try to call a kronecker function, the corresponding file in the fn_kron.hpp file are:<div><br></div><div>1) In "R":<br>Rcpparma_hello_world <- function () {<br>.Call ( 'fn_kron_hpp_rcpparma_hello_world', PACKAGE = 'fn_kron.hpp')<br>}}</div><div><br></div><div>Rcpparma_outerproduct <- function (x) {<br>.Call ( 'fn_kron_hpp_rcpparma_outerproduct', PACKAGE = 'fn_kron.hpp', x)<br>}}</div><div><br></div><div>2) "src":<br>#Include <Rcpp.h><br>Using namespace Rcpp;</div><div><br></div><div>// rcpparma_hello_world<br>Arma :: mat rcpparma_hello_world ();<br>RcppExport SEXP fn_kron_hpp_rcpparma_hello_world () {<br>BEGIN_RCPP<br>Rcpp :: RObject rcpp_result_gen;<br>Rcpp :: RNGScope rcpp_rngScope_gen;<br>Rcpp_result_gen = Rcpp :: wrap (rcpparma_hello_world ());<br>Return rcpp_result_gen;<br>END_RCPP<br>}}<br>// rcpparma_outerproduct<br>Arma :: mat rcpparma_outerproduct (const arma :: colvec & x);<br>RcppExport SEXP fn_kron_hpp_rcpparma_outerproduct (SEXP xSEXP) {<br>BEGIN_RCPP<br>Rcpp :: RObject rcpp_result_gen;<br>Rcpp :: RNGScope rcpp_rngScope_gen;<br>Rcpp :: traits :: input_parameter <const arma :: colvec &> :: type x (xSEXP);<br>Rcpp_result_gen = Rcpp :: wrap (rcpparma_outerproduct (x));<br>Return rcpp_result_gen;<br>END_RCPP<br>}}</div><div><br></div><div>3)"man" includes rcpparma_hello_world.Rd and fn_kron.hpp-package.Rd two documents.</div><div><br></div><div><br># =================================================<br>So now the question is that I not know how to call the function in R ?<br>Library (RcppArmadillo)<br>Ws <- .Call ( 'fn_kron_hpp_rcpparma_outerproduct', PACKAGE = 'fn_kron.hpp', listw)</div><div><br></div><div><b>Note: I used the R kronecker function, the code is as follows:</b><br><b>I_T <- Diagonal (T)</b><br><b>Ws <- kronecker (I_T, listw)</b></div><div><br></div><div>And I do not understand what 'x' represents in . Call ( 'fn_kron_hpp_rcpparma_outerproduct', PACKAGE = 'fn_kron.hpp', x).</div><div><br></div><div>Thank you !</div></div></div><br><br><span title="neteasefooter"><p> </p></span>