From 5c894ee210707a8bfe0036c95512712546708ee6 Mon Sep 17 00:00:00 2001 From: bbod Date: Sun, 29 Mar 2020 18:29:51 -0600 Subject: [PATCH] fixed resize of matrix --- HW10/main.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/HW10/main.cpp b/HW10/main.cpp index a0878d1..c443602 100644 --- a/HW10/main.cpp +++ b/HW10/main.cpp @@ -23,7 +23,7 @@ int main(int argc, char* argv[]) matrix = CostMatrixGenerator::GenerateCostMatrix(cities); } MPI_Bcast(&citiesSize, 1, MPI_INT, 0, MPI_COMM_WORLD); - if(!rank){ + if(rank){ // reserve memory for vectors matrix.resize(citiesSize); for(int i = 0; i < citiesSize; i++) { @@ -34,7 +34,6 @@ int main(int argc, char* argv[]) std::cout << "Process "<< rank << " has value " << citiesSize << "as size of city" << std::endl; if(rank){ - matrix[0][1]= 2.2; std::cout << "Process "<< rank << " has value " << citiesSize << "as size of city" << std::endl; for(int i = 0; i < citiesSize; i++){ for(int j = 0; j < citiesSize; j++) {