#pragma once
|
|
|
#include "akLinker.h"
|
#include <vector>
|
|
namespace akSTL
|
{
|
class akSTL_DLLSPEC CakInterpolation
|
{
|
public:
|
struct _Data
|
{
|
_Data()
|
{
|
x = y = 0;
|
}
|
double x;
|
double y;
|
};
|
|
public:
|
CakInterpolation();
|
~CakInterpolation();
|
|
//Æú¸®³ë¹Ì¾ó µ¥ÀÌÅÍ »ý¼º(rate:µ¥ÀÌÅÍ °£°Ý)
|
void CaculationPolinomial(double min, double max, double rate);
|
//Å¥ºò½ºÇöóÀÎ µ¥ÀÌÅÍ »ý¼º(rate:Á¡°ú Á¡»çÀÌÀÇ µ¥ÀÌÅÍ °¹¼ö)
|
void CaculationCubicSpline(double rate);
|
//Linear(rate:Á¡°ú Á¡»çÀÌÀÇ µ¥ÀÌÅÍ °¹¼ö)
|
void CaculationLinear(int step);
|
|
void AddPoint(double x, double y);
|
inline void ClearPoint(){m_vecInterPoint.clear();};
|
|
inline _Data GetData(int index);
|
inline int GetDataNum(){return (int)m_vecInterPoint.size();};
|
|
|
|
|
protected:
|
std::vector<_Data> m_vecOrgPoint;
|
std::vector<_Data> m_vecInterPoint;
|
private:
|
void solveTridiag(double* khb, double* diag, double* khp, double* b, int n) ;
|
};
|
}
|