modulus_add_int_naive< V > Struct Template Reference

#include <modular_int.hpp>

List of all members.

Classes

Static Public Member Functions


Detailed Description

template<typename V>
struct mmx::modulus_add_int_naive< V >

Definition at line 107 of file modular_int.hpp.


Member Function Documentation

static void add_mod ( C dest,
const C s1,
const C s2,
const M &  m,
C carry 
) [inline, static]

Definition at line 208 of file modular_int.hpp.

00208                                                                     {
00209     dest = s1;
00210     add_mod (dest, s2, m, carry); }

static void add_mod ( C dest,
const C s1,
const C s2,
const M &  m 
) [inline, static]

Definition at line 203 of file modular_int.hpp.

00203                                                           {
00204     dest = s1;
00205     add_mod (dest, s2, m); }

static void add_mod ( C dest,
const C s,
const M &  m,
C carry 
) [inline, static]

Definition at line 199 of file modular_int.hpp.

00199                                                       {
00200     add_mod_core (dest, s, m.p, carry); }

static void add_mod ( C dest,
const C s,
const M &  m 
) [inline, static]
static void add_mod_core ( C dest,
const C s,
const C p,
C carry 
) [inline, static]

Definition at line 191 of file modular_int.hpp.

00191                                                            {
00192     add_mod_helper<C,is_signed_helper<C>::value>::op (dest, s, p, carry); }

static void add_mod_core ( C dest,
const C s,
const C p 
) [inline, static]

Definition at line 187 of file modular_int.hpp.

Referenced by modulus_add_int_naive< modulus_reduction_int_naive< modulus_normalization_int_naive< modulus_maximum_size_int< size > > > >::add_mod().

00187                                                  {
00188     add_mod_helper<C,is_signed_helper<C>::value>::op (dest, s, p); }

static void add_mod_with_overflow ( C dest,
const C s,
const C p,
C carry 
) [inline, static]

Definition at line 146 of file modular_int.hpp.

00146                                                                     {
00147     VERIFY (carry == 0 || carry == 1, "unexpected large carry");
00148     dest += s + carry;
00149     if (dest < s || dest >= p) { dest -= p; carry= 1; }
00150     else carry= 0; }

static void add_mod_with_overflow ( C dest,
const C s,
const C p 
) [inline, static]

Definition at line 140 of file modular_int.hpp.

Referenced by add_mod_helper< C, false >::op().

00140                                                           {
00141     dest += s;
00142     if (dest < s) { dest -= p; return; }
00143     if (dest >= p) dest -= p; }

static void add_mod_without_overflow ( C dest,
const C s,
const C p,
C carry 
) [inline, static]

Definition at line 134 of file modular_int.hpp.

00134                                                                        {
00135     VERIFY (carry == 0 || carry == 1, "unexpected large carry");
00136     dest += s + carry;
00137     if (dest >= p) { dest -= p; carry= 1; } else carry= 0; }

static void add_mod_without_overflow ( C dest,
const C s,
const C p 
) [inline, static]

Definition at line 129 of file modular_int.hpp.

Referenced by add_mod_helper< C, false >::op(), and add_mod_helper< C, b >::op().

00129                                                              {
00130     dest += s;
00131     if (dest >= p) dest -= p; }

static void neg_mod ( C dest,
const C s,
const M &  m,
C carry 
) [inline, static]

Definition at line 123 of file modular_int.hpp.

00123                                                       {
00124     VERIFY (carry == 0 || carry == 1, "unexpected large carry");
00125     if (s != 0 || carry != 0) { dest= m.p - s - carry; carry= 1; }
00126     else dest= 0; }

static void neg_mod ( C dest,
const C s,
const M &  m 
) [inline, static]

Definition at line 119 of file modular_int.hpp.

00119                                             {
00120     if (s != 0) dest = m.p - s; else dest = s; }

static void neg_mod ( C dest,
const M &  m,
C carry 
) [inline, static]

Definition at line 114 of file modular_int.hpp.

00114                                           {
00115     VERIFY (carry == 0 || carry == 1, "unexpected large carry");
00116     if (dest != 0 || carry != 0) { dest= m.p - dest - carry; carry= 1; } }

static void neg_mod ( C dest,
const M &  m 
) [inline, static]

Definition at line 110 of file modular_int.hpp.

00110                                 {
00111     if (dest != 0) dest = m.p - dest; }

static void sub_mod ( C dest,
const C s1,
const C s2,
const M &  m,
C carry 
) [inline, static]

Definition at line 238 of file modular_int.hpp.

00238                                                                     {
00239     dest = s1;
00240     sub_mod (dest, s2, m, carry); }

static void sub_mod ( C dest,
const C s1,
const C s2,
const M &  m 
) [inline, static]

Definition at line 233 of file modular_int.hpp.

00233                                                           {
00234     dest = s1;
00235     sub_mod (dest, s2, m); }

static void sub_mod ( C dest,
const C s,
const M &  m,
C carry 
) [inline, static]

Definition at line 229 of file modular_int.hpp.

00229                                                       {
00230     sub_mod_core (dest, s, m.p, carry); }

static void sub_mod ( C dest,
const C s,
const M &  m 
) [inline, static]
static void sub_mod_core ( C dest,
const C s,
const C p,
C carry 
) [inline, static]

Definition at line 218 of file modular_int.hpp.

00218                                                            {
00219     VERIFY (carry == 0 || carry == 1, "unexpected large carry");
00220     C t = s + carry;
00221     if (t == p || dest < t) { dest += p; carry= 1; } else carry= 0;
00222     dest -= t; }

static void sub_mod_core ( C dest,
const C s,
const C p 
) [inline, static]

Definition at line 213 of file modular_int.hpp.

Referenced by modulus_add_int_naive< modulus_reduction_int_naive< modulus_normalization_int_naive< modulus_maximum_size_int< size > > > >::sub_mod().

00213                                                  {
00214     if (dest < s) dest += p;
00215     dest -= s; }


The documentation for this struct was generated from the following file:

Generated on 6 Dec 2012 for numerix by  doxygen 1.6.1