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

📄 zzvec.txt

📁 数值算法库for Windows
💻 TXT
字号:

/**************************************************************************\

MODULE: ZZVec

SUMMARY:

The class ZZVec implements vectors of fixed-length ZZ's.  You can
allocate a vector of ZZ's of a specified length, where the maximum
size of each ZZ is also specified.  The size is measured in terms
of the number of zzigits.

These parameters can be specified once, either with a constructor, 
or with SetSize.  It is an error to try to re-size a vector, 
or store a ZZ that doesn't fit.  The space can be released with "kill", 
and then you are free to call SetSize again.  

If you want more flexible---but less efficient---vectors, use vec_ZZ.

\**************************************************************************/

#include <NTL/ZZ.h>


class ZZVec {
public:
   ZZVec();

   ZZVec& operator=(const ZZVec&); 
   // first kill()'s destination (unless source and destination are
   // identical)

   ZZVec(const ZZVec&); 

   ~ZZVec();

   ZZVec(long n, long d);
   // sets length to n and max size of each element to d

   void SetSize(long n, long d);
   // sets length to n and max size of each element to d

   long length() const;
   // length of vector

   long BaseSize() const;
   // max size of each element

   void kill();
   // release space


   ZZ* elts();
   const ZZ* elts() const;
   // pointer to first element

   ZZ& operator[](long i);
   const ZZ& operator[](long i) const;
   // indexing operator; starts at 0; no range checking
};


void swap(ZZVec& x, ZZVec& y);
// swaps x and y by swapping pointers

⌨️ 快捷键说明

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