Commit 9e6a53c8 authored by BRAMAS Berenger's avatar BRAMAS Berenger
Browse files

use inverse permutations

parent 2b4b6804
......@@ -77,7 +77,8 @@ int main(int argc, char** argv){
tclusters.saveToDot(outputdir, "gscotch.dot");
std::unique_ptr<int[]> permutations(new int[dim]);
tclusters.fillPermutations(permutations.get());
std::unique_ptr<int[]> invpermutations(new int[dim]);
tclusters.fillPermutations(permutations.get(), invpermutations.get());
for(int idxLevel = 2 ; idxLevel <= height ; ++idxLevel){
const int nbPartitions = FMath::pow2(idxLevel-1);
......@@ -92,7 +93,7 @@ int main(int argc, char** argv){
int offsetParticles = 0;
for(int idxPartition = 0 ; idxPartition < nbPartitions ; ++idxPartition){
for(int idxPart = 0 ; idxPart < partitions[idxPartition] ; ++idxPart){
const int idxUnk = permutations[idxPart+offsetParticles];
const int idxUnk = invpermutations[idxPart+offsetParticles];
fprintf(fcoord, "%e,%e,%e,%d\n",
spherePoints[idxUnk*4 + 0],
spherePoints[idxUnk*4 + 1],
......
Markdown is supported
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