📄 poly.h
字号:
#ifndef POLY__H
#define POLY__H
#include <vector>
using namespace std;
class Poly;
ostream & operator << (ostream &, const Poly &);
istream & operator >> (istream &, Poly &);
class Poly {
// types
public:
typedef vector<int> coef_vector;
typedef coef_vector::size_type size_t;
typedef vector<Poly> poly_vector;
// variables
private:
coef_vector coef;
static poly_vector irreducible;
// methods
private:
inline void refresh();
bool isPrimitive_step2() const;
static void generateIrreducible(const size_t);
public:
// constructors
Poly();
Poly(const Poly &);
Poly(const string &);
// destructors
~Poly();
// overloaded operators
Poly & operator = (const Poly &);
bool operator == (const Poly &) const;
Poly operator + (const Poly &) const;
Poly operator - (const Poly &) const;
Poly operator * (const Poly &) const;
Poly operator / (const Poly &) const;
Poly operator % (const Poly &) const;
// others
bool isZero() const;
bool isOne() const;
bool isPrimitive() const;
bool isIrreducible() const;
Poly inverse (const Poly &) const;
static void listPrimitive(const size_t);
friend ostream & operator << (ostream &, const Poly &);
friend istream & operator >> (istream &, Poly &);
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -