From 9bcd8896181caa527d5ff2295e5f55d91230da4f Mon Sep 17 00:00:00 2001 From: bbod Date: Mon, 30 Mar 2020 22:39:18 -0600 Subject: [PATCH] Auto Commit --- HW10/MakePermutationMatrix.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HW10/MakePermutationMatrix.cpp b/HW10/MakePermutationMatrix.cpp index 5cefa28..d8173e3 100644 --- a/HW10/MakePermutationMatrix.cpp +++ b/HW10/MakePermutationMatrix.cpp @@ -20,7 +20,7 @@ std::vector MakePermutationMatrix::MakePermutation(std::vector sou returnVector.resize(source.size(), 0); //the "nextPerm" is the permutation to stop at. - if(rank != size) + if(rank != size-1) std::rotate(nextPerm.begin(), nextPerm.begin() + (rank + 1 + vectorOffset), nextPerm.end()); std::partial_sort(nextPerm.begin()+1, nextPerm.end(), nextPerm.end());