From 224f740fe7ae80ad041b6191fd700e46638ebce9 Mon Sep 17 00:00:00 2001 From: bbod Date: Mon, 30 Mar 2020 20:35:49 -0600 Subject: [PATCH] Auto Commit --- HW10/MakePermutationMatrix.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/HW10/MakePermutationMatrix.cpp b/HW10/MakePermutationMatrix.cpp index 3b09155..91d9adc 100644 --- a/HW10/MakePermutationMatrix.cpp +++ b/HW10/MakePermutationMatrix.cpp @@ -35,7 +35,7 @@ std::vector MakePermutationMatrix::MakePermutation(std::vector sou std::cout << nextPerm[i].GetName() << " "; } std::cout << std::endl; - do { + if(!rank){do { double cost = 0; //Add up the cost of the current permutation. std::cout <<"Rank: " << rank << " Current perm: "; @@ -48,8 +48,8 @@ std::vector MakePermutationMatrix::MakePermutation(std::vector sou //Push permutation cost to the localCostVector. localCostVector.push_back(cost); counter++; - } while (std::next_permutation(myPerm.begin(), myPerm.end()) && myPerm != nextPerm); - + } while (std::next_permutation(myPerm.begin(), myPerm.end())); +} // //find the lowest and add it to a lowest vector. // auto lowest = std::vector(1,localCostVector[0]); // for(int i = 0; i < localCostVector.size(); i++) {