Auto Commit
This commit is contained in:
@@ -16,19 +16,18 @@ std::vector<double> MakePermutationMatrix::MakePermutation(std::vector<City> sou
|
|||||||
std::vector<City> myPerm = source;
|
std::vector<City> myPerm = source;
|
||||||
std::vector<City> nextPerm = source;
|
std::vector<City> nextPerm = source;
|
||||||
|
|
||||||
if(!rank){
|
// if(!rank){
|
||||||
size_t totalNumPermutations = 1;
|
// size_t totalNumPermutations = 1;
|
||||||
for(size_t i = 1; i <= source.size(); i++)
|
// for(size_t i = 1; i <= source.size(); i++)
|
||||||
totalNumPermutations *= i;
|
// totalNumPermutations *= i;
|
||||||
offset = totalNumPermutations/size;
|
// offset = totalNumPermutations/size;
|
||||||
std::cout << "offset: "<<offset <<std::endl;
|
// std::cout << "offset: "<<offset <<std::endl;
|
||||||
}
|
// }
|
||||||
//MPI_Bcast(&offset, 1, MPI_LONG_LONG_INT, 0, MPI_COMM_WORLD);
|
//MPI_Bcast(&offset, 1, MPI_LONG_LONG_INT, 0, MPI_COMM_WORLD);
|
||||||
|
|
||||||
|
|
||||||
//return vector should be the size of number of processors as they are going to only return their own smallest.
|
//return vector should be the size of number of processors as they are going to only return their own smallest.
|
||||||
if(rank)
|
returnVector.resize(source.size(), 0);
|
||||||
returnVector.resize(source.size(), 0);
|
|
||||||
|
|
||||||
//the "nextPerm" is the permutation to stop at.
|
//the "nextPerm" is the permutation to stop at.
|
||||||
//std::rotate(nextPerm.begin(), nextPerm.begin()+(rank+1)*offset, nextPerm.end());
|
//std::rotate(nextPerm.begin(), nextPerm.begin()+(rank+1)*offset, nextPerm.end());
|
||||||
|
|||||||
Reference in New Issue
Block a user