[Rcpp-devel] Error for exp() using RcppArmadillo

2016-09-11 Thread Amina Shahzadi
Hello Dear I am new user of RcppArmadillo and Rcpp. I am using a sample function pasted here. I am haivng error given below: Any can help in this regard. In function ‘arma::vec sample(arma::vec, arma::vec)’: sample.cpp:23:35: error: could not convert ‘exp((alpha1.arma::Col::.arma::Mat::operator(

[Rcpp-devel] Error still there

2016-09-12 Thread Amina Shahzadi
Thank you for welcoming me. Your help will be appreciatable. My problem is still there and getting the following error. sample.cpp: In function ‘double sample(arma::vec, arma::vec)’: sample.cpp:29:29: error: cannot convert ‘arma::enable_if2, arma::Col, arma::eglue_plus>, arma::eop_e

Re: [Rcpp-devel] Error still there

2016-09-12 Thread Amina Shahzadi
ing 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 | @eddelb

[Rcpp-devel] how to use R distributions while using RcppArmadillo

2016-09-15 Thread Amina Shahzadi
Hello Friends I tried to find that how we can use pnorm(), dpois() etc. using arma library. It is easy to use using Rcpp. Would anybody help ? Thank you -- *Amina Shahzadi* ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https

Re: [Rcpp-devel] Error still there

2016-09-22 Thread Amina Shahzadi
answers(i) = exp(alpha(S(0)) + beta(S(1))); > } > return(answers); > } > > ___ > 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

[Rcpp-devel] Variable for loop

2016-09-26 Thread Amina Shahzadi
Hi Dear I have a problem in using a variable for loop in using RcppArmadillo library. I have pasting here my code. It is executing but not giving the same results as its R code version gives. The results produced by it are really weird. I have checked it step by step. It is because of the for (int

Re: [Rcpp-devel] Variable for loop

2016-09-26 Thread Amina Shahzadi
e fillup(arma::mat a){ > int m = a.n_cols; > int n = a.n_rows; > arma::cube C = arma::cube(n, m, n, arma::fill::zeros); > > C.slice(0) = a; > > return(C); > } > > Avi > > On Mon, Sep 26, 2016 at 5:59 PM, Amina Shahzadi > wrote: > > Hi Dear > >

Re: [Rcpp-devel] Variable for loop

2016-09-26 Thread Amina Shahzadi
to > understand. > > Avi > > On Mon, Sep 26, 2016 at 10:07 PM, Amina Shahzadi > wrote: > > Hi Dear > > > > My purpose is to make run of a variable for loop. Here I have assumed > else > > statement to be zero. Otherwise it could be anything for example in the

Re: [Rcpp-devel] Variable for loop

2016-09-26 Thread Amina Shahzadi
on is, of course, much faster especially for > large matrices. > > It often pays to start with something simpler, and see if there is a > pattern you can identify which would help you conceptually, even if > not completely optimized. > > Avi > > > > > On Mon,

[Rcpp-devel] How to call a function from an R package in cpp code

2016-10-10 Thread Amina Shahzadi
Hi Rcpp Friends I want to use dgev(x,shape=1,scale=1,location=0,log=FALSE) function of an R package "FAdist" in the framework of Rcpp. How can I call that? For example for the Poisson distribution which is basic function of R I have written the following code. #include using namespace Rcpp; /

[Rcpp-devel] a variable for loop

2016-12-13 Thread Amina Shahzadi
Hello Friends and Prof. Dirk I am pasting here a code which has a for loop depending on another for loop. I am getting zeros for cube c. I tried and searched a lot but did not get an example of this type. Would you please help in this regard? #include using namespace Rcpp; using namespace RcppA

Re: [Rcpp-devel] a variable for loop

2016-12-13 Thread Amina Shahzadi
quick response. I hope this will make my question more clear. Best regards On Wed, Dec 14, 2016 at 4:46 PM, Avraham Adler wrote: > On Tue, Dec 13, 2016 at 9:51 PM, Amina Shahzadi > wrote: > >> Hello Friends and Prof. Dirk >> >> I am pasting here a code which has a fo

Re: [Rcpp-devel] a variable for loop

2016-12-13 Thread Amina Shahzadi
0 0.00e+00 [7,] 00 0.00e+00 [8,] 00 0.00e+00 [9,] 00 0.00e+00 [10,] 3628800 670442572800 1.090274e+14 On Wed, Dec 14, 2016 at 7:27 PM, Avraham Adler wrote: > > > On Wed, Dec 14, 2016 at 1:24 AM Amina Shahzadi > wr