-
Notifications
You must be signed in to change notification settings - Fork 0
/
Polynom.h
46 lines (39 loc) · 1.06 KB
/
Polynom.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
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef Polynom_h
#define Polynom_h
#include "List2.h"
/*Ðåàëèçîâàòü êëàññ "Ìíîãî÷ëåí îò ïåðåìåííûõ x,y,z ñ âåùåñòâåííûìè
êîýôôèöèåíòàìè" ñ ìåòîäàìè:
* âû÷èñëåíèå çíà÷åíèÿ ìíîãî÷ëåíà íà çàäàííûõ ÷èñëàõ;
* âû÷èñëåíèå ñòåïåíè ìíîãî÷ëåíà ïî êàæäîé ïåðåìåííîé;
* èíèöèàëèçàöèÿ ìíîãî÷ëåíà ïî ñòðîêå.
Îáúåêò èíèöèàëèçèðóåòñÿ ñèìâîëüíîé ñòðîêîé, íå ñîäåðæàùåé ñêîáîê.
*/
using namespace std;
struct monom{
int x,y,z;
long double constant;
};
struct isEmpty{
isEmpty(){}
};
class Polynom{
protected:
List2<monom> list_;
void copy(const Polynom& p){list_=p.list_;}
public:
Polynom(){}
Polynom(const Polynom& p){copy(p);}
~Polynom(){}
Polynom& operator = (const Polynom&);
bool operator == (const Polynom&)const;
bool operator != (const Polynom&)const;
friend ostream& operator << (ostream&,const Polynom&);
friend void operator >> (istream&, Polynom&);
void add(const monom);
void makeItEmpty();
void erase(int i);
bool isEmpty()const;
int getDegree(char)const;
long double getValueOn(const long double x,const long double y,const long double z)const;
};
#endif