Loading src/libnptm/file_io.cpp +18 −6 Original line number Diff line number Diff line Loading @@ -94,7 +94,7 @@ HDFFile* HDFFile::from_schema( herr_t status; string *rec_types = schema.get_record_types(); string *rec_names = schema.get_record_names(); string known_types[] = {"INT32", "FLOAT64", "COMPLEX128"}; string known_types[] = {"INT32", "FLOAT64", "COMPLEX128", "INT64", "INT16"}; int rec_num = schema.get_record_number(); regex re; smatch m; Loading @@ -113,8 +113,10 @@ HDFFile* HDFFile::from_schema( if (type_index == 1) data_type = H5Tcopy(H5T_NATIVE_INT); else if (type_index == 2) data_type = H5Tcopy(H5T_NATIVE_DOUBLE); else if (type_index == 3) data_type = H5Tcopy(H5T_NATIVE_DOUBLE); else if (type_index == 4) data_type = H5Tcopy(H5T_NATIVE_LONG); else if (type_index == 5) data_type = H5Tcopy(H5T_NATIVE_SHORT); } if (type_index == 3) break; if (type_index == 5) break; } if (found_type) { re = regex("[0-9]+"); Loading Loading @@ -161,7 +163,7 @@ herr_t HDFFile::read( hid_t mem_space_id, hid_t file_space_id, hid_t dapl_id, hid_t dxpl_id ) { string known_types[] = {"INT32", "FLOAT64"}; string known_types[] = {"INT32", "FLOAT64", "COMPLEX128", "INT64", "INT16"}; regex re; smatch m; bool found_type = false; Loading @@ -169,7 +171,7 @@ herr_t HDFFile::read( while (!found_type) { re = regex(known_types[type_index++]); found_type = regex_search(data_type, m, re); if (type_index == 2) break; if (type_index == 5) break; } if (found_type) { hid_t dataset_id = H5Dopen2(file_id, dataset_name.c_str(), dapl_id); Loading @@ -179,6 +181,12 @@ herr_t HDFFile::read( mem_type_id = H5T_NATIVE_INT; break; case 2: mem_type_id = H5T_NATIVE_DOUBLE; break; case 3: mem_type_id = H5T_NATIVE_DOUBLE; break; case 4: mem_type_id = H5T_NATIVE_LONG; break; case 5: mem_type_id = H5T_NATIVE_SHORT; break; default: throw UnrecognizedParameterException("unrecognized data type \"" + data_type + "\""); } Loading @@ -200,7 +208,7 @@ herr_t HDFFile::write( hid_t mem_space_id, hid_t file_space_id, hid_t dapl_id, hid_t dxpl_id ) { string known_types[] = {"INT32", "FLOAT64", "COMPLEX128"}; string known_types[] = {"INT32", "FLOAT64", "COMPLEX128", "INT64", "INT16"}; regex re; smatch m; bool found_type = false; Loading @@ -208,7 +216,7 @@ herr_t HDFFile::write( while (!found_type) { re = regex(known_types[type_index++]); found_type = regex_search(data_type, m, re); if (type_index == 3) break; if (type_index == 5) break; } if (found_type) { hid_t dataset_id = H5Dopen2(file_id, dataset_name.c_str(), dapl_id); Loading @@ -220,6 +228,10 @@ herr_t HDFFile::write( mem_type_id = H5T_NATIVE_DOUBLE; break; case 3: mem_type_id = H5T_NATIVE_DOUBLE; break; case 4: mem_type_id = H5T_NATIVE_LONG; break; case 5: mem_type_id = H5T_NATIVE_SHORT; break; default: throw UnrecognizedParameterException("unrecognized data type \"" + data_type + "\""); } Loading Loading
src/libnptm/file_io.cpp +18 −6 Original line number Diff line number Diff line Loading @@ -94,7 +94,7 @@ HDFFile* HDFFile::from_schema( herr_t status; string *rec_types = schema.get_record_types(); string *rec_names = schema.get_record_names(); string known_types[] = {"INT32", "FLOAT64", "COMPLEX128"}; string known_types[] = {"INT32", "FLOAT64", "COMPLEX128", "INT64", "INT16"}; int rec_num = schema.get_record_number(); regex re; smatch m; Loading @@ -113,8 +113,10 @@ HDFFile* HDFFile::from_schema( if (type_index == 1) data_type = H5Tcopy(H5T_NATIVE_INT); else if (type_index == 2) data_type = H5Tcopy(H5T_NATIVE_DOUBLE); else if (type_index == 3) data_type = H5Tcopy(H5T_NATIVE_DOUBLE); else if (type_index == 4) data_type = H5Tcopy(H5T_NATIVE_LONG); else if (type_index == 5) data_type = H5Tcopy(H5T_NATIVE_SHORT); } if (type_index == 3) break; if (type_index == 5) break; } if (found_type) { re = regex("[0-9]+"); Loading Loading @@ -161,7 +163,7 @@ herr_t HDFFile::read( hid_t mem_space_id, hid_t file_space_id, hid_t dapl_id, hid_t dxpl_id ) { string known_types[] = {"INT32", "FLOAT64"}; string known_types[] = {"INT32", "FLOAT64", "COMPLEX128", "INT64", "INT16"}; regex re; smatch m; bool found_type = false; Loading @@ -169,7 +171,7 @@ herr_t HDFFile::read( while (!found_type) { re = regex(known_types[type_index++]); found_type = regex_search(data_type, m, re); if (type_index == 2) break; if (type_index == 5) break; } if (found_type) { hid_t dataset_id = H5Dopen2(file_id, dataset_name.c_str(), dapl_id); Loading @@ -179,6 +181,12 @@ herr_t HDFFile::read( mem_type_id = H5T_NATIVE_INT; break; case 2: mem_type_id = H5T_NATIVE_DOUBLE; break; case 3: mem_type_id = H5T_NATIVE_DOUBLE; break; case 4: mem_type_id = H5T_NATIVE_LONG; break; case 5: mem_type_id = H5T_NATIVE_SHORT; break; default: throw UnrecognizedParameterException("unrecognized data type \"" + data_type + "\""); } Loading @@ -200,7 +208,7 @@ herr_t HDFFile::write( hid_t mem_space_id, hid_t file_space_id, hid_t dapl_id, hid_t dxpl_id ) { string known_types[] = {"INT32", "FLOAT64", "COMPLEX128"}; string known_types[] = {"INT32", "FLOAT64", "COMPLEX128", "INT64", "INT16"}; regex re; smatch m; bool found_type = false; Loading @@ -208,7 +216,7 @@ herr_t HDFFile::write( while (!found_type) { re = regex(known_types[type_index++]); found_type = regex_search(data_type, m, re); if (type_index == 3) break; if (type_index == 5) break; } if (found_type) { hid_t dataset_id = H5Dopen2(file_id, dataset_name.c_str(), dapl_id); Loading @@ -220,6 +228,10 @@ herr_t HDFFile::write( mem_type_id = H5T_NATIVE_DOUBLE; break; case 3: mem_type_id = H5T_NATIVE_DOUBLE; break; case 4: mem_type_id = H5T_NATIVE_LONG; break; case 5: mem_type_id = H5T_NATIVE_SHORT; break; default: throw UnrecognizedParameterException("unrecognized data type \"" + data_type + "\""); } Loading