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

Method MMReadFormat

src/library/io/mm-reader.cpp:201–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199
200template<typename FloatType>
201bool MatrixMarketReader<FloatType>::MMReadFormat( const std::string &filename, cl_bool read_explicit_zeroes )
202{
203 FILE *mm_file = ::fopen( filename.c_str( ), "r" );
204 if( mm_file == NULL )
205 {
206 printf( "Cannot Open Matrix-Market File !\n" );
207 return 1;
208 }
209
210 if ( MMReadHeader( mm_file ) )
211 {
212 printf ("Matrix not supported !\n");
213 return 2;
214 }
215
216 if( mm_is_symmetric( Typecode ) )
217 unsym_coords = new Coordinate<FloatType>[ 2 * nNZ ];
218 else
219 unsym_coords = new Coordinate<FloatType>[ nNZ ];
220
221 MMGenerateCOOFromFile( mm_file, read_explicit_zeroes );
222 ::fclose( mm_file );
223
224 return 0;
225}
226
227template<typename FloatType>
228void FillCoordData( char Typecode[ ],

Callers 4

Calls

no outgoing calls

Tested by

no test coverage detected