gtcommonkits.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //
  2. // Created by lloyd on 2020/9/28.
  3. //
  4. #ifndef GTCVR_GTCOMMONKITS_H
  5. #define GTCVR_GTCOMMONKITS_H
  6. #include <vector>
  7. class gtcommonkits {
  8. public:
  9. static std::vector<std::string> str_Split(std::string str, std::string pattern);
  10. static void saveTxt(std::string path, std::string aLineText);
  11. static std::string getTextFromTxt(std::string path);
  12. std::vector<std::vector<double>>
  13. BezierInterpolation(std::vector<std::vector<double>> &poss, int precision, int dimersion);
  14. /**
  15. * 峰值选取算法
  16. * @param data 离散点
  17. * @param StartPoint 开始点位
  18. * @param endPoint 结束点位
  19. * @param Weight 峰值点强度
  20. * @param EX 1:上峰值:-1下峰值
  21. * @return
  22. */
  23. std::vector<std::vector<double>>
  24. FindPeakValue(std::vector<std::vector<double>> data, int StartPoint, int endPoint, int Weight, int EX);
  25. /**
  26. * 离散度计算
  27. * 计算标准差
  28. * @param values 离散点
  29. * @return
  30. */
  31. double cStandardDeviation(std::vector<double> values);
  32. static std::vector<std::vector<double>> gt_trans_strtoarray(std::string sgt);
  33. static std::string gt_trans_arraytostr(std::vector<std::vector<double>> sgt);
  34. };
  35. #endif //GTCVR_GTCOMMONKITS_H