implementation< crt_project, V, crt_signed< W > > Struct Template Reference
#include <crt_naive.hpp>
List of all members.
Static Public Member Functions
- template<typename M > static M::base half (const M &P)
- template<typename C , typename M > static M::base encode (const C &a, const M &p)
- template<typename C , typename M > static C decode (const C &a, const M &P, const C &H)
Detailed Description
template<typename V, typename W>
struct mmx::implementation< crt_project, V, crt_signed< W > >
Definition at line 146 of file crt_naive.hpp.
Member Function Documentation
static C decode |
( |
const C & |
a, |
|
|
const M & |
P, |
|
|
const C & |
H | |
|
) |
| | [inline, static] |
Definition at line 164 of file crt_naive.hpp.
00164 {
00165 return a > H ? a - *P : a; }
static M::base encode |
( |
const C & |
a, |
|
|
const M & |
p | |
|
) |
| | [inline, static] |
Definition at line 154 of file crt_naive.hpp.
References neg_mod().
00154 {
00155 typename M::base b;
00156 if (a < 0) {
00157 b= as<typename M::base> (-a); neg_mod (b, p);
00158 }
00159 else
00160 b= as<typename M::base> (a);
00161 return b; }
static M::base half |
( |
const M & |
P |
) |
[inline, static] |
The documentation for this struct was generated from the following file: