diff --git a/HW10/MakePermutationMatrix.cpp b/HW10/MakePermutationMatrix.cpp index 2dc2967..0c7a2a0 100644 --- a/HW10/MakePermutationMatrix.cpp +++ b/HW10/MakePermutationMatrix.cpp @@ -11,6 +11,7 @@ std::vector MakePermutationMatrix::MakePermutation(std::vector sou std::vector returnVector; std::vector localCostVector; std::size_t offset = 12; + std::size_t counter = 0; std::sort(source.begin(), source.end()); std::vector myPerm = source; std::vector nextPerm = source; @@ -30,7 +31,7 @@ std::vector MakePermutationMatrix::MakePermutation(std::vector sou returnVector.resize(source.size(), 0); //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()); //rotate my perm. std::rotate(myPerm.begin(), myPerm.begin()+offset*rank,myPerm.end()); @@ -40,11 +41,11 @@ std::vector MakePermutationMatrix::MakePermutation(std::vector sou std::cout << source[i].GetName() << " "; } std::cout << std::endl << std::endl; - std::cout <<"Rank: " << rank << " next perm: "; - for(int i = 0; i < nextPerm.size(); i++){ - std::cout << nextPerm[i].GetName() << " "; - } - std::cout << std::endl; +// std::cout <<"Rank: " << rank << " next perm: "; +// for(int i = 0; i < nextPerm.size(); i++){ +// std::cout << nextPerm[i].GetName() << " "; +// } +// std::cout << std::endl; do { double cost = 0; std::cout <<"Rank: " << rank << " myPerm: "; @@ -61,7 +62,8 @@ std::vector MakePermutationMatrix::MakePermutation(std::vector sou // std::cout << "cost: " << cost <(1,localCostVector[0]);