modulus_encoding_int_naive< V > Struct Template Reference
#include <modular_int.hpp>
List of all members.
Static Public Member Functions
- template<typename C , typename M > static void encode_mod (C &dest, const C &s, const M &m)
- template<typename C , typename M > static void decode_mod (C &dest, const C &s, const M &m)
Detailed Description
template<typename V>
struct mmx::modulus_encoding_int_naive< V >
Definition at line 491 of file modular_int.hpp.
Member Function Documentation
static void decode_mod |
( |
C & |
dest, |
|
|
const C & |
s, |
|
|
const M & |
m | |
|
) |
| | [inline, static] |
static void encode_mod |
( |
C & |
dest, |
|
|
const C & |
s, |
|
|
const M & |
m | |
|
) |
| | [inline, static] |
Definition at line 493 of file modular_int.hpp.
00493 {
00494 typedef typename unsigned_of_helper<C>::type uC;
00495 if (sign (s) < 0) {
00496 uC tmp = - ((uC) s);
00497 V::reduce_mod (tmp, m);
00498 dest = (C) (((uC) m.p) - tmp);
00499 }
00500 else
00501 dest = s;
00502 V::reduce_mod (dest, m);
00503 }
The documentation for this struct was generated from the following file: