[R] Multiplying complex numbers from R in C

2010-12-16 Thread Oleksandr Dyklevych
Hi! I'm trying to do some operations on complex numbers in C with returning results to R, but it seems that arithmetic operators do not overloaded for complex numbers. I mean, I try a very simple code, like #include #include #include int main(){ Rcomplex e, z, s; e.r = M_PI; e.

[R] Dynamically build functional expression and taking derivative

2010-12-09 Thread Oleksandr Dyklevych
Hi! I'm faced the next problem: suppose I have a vector of some coefficient and for some purpose from these coefficients I need dynamically build a functional expression (because, the number of elements in the vector of coefficients might differ each time). So, I'm trying to do like this (l

[R] Strange problems with compiling dll

2010-12-02 Thread Oleksandr Dyklevych
Dear sir\madam! I'm trying to speed up my R code by writing quite simple dll's in C. But I faced some problems, and I cannot determine their source. #include SEXP mycombin(SEXP N, SEXP k){ int i, *j, *l, c; j = INTEGER(k);l = INTEGER(N); c = 1; if(j[0] > 0 && j[0] < l[0]){