| diskio_meat.hpp | | diskio_meat.hpp | |
| | | | |
| skipping to change at line 61 | | skipping to change at line 61 | |
| else | | else | |
| if(is_u32<eT>::value == true) | | if(is_u32<eT>::value == true) | |
| { | | { | |
| return std::string("ARMA_MAT_TXT_IU004"); | | return std::string("ARMA_MAT_TXT_IU004"); | |
| } | | } | |
| else | | else | |
| if(is_s32<eT>::value == true) | | if(is_s32<eT>::value == true) | |
| { | | { | |
| return std::string("ARMA_MAT_TXT_IS004"); | | return std::string("ARMA_MAT_TXT_IS004"); | |
| } | | } | |
|
| #if defined(ARMA_64BIT_WORD) | | #if defined(ARMA_USE_U64S64) | |
| else | | else | |
| if(is_u64<eT>::value == true) | | if(is_u64<eT>::value == true) | |
| { | | { | |
| return std::string("ARMA_MAT_TXT_IU008"); | | return std::string("ARMA_MAT_TXT_IU008"); | |
| } | | } | |
| else | | else | |
| if(is_s64<eT>::value == true) | | if(is_s64<eT>::value == true) | |
| { | | { | |
| return std::string("ARMA_MAT_TXT_IS008"); | | return std::string("ARMA_MAT_TXT_IS008"); | |
| } | | } | |
| #endif | | #endif | |
|
| | | #if defined(ARMA_ALLOW_LONG) | |
| | | else | |
| | | if(is_ulng_t_32<eT>::value == true) | |
| | | { | |
| | | return std::string("ARMA_MAT_TXT_IU004"); | |
| | | } | |
| | | else | |
| | | if(is_slng_t_32<eT>::value == true) | |
| | | { | |
| | | return std::string("ARMA_MAT_TXT_IS004"); | |
| | | } | |
| | | else | |
| | | if(is_ulng_t_64<eT>::value == true) | |
| | | { | |
| | | return std::string("ARMA_MAT_TXT_IU008"); | |
| | | } | |
| | | else | |
| | | if(is_slng_t_64<eT>::value == true) | |
| | | { | |
| | | return std::string("ARMA_MAT_TXT_IS008"); | |
| | | } | |
| | | #endif | |
| else | | else | |
| if(is_float<eT>::value == true) | | if(is_float<eT>::value == true) | |
| { | | { | |
| return std::string("ARMA_MAT_TXT_FN004"); | | return std::string("ARMA_MAT_TXT_FN004"); | |
| } | | } | |
| else | | else | |
| if(is_double<eT>::value == true) | | if(is_double<eT>::value == true) | |
| { | | { | |
| return std::string("ARMA_MAT_TXT_FN008"); | | return std::string("ARMA_MAT_TXT_FN008"); | |
| } | | } | |
| | | | |
| skipping to change at line 143 | | skipping to change at line 165 | |
| else | | else | |
| if(is_u32<eT>::value == true) | | if(is_u32<eT>::value == true) | |
| { | | { | |
| return std::string("ARMA_MAT_BIN_IU004"); | | return std::string("ARMA_MAT_BIN_IU004"); | |
| } | | } | |
| else | | else | |
| if(is_s32<eT>::value == true) | | if(is_s32<eT>::value == true) | |
| { | | { | |
| return std::string("ARMA_MAT_BIN_IS004"); | | return std::string("ARMA_MAT_BIN_IS004"); | |
| } | | } | |
|
| #if defined(ARMA_64BIT_WORD) | | #if defined(ARMA_USE_U64S64) | |
| else | | else | |
| if(is_u64<eT>::value == true) | | if(is_u64<eT>::value == true) | |
| { | | { | |
| return std::string("ARMA_MAT_BIN_IU008"); | | return std::string("ARMA_MAT_BIN_IU008"); | |
| } | | } | |
| else | | else | |
| if(is_s64<eT>::value == true) | | if(is_s64<eT>::value == true) | |
| { | | { | |
| return std::string("ARMA_MAT_BIN_IS008"); | | return std::string("ARMA_MAT_BIN_IS008"); | |
| } | | } | |
| #endif | | #endif | |
|
| | | #if defined(ARMA_ALLOW_LONG) | |
| | | else | |
| | | if(is_ulng_t_32<eT>::value == true) | |
| | | { | |
| | | return std::string("ARMA_MAT_BIN_IU004"); | |
| | | } | |
| | | else | |
| | | if(is_slng_t_32<eT>::value == true) | |
| | | { | |
| | | return std::string("ARMA_MAT_BIN_IS004"); | |
| | | } | |
| | | else | |
| | | if(is_ulng_t_64<eT>::value == true) | |
| | | { | |
| | | return std::string("ARMA_MAT_BIN_IU008"); | |
| | | } | |
| | | else | |
| | | if(is_slng_t_64<eT>::value == true) | |
| | | { | |
| | | return std::string("ARMA_MAT_BIN_IS008"); | |
| | | } | |
| | | #endif | |
| else | | else | |
| if(is_float<eT>::value == true) | | if(is_float<eT>::value == true) | |
| { | | { | |
| return std::string("ARMA_MAT_BIN_FN004"); | | return std::string("ARMA_MAT_BIN_FN004"); | |
| } | | } | |
| else | | else | |
| if(is_double<eT>::value == true) | | if(is_double<eT>::value == true) | |
| { | | { | |
| return std::string("ARMA_MAT_BIN_FN008"); | | return std::string("ARMA_MAT_BIN_FN008"); | |
| } | | } | |
| | | | |
| skipping to change at line 225 | | skipping to change at line 269 | |
| else | | else | |
| if(is_u32<eT>::value == true) | | if(is_u32<eT>::value == true) | |
| { | | { | |
| return std::string("ARMA_SPM_BIN_IU004"); | | return std::string("ARMA_SPM_BIN_IU004"); | |
| } | | } | |
| else | | else | |
| if(is_s32<eT>::value == true) | | if(is_s32<eT>::value == true) | |
| { | | { | |
| return std::string("ARMA_SPM_BIN_IS004"); | | return std::string("ARMA_SPM_BIN_IS004"); | |
| } | | } | |
|
| #if defined(ARMA_64BIT_WORD) | | #if defined(ARMA_USE_U64S64) | |
| else | | else | |
| if(is_u64<eT>::value == true) | | if(is_u64<eT>::value == true) | |
| { | | { | |
| return std::string("ARMA_SPM_BIN_IU008"); | | return std::string("ARMA_SPM_BIN_IU008"); | |
| } | | } | |
| else | | else | |
| if(is_s64<eT>::value == true) | | if(is_s64<eT>::value == true) | |
| { | | { | |
| return std::string("ARMA_SPM_BIN_IS008"); | | return std::string("ARMA_SPM_BIN_IS008"); | |
| } | | } | |
| #endif | | #endif | |
|
| | | #if defined(ARMA_ALLOW_LONG) | |
| | | else | |
| | | if(is_ulng_t_32<eT>::value == true) | |
| | | { | |
| | | return std::string("ARMA_SPM_BIN_IU004"); | |
| | | } | |
| | | else | |
| | | if(is_slng_t_32<eT>::value == true) | |
| | | { | |
| | | return std::string("ARMA_SPM_BIN_IS004"); | |
| | | } | |
| | | else | |
| | | if(is_ulng_t_64<eT>::value == true) | |
| | | { | |
| | | return std::string("ARMA_SPM_BIN_IU008"); | |
| | | } | |
| | | else | |
| | | if(is_slng_t_64<eT>::value == true) | |
| | | { | |
| | | return std::string("ARMA_SPM_BIN_IS008"); | |
| | | } | |
| | | #endif | |
| else | | else | |
| if(is_float<eT>::value == true) | | if(is_float<eT>::value == true) | |
| { | | { | |
| return std::string("ARMA_SPM_BIN_FN004"); | | return std::string("ARMA_SPM_BIN_FN004"); | |
| } | | } | |
| else | | else | |
| if(is_double<eT>::value == true) | | if(is_double<eT>::value == true) | |
| { | | { | |
| return std::string("ARMA_SPM_BIN_FN008"); | | return std::string("ARMA_SPM_BIN_FN008"); | |
| } | | } | |
| | | | |
| skipping to change at line 307 | | skipping to change at line 373 | |
| else | | else | |
| if(is_u32<eT>::value == true) | | if(is_u32<eT>::value == true) | |
| { | | { | |
| return std::string("ARMA_CUB_TXT_IU004"); | | return std::string("ARMA_CUB_TXT_IU004"); | |
| } | | } | |
| else | | else | |
| if(is_s32<eT>::value == true) | | if(is_s32<eT>::value == true) | |
| { | | { | |
| return std::string("ARMA_CUB_TXT_IS004"); | | return std::string("ARMA_CUB_TXT_IS004"); | |
| } | | } | |
|
| #if defined(ARMA_64BIT_WORD) | | #if defined(ARMA_USE_U64S64) | |
| else | | else | |
| if(is_u64<eT>::value == true) | | if(is_u64<eT>::value == true) | |
| { | | { | |
| return std::string("ARMA_CUB_TXT_IU008"); | | return std::string("ARMA_CUB_TXT_IU008"); | |
| } | | } | |
| else | | else | |
| if(is_s64<eT>::value == true) | | if(is_s64<eT>::value == true) | |
| { | | { | |
| return std::string("ARMA_CUB_TXT_IS008"); | | return std::string("ARMA_CUB_TXT_IS008"); | |
| } | | } | |
| #endif | | #endif | |
|
| | | #if defined(ARMA_ALLOW_LONG) | |
| | | else | |
| | | if(is_ulng_t_32<eT>::value == true) | |
| | | { | |
| | | return std::string("ARMA_CUB_TXT_IU004"); | |
| | | } | |
| | | else | |
| | | if(is_slng_t_32<eT>::value == true) | |
| | | { | |
| | | return std::string("ARMA_CUB_TXT_IS004"); | |
| | | } | |
| | | else | |
| | | if(is_ulng_t_64<eT>::value == true) | |
| | | { | |
| | | return std::string("ARMA_CUB_TXT_IU008"); | |
| | | } | |
| | | else | |
| | | if(is_slng_t_64<eT>::value == true) | |
| | | { | |
| | | return std::string("ARMA_CUB_TXT_IS008"); | |
| | | } | |
| | | #endif | |
| else | | else | |
| if(is_float<eT>::value == true) | | if(is_float<eT>::value == true) | |
| { | | { | |
| return std::string("ARMA_CUB_TXT_FN004"); | | return std::string("ARMA_CUB_TXT_FN004"); | |
| } | | } | |
| else | | else | |
| if(is_double<eT>::value == true) | | if(is_double<eT>::value == true) | |
| { | | { | |
| return std::string("ARMA_CUB_TXT_FN008"); | | return std::string("ARMA_CUB_TXT_FN008"); | |
| } | | } | |
| | | | |
| skipping to change at line 389 | | skipping to change at line 477 | |
| else | | else | |
| if(is_u32<eT>::value == true) | | if(is_u32<eT>::value == true) | |
| { | | { | |
| return std::string("ARMA_CUB_BIN_IU004"); | | return std::string("ARMA_CUB_BIN_IU004"); | |
| } | | } | |
| else | | else | |
| if(is_s32<eT>::value == true) | | if(is_s32<eT>::value == true) | |
| { | | { | |
| return std::string("ARMA_CUB_BIN_IS004"); | | return std::string("ARMA_CUB_BIN_IS004"); | |
| } | | } | |
|
| #if defined(ARMA_64BIT_WORD) | | #if defined(ARMA_USE_U64S64) | |
| else | | else | |
| if(is_u64<eT>::value == true) | | if(is_u64<eT>::value == true) | |
| { | | { | |
| return std::string("ARMA_CUB_BIN_IU008"); | | return std::string("ARMA_CUB_BIN_IU008"); | |
| } | | } | |
| else | | else | |
| if(is_s64<eT>::value == true) | | if(is_s64<eT>::value == true) | |
| { | | { | |
| return std::string("ARMA_CUB_BIN_IS008"); | | return std::string("ARMA_CUB_BIN_IS008"); | |
| } | | } | |
| #endif | | #endif | |
|
| | | #if defined(ARMA_ALLOW_LONG) | |
| | | else | |
| | | if(is_ulng_t_32<eT>::value == true) | |
| | | { | |
| | | return std::string("ARMA_CUB_BIN_IU004"); | |
| | | } | |
| | | else | |
| | | if(is_slng_t_32<eT>::value == true) | |
| | | { | |
| | | return std::string("ARMA_CUB_BIN_IS004"); | |
| | | } | |
| | | else | |
| | | if(is_ulng_t_64<eT>::value == true) | |
| | | { | |
| | | return std::string("ARMA_CUB_BIN_IU008"); | |
| | | } | |
| | | else | |
| | | if(is_slng_t_64<eT>::value == true) | |
| | | { | |
| | | return std::string("ARMA_CUB_BIN_IS008"); | |
| | | } | |
| | | #endif | |
| else | | else | |
| if(is_float<eT>::value == true) | | if(is_float<eT>::value == true) | |
| { | | { | |
| return std::string("ARMA_CUB_BIN_FN004"); | | return std::string("ARMA_CUB_BIN_FN004"); | |
| } | | } | |
| else | | else | |
| if(is_double<eT>::value == true) | | if(is_double<eT>::value == true) | |
| { | | { | |
| return std::string("ARMA_CUB_BIN_FN008"); | | return std::string("ARMA_CUB_BIN_FN008"); | |
| } | | } | |
| | | | |
End of changes. 10 change blocks. |
| 5 lines changed or deleted | | 115 lines changed or added | |
|
| hdf5_misc.hpp | | hdf5_misc.hpp | |
| | | | |
| skipping to change at line 98 | | skipping to change at line 98 | |
| } | | } | |
| | | | |
| template<> | | template<> | |
| inline | | inline | |
| hid_t | | hid_t | |
| get_hdf5_type< unsigned long >() | | get_hdf5_type< unsigned long >() | |
| { | | { | |
| return H5Tcopy(H5T_NATIVE_ULONG); | | return H5Tcopy(H5T_NATIVE_ULONG); | |
| } | | } | |
| | | | |
|
| #if defined(ARMA_64BIT_WORD) | | #if defined(ARMA_USE_U64S64) && defined(ULLONG_MAX) | |
| template<> | | template<> | |
| inline | | inline | |
| hid_t | | hid_t | |
| get_hdf5_type< long long >() | | get_hdf5_type< long long >() | |
| { | | { | |
| return H5Tcopy(H5T_NATIVE_LLONG); | | return H5Tcopy(H5T_NATIVE_LLONG); | |
| } | | } | |
| | | | |
|
| template<> | | template<> | |
| inline | | inline | |
| hid_t | | hid_t | |
| get_hdf5_type< unsigned long long >() | | get_hdf5_type< unsigned long long >() | |
| { | | { | |
| return H5Tcopy(H5T_NATIVE_ULLONG); | | return H5Tcopy(H5T_NATIVE_ULLONG); | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| template<> | | template<> | |
| inline | | inline | |
| hid_t | | hid_t | |
| get_hdf5_type< float >() | | get_hdf5_type< float >() | |
| { | | { | |
| return H5Tcopy(H5T_NATIVE_FLOAT); | | return H5Tcopy(H5T_NATIVE_FLOAT); | |
| } | | } | |
| | | | |
| | | | |
| skipping to change at line 197 | | skipping to change at line 197 | |
| search_type = get_hdf5_type<float>(); | | search_type = get_hdf5_type<float>(); | |
| is_equal = ( H5Tequal(datatype, search_type) > 0 ); | | is_equal = ( H5Tequal(datatype, search_type) > 0 ); | |
| H5Tclose(search_type); | | H5Tclose(search_type); | |
| if (is_equal) { return true; } | | if (is_equal) { return true; } | |
| | | | |
| search_type = get_hdf5_type< std::complex<float> >(); | | search_type = get_hdf5_type< std::complex<float> >(); | |
| is_equal = ( H5Tequal(datatype, search_type) > 0 ); | | is_equal = ( H5Tequal(datatype, search_type) > 0 ); | |
| H5Tclose(search_type); | | H5Tclose(search_type); | |
| if (is_equal) { return true; } | | if (is_equal) { return true; } | |
| | | | |
|
| // remaining supported types: u8, s8, u16, s16, u32, s32, u64, s64 | | // remaining supported types: u8, s8, u16, s16, u32, s32, u64, s64, ulng_
t, slng_t | |
| | | | |
| search_type = get_hdf5_type<u8>(); | | search_type = get_hdf5_type<u8>(); | |
| is_equal = ( H5Tequal(datatype, search_type) > 0 ); | | is_equal = ( H5Tequal(datatype, search_type) > 0 ); | |
| H5Tclose(search_type); | | H5Tclose(search_type); | |
| if (is_equal) { return true; } | | if (is_equal) { return true; } | |
| | | | |
| search_type = get_hdf5_type<s8>(); | | search_type = get_hdf5_type<s8>(); | |
| is_equal = ( H5Tequal(datatype, search_type) > 0 ); | | is_equal = ( H5Tequal(datatype, search_type) > 0 ); | |
| H5Tclose(search_type); | | H5Tclose(search_type); | |
| if (is_equal) { return true; } | | if (is_equal) { return true; } | |
| | | | |
| skipping to change at line 229 | | skipping to change at line 229 | |
| search_type = get_hdf5_type<u32>(); | | search_type = get_hdf5_type<u32>(); | |
| is_equal = ( H5Tequal(datatype, search_type) > 0 ); | | is_equal = ( H5Tequal(datatype, search_type) > 0 ); | |
| H5Tclose(search_type); | | H5Tclose(search_type); | |
| if (is_equal) { return true; } | | if (is_equal) { return true; } | |
| | | | |
| search_type = get_hdf5_type<s32>(); | | search_type = get_hdf5_type<s32>(); | |
| is_equal = ( H5Tequal(datatype, search_type) > 0 ); | | is_equal = ( H5Tequal(datatype, search_type) > 0 ); | |
| H5Tclose(search_type); | | H5Tclose(search_type); | |
| if (is_equal) { return true; } | | if (is_equal) { return true; } | |
| | | | |
|
| #if defined(ARMA_64BIT_WORD) | | #if defined(ARMA_USE_U64S64) | |
| { | | { | |
| search_type = get_hdf5_type<u64>(); | | search_type = get_hdf5_type<u64>(); | |
| is_equal = ( H5Tequal(datatype, search_type) > 0 ); | | is_equal = ( H5Tequal(datatype, search_type) > 0 ); | |
| H5Tclose(search_type); | | H5Tclose(search_type); | |
| if (is_equal) { return true; } | | if (is_equal) { return true; } | |
| | | | |
| search_type = get_hdf5_type<s64>(); | | search_type = get_hdf5_type<s64>(); | |
| is_equal = ( H5Tequal(datatype, search_type) > 0 ); | | is_equal = ( H5Tequal(datatype, search_type) > 0 ); | |
| H5Tclose(search_type); | | H5Tclose(search_type); | |
| if (is_equal) { return true; } | | if (is_equal) { return true; } | |
| } | | } | |
| #endif | | #endif | |
| | | | |
|
| | | #if defined(ARMA_ALLOW_LONG) | |
| | | { | |
| | | search_type = get_hdf5_type<ulng_t>(); | |
| | | is_equal = ( H5Tequal(datatype, search_type) > 0 ); | |
| | | H5Tclose(search_type); | |
| | | if (is_equal) { return true; } | |
| | | | |
| | | search_type = get_hdf5_type<slng_t>(); | |
| | | is_equal = ( H5Tequal(datatype, search_type) > 0 ); | |
| | | H5Tclose(search_type); | |
| | | if (is_equal) { return true; } | |
| | | } | |
| | | #endif | |
| | | | |
| return false; | | return false; | |
| } | | } | |
| | | | |
| //! Auxiliary functions and structs for search_hdf5_file. | | //! Auxiliary functions and structs for search_hdf5_file. | |
| struct hdf5_search_info | | struct hdf5_search_info | |
| { | | { | |
| const std::vector<std::string>& names; | | const std::vector<std::string>& names; | |
| int num_dims; | | int num_dims; | |
| bool exact; | | bool exact; | |
| hid_t best_match; | | hid_t best_match; | |
| | | | |
| skipping to change at line 526 | | skipping to change at line 540 | |
| | | | |
| if(is_equal) | | if(is_equal) | |
| { | | { | |
| Mat<s32> m(n_rows, n_cols); | | Mat<s32> m(n_rows, n_cols); | |
| hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT
, void_ptr(m.memptr())); | | hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT
, void_ptr(m.memptr())); | |
| dest = conv_to< Mat<eT> >::from(m); // Convert. | | dest = conv_to< Mat<eT> >::from(m); // Convert. | |
| | | | |
| return status; | | return status; | |
| } | | } | |
| | | | |
|
| #if defined(ARMA_64BIT_WORD) | | #if defined(ARMA_USE_U64S64) | |
| { | | { | |
| // u64 | | // u64 | |
| search_type = get_hdf5_type<u64>(); | | search_type = get_hdf5_type<u64>(); | |
| is_equal = (H5Tequal(datatype, search_type) > 0); | | is_equal = (H5Tequal(datatype, search_type) > 0); | |
| H5Tclose(search_type); | | H5Tclose(search_type); | |
| | | | |
| if(is_equal) | | if(is_equal) | |
| { | | { | |
| Mat<u64> m(n_rows, n_cols); | | Mat<u64> m(n_rows, n_cols); | |
| hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAU
LT, void_ptr(m.memptr())); | | hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAU
LT, void_ptr(m.memptr())); | |
| | | | |
| skipping to change at line 558 | | skipping to change at line 572 | |
| { | | { | |
| Mat<s64> m(n_rows, n_cols); | | Mat<s64> m(n_rows, n_cols); | |
| hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAU
LT, void_ptr(m.memptr())); | | hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAU
LT, void_ptr(m.memptr())); | |
| dest = conv_to< Mat<eT> >::from(m); // Convert. | | dest = conv_to< Mat<eT> >::from(m); // Convert. | |
| | | | |
| return status; | | return status; | |
| } | | } | |
| } | | } | |
| #endif | | #endif | |
| | | | |
|
| | | #if defined(ARMA_ALLOW_LONG) | |
| | | { | |
| | | // ulng_t | |
| | | search_type = get_hdf5_type<ulng_t>(); | |
| | | is_equal = (H5Tequal(datatype, search_type) > 0); | |
| | | H5Tclose(search_type); | |
| | | | |
| | | if(is_equal) | |
| | | { | |
| | | Mat<ulng_t> m(n_rows, n_cols); | |
| | | hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAU | |
| | | LT, void_ptr(m.memptr())); | |
| | | dest = conv_to< Mat<eT> >::from(m); // Convert. | |
| | | | |
| | | return status; | |
| | | } | |
| | | | |
| | | // slng_t | |
| | | search_type = get_hdf5_type<slng_t>(); | |
| | | is_equal = (H5Tequal(datatype, search_type) > 0); | |
| | | H5Tclose(search_type); | |
| | | | |
| | | if(is_equal) | |
| | | { | |
| | | Mat<slng_t> m(n_rows, n_cols); | |
| | | hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAU | |
| | | LT, void_ptr(m.memptr())); | |
| | | dest = conv_to< Mat<eT> >::from(m); // Convert. | |
| | | | |
| | | return status; | |
| | | } | |
| | | } | |
| | | #endif | |
| | | | |
| // float | | // float | |
| search_type = get_hdf5_type<float>(); | | search_type = get_hdf5_type<float>(); | |
| is_equal = (H5Tequal(datatype, search_type) > 0); | | is_equal = (H5Tequal(datatype, search_type) > 0); | |
| H5Tclose(search_type); | | H5Tclose(search_type); | |
| | | | |
| if(is_equal) | | if(is_equal) | |
| { | | { | |
| Mat<float> m(n_rows, n_cols); | | Mat<float> m(n_rows, n_cols); | |
| hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT
, void_ptr(m.memptr())); | | hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT
, void_ptr(m.memptr())); | |
| dest = conv_to< Mat<eT> >::from(m); // Convert. | | dest = conv_to< Mat<eT> >::from(m); // Convert. | |
| | | | |
End of changes. 7 change blocks. |
| 18 lines changed or deleted | | 66 lines changed or added | |
|
| promote_type.hpp | | promote_type.hpp | |
|
| // Copyright (C) 2009-2011 NICTA (www.nicta.com.au) | | // Copyright (C) 2009-2013 NICTA (www.nicta.com.au) | |
| // Copyright (C) 2009-2011 Conrad Sanderson | | // Copyright (C) 2009-2013 Conrad Sanderson | |
| // | | // | |
| // This file is part of the Armadillo C++ library. | | // This file is part of the Armadillo C++ library. | |
| // It is provided without any warranty of fitness | | // It is provided without any warranty of fitness | |
| // for any purpose. You can redistribute this file | | // for any purpose. You can redistribute this file | |
| // and/or modify it under the terms of the GNU | | // and/or modify it under the terms of the GNU | |
| // Lesser General Public License (LGPL) as published | | // Lesser General Public License (LGPL) as published | |
| // by the Free Software Foundation, either version 3 | | // by the Free Software Foundation, either version 3 | |
| // of the License or (at your option) any later version. | | // of the License or (at your option) any later version. | |
| // (see http://www.opensource.org/licenses for more info) | | // (see http://www.opensource.org/licenses for more info) | |
| | | | |
| | | | |
| skipping to change at line 35 | | skipping to change at line 35 | |
| static const bool value = true; | | static const bool value = true; | |
| }; | | }; | |
| | | | |
| template<typename T> struct is_promotable<T, T> : public is_p
romotable_ok { typedef T result; }; | | template<typename T> struct is_promotable<T, T> : public is_p
romotable_ok { typedef T result; }; | |
| template<typename T> struct is_promotable<std::complex<T>, T> : public is_p
romotable_ok { typedef std::complex<T> result; }; | | template<typename T> struct is_promotable<std::complex<T>, T> : public is_p
romotable_ok { typedef std::complex<T> result; }; | |
| | | | |
| template<> struct is_promotable<std::complex<double>, std::complex<float> >
: public is_promotable_ok { typedef std::complex<double> result; }; | | template<> struct is_promotable<std::complex<double>, std::complex<float> >
: public is_promotable_ok { typedef std::complex<double> result; }; | |
| template<> struct is_promotable<std::complex<double>, float>
: public is_promotable_ok { typedef std::complex<double> result; }; | | template<> struct is_promotable<std::complex<double>, float>
: public is_promotable_ok { typedef std::complex<double> result; }; | |
| template<> struct is_promotable<std::complex<float>, double>
: public is_promotable_ok { typedef std::complex<double> result; }; | | template<> struct is_promotable<std::complex<float>, double>
: public is_promotable_ok { typedef std::complex<double> result; }; | |
| | | | |
|
| #if defined(ARMA_64BIT_WORD) | | #if defined(ARMA_USE_U64S64) | |
| template<typename t> struct is_promotable<std::complex<t>, u64> : public is | | template<typename t> struct is_promotable<std::complex<t>, u64> : public | |
| _promotable_ok { typedef std::complex<t> result; }; | | is_promotable_ok { typedef std::complex<t> result; }; | |
| template<typename t> struct is_promotable<std::complex<t>, s64> : public is | | template<typename t> struct is_promotable<std::complex<t>, s64> : public | |
| _promotable_ok { typedef std::complex<t> result; }; | | is_promotable_ok { typedef std::complex<t> result; }; | |
| #endif | | #endif | |
| template<typename T> struct is_promotable<std::complex<T>, s32> : public is | | #if defined(ARMA_ALLOW_LONG) | |
| _promotable_ok { typedef std::complex<T> result; }; | | template<typename t> struct is_promotable<std::complex<t>, ulng_t> : public | |
| template<typename T> struct is_promotable<std::complex<T>, u32> : public is | | is_promotable_ok { typedef std::complex<t> result; }; | |
| _promotable_ok { typedef std::complex<T> result; }; | | template<typename t> struct is_promotable<std::complex<t>, slng_t> : public | |
| template<typename T> struct is_promotable<std::complex<T>, s16> : public is | | is_promotable_ok { typedef std::complex<t> result; }; | |
| _promotable_ok { typedef std::complex<T> result; }; | | #endif | |
| template<typename T> struct is_promotable<std::complex<T>, u16> : public is | | template<typename T> struct is_promotable<std::complex<T>, s32> : public | |
| _promotable_ok { typedef std::complex<T> result; }; | | is_promotable_ok { typedef std::complex<T> result; }; | |
| template<typename T> struct is_promotable<std::complex<T>, s8> : public is | | template<typename T> struct is_promotable<std::complex<T>, u32> : public | |
| _promotable_ok { typedef std::complex<T> result; }; | | is_promotable_ok { typedef std::complex<T> result; }; | |
| template<typename T> struct is_promotable<std::complex<T>, u8> : public is | | template<typename T> struct is_promotable<std::complex<T>, s16> : public | |
| _promotable_ok { typedef std::complex<T> result; }; | | is_promotable_ok { typedef std::complex<T> result; }; | |
| | | template<typename T> struct is_promotable<std::complex<T>, u16> : public | |
| template<> struct is_promotable<double, float> : public is_promotable_ok { | | is_promotable_ok { typedef std::complex<T> result; }; | |
| typedef double result; }; | | template<typename T> struct is_promotable<std::complex<T>, s8> : public | |
| #if defined(ARMA_64BIT_WORD) | | is_promotable_ok { typedef std::complex<T> result; }; | |
| template<> struct is_promotable<double, s64 > : public is_promotable_ok { | | template<typename T> struct is_promotable<std::complex<T>, u8> : public | |
| typedef double result; }; | | is_promotable_ok { typedef std::complex<T> result; }; | |
| template<> struct is_promotable<double, u64 > : public is_promotable_ok { | | | |
| typedef double result; }; | | template<> struct is_promotable<double, float > : public is_promotable_ok { | |
| #endif | | typedef double result; }; | |
| template<> struct is_promotable<double, s32 > : public is_promotable_ok { | | #if defined(ARMA_USE_U64S64) | |
| typedef double result; }; | | template<> struct is_promotable<double, s64 > : public is_promotable_ok { | |
| template<> struct is_promotable<double, u32 > : public is_promotable_ok { | | typedef double result; }; | |
| typedef double result; }; | | template<> struct is_promotable<double, u64 > : public is_promotable_ok { | |
| template<> struct is_promotable<double, s16 > : public is_promotable_ok { | | typedef double result; }; | |
| typedef double result; }; | | #endif | |
| template<> struct is_promotable<double, u16 > : public is_promotable_ok { | | #if defined(ARMA_ALLOW_LONG) | |
| typedef double result; }; | | template<> struct is_promotable<double, slng_t> : public is_promotable_ok { | |
| template<> struct is_promotable<double, s8 > : public is_promotable_ok { | | typedef double result; }; | |
| typedef double result; }; | | template<> struct is_promotable<double, ulng_t> : public is_promotable_ok { | |
| template<> struct is_promotable<double, u8 > : public is_promotable_ok { | | typedef double result; }; | |
| typedef double result; }; | | #endif | |
| | | template<> struct is_promotable<double, s32 > : public is_promotable_ok { | |
| #if defined(ARMA_64BIT_WORD) | | typedef double result; }; | |
| template<> struct is_promotable<float, s64> : public is_promotable_ok { typ | | template<> struct is_promotable<double, u32 > : public is_promotable_ok { | |
| edef float result; }; | | typedef double result; }; | |
| template<> struct is_promotable<float, u64> : public is_promotable_ok { typ | | template<> struct is_promotable<double, s16 > : public is_promotable_ok { | |
| edef float result; }; | | typedef double result; }; | |
| #endif | | template<> struct is_promotable<double, u16 > : public is_promotable_ok { | |
| template<> struct is_promotable<float, s32> : public is_promotable_ok { typ | | typedef double result; }; | |
| edef float result; }; | | template<> struct is_promotable<double, s8 > : public is_promotable_ok { | |
| template<> struct is_promotable<float, u32> : public is_promotable_ok { typ | | typedef double result; }; | |
| edef float result; }; | | template<> struct is_promotable<double, u8 > : public is_promotable_ok { | |
| template<> struct is_promotable<float, s16> : public is_promotable_ok { typ | | typedef double result; }; | |
| edef float result; }; | | | |
| template<> struct is_promotable<float, u16> : public is_promotable_ok { typ | | #if defined(ARMA_USE_U64S64) | |
| edef float result; }; | | template<> struct is_promotable<float, s64 > : public is_promotable_ok { | |
| template<> struct is_promotable<float, s8 > : public is_promotable_ok { typ | | typedef float result; }; | |
| edef float result; }; | | template<> struct is_promotable<float, u64 > : public is_promotable_ok { | |
| template<> struct is_promotable<float, u8 > : public is_promotable_ok { typ | | typedef float result; }; | |
| edef float result; }; | | #endif | |
| | | #if defined(ARMA_ALLOW_LONG) | |
| | | template<> struct is_promotable<float, slng_t> : public is_promotable_ok { | |
| | | typedef float result; }; | |
| | | template<> struct is_promotable<float, ulng_t> : public is_promotable_ok { | |
| | | typedef float result; }; | |
| | | #endif | |
| | | template<> struct is_promotable<float, s32 > : public is_promotable_ok { | |
| | | typedef float result; }; | |
| | | template<> struct is_promotable<float, u32 > : public is_promotable_ok { | |
| | | typedef float result; }; | |
| | | template<> struct is_promotable<float, s16 > : public is_promotable_ok { | |
| | | typedef float result; }; | |
| | | template<> struct is_promotable<float, u16 > : public is_promotable_ok { | |
| | | typedef float result; }; | |
| | | template<> struct is_promotable<float, s8 > : public is_promotable_ok { | |
| | | typedef float result; }; | |
| | | template<> struct is_promotable<float, u8 > : public is_promotable_ok { | |
| | | typedef float result; }; | |
| | | | |
|
| #if defined(ARMA_64BIT_WORD) | | #if defined(ARMA_USE_U64S64) | |
| template<> struct is_promotable<u64, u32> : public is_promotable_ok { typed
ef u64 result; }; | | template<> struct is_promotable<u64, u32> : public is_promotable_ok { typed
ef u64 result; }; | |
| template<> struct is_promotable<u64, u16> : public is_promotable_ok { typed
ef u64 result; }; | | template<> struct is_promotable<u64, u16> : public is_promotable_ok { typed
ef u64 result; }; | |
| template<> struct is_promotable<u64, u8 > : public is_promotable_ok { typed
ef u64 result; }; | | template<> struct is_promotable<u64, u8 > : public is_promotable_ok { typed
ef u64 result; }; | |
| #endif | | #endif | |
| | | | |
|
| #if defined(ARMA_64BIT_WORD) | | #if defined(ARMA_USE_U64S64) | |
| template<> struct is_promotable<s64, u64> : public is_promotable_ok { typed
ef s64 result; }; // float ? | | template<> struct is_promotable<s64, u64> : public is_promotable_ok { typed
ef s64 result; }; // float ? | |
| template<> struct is_promotable<s64, u32> : public is_promotable_ok { typed
ef s64 result; }; | | template<> struct is_promotable<s64, u32> : public is_promotable_ok { typed
ef s64 result; }; | |
| template<> struct is_promotable<s64, s32> : public is_promotable_ok { typed
ef s64 result; }; | | template<> struct is_promotable<s64, s32> : public is_promotable_ok { typed
ef s64 result; }; | |
| template<> struct is_promotable<s64, s16> : public is_promotable_ok { typed
ef s64 result; }; | | template<> struct is_promotable<s64, s16> : public is_promotable_ok { typed
ef s64 result; }; | |
| template<> struct is_promotable<s64, u16> : public is_promotable_ok { typed
ef s64 result; }; | | template<> struct is_promotable<s64, u16> : public is_promotable_ok { typed
ef s64 result; }; | |
| template<> struct is_promotable<s64, s8 > : public is_promotable_ok { typed
ef s64 result; }; | | template<> struct is_promotable<s64, s8 > : public is_promotable_ok { typed
ef s64 result; }; | |
| template<> struct is_promotable<s64, u8 > : public is_promotable_ok { typed
ef s64 result; }; | | template<> struct is_promotable<s64, u8 > : public is_promotable_ok { typed
ef s64 result; }; | |
| #endif | | #endif | |
| | | | |
| template<> struct is_promotable<s32, u32> : public is_promotable_ok { typed
ef s32 result; }; // float ? | | template<> struct is_promotable<s32, u32> : public is_promotable_ok { typed
ef s32 result; }; // float ? | |
| | | | |
| skipping to change at line 114 | | skipping to change at line 126 | |
| | | | |
| // | | // | |
| // mirrored versions | | // mirrored versions | |
| | | | |
| template<typename T> struct is_promotable<T, std::complex<T> > : public is_
promotable_ok { typedef std::complex<T> result; }; | | template<typename T> struct is_promotable<T, std::complex<T> > : public is_
promotable_ok { typedef std::complex<T> result; }; | |
| | | | |
| template<> struct is_promotable<std::complex<float>, std::complex<double> >
: public is_promotable_ok { typedef std::complex<double> result; }; | | template<> struct is_promotable<std::complex<float>, std::complex<double> >
: public is_promotable_ok { typedef std::complex<double> result; }; | |
| template<> struct is_promotable<float, std::complex<double> >
: public is_promotable_ok { typedef std::complex<double> result; }; | | template<> struct is_promotable<float, std::complex<double> >
: public is_promotable_ok { typedef std::complex<double> result; }; | |
| template<> struct is_promotable<double, std::complex<float> >
: public is_promotable_ok { typedef std::complex<double> result; }; | | template<> struct is_promotable<double, std::complex<float> >
: public is_promotable_ok { typedef std::complex<double> result; }; | |
| | | | |
|
| #if defined(ARMA_64BIT_WORD) | | #if defined(ARMA_USE_U64S64) | |
| template<typename T> struct is_promotable<s64, std::complex<T> > : public i | | template<typename T> struct is_promotable<s64, std::complex<T> > : publi | |
| s_promotable_ok { typedef std::complex<T> result; }; | | c is_promotable_ok { typedef std::complex<T> result; }; | |
| template<typename T> struct is_promotable<u64, std::complex<T> > : public i | | template<typename T> struct is_promotable<u64, std::complex<T> > : publi | |
| s_promotable_ok { typedef std::complex<T> result; }; | | c is_promotable_ok { typedef std::complex<T> result; }; | |
| #endif | | #endif | |
| template<typename T> struct is_promotable<s32, std::complex<T> > : public i | | #if defined(ARMA_ALLOW_LONG) | |
| s_promotable_ok { typedef std::complex<T> result; }; | | template<typename T> struct is_promotable<slng_t, std::complex<T> > : publi | |
| template<typename T> struct is_promotable<u32, std::complex<T> > : public i | | c is_promotable_ok { typedef std::complex<T> result; }; | |
| s_promotable_ok { typedef std::complex<T> result; }; | | template<typename T> struct is_promotable<ulng_t, std::complex<T> > : publi | |
| template<typename T> struct is_promotable<s16, std::complex<T> > : public i | | c is_promotable_ok { typedef std::complex<T> result; }; | |
| s_promotable_ok { typedef std::complex<T> result; }; | | #endif | |
| template<typename T> struct is_promotable<u16, std::complex<T> > : public i | | template<typename T> struct is_promotable<s32, std::complex<T> > : publi | |
| s_promotable_ok { typedef std::complex<T> result; }; | | c is_promotable_ok { typedef std::complex<T> result; }; | |
| template<typename T> struct is_promotable<s8, std::complex<T> > : public i | | template<typename T> struct is_promotable<u32, std::complex<T> > : publi | |
| s_promotable_ok { typedef std::complex<T> result; }; | | c is_promotable_ok { typedef std::complex<T> result; }; | |
| template<typename T> struct is_promotable<u8, std::complex<T> > : public i | | template<typename T> struct is_promotable<s16, std::complex<T> > : publi | |
| s_promotable_ok { typedef std::complex<T> result; }; | | c is_promotable_ok { typedef std::complex<T> result; }; | |
| | | template<typename T> struct is_promotable<u16, std::complex<T> > : publi | |
| template<> struct is_promotable<float, double> : public is_promotable_ok { | | c is_promotable_ok { typedef std::complex<T> result; }; | |
| typedef double result; }; | | template<typename T> struct is_promotable<s8, std::complex<T> > : publi | |
| #if defined(ARMA_64BIT_WORD) | | c is_promotable_ok { typedef std::complex<T> result; }; | |
| template<> struct is_promotable<s64 , double> : public is_promotable_ok { | | template<typename T> struct is_promotable<u8, std::complex<T> > : publi | |
| typedef double result; }; | | c is_promotable_ok { typedef std::complex<T> result; }; | |
| template<> struct is_promotable<u64 , double> : public is_promotable_ok { | | | |
| typedef double result; }; | | template<> struct is_promotable<float, double> : public is_promotable_ok { | |
| #endif | | typedef double result; }; | |
| template<> struct is_promotable<s32 , double> : public is_promotable_ok { | | #if defined(ARMA_USE_U64S64) | |
| typedef double result; }; | | template<> struct is_promotable<s64, double> : public is_promotable_ok { | |
| template<> struct is_promotable<u32 , double> : public is_promotable_ok { | | typedef double result; }; | |
| typedef double result; }; | | template<> struct is_promotable<u64, double> : public is_promotable_ok { | |
| template<> struct is_promotable<s16 , double> : public is_promotable_ok { | | typedef double result; }; | |
| typedef double result; }; | | #endif | |
| template<> struct is_promotable<u16 , double> : public is_promotable_ok { | | #if defined(ARMA_ALLOW_LONG) | |
| typedef double result; }; | | template<> struct is_promotable<slng_t, double> : public is_promotable_ok { | |
| template<> struct is_promotable<s8 , double> : public is_promotable_ok { | | typedef double result; }; | |
| typedef double result; }; | | template<> struct is_promotable<ulng_t, double> : public is_promotable_ok { | |
| template<> struct is_promotable<u8 , double> : public is_promotable_ok { | | typedef double result; }; | |
| typedef double result; }; | | #endif | |
| | | template<> struct is_promotable<s32, double> : public is_promotable_ok { | |
| #if defined(ARMA_64BIT_WORD) | | typedef double result; }; | |
| template<> struct is_promotable<s64, float> : public is_promotable_ok { typ | | template<> struct is_promotable<u32, double> : public is_promotable_ok { | |
| edef float result; }; | | typedef double result; }; | |
| template<> struct is_promotable<u64, float> : public is_promotable_ok { typ | | template<> struct is_promotable<s16, double> : public is_promotable_ok { | |
| edef float result; }; | | typedef double result; }; | |
| #endif | | template<> struct is_promotable<u16, double> : public is_promotable_ok { | |
| template<> struct is_promotable<s32, float> : public is_promotable_ok { typ | | typedef double result; }; | |
| edef float result; }; | | template<> struct is_promotable<s8, double> : public is_promotable_ok { | |
| template<> struct is_promotable<u32, float> : public is_promotable_ok { typ | | typedef double result; }; | |
| edef float result; }; | | template<> struct is_promotable<u8, double> : public is_promotable_ok { | |
| template<> struct is_promotable<s16, float> : public is_promotable_ok { typ | | typedef double result; }; | |
| edef float result; }; | | | |
| template<> struct is_promotable<u16, float> : public is_promotable_ok { typ | | #if defined(ARMA_USE_U64S64) | |
| edef float result; }; | | template<> struct is_promotable<s64, float> : public is_promotable_ok { | |
| template<> struct is_promotable<s8 , float> : public is_promotable_ok { typ | | typedef float result; }; | |
| edef float result; }; | | template<> struct is_promotable<u64, float> : public is_promotable_ok { | |
| template<> struct is_promotable<u8 , float> : public is_promotable_ok { typ | | typedef float result; }; | |
| edef float result; }; | | #endif | |
| | | #if defined(ARMA_ALLOW_LONG) | |
| | | template<> struct is_promotable<slng_t, float> : public is_promotable_ok { | |
| | | typedef float result; }; | |
| | | template<> struct is_promotable<ulng_t, float> : public is_promotable_ok { | |
| | | typedef float result; }; | |
| | | #endif | |
| | | template<> struct is_promotable<s32, float> : public is_promotable_ok { | |
| | | typedef float result; }; | |
| | | template<> struct is_promotable<u32, float> : public is_promotable_ok { | |
| | | typedef float result; }; | |
| | | template<> struct is_promotable<s16, float> : public is_promotable_ok { | |
| | | typedef float result; }; | |
| | | template<> struct is_promotable<u16, float> : public is_promotable_ok { | |
| | | typedef float result; }; | |
| | | template<> struct is_promotable<s8, float> : public is_promotable_ok { | |
| | | typedef float result; }; | |
| | | template<> struct is_promotable<u8, float> : public is_promotable_ok { | |
| | | typedef float result; }; | |
| | | | |
|
| #if defined(ARMA_64BIT_WORD) | | #if defined(ARMA_USE_U64S64) | |
| template<> struct is_promotable<u32, u64> : public is_promotable_ok { typed
ef u64 result; }; | | template<> struct is_promotable<u32, u64> : public is_promotable_ok { typed
ef u64 result; }; | |
| template<> struct is_promotable<u16, u64> : public is_promotable_ok { typed
ef u64 result; }; | | template<> struct is_promotable<u16, u64> : public is_promotable_ok { typed
ef u64 result; }; | |
| template<> struct is_promotable<u8, u64> : public is_promotable_ok { typed
ef u64 result; }; | | template<> struct is_promotable<u8, u64> : public is_promotable_ok { typed
ef u64 result; }; | |
| #endif | | #endif | |
| | | | |
|
| #if defined(ARMA_64BIT_WORD) | | #if defined(ARMA_USE_U64S64) | |
| template<> struct is_promotable<u64, s64> : public is_promotable_ok { typed
ef s64 result; }; // float ? | | template<> struct is_promotable<u64, s64> : public is_promotable_ok { typed
ef s64 result; }; // float ? | |
| template<> struct is_promotable<u32, s64> : public is_promotable_ok { typed
ef s64 result; }; | | template<> struct is_promotable<u32, s64> : public is_promotable_ok { typed
ef s64 result; }; | |
| template<> struct is_promotable<s16, s64> : public is_promotable_ok { typed
ef s64 result; }; | | template<> struct is_promotable<s16, s64> : public is_promotable_ok { typed
ef s64 result; }; | |
| template<> struct is_promotable<u16, s64> : public is_promotable_ok { typed
ef s64 result; }; | | template<> struct is_promotable<u16, s64> : public is_promotable_ok { typed
ef s64 result; }; | |
| template<> struct is_promotable<s8 , s64> : public is_promotable_ok { typed
ef s64 result; }; | | template<> struct is_promotable<s8 , s64> : public is_promotable_ok { typed
ef s64 result; }; | |
| template<> struct is_promotable<u8 , s64> : public is_promotable_ok { typed
ef s64 result; }; | | template<> struct is_promotable<u8 , s64> : public is_promotable_ok { typed
ef s64 result; }; | |
| #endif | | #endif | |
| | | | |
| template<> struct is_promotable<u32, s32> : public is_promotable_ok { typed
ef s32 result; }; // float ? | | template<> struct is_promotable<u32, s32> : public is_promotable_ok { typed
ef s32 result; }; // float ? | |
| template<> struct is_promotable<s16, s32> : public is_promotable_ok { typed
ef s32 result; }; | | template<> struct is_promotable<s16, s32> : public is_promotable_ok { typed
ef s32 result; }; | |
| | | | |
End of changes. 7 change blocks. |
| 122 lines changed or deleted | | 158 lines changed or added | |
|
| restrictors.hpp | | restrictors.hpp | |
|
| // Copyright (C) 2010-2012 NICTA (www.nicta.com.au) | | // Copyright (C) 2010-2013 NICTA (www.nicta.com.au) | |
| // Copyright (C) 2010-2012 Conrad Sanderson | | // Copyright (C) 2010-2013 Conrad Sanderson | |
| // | | // | |
| // This file is part of the Armadillo C++ library. | | // This file is part of the Armadillo C++ library. | |
| // It is provided without any warranty of fitness | | // It is provided without any warranty of fitness | |
| // for any purpose. You can redistribute this file | | // for any purpose. You can redistribute this file | |
| // and/or modify it under the terms of the GNU | | // and/or modify it under the terms of the GNU | |
| // Lesser General Public License (LGPL) as published | | // Lesser General Public License (LGPL) as published | |
| // by the Free Software Foundation, either version 3 | | // by the Free Software Foundation, either version 3 | |
| // of the License or (at your option) any later version. | | // of the License or (at your option) any later version. | |
| // (see http://www.opensource.org/licenses for more info) | | // (see http://www.opensource.org/licenses for more info) | |
| | | | |
| | | | |
| skipping to change at line 28 | | skipping to change at line 28 | |
| // http://en.wikipedia.org/wiki/SFINAE | | // http://en.wikipedia.org/wiki/SFINAE | |
| | | | |
| template<typename T> struct arma_scalar_only { }; | | template<typename T> struct arma_scalar_only { }; | |
| | | | |
| template<> struct arma_scalar_only<u8> { typedef u8 result; }; | | template<> struct arma_scalar_only<u8> { typedef u8 result; }; | |
| template<> struct arma_scalar_only<s8> { typedef s8 result; }; | | template<> struct arma_scalar_only<s8> { typedef s8 result; }; | |
| template<> struct arma_scalar_only<u16> { typedef u16 result; }; | | template<> struct arma_scalar_only<u16> { typedef u16 result; }; | |
| template<> struct arma_scalar_only<s16> { typedef s16 result; }; | | template<> struct arma_scalar_only<s16> { typedef s16 result; }; | |
| template<> struct arma_scalar_only<u32> { typedef u32 result; }; | | template<> struct arma_scalar_only<u32> { typedef u32 result; }; | |
| template<> struct arma_scalar_only<s32> { typedef s32 result; }; | | template<> struct arma_scalar_only<s32> { typedef s32 result; }; | |
|
| #if defined(ARMA_64BIT_WORD) | | #if defined(ARMA_USE_U64S64) | |
| template<> struct arma_scalar_only<u64> { typedef u64 result; }; | | template<> struct arma_scalar_only<u64> { typedef u64 result; }; | |
| template<> struct arma_scalar_only<s64> { typedef s64 result; }; | | template<> struct arma_scalar_only<s64> { typedef s64 result; }; | |
| #endif | | #endif | |
| template<> struct arma_scalar_only<float> { typedef float result; }; | | template<> struct arma_scalar_only<float> { typedef float result; }; | |
| template<> struct arma_scalar_only<double> { typedef double result; }; | | template<> struct arma_scalar_only<double> { typedef double result; }; | |
|
| | | #if defined(ARMA_ALLOW_LONG) | |
| | | template<> struct arma_scalar_only<ulng_t> { typedef ulng_t result; }; | |
| | | template<> struct arma_scalar_only<slng_t> { typedef slng_t result; }; | |
| | | #endif | |
| | | | |
| template<typename T> | | template<typename T> | |
| struct arma_scalar_only< std::complex<T> > { typedef std::complex<T> result
; }; | | struct arma_scalar_only< std::complex<T> > { typedef std::complex<T> result
; }; | |
| | | | |
| template<typename T> struct arma_integral_only { }; | | template<typename T> struct arma_integral_only { }; | |
| | | | |
| template<> struct arma_integral_only<u8> { typedef u8 result; }; | | template<> struct arma_integral_only<u8> { typedef u8 result; }; | |
| template<> struct arma_integral_only<s8> { typedef s8 result; }; | | template<> struct arma_integral_only<s8> { typedef s8 result; }; | |
| template<> struct arma_integral_only<u16> { typedef u16 result; }; | | template<> struct arma_integral_only<u16> { typedef u16 result; }; | |
| template<> struct arma_integral_only<s16> { typedef s16 result; }; | | template<> struct arma_integral_only<s16> { typedef s16 result; }; | |
| template<> struct arma_integral_only<u32> { typedef u32 result; }; | | template<> struct arma_integral_only<u32> { typedef u32 result; }; | |
| template<> struct arma_integral_only<s32> { typedef s32 result; }; | | template<> struct arma_integral_only<s32> { typedef s32 result; }; | |
|
| #if defined(ARMA_64BIT_WORD) | | #if defined(ARMA_USE_U64S64) | |
| template<> struct arma_integral_only<u64> { typedef u64 result; }; | | template<> struct arma_integral_only<u64> { typedef u64 result; }; | |
| template<> struct arma_integral_only<s64> { typedef s64 result; }; | | template<> struct arma_integral_only<s64> { typedef s64 result; }; | |
| #endif | | #endif | |
|
| | | #if defined(ARMA_ALLOW_LONG) | |
| | | template<> struct arma_integral_only<ulng_t> { typedef ulng_t result; }; | |
| | | template<> struct arma_integral_only<slng_t> { typedef slng_t result; }; | |
| | | #endif | |
| | | | |
| template<typename T> struct arma_unsigned_integral_only { }; | | template<typename T> struct arma_unsigned_integral_only { }; | |
| | | | |
|
| template<> struct arma_unsigned_integral_only<u8> { typedef u8 result; }; | | template<> struct arma_unsigned_integral_only<u8> { typedef u8 resu | |
| template<> struct arma_unsigned_integral_only<u16> { typedef u16 result; }; | | lt; }; | |
| template<> struct arma_unsigned_integral_only<u32> { typedef u32 result; }; | | template<> struct arma_unsigned_integral_only<u16> { typedef u16 resu | |
| #if defined(ARMA_64BIT_WORD) | | lt; }; | |
| template<> struct arma_unsigned_integral_only<u64> { typedef u64 result; }; | | template<> struct arma_unsigned_integral_only<u32> { typedef u32 resu | |
| | | lt; }; | |
| | | #if defined(ARMA_USE_U64S64) | |
| | | template<> struct arma_unsigned_integral_only<u64> { typedef u64 resu | |
| | | lt; }; | |
| | | #endif | |
| | | #if defined(ARMA_ALLOW_LONG) | |
| | | template<> struct arma_unsigned_integral_only<ulng_t> { typedef ulng_t resu | |
| | | lt; }; | |
| #endif | | #endif | |
| | | | |
| template<typename T> struct arma_signed_integral_only { }; | | template<typename T> struct arma_signed_integral_only { }; | |
| | | | |
|
| template<> struct arma_signed_integral_only<s8> { typedef s8 result; }; | | template<> struct arma_signed_integral_only<s8> { typedef s8 result | |
| template<> struct arma_signed_integral_only<s16> { typedef s16 result; }; | | ; }; | |
| template<> struct arma_signed_integral_only<s32> { typedef s32 result; }; | | template<> struct arma_signed_integral_only<s16> { typedef s16 result | |
| #if defined(ARMA_64BIT_WORD) | | ; }; | |
| template<> struct arma_signed_integral_only<s64> { typedef s64 result; }; | | template<> struct arma_signed_integral_only<s32> { typedef s32 result | |
| | | ; }; | |
| | | #if defined(ARMA_USE_U64S64) | |
| | | template<> struct arma_signed_integral_only<s64> { typedef s64 result | |
| | | ; }; | |
| | | #endif | |
| | | #if defined(ARMA_ALLOW_LONG) | |
| | | template<> struct arma_signed_integral_only<slng_t> { typedef slng_t result | |
| | | ; }; | |
| #endif | | #endif | |
| | | | |
| template<typename T> struct arma_signed_only { }; | | template<typename T> struct arma_signed_only { }; | |
| | | | |
|
| template<> struct arma_signed_only<s8> { typedef s8 result; }; | | template<> struct arma_signed_only<s8> { typedef s8 result; }; | |
| template<> struct arma_signed_only<s16> { typedef s16 result; }; | | template<> struct arma_signed_only<s16> { typedef s16 result; }; | |
| template<> struct arma_signed_only<s32> { typedef s32 result; }; | | template<> struct arma_signed_only<s32> { typedef s32 result; }; | |
| #if defined(ARMA_64BIT_WORD) | | #if defined(ARMA_USE_U64S64) | |
| template<> struct arma_signed_only<s64> { typedef s64 result; }; | | template<> struct arma_signed_only<s64> { typedef s64 result; }; | |
| #endif | | #endif | |
| template<> struct arma_signed_only<float> { typedef float result; }; | | template<> struct arma_signed_only<float> { typedef float result; }; | |
| template<> struct arma_signed_only<double> { typedef double result; }; | | template<> struct arma_signed_only<double> { typedef double result; }; | |
|
| | | #if defined(ARMA_ALLOW_LONG) | |
| | | template<> struct arma_signed_only<slng_t> { typedef slng_t result; }; | |
| | | #endif | |
| | | | |
| template<typename T> struct arma_signed_only< std::complex<T> > { typedef s
td::complex<T> result; }; | | template<typename T> struct arma_signed_only< std::complex<T> > { typedef s
td::complex<T> result; }; | |
| | | | |
| template<typename T> struct arma_float_only { }; | | template<typename T> struct arma_float_only { }; | |
| | | | |
| template<> struct arma_float_only<float> { typedef float result; }; | | template<> struct arma_float_only<float> { typedef float result; }; | |
| template<> struct arma_float_only<double> { typedef double result; }; | | template<> struct arma_float_only<double> { typedef double result; }; | |
| | | | |
| template<typename T> struct arma_float_or_cx_only { }; | | template<typename T> struct arma_float_or_cx_only { }; | |
| | | | |
| | | | |
End of changes. 9 change blocks. |
| 19 lines changed or deleted | | 46 lines changed or added | |
|
| typedef.hpp | | typedef.hpp | |
|
| // Copyright (C) 2008-2011 NICTA (www.nicta.com.au) | | // Copyright (C) 2008-2013 NICTA (www.nicta.com.au) | |
| // Copyright (C) 2008-2011 Conrad Sanderson | | // Copyright (C) 2008-2013 Conrad Sanderson | |
| // | | // | |
| // This file is part of the Armadillo C++ library. | | // This file is part of the Armadillo C++ library. | |
| // It is provided without any warranty of fitness | | // It is provided without any warranty of fitness | |
| // for any purpose. You can redistribute this file | | // for any purpose. You can redistribute this file | |
| // and/or modify it under the terms of the GNU | | // and/or modify it under the terms of the GNU | |
| // Lesser General Public License (LGPL) as published | | // Lesser General Public License (LGPL) as published | |
| // by the Free Software Foundation, either version 3 | | // by the Free Software Foundation, either version 3 | |
| // of the License or (at your option) any later version. | | // of the License or (at your option) any later version. | |
| // (see http://www.opensource.org/licenses for more info) | | // (see http://www.opensource.org/licenses for more info) | |
| | | | |
| //! \addtogroup typedef | | //! \addtogroup typedef | |
| //! @{ | | //! @{ | |
| | | | |
|
| #if UCHAR_MAX >= 0xff | | #if UCHAR_MAX >= 0xff | |
| //! unsigned 8 bit type | | typedef unsigned char u8; | |
| typedef unsigned char u8; | | typedef char s8; | |
| typedef char s8; | | #elif defined(UINT8_MAX) | |
| | | typedef uint8_t u8; | |
| | | typedef int8_t s8; | |
| #else | | #else | |
| #error "don't know how to typedef 'u8' on this system" | | #error "don't know how to typedef 'u8' on this system" | |
| #endif | | #endif | |
| | | | |
| // NOTE: | | // NOTE: | |
| // "signed char" is not the same as "char". | | // "signed char" is not the same as "char". | |
| // http://www.embedded.com/columns/programmingpointers/206107018 | | // http://www.embedded.com/columns/programmingpointers/206107018 | |
| // http://en.wikipedia.org/wiki/C_variable_types_and_declarations | | // http://en.wikipedia.org/wiki/C_variable_types_and_declarations | |
| | | | |
|
| #if USHRT_MAX >= 0xffff | | #if USHRT_MAX >= 0xffff | |
| //! unsigned 16 bit type | | typedef unsigned short u16; | |
| typedef unsigned short u16; | | typedef short s16; | |
| typedef short s16; | | #elif defined(UINT16_MAX) | |
| | | typedef uint16_t u16; | |
| | | typedef int16_t s16; | |
| #else | | #else | |
| #error "don't know how to typedef 'u16' on this system" | | #error "don't know how to typedef 'u16' on this system" | |
| #endif | | #endif | |
| | | | |
| #if UINT_MAX >= 0xffffffff | | #if UINT_MAX >= 0xffffffff | |
|
| typedef unsigned int u32; | | typedef unsigned int u32; | |
| typedef int s32; | | typedef int s32; | |
| #elif ULONG_MAX >= 0xffffffff | | #elif defined(UINT32_MAX) | |
| typedef unsigned long u32; | | typedef uint32_t u32; | |
| typedef long s32; | | typedef int32_t s32; | |
| #else | | #else | |
| #error "don't know how to typedef 'u32' on this system" | | #error "don't know how to typedef 'u32' on this system" | |
| #endif | | #endif | |
| | | | |
|
| #if defined(ARMA_64BIT_WORD) | | #if defined(ARMA_USE_U64S64) | |
| #if ULONG_MAX >= 0xffffffffffffffff | | #if ULLONG_MAX >= 0xffffffffffffffff | |
| | | typedef unsigned long long u64; | |
| | | typedef long long s64; | |
| | | #elif ULONG_MAX >= 0xffffffffffffffff | |
| typedef unsigned long u64; | | typedef unsigned long u64; | |
| typedef long s64; | | typedef long s64; | |
|
| | | #define ARMA_U64_IS_LONG | |
| | | #elif defined(UINT64_MAX) | |
| | | typedef uint64_t u64; | |
| | | typedef int64_t s64; | |
| #else | | #else | |
|
| #if ULLONG_MAX >= 0xffffffffffffffff | | #error "don't know how to typedef 'u64' on this system; please disabl | |
| typedef unsigned long long u64; | | e ARMA_64BIT_WORD and/or ARMA_USE_U64S64" | |
| typedef long long s64; | | | |
| #else | | | |
| #error "don't know how to typedef 'u64' on this system" | | | |
| #endif | | | |
| #endif | | #endif | |
| #endif | | #endif | |
| | | | |
|
| // // only supported by C++11, via #include <cstdint>, or by C99, via #incl | | #if !defined(ARMA_USE_U64S64) || (defined(ARMA_USE_U64S64) && !defined(ARMA | |
| ude <stdint.h> | | _U64_IS_LONG)) | |
| // | | #define ARMA_ALLOW_LONG | |
| // typedef uint8_t u8; | | #endif | |
| // typedef int8_t s8; | | | |
| // | | typedef unsigned long ulng_t; | |
| // typedef uint16_t u16; | | typedef long slng_t; | |
| // typedef int16_t s16; | | | |
| // | | | |
| // typedef uint32_t u32; | | | |
| // typedef int32_t s32; | | | |
| // | | | |
| // typedef uint64_t u64; | | | |
| // typedef int64_t s64; | | | |
| | | | |
| #if !defined(ARMA_64BIT_WORD) | | #if !defined(ARMA_64BIT_WORD) | |
| typedef u32 uword; | | typedef u32 uword; | |
| typedef s32 sword; | | typedef s32 sword; | |
| | | | |
| typedef u16 uhword; | | typedef u16 uhword; | |
| typedef s16 shword; | | typedef s16 shword; | |
| | | | |
| #define ARMA_MAX_UWORD 0xffffffff | | #define ARMA_MAX_UWORD 0xffffffff | |
| #define ARMA_MAX_UHWORD 0xffff | | #define ARMA_MAX_UHWORD 0xffff | |
| | | | |
| skipping to change at line 116 | | skipping to change at line 115 | |
| typedef Col <u32> u32_colvec; | | typedef Col <u32> u32_colvec; | |
| typedef Row <u32> u32_rowvec; | | typedef Row <u32> u32_rowvec; | |
| typedef Cube<u32> u32_cube; | | typedef Cube<u32> u32_cube; | |
| | | | |
| typedef Mat <s32> s32_mat; | | typedef Mat <s32> s32_mat; | |
| typedef Col <s32> s32_vec; | | typedef Col <s32> s32_vec; | |
| typedef Col <s32> s32_colvec; | | typedef Col <s32> s32_colvec; | |
| typedef Row <s32> s32_rowvec; | | typedef Row <s32> s32_rowvec; | |
| typedef Cube<s32> s32_cube; | | typedef Cube<s32> s32_cube; | |
| | | | |
|
| | | #if defined(ARMA_USE_U64S64) | |
| | | typedef Mat <u64> u64_mat; | |
| | | typedef Col <u64> u64_vec; | |
| | | typedef Col <u64> u64_colvec; | |
| | | typedef Row <u64> u64_rowvec; | |
| | | typedef Cube<u64> u64_cube; | |
| | | | |
| | | typedef Mat <s64> s64_mat; | |
| | | typedef Col <s64> s64_vec; | |
| | | typedef Col <s64> s64_colvec; | |
| | | typedef Row <s64> s64_rowvec; | |
| | | typedef Cube<s64> s64_cube; | |
| | | #endif | |
| | | | |
| typedef Mat <uword> umat; | | typedef Mat <uword> umat; | |
| typedef Col <uword> uvec; | | typedef Col <uword> uvec; | |
| typedef Col <uword> ucolvec; | | typedef Col <uword> ucolvec; | |
| typedef Row <uword> urowvec; | | typedef Row <uword> urowvec; | |
| typedef Cube<uword> ucube; | | typedef Cube<uword> ucube; | |
| | | | |
| typedef Mat <sword> imat; | | typedef Mat <sword> imat; | |
| typedef Col <sword> ivec; | | typedef Col <sword> ivec; | |
| typedef Col <sword> icolvec; | | typedef Col <sword> icolvec; | |
| typedef Row <sword> irowvec; | | typedef Row <sword> irowvec; | |
| | | | |
| skipping to change at line 198 | | skipping to change at line 211 | |
| | | | |
| arma_static_check( (sizeof(u8) != 1), ERROR___TYPE_U8_HAS_UNSUPPORTED_S
IZE ); | | arma_static_check( (sizeof(u8) != 1), ERROR___TYPE_U8_HAS_UNSUPPORTED_S
IZE ); | |
| arma_static_check( (sizeof(s8) != 1), ERROR___TYPE_S8_HAS_UNSUPPORTED_S
IZE ); | | arma_static_check( (sizeof(s8) != 1), ERROR___TYPE_S8_HAS_UNSUPPORTED_S
IZE ); | |
| | | | |
| arma_static_check( (sizeof(u16) != 2), ERROR___TYPE_U16_HAS_UNSUPPORTED
_SIZE ); | | arma_static_check( (sizeof(u16) != 2), ERROR___TYPE_U16_HAS_UNSUPPORTED
_SIZE ); | |
| arma_static_check( (sizeof(s16) != 2), ERROR___TYPE_S16_HAS_UNSUPPORTED
_SIZE ); | | arma_static_check( (sizeof(s16) != 2), ERROR___TYPE_S16_HAS_UNSUPPORTED
_SIZE ); | |
| | | | |
| arma_static_check( (sizeof(u32) != 4), ERROR___TYPE_U32_HAS_UNSUPPORTED
_SIZE ); | | arma_static_check( (sizeof(u32) != 4), ERROR___TYPE_U32_HAS_UNSUPPORTED
_SIZE ); | |
| arma_static_check( (sizeof(s32) != 4), ERROR___TYPE_S32_HAS_UNSUPPORTED
_SIZE ); | | arma_static_check( (sizeof(s32) != 4), ERROR___TYPE_S32_HAS_UNSUPPORTED
_SIZE ); | |
| | | | |
|
| #if defined(ARMA_64BIT_WORD) | | #if defined(ARMA_USE_U64S64) | |
| arma_static_check( (sizeof(u64) != 8), ERROR___TYPE_U64_HAS_UNSUPPORTED | | arma_static_check( (sizeof(u64) != 8), ERROR___TYPE_U64_HAS_UNSUPPORT | |
| _SIZE ); | | ED_SIZE ); | |
| arma_static_check( (sizeof(s64) != 8), ERROR___TYPE_S64_HAS_UNSUPPORTED | | arma_static_check( (sizeof(s64) != 8), ERROR___TYPE_S64_HAS_UNSUPPORT | |
| _SIZE ); | | ED_SIZE ); | |
| #endif | | #endif | |
| | | | |
| arma_static_check( (sizeof(float) != 4), ERROR___TYPE_FLOAT_HAS_UNSUPP
ORTED_SIZE ); | | arma_static_check( (sizeof(float) != 4), ERROR___TYPE_FLOAT_HAS_UNSUPP
ORTED_SIZE ); | |
| arma_static_check( (sizeof(double) != 8), ERROR___TYPE_DOUBLE_HAS_UNSUP
PORTED_SIZE ); | | arma_static_check( (sizeof(double) != 8), ERROR___TYPE_DOUBLE_HAS_UNSUP
PORTED_SIZE ); | |
| | | | |
| arma_static_check( (sizeof(std::complex<float>) != 8), ERROR___TYPE_C
OMPLEX_FLOAT_HAS_UNSUPPORTED_SIZE ); | | arma_static_check( (sizeof(std::complex<float>) != 8), ERROR___TYPE_C
OMPLEX_FLOAT_HAS_UNSUPPORTED_SIZE ); | |
| arma_static_check( (sizeof(std::complex<double>) != 16), ERROR___TYPE_C
OMPLEX_DOUBLE_HAS_UNSUPPORTED_SIZE ); | | arma_static_check( (sizeof(std::complex<double>) != 16), ERROR___TYPE_C
OMPLEX_DOUBLE_HAS_UNSUPPORTED_SIZE ); | |
| | | | |
| }; | | }; | |
| } | | } | |
| | | | |
End of changes. 10 change blocks. |
| 42 lines changed or deleted | | 56 lines changed or added | |
|