CubicFuncSpline.h 812 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #pragma once
  2. #include "Common.h"
  3. #include "Point.h"
  4. #include <vector>
  5. NS_BF_BEGIN;
  6. class CubicFuncSpline
  7. {
  8. public:
  9. std::vector<PointF> mInputPoints;
  10. float* lagpoly;
  11. float* intpoly;
  12. float* slopes;
  13. protected:
  14. void Lagrange();
  15. void ComputeSplineSlopes();
  16. public:
  17. CubicFuncSpline();
  18. ~CubicFuncSpline();
  19. void AddPt(float x, float y);
  20. int GetLength();
  21. void Calculate();
  22. float Evaluate(float x);
  23. };
  24. class CubicUnitFuncSpline
  25. {
  26. public:
  27. std::vector<float> mInputPoints;
  28. float* lagpoly;
  29. float* intpoly;
  30. float* slopes;
  31. protected:
  32. void Lagrange();
  33. void ComputeSplineSlopes();
  34. public:
  35. CubicUnitFuncSpline();
  36. ~CubicUnitFuncSpline();
  37. void AddPt(float y);
  38. int GetLength();
  39. void Calculate();
  40. float Evaluate(float x);
  41. };
  42. NS_BF_END;