diff --git a/tools/useful.cpp b/tools/useful.cpp index 601c97a..bbde8d1 100644 --- a/tools/useful.cpp +++ b/tools/useful.cpp @@ -89,3 +89,19 @@ std::vector SplitString2Float(std::string str, std::string delimiter) } return v_f; } + +std::vector SplitString2Double(std::string str, std::string delimiter) +{ + std::vector v_f; + std::vector results; + boost::split(results, str, boost::is_any_of(delimiter)); + + for (size_t n=0;n> num) + v_f.push_back(num); + } + return v_f; +} diff --git a/tools/useful.h b/tools/useful.h index 770f2e9..9008f74 100644 --- a/tools/useful.h +++ b/tools/useful.h @@ -31,5 +31,6 @@ double CalcNyquistFrequency(unsigned int nyquist, double dT); std::vector AssignJobs2Threads(unsigned int jobs, unsigned int nrThreads, bool RemoveEmpty=false); std::vector SplitString2Float(std::string str, std::string delimiter=","); +std::vector SplitString2Double(std::string str, std::string delimiter=","); #endif // USEFUL_H