numerix_doc 0.4
modular< M, V > Class Template Reference

#include <modular.hpp>

List of all members.

Public Types

Public Member Functions

Static Public Member Functions

Public Attributes


Detailed Description

template<typename M, typename V = typename modular_variant_helper< M >::MV>
class mmx::modular< M, V >

Examples:

modular_test.cpp.

Definition at line 96 of file modular.hpp.


Member Typedef Documentation

typedef M::base C

Definition at line 100 of file modular.hpp.

typedef M modulus

Definition at line 99 of file modular.hpp.

typedef V::template modulus_storage<M> S

Definition at line 101 of file modular.hpp.


Constructor & Destructor Documentation

modular ( ) [inline]

Definition at line 112 of file modular.hpp.

References mmx::encode_mod(), modular< M, V >::get_modulus(), and modular< M, V >::rep.

{ encode_mod (rep, C (), get_modulus ()); }
modular ( const modular< M, V > &  s) [inline]

Definition at line 114 of file modular.hpp.

: rep (s.rep) {}
modular ( const C a,
bool  reduced 
) [inline]

Definition at line 116 of file modular.hpp.

References mmx::encode_mod(), modular< M, V >::get_modulus(), and modular< M, V >::rep.

                                            {
    if (reduced) rep = a;
    else encode_mod (rep, a, get_modulus ()); }
modular ( const C s,
const M &  p,
bool  reduced = false 
) [inline]

Definition at line 120 of file modular.hpp.

References mmx::encode_mod(), modular< M, V >::get_modulus(), and modular< M, V >::rep.

                                                              {
    VERIFY (p == get_modulus (), "wrong modulus");
    if (reduced) rep= s; 
    else encode_mod (rep, s, p); }
modular ( const O &  a) [inline]

Definition at line 126 of file modular.hpp.

References mmx::encode_mod(), modular< M, V >::get_modulus(), and modular< M, V >::rep.

                              {
    encode_mod (rep, as<C> (a), get_modulus ()); }

Member Function Documentation

static M get_modulus ( ) [inline, static]
bool operator!= ( const modular< M, V > &  a) const [inline]

Definition at line 136 of file modular.hpp.

References modular< M, V >::rep.

                                                   {
    return rep != a.rep; }
C operator* ( ) const [inline]

Definition at line 107 of file modular.hpp.

References mmx::decode_mod(), modular< M, V >::get_modulus(), and modular< M, V >::rep.

                               {
    C dest;
    decode_mod (dest, rep, get_modulus ());
    return dest; }
modular<M,V>& operator= ( const modular< M, V > &  a) [inline]

Definition at line 129 of file modular.hpp.

References modular< M, V >::rep.

                                                {
    rep = a.rep;
    return *this; }
bool operator== ( const modular< M, V > &  a) const [inline]

Definition at line 133 of file modular.hpp.

References modular< M, V >::rep.

                                                   {
    return rep == a.rep; }
static void set_modulus ( const M &  p) [inline, static]

Member Data Documentation


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