| 58 | |
| 59 | template <typename FloatType> |
| 60 | class MatrixMarketReader |
| 61 | { |
| 62 | char Typecode[ 4 ]; |
| 63 | clsparseIdx_t nNZ; |
| 64 | clsparseIdx_t nRows; |
| 65 | clsparseIdx_t nCols; |
| 66 | int isSymmetric; |
| 67 | int isDoubleMem; |
| 68 | Coordinate<FloatType> *unsym_coords; |
| 69 | |
| 70 | public: |
| 71 | MatrixMarketReader( ): nNZ( 0 ), nRows( 0 ), nCols( 0 ), isSymmetric( 0 ), isDoubleMem( 0 ) |
| 72 | { |
| 73 | for( auto c : Typecode ) |
| 74 | c = '\0'; |
| 75 | |
| 76 | unsym_coords = NULL; |
| 77 | } |
| 78 | |
| 79 | bool MMReadHeader( FILE* infile ); |
| 80 | bool MMReadHeader( const std::string& filename ); |
| 81 | bool MMReadFormat( const std::string& _filename, bool explicit_zeroes ); |
| 82 | int MMReadBanner( FILE* infile ); |
| 83 | int MMReadMtxCrdSize( FILE* infile ); |
| 84 | void MMGenerateCOOFromFile( FILE* infile, bool explicit_zeroes ); |
| 85 | |
| 86 | clsparseIdx_t GetNumRows( ) |
| 87 | { |
| 88 | return nRows; |
| 89 | } |
| 90 | |
| 91 | clsparseIdx_t GetNumCols( ) |
| 92 | { |
| 93 | return nCols; |
| 94 | } |
| 95 | |
| 96 | clsparseIdx_t GetNumNonZeroes( ) |
| 97 | { |
| 98 | return nNZ; |
| 99 | } |
| 100 | |
| 101 | int GetSymmetric( ) |
| 102 | { |
| 103 | return isSymmetric; |
| 104 | } |
| 105 | |
| 106 | char &GetTypecode( ) |
| 107 | { |
| 108 | return Typecode; |
| 109 | } |
| 110 | |
| 111 | Coordinate<FloatType> *GetUnsymCoordinates( ) |
| 112 | { |
| 113 | return unsym_coords; |
| 114 | } |
| 115 | |
| 116 | ~MatrixMarketReader( ) |
| 117 | { |
nothing calls this directly
no outgoing calls
no test coverage detected