| 184 | |
| 185 | template<typename FloatType> |
| 186 | bool 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 | |
| 212 | template<typename FloatType> |
| 213 | void FillCoordData( char Typecode[ ], |
no outgoing calls
no test coverage detected