<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
Dear Rcpp experts, <br>
<blockquote cite="mid:4D11D51A.6020906@kcl.ac.uk" type="cite"> I've
got another problem related to Rcpp Sugar. Basically, I would like
to have the same functionality that you get from R's vectors,
where binary operations with scalars are automatically interpreted
as elementwise operations. See the following code and error
message: <br>
<br>
###########################################<br>
VectorScalar <- cxxfunction(signature(x="numeric"), '<br>
Rcpp::NumericVector xV(x);<br>
xV = xV - 1; <br>
return(xV);<br>
',plugin="Rcpp")<br>
VectorScalar(rnorm(100))<br>
<br>
file3165a3be.cpp: In function ‘SEXPREC* file3165a3be(SEXPREC*)’:<br>
file3165a3be.cpp:32: warning: ISO C++ says that these are
ambiguous, even though the worst conversion for the first is
better than the worst conversion for the second:<br>
##########################################<br>
<br>
Thank you very much for your help, <br>
<br>
<br>
<div class="moz-signature">-- <br>
<div class="moz-signature"><font face="Times" size="3"> Cedric
Ginestet <br>
Centre for Neuroimaging Sciences (L3.04) <br>
NIHR Biomedical Research Centre <br>
Department of Neuroimaging <br>
Institute of Psychiatry, Box P089 <br>
King's College London <br>
De Crespigny Park<br>
London <br>
SE5 8AF <br>
Tel: (+44) 20-3228-3052<br>
Fax: (+44) 20-3228-2116<br>
Email: <a moz-do-not-send="true"
class="moz-txt-link-abbreviated"
href="mailto:cedric.ginestet@kcl.ac.uk">cedric.ginestet@kcl.ac.uk</a><br>
</font> </div>
</div>
</blockquote>
</body>
</html>