Skip to content
Snippets Groups Projects
Commit 9cc09df6 authored by Saad Jbabdi's avatar Saad Jbabdi
Browse files

really fixed the rand problem in randfib=2

parent 662a6df3
No related branches found
No related tags found
No related merge requests found
......@@ -186,19 +186,18 @@ namespace TRACTVOLSX{
fibst=0;
}
else{
float fsumtmp2=0;
int fib=0;
float rtmp=(float)rand()/float(RAND_MAX);
float ft,fsumtmp2=0;
float rtmp=fsumtmp * (float)rand()/float(RAND_MAX);
while( fsumtmp2<=rtmp){
float ft=(*fsamples[fib])(int(newx),int(newy),int(newz),int(samp));
if(ft>opts.fibthresh.value()){
fsumtmp2+=(ft/fsumtmp);
for(unsigned int fib=0;fib<thsamples.size();fib++){
ft=(*fsamples[fib])(int(newx),int(newy),int(newz),int(samp));
if(ft>opts.fibthresh.value())
fsumtmp2 += ft;
if(rtmp<=fsumtmp2){
fibst=(int)fib;
break;
}
fibst=fib;
fib++;
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment