| 199 | |
| 200 | template<typename FloatType> |
| 201 | bool 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 | |
| 227 | template<typename FloatType> |
| 228 | void FillCoordData( char Typecode[ ], |
no outgoing calls
no test coverage detected