crt_dicho_transformer< C, S, V > Struct Template Reference

#include <crt_dicho.hpp>

List of all members.

Public Member Functions


Detailed Description

template<typename C, typename S = std_crt_dicho<C>, typename V = typename crt_dicho_variant_helper< C >::CV>
struct mmx::crt_dicho_transformer< C, S, V >

Definition at line 110 of file crt_dicho.hpp.


Constructor & Destructor Documentation

crt_dicho_transformer ( const vector< M > &  p,
bool  lazy = true 
) [inline]

Definition at line 164 of file crt_dicho.hpp.

References mmx::N(), mmx::seg(), and crt_dicho_transformer< C, S, V >::setup_inverse().

00165     : tree(NULL), k(NULL) {
00166     setup_direct (seg (p), N(p));
00167     aux= mmx_new<C> (n);
00168     if (! lazy) setup_inverse (); }

~crt_dicho_transformer (  )  [inline]

Definition at line 170 of file crt_dicho.hpp.

00170                                    {
00171     if (n == 0) return;
00172     mmx_delete<M> (p, n);
00173     mmx_delete<C> (aux, n);
00174     for (nat i= 0; i < depth; i++)
00175       mmx_delete<Modulus> (tree[i], k[i]);
00176     mmx_delete<Modulus*> (tree, depth);
00177     mmx_delete<nat> (k, depth);
00178     if (m != NULL) mmx_delete<C> (m, n); }


Member Function Documentation

void combine ( C a,
const I *  c 
) [inline]

Definition at line 198 of file crt_dicho.hpp.

00198                                          {
00199     Crt::combine (a, c, tree, k, depth, n, aux); }

C comodulus ( nat  i  )  const [inline]

Definition at line 190 of file crt_dicho.hpp.

00190                                    {
00191     VERIFY (i < n, "index out of range");
00192     return *P / m[i]; }

void direct_transform ( I *  c,
const C a 
) const [inline]

Definition at line 194 of file crt_dicho.hpp.

References mmx::C.

00194                                                         {
00195     C b= Crt::encode (a, P);
00196     Crt::direct (c, b, tree, k, depth, n, aux); }

void inverse_transform ( C a,
const I *  c 
) [inline]

Definition at line 201 of file crt_dicho.hpp.

References crt_dicho_transformer< C, S, V >::setup_inverse().

00201                                                    {
00202     setup_inverse ();
00203     Crt::inverse (a, c, tree, k, depth, m, n, P, aux);
00204     a= Crt::decode (a, P, H); }

M operator[] ( nat  i  )  const [inline]

Definition at line 180 of file crt_dicho.hpp.

00180                                     {
00181     VERIFY (i < n, "index out of range");
00182     return p[i]; }

Modulus product (  )  const [inline]

Definition at line 187 of file crt_dicho.hpp.

00187                                   {
00188     return P; }

void setup_inverse (  )  [inline]

Definition at line 153 of file crt_dicho.hpp.

References mmx::C, and inv_mod().

Referenced by crt_dicho_transformer< C, S, V >::crt_dicho_transformer(), and crt_dicho_transformer< C, S, V >::inverse_transform().

00153                                {
00154     typedef implementation<vector_linear,vector_naive> Vec;
00155     if (n == 0 || m != NULL) return;
00156     m= mmx_new<C> (n);
00157     C c;
00158     Vec::set (m, C(1), n);
00159     Crt::up (c, m, tree, k, depth, n);
00160     Crt::down (m, c, tree, k, depth, n);
00161     for (nat i= 0; i < n; i++)
00162       inv_mod (m[i], tree[0][i]); }

nat size (  )  const [inline]

Definition at line 184 of file crt_dicho.hpp.

Referenced by mmx::N().

00184                            {
00185     return n; }


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

Generated on 20 Mar 2013 for algebramix by  doxygen 1.6.1