-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPolynomial.h
33 lines (30 loc) · 836 Bytes
/
Polynomial.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef POLYNOMIAL_H_INCLUDED
#define POLYNOMIAL_H_INCLUDED
class PolyList_Class
{
public:
void add(char polyname, char* exp);
polynomial* sear(char polyname);
private:
struct PolyPointer
{
char name;
polynomial* p;
};
PolyPointer ppoint[10];
int point;
};
class polynomial
{
public:
polynomial(int a=20); //By default, suppose the max time is 20
void setp(char*); //set the polynomial from INPUT
/*By NOW, the function only support the case of coefficients&time less than 10 and not less than 0 */
void print(); //print the polynamial to OUTPUT
int* show(); //diliver the polynomial the another procedure
fraction value(double); //calculate the value of the poly at an exact point
private:
int* poly;
int n; //time
};
#endif // POLYNOMIAL_H_INCLUDED