source: git/ntl/doc/GF2XVec.txt @ 6ce030f

spielwiese
Last change on this file since 6ce030f 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.6 KB
Line 
1
2/**************************************************************************\
3
4MODULE: GF2XVec
5
6SUMMARY:
7
8The class GF2XVec implements vectors of fixed-length GF2X's.  You can
9allocate a vector of GF2X's of a specified length, where the maximum
10size of each GF2X is also specified.  These parameters can be specified
11either with a constructor, or with SetSize.  It is an error to
12try to re-size a vector of non-xero , or store a GF2X that doesn't fit. 
13The space can be released with "kill", and then you are free to call SetSize
14again.  If you want more flexible---but less efficient---vectors, use
15vec_GF2X.
16
17\**************************************************************************/
18
19#include <NTL/GF2X.h>
20
21
22class GF2XVec {
23public:
24   GF2XVec();
25
26   GF2XVec& operator=(const GF2XVec&);
27   // first kill()'s destination (unless source and destination are
28   // identical)
29
30   GF2XVec(const GF2XVec&);
31   ~GF2XVec();
32
33   GF2XVec(long n, long d);
34   // sets length to n and max size of each element to d,
35   // where the size d measures the number of words
36
37   void SetSize(long n, long d);
38   // sets length to n and max size of each element to d,
39   // where the size d measures the number of words
40
41   long length() const;
42   // length of vector
43
44   long BaseSize() const;
45   // max size of each element
46
47   void kill();
48   // release space
49
50
51   GF2X* elts();
52   const GF2X* elts() const;
53   // pointer to first element
54
55   GF2X& operator[](long i);
56   const GF2X& operator[](long i) const;
57   // indexing operator; starts at 0; no range checking
58};
59
60
61void swap(GF2XVec& x, GF2XVec& y);
62// swaps x and y by swapping pointers
63
Note: See TracBrowser for help on using the repository browser.