Message-ID: <9226.22116.qm@web120115.mail.ne1.yahoo.com>
Date: 2011-04-18T15:53:43Z
From: Alaios
Subject: From nested loop to mclapply
Dear all,
I am trying to find a decent way to speed up my code.
So far I have used mclapply with really good results (parallel version of lapply). I have a nested loop that I would like to help me convert it to lapply
for (i in seq(from=-1,to=1-2/ncol(sr),length=ncol(sr))){
for (j in seq(from=-1,to=1-2/nrow(sr),length=nrow(sr))){
estimatedsr[findCoord(c(i,j),sr)[1],findCoord(c(i,j),sr)[2] ]<-fxy(c(i,j))
}
So far I have converted some one-depth for loops to lapply but I am not sure If I can use lapply to convert a nested loop to something simpler.
Best Regards
Alex