search for: atol

Displaying 20 results from an estimated 209 matches for "atol".

Did you mean: atoi
2005 Nov 06
1
Problem defining a system of odes as a C library with lsoda
...le bundled with the package: ### START rm(list=ls()) setwd("~/projects/test_odesolve") invisible(file.remove("mymod.o","mymod.so")) system("R CMD SHLIB mymod.c") dyn.load("mymod.so") require(odesolve) parms <- c(k1 = 0.04, k2 = 1e4, k3=3e7) my.atol <- c(1e-6, 1e-10, 1e-6) times <- c(0, 4*10^(-1:10)) print(system.time( out1 <- lsoda(c(1.0,0.0,0.0),times,"myderivs", parms, rtol=1e-4,atol=my.atol,jacfunc="myjac",...
2014 Dec 15
2
Replace atoi and atol with strtol strtoul:Need Help
Hello, I am working on replacing atoi () and atol() functions with strtol() and strtoul() . I came across many files which uses statement like these time_t secs= atoi(data_span.c_str()), here time_t Datatype is not known but wikipedia says that it is integer so is it necessary to replace atoi with strtol over here ?? And is their any document w...
2014 Dec 18
4
Replace atoi and atol with strtol strtoul:Need Help
Hello, I came across the file *omega.cc* which is in directory* xapain-application/omega/* In this file , atoi is used in *Percentage Relevance cutoff *(293 line no) as Percentage lies between 0-100 their is no need to modify atoi . But do we need to check for error's ? Second Implementation is in *collapsing* (301) in which we collapse set of document under a key,range of this key has not
2014 Dec 19
2
Replace atoi and atol with strtol strtoul:Need Help
...re checks and then install it to an architecture-dependent path. But anyway, there's no "strtou()" so you have to converting to unsigned long with strtoul() and then check for potential overflow from the cast to Xapian::valueno. > I think you?ve been looking at other uses of atoi/atol; if you?ve > successfully updated code then you should make a pull request or email > a patch (or attach one to the trac ticket) so someone can review it > and get it into trunk (and hence into a future release). Smaller PRs > are generally easier to review than ones that touch lots of...
2004 Jun 10
0
lsoda with arbitrary zero thresholds (with psuedo-solution)
...> that kind of works but is rather inelegant and I think may be > problematic in difficult systems. > Borrowing from the lsoda example again I once again highlight the code > that I have changed to put in place arbitrary thresholds: > parms <- c(k1=0.04, k2=1e4, k3=3e7) > my.atol <- c(1e-6, 1e-10, 1e-6) > times <- seq(0,1000) > lsexamp <- function(t, y, p) > { > if(y[1] < .4) yd1 <- -y[1] ### These if, else statements are new > else yd1 <- -p["k1"] * y[1] + p["k2"] * y[2]*y[3] > if(y[3] < .4) yd3...
2014 Dec 19
2
Replace atoi and atol with strtol strtoul:Need Help
On Sat, Dec 20, 2014 at 12:42:08AM +0530, Priyank Bhatt wrote: > As James said I am attaching two file *date.cc* and *datematchdecider.cc* Please send patches, not complete source files: http://trac.xapian.org/browser/git/xapian-core/HACKING#L1176 Patches are much smaller, and don't require the reviewer to work out the exact version of the source file you started from. Cheers, Olly
2014 Dec 16
2
Replace atoi and atol with strtol strtoul:Need Help
...ed to change the that definition of "val" also. Is that ok to do so ? Just need to clarify . On 16 December 2014 at 04:34, Olly Betts <olly at survex.com> wrote: > > On Tue, Dec 16, 2014 at 02:32:31AM +0530, Priyank Bhatt wrote: > > I am working on replacing atoi () and atol() functions with strtol() and > > strtoul() . I came across many files which uses statement like these > > time_t secs= atoi(data_span.c_str()), here time_t Datatype is not known > but > > wikipedia says that it is integer so is it necessary to replace atoi > with > &gt...
2005 Jul 19
2
Michaelis-menten equation
...function(time, y, parms) { dCpdt <- -(parms["Vm"]/parms["Vd"])*y[1]/(parms["Km"]+y[1]) list(dCpdt)} Dose<-300 modfun <- function(time,Vm,Km,Vd) { out <- lsoda(Dose/Vd,time,mm.model,parms=c(Vm=Vm,Km=Km,Vd=Vd), rtol=1e-8,atol=1e-8) out[,2] } objfun <- function(par) { out <- modfun(PKindex$time,par[1],par[2],par[3]) sum((PKindex$conc-out)^2) } fit <- optim(c(10,1,80),objfun, method="Nelder-Mead) print(fit$par) [1] 10.0390733 0.1341544 34.9891829 #--Km=0.1341544,wrong value-- #-----wr...
2004 Oct 06
1
Foreign code problem
Hello, I wanted to test the odesolve package and tried to use compiled C-code. But when I do: erg <- lsoda(y, times, "mond", parms, rtol, atol, tcrit=NULL, jacfunc=NULL, verbose=FALSE, dllname="mond", hmin=0, hmax=Inf) I get the error message: Error in lsoda(y, times, "mond", parms, rtol, atol, tcrit = NULL, jacfunc = NULL, : Unable to find mond in mond The C code is:...
2006 Aug 26
1
problems with loop
...<=sim[n,2]){tmp[k,2]=1} if(tmp[k,1]==sim[n,1] && v[k]>sim[n,2]) {tmp[k,2]=0} } } return(tmp) } # The model to be fitted Model_1=function(beta0_mod,mu_mod,k_mod,I_mod) { parms = c(beta0=beta0_mod, mu=mu_mod, k=k_mod) my.atol = 1e-6 times1=c(0,0.002884615,0.003846154,0.005769231,0.009615385,0.01,0.019230769) times2=c(0.028846154,0.038461538,0.057692308, 0.076923077,0.083333333,0.096153846) times3=c(0.115384615,0.125,0.134615385,0.166666667,0.25,0.416666667,0.5) times4=c(0.58333333,0.666666667,0.75,...
2001 May 11
1
lsoda
...for that system of equations. Why is it needed? For my function below ('lvcomp2'), I don't know what global values lsoda needs at each point in time (see???), other than the previous time step's values of y and the parms. Any help? Also, any rule of thumb advice regarding rtol and atol would be appreciated. p <- c(r1=.01, r2=.01, a12=0.5, a21=0.6, k1=1,k2=1) t <- 1:20 lvcomp2 <- function(y, t, p) { # Lotka - Volterra model of two competing populations dN1.dt <- p["r1"] * y[1] * (1-(y[1] + p["a12"]*y[2])/p["k1"]) dN2.dt <- p["r2&q...
2008 Jul 29
2
[LLVMdev] llvm-gcc linking errors
...here trirast.o(.text+0x1230): In function `strtol': : multiple definition of `strtol' main.o(.text+0x1470): first defined here trirast.o(.text+0x1260): In function `atoi': : multiple definition of `atoi' main.o(.text+0x14a0): first defined here trirast.o(.text+0x1290): In function `atol': : multiple definition of `atol' main.o(.text+0x14d0): first defined here trirast.o(.text+0x12c0): In function `atoll': : multiple definition of `atoll' main.o(.text+0x1500): first defined here trirast.o(.text+0x12f0): In function `atof': : multiple definition of `atof' mai...
2004 Jun 10
2
odesolve: lsoda vs rk4
...e results look not unreasonable: out<-as.data.frame(out) par(mfrow=c(4,1)) for (i in 2:(dim(out)[2]))plot(out[,1],out[,i], pch=".", xlab="time", ylab=names(out)[i]) If I try doing the same thing with lsoda: out <- lsoda(y=y,times=times,func=func, parms=parms, rtol=1e-1, atol= 1e-1) I run into problems with a series of 'Excessive precision requested' warnings with no output beyond the first time point. Fiddling with rtol and atol doesn't seem to do very much. What is likely to be causing this (I'm guessing the wide range of the absolute values of the...
2008 Feb 16
0
[LLVMdev] linux/x86-64 codegen support
...int *arglist shows too much information.... $ /home/edwin/llvm-svn/obj42/./prev-gcc/cc1 charset.i vprintf getchar fgetc_unlocked getc_unlocked getchar_unlocked putchar fputc_unlocked putc_unlocked putchar_unlocked feof_unlocked ferror_unlocked gnu_dev_major gnu_dev_minor gnu_dev_makedev atof atoi atol atoll stat lstat fstat mknod cpp_in_system_header ustrcmp ustrncmp ustrcspn ustrlen uxstrdup ustrchr ufputs one_utf8_to_cppchar one_cppchar_to_utf8 one_utf8_to_utf32 one_utf32_to_utf8 one_utf8_to_utf16 one_utf16_to_utf8 conversion_loop convert_utf8_utf16 convert_utf8_utf32 convert_utf16_utf8 conver...
2008 Apr 09
3
LSODA not accurate when RK4 is; what's going on?
I'm solving the differential equation dy/dx = xy-1 with y(0) = sqrt(pi/2). This can be used in computing the tail of the normal distribution. (The actual solution is y(x) = exp(x^2/2) * Integral_x_inf {exp(-t^2/2) dt} = Integral_0_inf {exp (-xt - t^2/2) dt}. For large x, y ~ 1/x, starting around x~2.) I'm testing both lsoda and rk4 from the package odesolve. rk4 is accurate using step
2006 Jun 08
2
nested mixed-effect model: variance components
...to lagoons? habitats? lagoons*habitat? transects? Here is my code: res <- aov(COVER ~ HABITAT + Error(HABITAT+LAGOON+LAGOON/HABITAT), data=cov) summary(res) and I get Sum Sq for each to calculate variance components: Error: STRATE Df Sum Sq Mean Sq STRATE 5 4493.1 898.6 Error: ATOLL Df Sum Sq Mean Sq F value Pr(>F) Residuals 5 3340.5 668.1 Error: STRATE:ATOLL Df Sum Sq Mean Sq F value Pr(>F) Residuals 18 2442.71 135.71 Error: Within Df Sum Sq Mean Sq F value Pr(>F) Residuals 145 6422.0 44.3 My error message seems to come f...
2008 Feb 16
2
[LLVMdev] linux/x86-64 codegen support
Interestingly, in the .i file there are 2 __builtin_alloca, and EmitBuiltinAlloca is only being called once. Andrew On 2/16/08, Andrew Lenharth <andrewl at lenharth.org> wrote: > libcpp/charset.c:631 turns into: > > %tmp16 = tail call i64 @strlen( i8* %to ) nounwind readonly > ; <i64> [#uses=1] > %tmp18 = tail call i64 @strlen( i8* %from ) nounwind
2004 Aug 13
3
[LLVMdev] is this code really JITed and/or optimized ? ..
.... fibonacci function of 35 from attached file is more then 100 times slower then the following code compiled with "gcc -O2" : ----------- #include <iostream> int fib(int x) { if(x<=2) return 1; return fib(x-1)+fib(x-2); } int main(int argc, char**argv) { int n = argc > 1 ? atol(argv[1]) : 10; std::cout << fib(n) << "\n"; } ----------- Where's the rake I step at?.. I guess the JIT was not really invoked or code was not optimized.. P.S. My best wishes to all countries at Olympiad 2004. --- Valery A.Khamenya -------------- next part ---------...
2010 Oct 29
2
[LLVMdev] "multiple definition of .. " in clang 2.8
...ostname.o: In function `atof': Hostname.c:(.text+0xe0): multiple definition of `atof' av.o:av.c:(.text+0xe0): first defined here Hostname.o: In function `atoi': Hostname.c:(.text+0xf0): multiple definition of `atoi' av.o:av.c:(.text+0xf0): first defined here Hostname.o: In function `atol': Hostname.c:(.text+0x110): multiple definition of `atol' av.o:av.c:(.text+0x110): first defined here Hostname.o: In function `atoll': Hostname.c:(.text+0x130): multiple definition of `atoll' av.o:av.c:(.text+0x130): first defined here Hostname.o: In function `__strcspn_c1': Hos...
2009 Jun 11
3
deSolve question
...st(dy = c(dAar, dAve, dAlu, dAli, dAbr, dAh, dApa, dAsp, dAgi, dAk, dAm, dAad, dAsk), Car = Car, Cve=Cve, Clu=Clu, Cli=Cli, Cbr=Cbr, Ch=Ch, Cpa=Cpa, Csp=Csp, Cgi=Cgi, Ck=Ck, Cm=Cm, Cad=Cad, Csk=Csk)) }) } ODE <- as.data.frame(daspk(y = y, times = times, func = Fun_ODE, parms = pars, atol = 1e-10, rtol = 1e-10)) -- Dr In-Sun Nam Knutsson Research Associate The Centre for Applied Pharmacokinetic Research (CAPKR) School of Pharmacy and Pharmaceutical Sciences University of Manchester Stopford Building Oxford Road Manchester U.K. Phone: +44 161 275 2355 Email: In-sunnam.Knutsson@m...