Loading src/include/List.h +24 −34 Original line number Diff line number Diff line Loading @@ -12,12 +12,8 @@ */ class ListOutOfBoundsException: public std::exception { protected: //! \brief Minimum index defined in the List. int min_index; //! \brief Maximum index defined in the List. int max_index; //! \brief List index requested by user. int requested_index; //! Description of the problem. std::string message; public: /** Loading @@ -28,21 +24,15 @@ public: * \param max: `int` The maximum index allowed by the list. */ ListOutOfBoundsException(int requested, int min, int max) { min_index = min; max_index = max; requested_index = requested; message = "Error: requested index " + std::to_string(requested) + " out of list allowed bounds [" + std::to_string(min) + ", " + std::to_string(max - 1) + "]"; } /** * \brief Exception message. */ virtual const char* what() const throw() { std::string message = "Error: requested index "; message += requested_index; message += " is out of range ["; message += min_index; message += ", "; message += (max_index - 1); message += "]"; return message.c_str(); } }; Loading src/libnptm/Configuration.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -265,7 +265,7 @@ ScattererConfiguration* ScattererConfiguration::from_binary(string file_name, st try { xi_vec = new double[nxi](); } catch (const bad_alloc &ex) { throw UnrecognizedConfigurationException("Wrong parameter set: invalid number of scales " + nxi); throw UnrecognizedConfigurationException("Wrong parameter set: invalid number of scales " + to_string(nxi)); } for (int i = 0; i < nxi; i++) { input.read(reinterpret_cast<char *>(&(xi_vec[i])), sizeof(double)); Loading @@ -285,7 +285,7 @@ ScattererConfiguration* ScattererConfiguration::from_binary(string file_name, st try { rcf_vector[i115 - 1] = new double[nsh](); } catch (const bad_alloc &ex) { throw UnrecognizedConfigurationException("Wrong parameter set: invalid number of layers " + nsh); throw UnrecognizedConfigurationException("Wrong parameter set: invalid number of layers " + to_string(nsh)); } for (int nsi = 0; nsi < nsh; nsi++) { input.read(reinterpret_cast<char *>(&(rcf_vector[i115 - 1][nsi])), sizeof(double)); Loading Loading
src/include/List.h +24 −34 Original line number Diff line number Diff line Loading @@ -12,12 +12,8 @@ */ class ListOutOfBoundsException: public std::exception { protected: //! \brief Minimum index defined in the List. int min_index; //! \brief Maximum index defined in the List. int max_index; //! \brief List index requested by user. int requested_index; //! Description of the problem. std::string message; public: /** Loading @@ -28,21 +24,15 @@ public: * \param max: `int` The maximum index allowed by the list. */ ListOutOfBoundsException(int requested, int min, int max) { min_index = min; max_index = max; requested_index = requested; message = "Error: requested index " + std::to_string(requested) + " out of list allowed bounds [" + std::to_string(min) + ", " + std::to_string(max - 1) + "]"; } /** * \brief Exception message. */ virtual const char* what() const throw() { std::string message = "Error: requested index "; message += requested_index; message += " is out of range ["; message += min_index; message += ", "; message += (max_index - 1); message += "]"; return message.c_str(); } }; Loading
src/libnptm/Configuration.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -265,7 +265,7 @@ ScattererConfiguration* ScattererConfiguration::from_binary(string file_name, st try { xi_vec = new double[nxi](); } catch (const bad_alloc &ex) { throw UnrecognizedConfigurationException("Wrong parameter set: invalid number of scales " + nxi); throw UnrecognizedConfigurationException("Wrong parameter set: invalid number of scales " + to_string(nxi)); } for (int i = 0; i < nxi; i++) { input.read(reinterpret_cast<char *>(&(xi_vec[i])), sizeof(double)); Loading @@ -285,7 +285,7 @@ ScattererConfiguration* ScattererConfiguration::from_binary(string file_name, st try { rcf_vector[i115 - 1] = new double[nsh](); } catch (const bad_alloc &ex) { throw UnrecognizedConfigurationException("Wrong parameter set: invalid number of layers " + nsh); throw UnrecognizedConfigurationException("Wrong parameter set: invalid number of layers " + to_string(nsh)); } for (int nsi = 0; nsi < nsh; nsi++) { input.read(reinterpret_cast<char *>(&(rcf_vector[i115 - 1][nsi])), sizeof(double)); Loading