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

📄 polynomi_8h-source.html

📁 著名的密码库Crypto++的文档 C++语言的杰作。程序员必备。
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<a name="l00166"></a><a class="code" href="class_polynomial_over_fixed_ring.html#0db1534646ae791c106da6244896e46f">00166</a>         <span class="keyword">typedef</span> <span class="keyword">typename</span> T::Element <a class="code" href="class_polynomial_over_fixed_ring.html#0db1534646ae791c106da6244896e46f">CoefficientType</a>;<a name="l00167"></a><a class="code" href="class_polynomial_over_fixed_ring.html#7c46ac2217af15c40b628022053e4979">00167</a>         <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="class_polynomial_over_1_1_divide_by_zero.html" title="division by zero exception">B::DivideByZero</a> <a class="code" href="class_polynomial_over_1_1_divide_by_zero.html" title="division by zero exception">DivideByZero</a>;<a name="l00168"></a><a class="code" href="class_polynomial_over_fixed_ring.html#b606ab5ea3059ba7b6725973bfc3fa5d">00168</a>         <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="class_polynomial_over_1_1_randomization_parameter.html" title="specify the distribution for randomization functions">B::RandomizationParameter</a> <a class="code" href="class_polynomial_over_1_1_randomization_parameter.html" title="specify the distribution for randomization functions">RandomizationParameter</a>;<a name="l00169"></a>00169 <span class="comment"></span><a name="l00170"></a>00170 <span class="comment">        //! \name CREATORS</span><a name="l00171"></a>00171 <span class="comment"></span><span class="comment">        //@{</span><a name="l00172"></a>00172 <span class="comment"></span><span class="comment">                //! creates the zero polynomial</span><a name="l00173"></a><a class="code" href="class_polynomial_over_fixed_ring.html#8e10a57bab595f53a2055bcfb03fb66e">00173</a> <span class="comment"></span>                <a class="code" href="class_polynomial_over_fixed_ring.html#8e10a57bab595f53a2055bcfb03fb66e" title="creates the zero polynomial">PolynomialOverFixedRing</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> count = 0) : <a class="code" href="class_polynomial_over.html" title="represents single-variable polynomials over arbitrary rings">B</a>(ms_fixedRing, count) {}<a name="l00174"></a>00174 <span class="comment"></span><a name="l00175"></a>00175 <span class="comment">                //! copy constructor</span><a name="l00176"></a><a class="code" href="class_polynomial_over_fixed_ring.html#d63e985a7c37535ea710b7779ecfb3aa">00176</a> <span class="comment"></span>                <a class="code" href="class_polynomial_over_fixed_ring.html#8e10a57bab595f53a2055bcfb03fb66e" title="creates the zero polynomial">PolynomialOverFixedRing</a>(<span class="keyword">const</span> <a class="code" href="class_polynomial_over_fixed_ring.html" title="Polynomials over a fixed ring.">ThisType</a> &amp;t) : <a class="code" href="class_polynomial_over.html" title="represents single-variable polynomials over arbitrary rings">B</a>(t) {}<a name="l00177"></a>00177 <a name="l00178"></a><a class="code" href="class_polynomial_over_fixed_ring.html#9e789b2a6cc07a99e96c5887ad24bf4c">00178</a>                 <span class="keyword">explicit</span> <a class="code" href="class_polynomial_over_fixed_ring.html#8e10a57bab595f53a2055bcfb03fb66e" title="creates the zero polynomial">PolynomialOverFixedRing</a>(<span class="keyword">const</span> <a class="code" href="class_polynomial_over.html" title="represents single-variable polynomials over arbitrary rings">B</a> &amp;t) : <a class="code" href="class_polynomial_over.html" title="represents single-variable polynomials over arbitrary rings">B</a>(t) {}<a name="l00179"></a>00179 <span class="comment"></span><a name="l00180"></a>00180 <span class="comment">                //! construct constant polynomial</span><a name="l00181"></a><a class="code" href="class_polynomial_over_fixed_ring.html#dbff44242557cef909c01a74d75d181e">00181</a> <span class="comment"></span>                <a class="code" href="class_polynomial_over_fixed_ring.html#8e10a57bab595f53a2055bcfb03fb66e" title="creates the zero polynomial">PolynomialOverFixedRing</a>(<span class="keyword">const</span> <a class="code" href="class_polynomial_over_fixed_ring.html#0db1534646ae791c106da6244896e46f">CoefficientType</a> &amp;element) : <a class="code" href="class_polynomial_over.html" title="represents single-variable polynomials over arbitrary rings">B</a>(element) {}<a name="l00182"></a>00182 <span class="comment"></span><a name="l00183"></a>00183 <span class="comment">                //! construct polynomial with specified coefficients, starting from coefficient of x^0</span><a name="l00184"></a><a class="code" href="class_polynomial_over_fixed_ring.html#f56946dfdf8007a92ad56388c99313be">00184</a> <span class="comment"></span>                <span class="keyword">template</span> &lt;<span class="keyword">typename</span> Iterator&gt; <a class="code" href="class_polynomial_over_fixed_ring.html#8e10a57bab595f53a2055bcfb03fb66e" title="creates the zero polynomial">PolynomialOverFixedRing</a>(Iterator first, Iterator last)<a name="l00185"></a>00185                         : <a class="code" href="class_polynomial_over.html" title="represents single-variable polynomials over arbitrary rings">B</a>(first, last) {}<a name="l00186"></a>00186 <span class="comment"></span><a name="l00187"></a>00187 <span class="comment">                //! convert from string</span><a name="l00188"></a><a class="code" href="class_polynomial_over_fixed_ring.html#ebbb74586712f3f825c4fa4894fbf217">00188</a> <span class="comment"></span>                <span class="keyword">explicit</span> <a class="code" href="class_polynomial_over_fixed_ring.html#8e10a57bab595f53a2055bcfb03fb66e" title="creates the zero polynomial">PolynomialOverFixedRing</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *str) : <a class="code" href="class_polynomial_over.html" title="represents single-variable polynomials over arbitrary rings">B</a>(str, ms_fixedRing) {}<a name="l00189"></a>00189 <span class="comment"></span><a name="l00190"></a>00190 <span class="comment">                //! convert from big-endian byte array</span><a name="l00191"></a><a class="code" href="class_polynomial_over_fixed_ring.html#38de0135bd58a61176cef61bc6397c47">00191</a> <span class="comment"></span>                <a class="code" href="class_polynomial_over_fixed_ring.html#8e10a57bab595f53a2055bcfb03fb66e" title="creates the zero polynomial">PolynomialOverFixedRing</a>(<span class="keyword">const</span> byte *encodedPoly, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> byteCount) : <a class="code" href="class_polynomial_over.html" title="represents single-variable polynomials over arbitrary rings">B</a>(encodedPoly, byteCount) {}<a name="l00192"></a>00192 <span class="comment"></span><a name="l00193"></a>00193 <span class="comment">                //! convert from Basic Encoding Rules encoded byte array</span><a name="l00194"></a><a class="code" href="class_polynomial_over_fixed_ring.html#eea00158952013a08cd97d1a416fa5a4">00194</a> <span class="comment"></span>                <span class="keyword">explicit</span> <a class="code" href="class_polynomial_over_fixed_ring.html#8e10a57bab595f53a2055bcfb03fb66e" title="creates the zero polynomial">PolynomialOverFixedRing</a>(<span class="keyword">const</span> byte *BEREncodedPoly) : <a class="code" href="class_polynomial_over.html" title="represents single-variable polynomials over arbitrary rings">B</a>(BEREncodedPoly) {}<a name="l00195"></a>00195 <span class="comment"></span><a name="l00196"></a>00196 <span class="comment">                //! convert from BER encoded byte array stored in a BufferedTransformation object</span><a name="l00197"></a><a class="code" href="class_polynomial_over_fixed_ring.html#c24e06202bb7b81088948d6aa2c9d54f">00197</a> <span class="comment"></span>                <span class="keyword">explicit</span> <a class="code" href="class_polynomial_over_fixed_ring.html#8e10a57bab595f53a2055bcfb03fb66e" title="creates the zero polynomial">PolynomialOverFixedRing</a>(<a class="code" href="class_buffered_transformation.html" title="interface for buffered transformations">BufferedTransformation</a> &amp;bt) : <a class="code" href="class_polynomial_over.html" title="represents single-variable polynomials over arbitrary rings">B</a>(bt) {}<a name="l00198"></a>00198 <span class="comment"></span><a name="l00199"></a>00199 <span class="comment">                //! create a random PolynomialOverFixedRing</span><a name="l00200"></a><a class="code" href="class_polynomial_over_fixed_ring.html#49d91088bbec643b9e5b8db7c8c1e89b">00200</a> <span class="comment"></span>                <a class="code" href="class_polynomial_over_fixed_ring.html#8e10a57bab595f53a2055bcfb03fb66e" title="creates the zero polynomial">PolynomialOverFixedRing</a>(<a class="code" href="class_random_number_generator.html" title="interface for random number generators">RandomNumberGenerator</a> &amp;rng, <span class="keyword">const</span> <a class="code" href="class_polynomial_over_1_1_randomization_parameter.html" title="specify the distribution for randomization functions">RandomizationParameter</a> &amp;parameter) : <a class="code" href="class_polynomial_over.html" title="represents single-variable polynomials over arbitrary rings">B</a>(rng, parameter, ms_fixedRing) {}<a name="l00201"></a>00201 <a name="l00202"></a>00202                 <span class="keyword">static</span> <span class="keyword">const</span> ThisType &amp;<a class="code" href="class_polynomial_over_fixed_ring.html#cf15e24394702ba6916a0857cc4e427c">Zero</a>();<a name="l00203"></a>00203                 <span class="keyword">static</span> <span class="keyword">const</span> ThisType &amp;<a class="code" href="class_polynomial_over_fixed_ring.html#c9c05659468142af8935952fbe4e5504">One</a>();<span class="comment"></span><a name="l00204"></a>00204 <span class="comment">        //@}</span><a name="l00205"></a>00205 <span class="comment"></span><span class="comment"></span><a name="l00206"></a>00206 <span class="comment">        //! \name ACCESSORS</span><a name="l00207"></a>00207 <span class="comment"></span><span class="comment">        //@{</span><a name="l00208"></a>00208 <span class="comment"></span><span class="comment">                //! the zero polynomial will return a degree of -1</span><a name="l00209"></a><a class="code" href="class_polynomial_over_fixed_ring.html#dc7375389ed8759970361a61cce61ea0">00209</a> <span class="comment"></span>                <span class="keywordtype">int</span> <a class="code" href="class_polynomial_over_fixed_ring.html#dc7375389ed8759970361a61cce61ea0" title="the zero polynomial will return a degree of -1">Degree</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="class_polynomial_over.html#604beee6d397108b3334eaeb564b641a" title="the zero polynomial will return a degree of -1">B::Degree</a>(ms_fixedRing);}<span class="comment"></span><a name="l00210"></a>00210 <span class="comment">                //! degree + 1</span><a name="l00211"></a><a class="code" href="class_polynomial_over_fixed_ring.html#5e659b8a429b441a1ae1d6e544ebf189">00211</a> <span class="comment"></span>                <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_polynomial_over_fixed_ring.html#5e659b8a429b441a1ae1d6e544ebf189" title="degree + 1">CoefficientCount</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="class_polynomial_over.html#65c6004a42608f31008ff066f2eba3e2">B::CoefficientCount</a>(ms_fixedRing);}<span class="comment"></span><a name="l00212"></a>00212 <span class="comment">                //! return coefficient for x^i</span><a name="l00213"></a><a class="code" href="class_polynomial_over_fixed_ring.html#9a8792968ce06c04c438d87146314e31">00213</a> <span class="comment"></span>                <a class="code" href="class_polynomial_over_fixed_ring.html#0db1534646ae791c106da6244896e46f">CoefficientType</a> <a class="code" href="class_polynomial_over_fixed_ring.html#9a8792968ce06c04c438d87146314e31" title="return coefficient for x^i">GetCoefficient</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i)<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="class_polynomial_over.html#e35221cf35e25478e07de2e5fcebf0f9" title="return coefficient for x^i">B::GetCoefficient</a>(i, ms_fixedRing);}<span class="comment"></span><a name="l00214"></a>00214 <span class="comment">                //! return coefficient for x^i</span><a name="l00215"></a><a class="code" href="class_polynomial_over_fixed_ring.html#d8abf938fb1aaedc4d6855f9e0e4da20">00215</a> <span class="comment"></span>                <a class="code" href="class_polynomial_over_fixed_ring.html#0db1534646ae791c106da6244896e46f">CoefficientType</a> <a class="code" href="class_polynomial_over_fixed_ring.html#d8abf938fb1aaedc4d6855f9e0e4da20" title="return coefficient for x^i">operator[]</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i)<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="class_polynomial_over.html#e35221cf35e25478e07de2e5fcebf0f9" title="return coefficient for x^i">B::GetCoefficient</a>(i, ms_fixedRing);}<span class="comment"></span><a name="l00216"></a>00216 <span class="comment">        //@}</span><a name="l00217"></a>00217 <span class="comment"></span><span class="comment"></span><a name="l00218"></a>00218 <span class="comment">        //! \name MANIPULATORS</span><a name="l00219"></a>00219 <span class="comment"></span><span class="comment">        //@{</span><a name="l00220"></a>00220 <span class="comment"></span><span class="comment">                //!</span><a name="l00221"></a><a class="code" href="class_polynomial_over_fixed_ring.html#aae7212a3da16c14b3d577db74ff30d7">00221</a> <span class="comment"></span>                <a class="code" href="class_polynomial_over_fixed_ring.html" title="Polynomials over a fixed ring.">ThisType</a>&amp;  <a class="code" href="class_polynomial_over_fixed_ring.html#aae7212a3da16c14b3d577db74ff30d7">operator=</a>(<span class="keyword">const</span> <a class="code" href="class_polynomial_over_fixed_ring.html" title="Polynomials over a fixed ring.">ThisType</a>&amp; t) {B::operator=(t); <span class="keywordflow">return</span> *<span class="keyword">this</span>;}<span class="comment"></span><a name="l00222"></a>00222 <span class="comment">                //!</span><a name="l00223"></a><a class="code" href="class_polynomial_over_fixed_ring.html#3dc64af1ce335a8d0f92d1b253d60d24">00223</a> <span class="comment"></span>                <a class="code" href="class_polynomial_over_fixed_ring.html" title="Polynomials over a fixed ring.">ThisType</a>&amp;  <a class="code" href="class_polynomial_over_fixed_ring.html#3dc64af1ce335a8d0f92d1b253d60d24">operator+=</a>(<span class="keyword">const</span> <a class="code" href="class_polynomial_over_fixed_ring.html" title="Polynomials over a fixed ring.">ThisType</a>&amp; t) {Accumulate(t, ms_fixedRing); <span class="keywordflow">return</span> *<span class="keyword">this</span>;}<span class="comment"></span><a name="l00224"></a>00224 <span class="comment">                //!</span><a name="l00225"></a><a class="code" href="class_polynomial_over_fixed_ring.html#791c31f75ff6d84ffe3821a2bb49697a">00225</a> <span class="comment"></span>                <a class="code" href="class_polynomial_over_fixed_ring.html" title="Polynomials over a fixed ring.">ThisType</a>&amp;  <a class="code" href="class_polynomial_over_fixed_ring.html#791c31f75ff6d84ffe3821a2bb49697a">operator-=</a>(<span class="keyword">const</span> <a class="code" href="class_polynomial_over_fixed_ring.html" title="Polynomials over a fixed ring.">ThisType</a>&amp; t) {Reduce(t, ms_fixedRing); <span class="keywordflow">return</span> *<span class="keyword">this</span>;}<span class="comment"></span><a name="l00226"></a>00226 <span class="comment">                //!</span><a name="l00227"></a><a class="code" href="class_polynomial_over_fixed_ring.html#cce8894cfbdaa5ad709bdc8bbe693461">00227</a> <span class="comment"></span>                <a class="code" href="class_polynomial_over_fixed_ring.html" title="Polynomials over a fixed ring.">ThisType</a>&amp;  <a class="code" href="class_polynomial_over_fixed_ring.html#cce8894cfbdaa5ad709bdc8bbe693461">operator*=</a>(<span class="keyword">const</span> <a class="code" href="class_polynomial_over_fixed_ring.html" title="Polynomials over a fixed ring.">ThisType</a>&amp; t) {<span class="keywordflow">return</span> *<span class="keyword">this</span> = *<span class="keyword">this</span>*t;}<span class="comment"></span>

⌨️ 快捷键说明

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