diff --git a/miniTri/linearAlgebra/HPX3/CSRMatrix.cc b/miniTri/linearAlgebra/HPX3/CSRMatrix.cc index fe32e69..4f5a4fa 100644 --- a/miniTri/linearAlgebra/HPX3/CSRMatrix.cc +++ b/miniTri/linearAlgebra/HPX3/CSRMatrix.cc @@ -401,7 +401,8 @@ int matmat_ComputeRowBlock(const CSRMat &A, const CSRMat &B, blockDS blockInfo, { if((*iter).second.size()==1) { - newNZs.erase(iter++); // Remove nonzero + // newNZs.erase(iter++); // Remove nonzero (C++98 Compliant) + iter = newNZs.erase(iter); // Remove nonzero (C++11 Compliant) nnzInRow[rownum]--; // One less nonzero in row } else diff --git a/miniTri/linearAlgebra/MPI/CSRMatrix.cpp b/miniTri/linearAlgebra/MPI/CSRMatrix.cpp index 9fb8925..1b56602 100644 --- a/miniTri/linearAlgebra/MPI/CSRMatrix.cpp +++ b/miniTri/linearAlgebra/MPI/CSRMatrix.cpp @@ -60,7 +60,7 @@ #include #include -#include "CSRmatrix.hpp" +#include "CSRMatrix.hpp" #include "Vector.hpp" #include "mmUtil.h" #include "binFileReader.h" @@ -378,7 +378,8 @@ void CSRMat::matmat(const CSRMat &A, const CSRMat &B) { if((*iter).second.size()==1) { - CNZs[submatNum][rownum].erase(iter++); // Remove nonzero + //CNZs[submatNum][rownum].erase(iter++); // Remove nonzero (C++98 Compliant) + iter = CNZs[submatNum][rownum].erase(iter); // Remove nonzero (C++11 Required) } else { diff --git a/miniTri/linearAlgebra/MPI/Graph.hpp b/miniTri/linearAlgebra/MPI/Graph.hpp index 4d030d9..e79c31e 100644 --- a/miniTri/linearAlgebra/MPI/Graph.hpp +++ b/miniTri/linearAlgebra/MPI/Graph.hpp @@ -59,7 +59,7 @@ #include #include -#include "CSRmatrix.hpp" +#include "CSRMatrix.hpp" #include "Vector.hpp" ////////////////////////////////////////////////////////////////////////////// diff --git a/miniTri/linearAlgebra/MPI/Makefile b/miniTri/linearAlgebra/MPI/Makefile index 2ff2e1c..8eb0838 100644 --- a/miniTri/linearAlgebra/MPI/Makefile +++ b/miniTri/linearAlgebra/MPI/Makefile @@ -12,7 +12,7 @@ UTILDIR = ../../utils/ INCDIRS = -I. -I$(UTILDIR) CCC = mpicxx -CCFLAGS = -O3 -Wall -DNDEBUG -DUSE_MPI +CCFLAGS = -O3 -Wall -DNDEBUG -DUSE_MPI -std=c++11 LIBPATH = -L. #-------------------------------------------------- @@ -40,12 +40,12 @@ vpath %.cc $(UTILDIR) vpath %.cpp $(UTILDIR) all : lib miniTri -matrix.o : CSRmatrix.h +matrix.o : CSRMatrix.hpp lib : $(LIBOBJECTS) $(UTILOBJECTS) ar rvu libSPLA.a $(LIBOBJECTS) $(UTILOBJECTS) -miniTri : lib CSRmatrix.hpp Graph.hpp +miniTri : lib CSRMatrix.hpp Graph.hpp $(CCC) $(INCDIRS) $(LIBPATH) $(CCFLAGS) -o miniTri.exe miniTri.cpp -lSPLA clean : diff --git a/miniTri/linearAlgebra/openmp/CSRMatrix.cc b/miniTri/linearAlgebra/openmp/CSRMatrix.cc index 0c60e14..2ded02f 100644 --- a/miniTri/linearAlgebra/openmp/CSRMatrix.cc +++ b/miniTri/linearAlgebra/openmp/CSRMatrix.cc @@ -234,7 +234,9 @@ void CSRMat::matmat(const CSRMat &A, const CSRMat &B) { if((*iter).second.size()==1) { - newNZs.erase(iter++); // Remove nonzero + // newNZs.erase(iter++); // Remove nonzero (C++98 Compliant) + iter = newNZs.erase(iter); // Remove nonzero (C++11 Required) + nnzInRow[rownum]--; // One less nonzero in row } else diff --git a/miniTri/linearAlgebra/openmp/Makefile b/miniTri/linearAlgebra/openmp/Makefile index f60aeb1..6a0992a 100644 --- a/miniTri/linearAlgebra/openmp/Makefile +++ b/miniTri/linearAlgebra/openmp/Makefile @@ -11,7 +11,7 @@ UTILDIRS = ../../utils/ INCDIRS = -I. -I$(UTILDIRS) CCC = g++ -CCFLAGS = -O3 -Wall -DNDEBUG -fopenmp -std=c++11 $(BOOSTCCFLAGS) +CCFLAGS = -O3 -Wall -DNDEBUG -fopenmp -std=c++11 LIBPATH = -L. diff --git a/miniTri/linearAlgebra/serial/CSRmatrix.cpp b/miniTri/linearAlgebra/serial/CSRmatrix.cpp index 93a103e..c0d237b 100644 --- a/miniTri/linearAlgebra/serial/CSRmatrix.cpp +++ b/miniTri/linearAlgebra/serial/CSRmatrix.cpp @@ -216,7 +216,9 @@ void CSRMat::matmat(const CSRMat &A, const CSRMat &B) { if((*iter).second.size()==1) { - newNZs.erase(iter++); // Remove nonzero + //newNZs.erase(iter++); // Remove nonzero (C++98 compliant) + iter = newNZs.erase(iter); // Remove nonzero (requires C++11) + nnzInRow[rownum]--; // One less nonzero in row } else diff --git a/miniTri/linearAlgebra/serial/Makefile b/miniTri/linearAlgebra/serial/Makefile index 50dbbe9..8740dff 100644 --- a/miniTri/linearAlgebra/serial/Makefile +++ b/miniTri/linearAlgebra/serial/Makefile @@ -12,7 +12,7 @@ UTILDIR = ../../utils/ INCDIRS = -I. -I$(UTILDIR) CCC = g++ -CCFLAGS = -O3 -Wall -DNDEBUG +CCFLAGS = -O3 -Wall -DNDEBUG -std=c++11 LIBPATH = -L. #-------------------------------------------------- diff --git a/triangleCounting/linearAlgebra/LH/openmp/CSRMatrix.cc b/triangleCounting/linearAlgebra/LH/openmp/CSRMatrix.cc index 754b53d..a80224f 100644 --- a/triangleCounting/linearAlgebra/LH/openmp/CSRMatrix.cc +++ b/triangleCounting/linearAlgebra/LH/openmp/CSRMatrix.cc @@ -143,7 +143,8 @@ void CSRMat::matmat(const CSRMat &A, const CSRMat &B) { if((*iter).second==1) { - newNZs.erase(iter++); // Remove nonzero + // newNZs.erase(iter++); // Remove nonzero (C++98 Compliant) + iter = newNZs.erase(iter); // Remove nonzero (Requires C++11) nnzInRow[rownum]--; // One less nonzero in row } else diff --git a/triangleCounting/linearAlgebra/LH/serial/CSRmatrix.cpp b/triangleCounting/linearAlgebra/LH/serial/CSRmatrix.cpp index 09e1a46..88ec8f3 100644 --- a/triangleCounting/linearAlgebra/LH/serial/CSRmatrix.cpp +++ b/triangleCounting/linearAlgebra/LH/serial/CSRmatrix.cpp @@ -145,7 +145,8 @@ void CSRMat::matmat(const CSRMat &A, const CSRMat &B) { if((*iter).second==1) { - newNZs.erase(iter++); // Remove nonzero + // newNZs.erase(iter++); // Remove nonzero (C++98 Compliant) + iter = newNZs.erase(iter); // Remove nonzero (C++11 Required) nnzInRow[rownum]--; // One less nonzero in row } else