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

Method MMReadFormat

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

Source from the content-addressed store, hash-verified

184
185template<typename FloatType>
186bool MatrixMarketReader<FloatType>::MMReadFormat( const std::string &filename, bool explicit_zeroes )
187{
188 FILE *mm_file = ::fopen( filename.c_str( ), "r" );
189 if( mm_file == NULL )
190 {
191 printf( "Cannot Open Matrix-Market File !\n" );
192 return 1;
193 }
194
195 if ( MMReadHeader( mm_file ) )
196 {
197 printf ("Matrix not supported !\n");
198 return 2;
199 }
200
201 if( mm_is_symmetric( Typecode ) )
202 unsym_coords = new Coordinate<FloatType>[ 2 * nNZ ];
203 else
204 unsym_coords = new Coordinate<FloatType>[ nNZ ];
205
206 MMGenerateCOOFromFile( mm_file, explicit_zeroes );
207 ::fclose( mm_file );
208
209 return 0;
210}
211
212template<typename FloatType>
213void FillCoordData( char Typecode[ ],

Callers 2

cooMatrixfromFileFunction · 0.45
csrMatrixfromFileFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected