Commit d4ec6a47 authored by berenger-bramas's avatar berenger-bramas
Browse files

Update the stat example because it print the wrong number of potential leaves.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/scalfmm/scalfmm/trunk@143 2616d619-271b-44dc-8df4-d4a8f33a7222
parent 07bbd78b
...@@ -97,7 +97,7 @@ int main(int argc, char ** argv){ ...@@ -97,7 +97,7 @@ int main(int argc, char ** argv){
{ // get stats { // get stats
{ {
std::cout << "[STAT] level is " << NbLevels << std::endl; std::cout << "[STAT] level is " << NbLevels << std::endl;
std::cout << "[STAT] potentials leafs number is " << (1 << (3*NbLevels)) << std::endl; std::cout << "[STAT] potentials leafs number is " << (1 << (3* (NbLevels-1) )) << std::endl;
FReal averageParticles = 0; FReal averageParticles = 0;
{ {
...@@ -162,11 +162,8 @@ int main(int argc, char ** argv){ ...@@ -162,11 +162,8 @@ int main(int argc, char ** argv){
do{ do{
ContainerClass* neighbors[26]; ContainerClass* neighbors[26];
// need the current particles and neighbors particles // need the current particles and neighbors particles
const long counterNeighbors = tree.getLeafsNeighbors(neighbors, octreeIterator.getCurrentGlobalIndex(),NbLevels-1); averageNeighbors += tree.getLeafsNeighbors(neighbors, octreeIterator.getCurrentGlobalIndex(),NbLevels-1);
++nbLeafs; ++nbLeafs;
for(long idx = 0 ; idx < counterNeighbors ; ++idx){
averageNeighbors += neighbors[idx]->getSize();
}
} while(octreeIterator.moveRight()); } while(octreeIterator.moveRight());
std::cout << "[STAT] Average neighbors for each leafs = " << (averageNeighbors/nbLeafs) << std::endl; std::cout << "[STAT] Average neighbors for each leafs = " << (averageNeighbors/nbLeafs) << std::endl;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment