-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathZZVec.cpp.html
94 lines (69 loc) · 3.88 KB
/
ZZVec.cpp.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>/Volumes/Unix/unix-files.noindex/ntl-new/ntl-9.6.0/doc/ZZVec.cpp.html</title>
<meta name="Generator" content="Vim/7.3">
<meta name="plugin-version" content="vim7.3_v6">
<meta name="syntax" content="cpp">
<meta name="settings" content="use_css">
<style type="text/css">
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffff; }
body { font-family: monospace; color: #000000; background-color: #ffffff; }
.Statement { color: #b03060; font-weight: bold; }
.Type { color: #008b00; font-weight: bold; }
.String { color: #4a708b; }
.PreProc { color: #1874cd; }
.Comment { color: #0000ee; font-style: italic; }
-->
</style>
</head>
<body>
<pre>
<span class="Comment">/*</span><span class="Comment">*************************************************************************\</span>
<span class="Comment">MODULE: ZZVec</span>
<span class="Comment">SUMMARY:</span>
<span class="Comment">The class ZZVec implements vectors of fixed-length ZZ's. You can</span>
<span class="Comment">allocate a vector of ZZ's of a specified length, where the maximum</span>
<span class="Comment">size of each ZZ is also specified. The size is measured in terms</span>
<span class="Comment">of the number of zzigits.</span>
<span class="Comment">These parameters can be specified either with a constructor </span>
<span class="Comment">or with SetSize. It is an error to try to re-size a vector of non-zero length,</span>
<span class="Comment">or store a ZZ that doesn't fit. The space can be released with "kill", </span>
<span class="Comment">and then you are free to call SetSize again. </span>
<span class="Comment">If you want more flexible---but less efficient---vectors, use vec_ZZ.</span>
<span class="Comment">\*************************************************************************</span><span class="Comment">*/</span>
<span class="PreProc">#include </span><span class="String"><NTL/ZZ.h></span>
<span class="Type">class</span> ZZVec {
<span class="Statement">public</span>:
ZZVec();
ZZVec& <span class="Statement">operator</span>=(<span class="Type">const</span> ZZVec&);
<span class="Comment">// first kill()'s destination (unless source and destination are</span>
<span class="Comment">// identical)</span>
ZZVec(<span class="Type">const</span> ZZVec&);
~ZZVec();
ZZVec(<span class="Type">long</span> n, <span class="Type">long</span> d);
<span class="Comment">// sets length to n and max size of each element to d</span>
<span class="Type">void</span> SetSize(<span class="Type">long</span> n, <span class="Type">long</span> d);
<span class="Comment">// sets length to n and max size of each element to d</span>
<span class="Type">long</span> length() <span class="Type">const</span>;
<span class="Comment">// length of vector</span>
<span class="Type">long</span> BaseSize() <span class="Type">const</span>;
<span class="Comment">// max size of each element</span>
<span class="Type">void</span> kill();
<span class="Comment">// release space</span>
ZZ* elts();
<span class="Type">const</span> ZZ* elts() <span class="Type">const</span>;
<span class="Comment">// pointer to first element</span>
ZZ& <span class="Statement">operator</span>[](<span class="Type">long</span> i);
<span class="Type">const</span> ZZ& <span class="Statement">operator</span>[](<span class="Type">long</span> i) <span class="Type">const</span>;
<span class="Comment">// indexing operator; starts at 0; no range checking</span>
swap(ZZVec& x);
<span class="Comment">// swap with x by swapping pointers</span>
};
<span class="Type">void</span> swap(ZZVec& x, ZZVec& y);
<span class="Comment">// swaps x and y by swapping pointers</span>
</pre>
</body>
</html>