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
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>/Volumes/unix-files/u/ntl-new/ntl-9.9.0dev/doc/GF2XVec.cpp.html</title>
<meta name="Generator" content="Vim/7.1">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#ffffff" text="#000000"><font face="monospace">
<br>
<font color="#0000ed"><i>/*</i></font><font color="#0000ed"><i>*************************************************************************\</i></font><br>
<br>
<font color="#0000ed"><i>MODULE: GF2XVec</i></font><br>
<br>
<font color="#0000ed"><i>SUMMARY:</i></font><br>
<br>
<font color="#0000ed"><i>The class GF2XVec implements vectors of fixed-length GF2X's. You can</i></font><br>
<font color="#0000ed"><i>allocate a vector of GF2X's of a specified length, where the maximum</i></font><br>
<font color="#0000ed"><i>size of each GF2X is also specified. These parameters can be specified</i></font><br>
<font color="#0000ed"><i>either with a constructor, or with SetSize. It is an error to</i></font><br>
<font color="#0000ed"><i>try to re-size a vector of non-xero , or store a GF2X that doesn't fit. </i></font><br>
<font color="#0000ed"><i>The space can be released with "kill", and then you are free to call SetSize</i></font><br>
<font color="#0000ed"><i>again. If you want more flexible---but less efficient---vectors, use</i></font><br>
<font color="#0000ed"><i>vec_GF2X.</i></font><br>
<br>
<font color="#0000ed"><i>\*************************************************************************</i></font><font color="#0000ed"><i>*/</i></font><br>
<br>
<font color="#1773cc">#include </font><font color="#4a6f8b"><NTL/GF2X.h></font><br>
<br>
<br>
<font color="#008b00"><b>class</b></font> GF2XVec {<br>
<font color="#b02f60"><b>public</b></font>:<br>
GF2XVec();<br>
<br>
GF2XVec& <font color="#b02f60"><b>operator</b></font>=(<font color="#008b00"><b>const</b></font> GF2XVec&); <br>
<font color="#0000ed"><i>// first kill()'s destination (unless source and destination are</i></font><br>
<font color="#0000ed"><i>// identical)</i></font><br>
<br>
GF2XVec(<font color="#008b00"><b>const</b></font> GF2XVec&); <br>
~GF2XVec();<br>
<br>
GF2XVec(<font color="#008b00"><b>long</b></font> n, <font color="#008b00"><b>long</b></font> d);<br>
<font color="#0000ed"><i>// sets length to n and max size of each element to d,</i></font><br>
<font color="#0000ed"><i>// where the size d measures the number of words </i></font><br>
<br>
<font color="#008b00"><b>void</b></font> SetSize(<font color="#008b00"><b>long</b></font> n, <font color="#008b00"><b>long</b></font> d);<br>
<font color="#0000ed"><i>// sets length to n and max size of each element to d,</i></font><br>
<font color="#0000ed"><i>// where the size d measures the number of words </i></font><br>
<br>
<font color="#008b00"><b>long</b></font> length() <font color="#008b00"><b>const</b></font>;<br>
<font color="#0000ed"><i>// length of vector</i></font><br>
<br>
<font color="#008b00"><b>long</b></font> BaseSize() <font color="#008b00"><b>const</b></font>;<br>
<font color="#0000ed"><i>// max size of each element</i></font><br>
<br>
<font color="#008b00"><b>void</b></font> kill();<br>
<font color="#0000ed"><i>// release space</i></font><br>
<br>
<br>
GF2X* elts();<br>
<font color="#008b00"><b>const</b></font> GF2X* elts() <font color="#008b00"><b>const</b></font>;<br>
<font color="#0000ed"><i>// pointer to first element</i></font><br>
<br>
GF2X& <font color="#b02f60"><b>operator</b></font>[](<font color="#008b00"><b>long</b></font> i);<br>
<font color="#008b00"><b>const</b></font> GF2X& <font color="#b02f60"><b>operator</b></font>[](<font color="#008b00"><b>long</b></font> i) <font color="#008b00"><b>const</b></font>;<br>
<font color="#0000ed"><i>// indexing operator; starts at 0; no range checking</i></font><br>
};<br>
<br>
<br>
<font color="#008b00"><b>void</b></font> swap(GF2XVec& x, GF2XVec& y);<br>
<font color="#0000ed"><i>// swaps x and y by swapping pointers</i></font><br>
<br>
</font></body>
</html>
|