From 2ccc3cd9cce42534c3c52fbfb06b3da84a89f0a8 Mon Sep 17 00:00:00 2001 From: bbod Date: Mon, 30 Mar 2020 22:32:20 -0600 Subject: [PATCH] Auto Commit --- HW10/MakePermutationMatrix.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/HW10/MakePermutationMatrix.cpp b/HW10/MakePermutationMatrix.cpp index 0666c15..f76830d 100644 --- a/HW10/MakePermutationMatrix.cpp +++ b/HW10/MakePermutationMatrix.cpp @@ -20,11 +20,10 @@ std::vector MakePermutationMatrix::MakePermutation(std::vector sou returnVector.resize(source.size(), 0); //the "nextPerm" is the permutation to stop at. - if(rank != size) - std::rotate(nextPerm.begin(), nextPerm.begin()+(rank+1*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*vectorOffset),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;