search for: cvec

Displaying 8 results from an estimated 8 matches for "cvec".

Did you mean: bvec
2009 Sep 14
2
Escaping . in regular expression
If I run cvec<-c("test.f", "test.sf", "try.g","try.res", "try.f") print(cvec) indx<-grep('\.f',cvec,perl=TRUE) fset<-cvec[indx] print(fset) I get > cvec<-c("test.f", "test.sf", "try.g","try.res", &...
2004 Sep 16
1
Newbie q. need some help understanding this code.
...e and inclination) It implements gillepsie's stochastic algorithm for Lotka Volterra model. What would help me tremendously is to see the breakdown of the line by line code into plain english. thanks for any insights or other comments. sean library(stepfun) lv <- function(N=1000,cvec=c(1,0.005,0.6),x=c(50,100)) { m<-length(cvec) n<-length(x) xmat<-matrix(nrow=N+1,ncol=n) tvec<-vector("numeric",N) h<-vector("numeric",m) t<-0 xmat[1,]<-x for (i in 1:N) { h[1]&l...
2015 Feb 01
2
invoking R function in C++ in parallel
...s you cannot trigger gc() calls from different threads > I think you can use R objects, as long as you don't call R functions on them (not even from R's C api, although some of them are currently fine) and consider them as read-only. E.g. if you have a numeric vector, you can do double *cvec = REAL(vec); and then use cvec in your thread(s). This is pretty restrictive, but could be enough in some cases. Gabor [...] [[alternative HTML version deleted]]
2009 Oct 23
1
help using R's linprog for LP
Hi, I am using R in one of my courses. I am trying to use R's linprog package to solve to formulate 2-class classification problem as Linear programming problem. For my formulation, I need to set to "cvec" to all 0s. I know the points are linearly separable so an optimal solution "x" does exist, which satisfies all the constraints. But given the constraints and setting "cvec" to all 0s it simply gives me an "x" of all 0s. How can I fix this? Medha
2003 Sep 26
2
checking generic/method consistency
...'quadprog' has a function with the name 'solve.QP' to perform Quadratic Programming, I named my (main) function 'solve.LP'. However 'R CMD check' gives one warning: * checking generic/method consistency ... WARNING solve: function(a, b, ...) solve.LP: function(cvec, bvec, Amat, maximum, maxiter, verbose) while 'R CMD check' gives no warnings when the function has the name 'solve.QP'. What do you recommend me to do? 1) Ignore the warning and upload the package to CRAN as it is? 2) Rename the function? (any suggestions?) 3) Change something t...
2015 Feb 01
0
invoking R function in C++ in parallel
...not trigger gc() calls from different threads | | | I think you can use R objects, as long as you don't call R functions on them | (not even from R's C api, although some of them are currently fine) and | consider them as read-only. E.g. if you have a numeric vector, you can do? | double *cvec = REAL(vec); | and then use cvec in your thread(s). You and I are saying the same thing here: you call it read-only access; I called ot "do not use R types". We recommend the same approach in other places: instantiate std::vector<double> from RcppVector, don't use R calls. My...
2015 Jan 31
2
invoking R function in C++ in parallel
Hello, I'm writing an R extension in C++. In the extension, I want to invoke an R function directly and it works when I use Rcpp in the serial code. But what I really want is to invoke the R function in parallel with openmp. When I do so, I got segmentation fault. I remember someone said that R isn't thread-safe. I think it's also understandable because an R function also has
2013 Apr 28
0
Positive Smoothing in fda package
...3 1700.604 23.1824 14 1697.774 23.8055 15 1696.296 23.944 16 1691.261 25.1618 17 1689.009 25.2832 18 1688.607 25.1727 19 1685.972 25.798 20 1685.278 25.6813Error in if (any(stepi[index] < bot[index] - cvec[index]) & any(deltac[index] != : missing value where TRUE/FALSE needed Changing the parameters of the basis I can get a fit, but I'm trying to fit thousands of objects and I haven't found a combination that works for all of them. Another question is how to fit simultaneously sever...