Skip to content

Commit

Permalink
Changed erase to use C++11 version, requires C++11
Browse files Browse the repository at this point in the history
  • Loading branch information
mmwolf committed Aug 24, 2017
1 parent 3c6063b commit a5e1677
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 13 deletions.
3 changes: 2 additions & 1 deletion miniTri/linearAlgebra/HPX3/CSRMatrix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions miniTri/linearAlgebra/MPI/CSRMatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
#include <cassert>
#include <cstdlib>

#include "CSRmatrix.hpp"
#include "CSRMatrix.hpp"
#include "Vector.hpp"
#include "mmUtil.h"
#include "binFileReader.h"
Expand Down Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion miniTri/linearAlgebra/MPI/Graph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
#include <cmath>
#include <memory>

#include "CSRmatrix.hpp"
#include "CSRMatrix.hpp"
#include "Vector.hpp"

//////////////////////////////////////////////////////////////////////////////
Expand Down
6 changes: 3 additions & 3 deletions miniTri/linearAlgebra/MPI/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.

#--------------------------------------------------
Expand Down Expand Up @@ -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 :
Expand Down
4 changes: 3 additions & 1 deletion miniTri/linearAlgebra/openmp/CSRMatrix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion miniTri/linearAlgebra/openmp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.


Expand Down
4 changes: 3 additions & 1 deletion miniTri/linearAlgebra/serial/CSRmatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion miniTri/linearAlgebra/serial/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.

#--------------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion triangleCounting/linearAlgebra/LH/openmp/CSRMatrix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion triangleCounting/linearAlgebra/LH/serial/CSRmatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a5e1677

Please sign in to comment.