MCPcopy Create free account
hub / github.com/clMathLibraries/clSPARSE / MatrixMarketReader

Class MatrixMarketReader

src/benchmarks/cusparse-bench/src/mm_reader.cpp:60–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58
59template <typename FloatType>
60class 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
70public:
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 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected