⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fpoly.h

📁 大数运算库
💻 H
字号:
/*
 * C++ class to implement a polynomial type and to allow 
 * arithmetic on polynomials whose elements are flash numbers
 *
 * WARNING: This class has been cobbled together for a specific use with
 * the MIRACL library. It is not complete, and may not work in other 
 * applications
 *
 * See Knuth The Art of Computer Programming Vol.2, Chapter 4.6 
 */

#ifndef FPOLY_H
#define FPOLY_H

#include <flash.h>

class fterm
{
public:
    Flash an;
    int n;
    fterm *next;
};
  
class FPoly
{
    fterm *start;
public:
    FPoly() {start=NULL;}
    FPoly(const FPoly&);
    void clear();
    fterm* addterm(Flash,int,fterm *pos=NULL);
    void multerm(Flash,int);
    Flash coeff(int);
    int getterms(Flash *,int *);
    FPoly& operator=(const FPoly&);
    FPoly& operator+=(const FPoly&);
    FPoly& operator-=(const FPoly&);
    friend int degree(const FPoly&);
    friend FPoly operator*(const FPoly&,const FPoly&);
    friend ostream& operator<<(ostream&,const FPoly&);
    ~FPoly();
};


#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -