wxFreeChart
polynom.h
1 // Name: polynom.h
3 // Purpose: polynom function dataset declaration
4 // Author: Moskvichev Andrey V.
5 // Created: 2008/11/07
6 // Copyright: (c) 2008-2010 Moskvichev Andrey V.
7 // Licence: wxWidgets licence
9 
10 #ifndef POLYNOM_H_
11 #define POLYNOM_H_
12 
13 #include <wx/xy/xydataset.h>
14 
19 class WXDLLIMPEXP_FREECHART Polynom : public XYDataset
20 {
21 public:
29  Polynom(double *coefs, size_t coefCount, double min, double max, double step);
30  virtual ~Polynom();
31 
32  virtual double GetX(size_t index, size_t serie);
33 
34  virtual double GetY(size_t index, size_t serie);
35 
36  virtual size_t GetCount(size_t serie);
37 
38  virtual size_t GetSerieCount();
39 
40  virtual wxString GetSerieName(size_t serie);
41 
42 private:
43  double CalcY(double x);
44 
45  double *m_coefs;
46  size_t m_coefCount;
47  double m_min;
48  double m_max;
49  double m_step;
50 };
51 
52 #endif /*POLYNOM_H_*/
Polynom function of type: y = c0 * x^n + c1 * x^(n-1) + ...
Definition: polynom.h:19
virtual size_t GetSerieCount()=0
Returns serie count in this dataset.
virtual double GetX(size_t index, size_t serie)=0
Returns x value at index.
virtual double GetY(size_t index, size_t serie)=0
Returns y value at index.
virtual size_t GetCount(size_t serie)=0
Returns value count in serie specified by index.
Base class for XY datasets.
Definition: xydataset.h:21
virtual wxString GetSerieName(size_t serie)=0
Returns serie name.