File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 2121#ifndef SPARSEMATRIX_HPP
2222#define SPARSEMATRIX_HPP
2323
24- #include < map>
2524#include < vector>
2625#include < cassert>
2726#include " Geometry.hpp"
2827#include " Vector.hpp"
2928#include " MGData.hpp"
29+ #if __cplusplus <= 201103L
30+ // for C++03
31+ #include < map>
32+ typedef std::map< global_int_t , local_int_t > GlobalToLocalMap;
33+ #else
34+ // for C++11 or greater
35+ #include < unordered_map>
36+ using GlobalToLocalMap = std::unorderd_map< global_int_t , local_int_t >;
37+ #endif
3038
3139struct SparseMatrix_STRUCT {
3240 char * title; // !< name of the sparse matrix
@@ -41,7 +49,7 @@ struct SparseMatrix_STRUCT {
4149 local_int_t ** mtxIndL; // !< matrix indices as local values
4250 double ** matrixValues; // !< values of matrix entries
4351 double ** matrixDiagonal; // !< values of matrix diagonal entries
44- std::map< global_int_t , local_int_t > globalToLocalMap; // !< global-to-local mapping
52+ GlobalToLocalMap globalToLocalMap; // !< global-to-local mapping
4553 std::vector< global_int_t > localToGlobalMap; // !< local-to-global mapping
4654 mutable bool isDotProductOptimized;
4755 mutable bool isSpmvOptimized;
You can’t perform that action at this time.
0 commit comments