-
Notifications
You must be signed in to change notification settings - Fork 0
/
poly.hpp
50 lines (37 loc) · 1005 Bytes
/
poly.hpp
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
#if !defined(POLY_H)
/* ========================================================================
grapt:
Generates a LaTeX report of a user-defined graph property.
poly.hpp:
Basic polynomial class Poly, used for generating algebraic
graphs.
Josh Tobin (tobinrj@tcd.ie), 2015
======================================================================== */
#define POLY_H
#include <iostream>
#include <vector>
#include <deque>
#include <utility>
#include <cstdlib>
#include <ctime>
// XXX get rid of this
using namespace std;
typedef vector<int> monomial;
typedef pair<int, monomial> term;
class poly
{
private:
int n_vars;
deque<term> terms;
public:
poly(int _n_vars) : n_vars(_n_vars) {;}
poly operator+(const term&);
poly operator+(const poly&);
//poly operator-(const polt&);
//poly operator*(const term&);
poly& operator=(const poly& rhs);
void print();
int eval(const vector<int>&, int m);
};
poly rand_poly(int d, int nv, int m);
#endif