numerix_doc 0.4
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 s,
const M &  m 
) [inline, static]
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.

                                                      {
    add_mod_core (dest, s, m.p, 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.

                                                          {
    dest = s1;
    add_mod (dest, s2, m); }
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.

                                                                    {
    dest = s1;
    add_mod (dest, s2, m, 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().

                                                 {
    add_mod_helper<C,is_signed_helper<C>::value>::op (dest, s, p); }
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.

                                                           {
    add_mod_helper<C,is_signed_helper<C>::value>::op (dest, s, p, carry); }
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.

                                                                    {
    VERIFY (carry == 0 || carry == 1, "unexpected large carry");
    dest += s + carry;
    if (dest < s || dest >= p) { dest -= p; carry= 1; }
    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 modulus_add_int_naive< V >::add_mod_helper< C, false >::op().

                                                          {
    dest += s;
    if (dest < s) { dest -= p; return; }
    if (dest >= p) dest -= p; }
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 modulus_add_int_naive< V >::add_mod_helper< C, false >::op(), and modulus_add_int_naive< V >::add_mod_helper< C, b >::op().

                                                             {
    dest += s;
    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.

                                                                       {
    VERIFY (carry == 0 || carry == 1, "unexpected large carry");
    dest += s + carry;
    if (dest >= p) { dest -= p; carry= 1; } else carry= 0; }
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.

                                                      {
    VERIFY (carry == 0 || carry == 1, "unexpected large carry");
    if (s != 0 || carry != 0) { dest= m.p - s - carry; carry= 1; }
    else dest= 0; }
static void neg_mod ( C dest,
const M &  m 
) [inline, static]

Definition at line 110 of file modular_int.hpp.

                                {
    if (dest != 0) dest = m.p - dest; }
static void neg_mod ( C dest,
const M &  m,
C carry 
) [inline, static]

Definition at line 114 of file modular_int.hpp.

                                          {
    VERIFY (carry == 0 || carry == 1, "unexpected large carry");
    if (dest != 0 || carry != 0) { dest= m.p - dest - carry; carry= 1; } }
static void neg_mod ( C dest,
const C s,
const M &  m 
) [inline, static]

Definition at line 119 of file modular_int.hpp.

                                            {
    if (s != 0) dest = m.p - s; else dest = s; }
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.

                                                                    {
    dest = s1;
    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.

                                                          {
    dest = s1;
    sub_mod (dest, s2, m); }
static void sub_mod ( C dest,
const C s,
const M &  m 
) [inline, static]
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.

                                                      {
    sub_mod_core (dest, s, m.p, carry); }
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.

                                                           {
    VERIFY (carry == 0 || carry == 1, "unexpected large carry");
    C t = s + carry;
    if (t == p || dest < t) { dest += p; carry= 1; } else carry= 0;
    dest -= t; }
static void sub_mod_core ( C dest,
const C s,
const C p 
) [inline, static]

The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Friends Defines