Displaying 2 results from an estimated 2 matches for "gbest".
Did you mean:
best
2010 Jan 17
2
For loops in R
Hello.
I've just started using R and am trying to figure out if the two codes
snippets below have the same output
gBest<-floor(runif(popsize,min=1,max=top))
velocity[i,j]<<-.4* velocity[i,j] + 1 * runif(1) * (pbestsVar[i,j] -
popVar[i,j]) + 1 * runif(1) * (archiveVar[gBest,j] - popVar[i,j])
and
for (i in 1:popsize) {
for (j in 1:maxvar) {
gBest<-sample(top,size=1)
velocity[i,j]<<-.4*...
2010 Jul 14
1
calling a c function from R
...some of the tutorials, I understood how to do this if the
arguments are integers or floats. I am stuck when i am trying to send the
files. I am attaching stub of each file.
Help appreciated.
Thanks
---------------------------------------
My function call would be:
source("parse.R")
parseGBest('./gbest/inFile.seq', './gbest/outFile.out');
---------------------------------------
I wrote a wrapper function (parse.R) as follows:
dyn.load("parse.so");
parseGBest = function(inFile, outFile)
{
.C( "parse" , inFile , outFile);
}
How to write receive the f...