-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPolytest.cpp
65 lines (64 loc) · 1.05 KB
/
Polytest.cpp
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include <iostream>
#include "PolynomQF.h"
#include "PolynomX.h"
#include "PolynomQ.h"
using namespace std;
void main(){
Polynom P,S;
cin>>P;
cin>>S;
try{
cout<<P<<'\n'<<S<<'\n';
}
catch(isEmpty){
cerr<<"Polynom is Empty.";
}
P=S;
if(P==S){
try{
cout<<P<<'\n'<<S<<'\n';
}
catch(isEmpty){
cerr<<"Polynom is Empty.\n";
}
}
cout<<P.getValueOn(5.4,7.898,7)<<'\n';
PolynomX p;
cin>>p;
cout<<p.getDerivative()<<'\n';
PolynomQ PQ;
cin>>PQ;
pairOfRoots pairR;
pairR.first=0;
pairR.second=0;
try{
pairR=PQ.computeRoots();
cout<<pairR.first<<' '<<pairR.second<<' ';
}
catch(badcoeffitients){
cerr<<"Bad Coeffitients.\n";
}
pairOfPolynoms pairP;
try{
pairP=PQ.factorization();
cout<<'\n'<<pairP.first<<' '<<pairP.second<<' ';
}
catch(irreducible){
cerr<<"It's irreducible.\n";
}
PolynomQF PQF;
cin>>PQF;
if(PQF.isDiagonal()){
cout<<"It is.\n";
}
else{
cout<<"Is not.\n";
}
if(PQF.isSingular()){
cout<<"It is.\n";
}
else{
cout<<"Is not.\n";
}
system("pause");
}