numerix_doc 0.4
modulus_add_integer_naive< V > Struct Template Reference

#include <modular_integer.hpp>

List of all members.

Static Public Member Functions


Detailed Description

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

Definition at line 39 of file modular_integer.hpp.


Member Function Documentation

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

Definition at line 62 of file modular_integer.hpp.

Referenced by modulus_add_integer_naive< modulus_reduction_naive< modulus_normalization_integer_naive > >::add_mod().

                                            {
    dest += s;
    if (dest >= m.p) dest -= m.p; }
static void add_mod ( C dest,
const C s1,
const C s2,
const M &  m,
C carry 
) [inline, static]

Definition at line 78 of file modular_integer.hpp.

                                                                    {
    dest = s1;
    add_mod (dest, s2, m, carry); }
static void add_mod ( C dest,
const C s,
const M &  m,
C carry 
) [inline, static]

Definition at line 67 of file modular_integer.hpp.

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

Definition at line 73 of file modular_integer.hpp.

                                                          {
    dest = s1;
    add_mod (dest, s2, m); }
static void neg_mod ( C dest,
const M &  m 
) [inline, static]

Definition at line 42 of file modular_integer.hpp.

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

Definition at line 56 of file modular_integer.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,
C carry 
) [inline, static]

Definition at line 46 of file modular_integer.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 51 of file modular_integer.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 
) [inline, static]

Definition at line 103 of file modular_integer.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 s1,
const C s2,
const M &  m,
C carry 
) [inline, static]

Definition at line 108 of file modular_integer.hpp.

                                                                    {
    dest = s1;
    sub_mod (dest, s2, m, carry); }
static void sub_mod ( C dest,
const C s,
const M &  m,
C carry 
) [inline, static]

Definition at line 99 of file modular_integer.hpp.

                                                      {
    sub_mod_core (dest, s, m.p, carry); }
static void sub_mod_core ( C dest,
const C s,
const C p 
) [inline, static]

Definition at line 83 of file modular_integer.hpp.

Referenced by modulus_add_integer_naive< modulus_reduction_naive< modulus_normalization_integer_naive > >::sub_mod().

                                                 {
    if (dest < s) dest += p;
    dest -= s; }
static void sub_mod_core ( C dest,
const C s,
const C p,
C carry 
) [inline, static]

Definition at line 88 of file modular_integer.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; }

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