source: git/ntl/doc/ZZVec.txt @ 26e030

spielwiese
Last change on this file since 26e030 was e6caf81, checked in by Hans Schönemann <hannes@…>, 20 years ago
*hannes: 5.3.2 git-svn-id: file:///usr/local/Singular/svn/trunk@7472 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1.5 KB
Line 
1
2/**************************************************************************\
3
4MODULE: ZZVec
5
6SUMMARY:
7
8The class ZZVec implements vectors of fixed-length ZZ's.  You can
9allocate a vector of ZZ's of a specified length, where the maximum
10size of each ZZ is also specified.  The size is measured in terms
11of the number of zzigits.
12
13These parameters can be specified either with a constructor
14or with SetSize.  It is an error to try to re-size a vector of non-zero length,
15or store a ZZ that doesn't fit.  The space can be released with "kill",
16and then you are free to call SetSize again. 
17
18If you want more flexible---but less efficient---vectors, use vec_ZZ.
19
20\**************************************************************************/
21
22#include <NTL/ZZ.h>
23
24
25class ZZVec {
26public:
27   ZZVec();
28
29   ZZVec& operator=(const ZZVec&);
30   // first kill()'s destination (unless source and destination are
31   // identical)
32
33   ZZVec(const ZZVec&);
34
35   ~ZZVec();
36
37   ZZVec(long n, long d);
38   // sets length to n and max size of each element to d
39
40   void SetSize(long n, long d);
41   // sets length to n and max size of each element to d
42
43   long length() const;
44   // length of vector
45
46   long BaseSize() const;
47   // max size of each element
48
49   void kill();
50   // release space
51
52
53   ZZ* elts();
54   const ZZ* elts() const;
55   // pointer to first element
56
57   ZZ& operator[](long i);
58   const ZZ& operator[](long i) const;
59   // indexing operator; starts at 0; no range checking
60};
61
62
63void swap(ZZVec& x, ZZVec& y);
64// swaps x and y by swapping pointers
65
Note: See TracBrowser for help on using the repository browser.