@@ -1062,7 +1062,7 @@ diskio::save_coord_ascii(const Mat<eT>& x, std::ostream& f)
10621062 f.put (' \n ' );
10631063 }
10641064
1065- // make sure it's possible to figure out the matrix size later
1065+ // make sure it's possible to determine the matrix size
10661066 if ( (x.n_rows > 0 ) && (x.n_cols > 0 ) )
10671067 {
10681068 const uword max_row = (x.n_rows > 0 ) ? x.n_rows -1 : 0 ;
@@ -1125,7 +1125,7 @@ diskio::save_coord_ascii(const Mat< std::complex<T> >& x, std::ostream& f)
11251125 f.put (' \n ' );
11261126 }
11271127
1128- // make sure it's possible to figure out the matrix size later
1128+ // make sure it's possible to determine the matrix size
11291129 if ( (x.n_rows > 0 ) && (x.n_cols > 0 ) )
11301130 {
11311131 const uword max_row = (x.n_rows > 0 ) ? x.n_rows -1 : 0 ;
@@ -1319,8 +1319,8 @@ diskio::save_hdf5_binary(const Mat<eT>& x, const hdf5_name& spec, std::string& e
13191319 hid_t dataspace = H5Screate_simple (2 , dims, NULL ); // treat the matrix as a 2d array dataspace
13201320 hid_t datatype = hdf5_misc::get_hdf5_type<eT>();
13211321
1322- // If this returned something invalid, well, it's time to crash.
1323- arma_check (datatype == -1 , " Mat::save(): unknown datatype for HDF5" );
1322+ // fail if we can't handle the datatype
1323+ if (datatype == -1 ) { err_msg = " unknown datatype for HDF5" ; return false ; }
13241324
13251325 // MATLAB forces the users to specify a name at save time for HDF5;
13261326 // Octave will use the default of 'dataset' unless otherwise specified.
@@ -3065,7 +3065,7 @@ diskio::save_coord_ascii(const SpMat<eT>& x, std::ostream& f)
30653065 }
30663066
30673067
3068- // make sure it's possible to figure out the matrix size later
3068+ // make sure it's possible to determine the matrix size
30693069 if ( (x.n_rows > 0 ) && (x.n_cols > 0 ) )
30703070 {
30713071 const uword max_row = (x.n_rows > 0 ) ? x.n_rows -1 : 0 ;
@@ -3128,7 +3128,7 @@ diskio::save_coord_ascii(const SpMat< std::complex<T> >& x, std::ostream& f)
31283128 f.put (' \n ' );
31293129 }
31303130
3131- // make sure it's possible to figure out the matrix size later
3131+ // make sure it's possible to determine the matrix size
31323132 if ( (x.n_rows > 0 ) && (x.n_cols > 0 ) )
31333133 {
31343134 const uword max_row = (x.n_rows > 0 ) ? x.n_rows -1 : 0 ;
@@ -4016,8 +4016,8 @@ diskio::save_hdf5_binary(const Cube<eT>& x, const hdf5_name& spec, std::string&
40164016 hid_t dataspace = H5Screate_simple (3 , dims, NULL ); // treat the cube as a 3d array dataspace
40174017 hid_t datatype = hdf5_misc::get_hdf5_type<eT>();
40184018
4019- // If this returned something invalid, well, it's time to crash.
4020- arma_check (datatype == -1 , " Cube::save(): unknown datatype for HDF5" );
4019+ // fail if we can't handle the datatype
4020+ if (datatype == -1 ) { err_msg = " unknown datatype for HDF5" ; return false ; }
40214021
40224022 // MATLAB forces the users to specify a name at save time for HDF5;
40234023 // Octave will use the default of 'dataset' unless otherwise specified.
0 commit comments