gf2xvec.txt

来自「数值算法库for Unix」· 文本 代码 · 共 64 行

TXT
64
字号
/**************************************************************************\MODULE: GF2XVecSUMMARY:The class GF2XVec implements vectors of fixed-length GF2X's.  You canallocate a vector of GF2X's of a specified length, where the maximumsize of each GF2X is also specified.  These parameters can be specifiedonce, either with a constructor, or with SetSize.  It is an error totry to re-size a vector, or store a GF2X that doesn't fit.  The spacecan be released with "kill", and then you are free to call SetSizeagain.  If you want more flexible---but less efficient---vectors, usevec_GF2X.\**************************************************************************/#include <NTL/GF2X.h>class GF2XVec {public:   GF2XVec();   GF2XVec& operator=(const GF2XVec&);    // first kill()'s destination (unless source and destination are   // identical)   GF2XVec(const GF2XVec&);    ~GF2XVec();   GF2XVec(long n, long d);   // sets length to n and max size of each element to d,   // where the size d measures the number of words    void SetSize(long n, long d);   // sets length to n and max size of each element to d,   // where the size d measures the number of words    long length() const;   // length of vector   long BaseSize() const;   // max size of each element   void kill();   // release space   GF2X* elts();   const GF2X* elts() const;   // pointer to first element   GF2X& operator[](long i);   const GF2X& operator[](long i) const;   // indexing operator; starts at 0; no range checking};void swap(GF2XVec& x, GF2XVec& y);// swaps x and y by swapping pointers

⌨️ 快捷键说明

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