search for: test_it

Displaying 5 results from an estimated 5 matches for "test_it".

Did you mean: test_bit
2017 Jun 11
1
Memory leak in nleqslv()
...t;- x[1:rows_x] x_2 <- x[(rows_x+1):(rows_x*2)] eq1<- x_1-100 eq2<-x_2*10-40 return(c(eq1,eq2)) } model_test <- function() { reserves<-(c(0:200)/200)^(2)*2000 lambda <- numeric(NROW(reserves))+5 res_ext <- pmin((reserves*.5),5) x_test <- c(res_ext,lambda) #print(x_test) for(test_iter in c(1:1000)) nleqslv(x_test,cons_ext_test,jacobian=NULL) i<- sort( sapply(ls(),function(x){object.size(get(x))})) print(i[(NROW(i)-5):NROW(i)]) } model_test() When I run this over 1000 iterations, memory use ramps up to over 2.4 GB While running it with 10 iterations uses far less memor...
2017 Jun 12
2
Possible with enableJIT function
...ge with the following small example. <code> library(nleqslv,lib.loc="../nleqslv.Rcheck") library(pryr) dslnex <- function(x) { y <- numeric(2) y[1] <- x[1]^2 + x[2]^2 - 2 y[2] <- exp(x[1]-1) + x[2]^3 - 2 y } xstart <- c(x1=1.5,x2=2) nsims <- 10 for(test_iter in seq_len(nsims)){ z <- nleqslv(xstart,dslnex,jacobian=NULL) print(paste("nleqslv iteration",test_iter,"and memory used is",mem_used())) } memory.profile() gc() print(paste("At end memory used is", mem_used())) </code> The final output is <outp...
2017 Jun 13
0
Possible with enableJIT function
...> library(nleqslv,lib.loc="../nleqslv.Rcheck") > library(pryr) > dslnex <- function(x) { > y <- numeric(2) > y[1] <- x[1]^2 + x[2]^2 - 2 > y[2] <- exp(x[1]-1) + x[2]^3 - 2 > y > } > xstart <- c(x1=1.5,x2=2) > nsims <- 10 > for(test_iter in seq_len(nsims)){ > z <- nleqslv(xstart,dslnex,jacobian=NULL) > print(paste("nleqslv iteration",test_iter,"and memory used is",mem_used())) > } > memory.profile() > gc() > print(paste("At end memory used is", mem_used())) > </code&g...
2006 Jun 06
14
How can I set the session in a functional test?
Hey :) I need to simulate a login in my functional test, otherwise I can''t GET nor POST to the action. I need to set the session key "logged_in_user_id". I tried this inside the setup() method: session[''logged_in_user_id''] = 1 But that throws: TypeError: can''t convert String into Integer Any ideas? Thanks, Rob -------------- next part
2010 May 17
3
Writing a properly-formed custom type (configxml)
...} ... } ---- 8< ---- configxml.rb ---- 8< ---- module Puppet newtype(:configxml) do @doc = "Modify attributes of the first element matching the XPath expression in an XML file." require ''rexml/document'' require ''set'' def test_it doc = REXML::Document.new(File.open(value(:name))) # Take the first element matching the provided XPath expression attrs = doc.elements[value(:xpath) + "[1]"].attributes # Split up the comma-separated key-value pairs into an array and then isolate the keys keys = value(:a...