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 >

Definition at line 115 of file modular.hpp.


Member Typedef Documentation

typedef M::base C

Definition at line 119 of file modular.hpp.

typedef M modulus

Definition at line 118 of file modular.hpp.

typedef V::template modulus_storage<M> S

Definition at line 120 of file modular.hpp.


Constructor & Destructor Documentation

modular (  )  [inline]

Definition at line 131 of file modular.hpp.

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

00131 { encode_mod (rep, C (), get_modulus ()); }

modular ( const modular< M, V > &  s  )  [inline]

Definition at line 133 of file modular.hpp.

00133 : rep (s.rep) {}

modular ( const C a,
bool  reduced 
) [inline]

Definition at line 135 of file modular.hpp.

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

00135                                             {
00136     if (reduced) rep = a;
00137     else encode_mod (rep, a, get_modulus ()); }

modular ( const C s,
const M &  p,
bool  reduced = false 
) [inline]

Definition at line 139 of file modular.hpp.

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

00139                                                               {
00140     VERIFY (p == get_modulus (), "wrong modulus");
00141     if (reduced) rep= s; 
00142     else encode_mod (rep, s, p); }

modular ( const O &  a  )  [inline]

Definition at line 145 of file modular.hpp.

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

00145                               {
00146     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 155 of file modular.hpp.

References modular< M, V >::rep.

00155                                                    {
00156     return rep != a.rep; }

C operator* (  )  const [inline]

Definition at line 126 of file modular.hpp.

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

00126                                {
00127     C dest;
00128     decode_mod (dest, rep, get_modulus ());
00129     return dest; }

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

Definition at line 148 of file modular.hpp.

References modular< M, V >::rep.

00148                                                 {
00149     rep = a.rep;
00150     return *this; }

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

Definition at line 152 of file modular.hpp.

References modular< M, V >::rep.

00152                                                    {
00153     return rep == a.rep; }

static void set_modulus ( const M &  p  )  [inline, static]

Member Data Documentation

C rep

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

Generated on 6 Dec 2012 for numerix by  doxygen 1.6.1