Re: [Rcpp-devel] Error still there

2016-09-23 Thread Dirk Eddelbuettel
On 23 September 2016 at 18:17, Amina Shahzadi wrote: | Hello Dirk, Adler and Rcpp Colleagues | | Would you please guide me why the following code is giving the error of " | | cannot convert 'arma::subview_elem1, arma::op_rel_noteq>, arma::mtOp, arma::op_rel_noteq>, arma::glue_rel_and>, arma::o

Re: [Rcpp-devel] Error still there

2016-09-22 Thread Amina Shahzadi
Hello Dirk, Adler and Rcpp Colleagues Would you please guide me why the following code is giving the error of " cannot convert 'arma::subview_elem1, arma::op_rel_noteq>, arma::mtOp, arma::op_rel_noteq>, arma::glue_rel_and>, arma::op_find_simple> >' to 'double' in initialization" The problem is

Re: [Rcpp-devel] Error still there

2016-09-14 Thread Dirk Eddelbuettel
On 14 September 2016 at 10:52, Avraham Adler wrote: | "multiple" version was tweaked a bit as there was comparison between signed and | unsigned ints which did not throw an error for me, but did for Amina. Final Then your compiler switches are too strong and take warnings as errors. Most pe

Re: [Rcpp-devel] Error still there

2016-09-14 Thread Avraham Adler
Amina and I continued the conversation off list, but for closure purposes, the "multiple" version was tweaked a bit as there was comparison between signed and unsigned ints which did not throw an error for me, but did for Amina. Final multiple version posted below. Thanks, Avi #include using n

Re: [Rcpp-devel] Error still there

2016-09-12 Thread Avraham Adler
Hello, Amina. My apologies but it is still unclear as to what you want to do. Your inputs are two vectors of length m. What do you expect as output? Looking at the for loop in your code, you are running m² calculations as you have nested loops. Is that what you truly want? Let's start with some

Re: [Rcpp-devel] Error still there

2016-09-12 Thread Amina Shahzadi
My main objective is to index some elements of a given vector and then taking exponent. Great Prof. Dirk. I have just minimized example and got the solution. I would like to share my minimized code. Thank You all. #include using namespace Rcpp; using namespace RcppArmadillo; //[[Rcpp::depends(R

Re: [Rcpp-devel] Error still there

2016-09-12 Thread Dirk Eddelbuettel
On 12 September 2016 at 19:05, Avraham Adler wrote: | What exactly is it that you are trying to do? Also review some resources on 'minimally reproducible example' as eg http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example Dirk -- http://dirk.eddelbuettel.com |

Re: [Rcpp-devel] Error still there

2016-09-12 Thread Avraham Adler
Hello, Amina. I am having trouble understanding your code, however,one thing that stands out is that your return statement is inside your for loop which looks strange. Secondly in your first branch, you seem to want to return a scalar and in your second branch, you seem to want to return a vector