diff --git a/HW10/MakePermutationMatrix.cpp b/HW10/MakePermutationMatrix.cpp index 8175455..fbca922 100644 --- a/HW10/MakePermutationMatrix.cpp +++ b/HW10/MakePermutationMatrix.cpp @@ -20,10 +20,10 @@ 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+vectorOffset), nextPerm.end()); + std::rotate(nextPerm.begin(), nextPerm.begin()+(rank+1*vectorOffset), nextPerm.end()); std::partial_sort(nextPerm.begin()+1, nextPerm.end(), nextPerm.end()); //rotate my perm. - std::rotate(myPerm.begin(), myPerm.begin()+rank,myPerm.end()); + std::rotate(myPerm.begin(), myPerm.begin()+(rank*vectorOffset),myPerm.end()); std::partial_sort(myPerm.begin()+1, myPerm.end(), myPerm.end()); //std::cout << "source.last(): " << source[8].GetName() << std::endl;