#include <modular_polynomial.hpp>
Definition at line 99 of file modular_polynomial.hpp.
static void reduce_mod | ( | polynomial< C, V > & | dest, | |
const polynomial< C, V > & | s, | |||
const M & | m, | |||
polynomial< C, V > & | carry | |||
) | [inline, static] |
Definition at line 129 of file modular_polynomial.hpp.
References reduce_mod().
00130 { 00131 dest= s; reduce_mod (dest, m, carry); }
static void reduce_mod | ( | polynomial< C, V > & | dest, | |
const polynomial< C, V > & | s, | |||
const M & | m | |||
) | [inline, static] |
Definition at line 125 of file modular_polynomial.hpp.
References reduce_mod().
00125 { 00126 dest= s; reduce_mod (dest, m); }
static void reduce_mod | ( | polynomial< C, V > & | dest, | |
const M & | m, | |||
polynomial< C, V > & | carry | |||
) | [inline, static] |
Definition at line 112 of file modular_polynomial.hpp.
References mmx::deg(), mmx::degree(), mmx::is_exact_zero(), mmx::quo(), mmx::range(), mmx::rem(), and mmx::rshiftz().
00112 { 00113 int d= degree (m.p); 00114 if (is_exact_zero (m.p) != 0) 00115 carry= 0; 00116 else if (deg (dest) < (d << 1)) { 00117 carry = rshiftz (rshiftz (dest, d) * m.q, d); 00118 dest = range (dest - carry * m.p, 0, d); 00119 } 00120 else { 00121 carry= quo (dest, m.p); 00122 dest = rem (dest, m.p); } }
static void reduce_mod | ( | polynomial< C, V > & | dest, | |
const M & | m | |||
) | [inline, static] |
Definition at line 101 of file modular_polynomial.hpp.
References mmx::deg(), mmx::degree(), mmx::is_exact_zero(), Polynomial, mmx::range(), mmx::rem(), and mmx::rshiftz().
00101 { 00102 if (is_exact_zero (m.p)) return; 00103 int d= degree (m.p); 00104 if (deg (dest) < (d << 1)) { 00105 Polynomial carry; 00106 carry = rshiftz (rshiftz (dest, d) * m.q, d); 00107 dest = range (dest - carry * m.p, 0, d); 00108 } 00109 else dest= rem (dest, m.p); }