crt_blocks_transformer< WL, WH, s, V > Struct Template Reference

#include <crt_blocks.hpp>

List of all members.

Public Types

Public Member Functions

Public Attributes


Detailed Description

template<typename WL, typename WH, nat s = Threshold(typename WH::base,crt_blocks_threshold), typename V = typename crt_blocks_variant_helper< typename WH::base >::CV>
struct mmx::crt_blocks_transformer< WL, WH, s, V >

Definition at line 87 of file crt_blocks.hpp.


Member Typedef Documentation

typedef WL::base base

Definition at line 89 of file crt_blocks.hpp.

typedef WL::modulus_base modulus_base

Definition at line 91 of file crt_blocks.hpp.

typedef WL::modulus_base_variant modulus_base_variant

Definition at line 92 of file crt_blocks.hpp.

typedef WL::modulus_variant modulus_variant

Definition at line 90 of file crt_blocks.hpp.


Constructor & Destructor Documentation

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

Definition at line 121 of file crt_blocks.hpp.

References crt_blocks_transformer< WL, WH, s, V >::aux, crt_blocks_transformer< WL, WH, s, V >::H, crt_blocks_transformer< WL, WH, s, V >::high, crt_blocks_transformer< WL, WH, s, V >::low, crt_blocks_transformer< WL, WH, s, V >::m, min(), mmx::N(), crt_blocks_transformer< WL, WH, s, V >::n, crt_blocks_transformer< WL, WH, s, V >::P, crt_blocks_transformer< WL, WH, s, V >::product(), mmx::range(), and crt_blocks_transformer< WL, WH, s, V >::setup.

00121                                                                       {
00122     n= N(p); m= (n + s - 1) / s; setup= !lazy;
00123     if (n == 0) { P= 1; H= 0; return; }
00124     low= mmx_new<WL*> (m);
00125     vector<Modulus> v (Modulus (), m);
00126     for (nat i= 0; i < m; i++) {
00127       low[i]= mmx_new<WL> (1, range (p, i * s, min (n, (i+1) * s)), lazy);
00128       v[i]= low[i] -> product ();
00129     }
00130     high= mmx_new<WH> (1, v, lazy);
00131     P= high -> product ();
00132     H= Crt::half (P);
00133     aux= mmx_new<C> (m); }

~crt_blocks_transformer (  )  [inline]

Definition at line 135 of file crt_blocks.hpp.

References crt_blocks_transformer< WL, WH, s, V >::aux, crt_blocks_transformer< WL, WH, s, V >::high, crt_blocks_transformer< WL, WH, s, V >::low, crt_blocks_transformer< WL, WH, s, V >::m, and crt_blocks_transformer< WL, WH, s, V >::n.

00135                                     {
00136     if (n == 0) return;
00137     for (nat i= 0; i < m; i++) mmx_delete<WL> (low[i], 1);
00138     mmx_delete<WL*> (low, m);
00139     mmx_delete<WH> (high, 1);
00140     mmx_delete<C> (aux, m); }


Member Function Documentation

void combine ( C &  a,
const I *  c 
) [inline]
C comodulus ( nat  i  )  const [inline]

Definition at line 152 of file crt_blocks.hpp.

References crt_blocks_transformer< WL, WH, s, V >::high, crt_blocks_transformer< WL, WH, s, V >::low, and crt_blocks_transformer< WL, WH, s, V >::n.

00152                                    {
00153     VERIFY (i < n, "index out of range");
00154     return high -> comodulus(i / s) * low[i / s] -> comodulus(i % s); }

void direct_transform ( I *  c,
const C &  a 
) [inline]
void inverse_transform ( C &  a,
const I *  c 
) [inline]
M operator[] ( nat  i  )  const [inline]

Definition at line 142 of file crt_blocks.hpp.

References crt_blocks_transformer< WL, WH, s, V >::low, and crt_blocks_transformer< WL, WH, s, V >::n.

00142                                     {
00143     VERIFY (i < n, "index out of range");
00144     return low[i / s]-> operator [] (i % s); }

Modulus product (  )  const [inline]

Definition at line 149 of file crt_blocks.hpp.

References crt_blocks_transformer< WL, WH, s, V >::P.

Referenced by crt_blocks_transformer< WL, WH, s, V >::crt_blocks_transformer().

00149                                   {
00150     return P; }

void setup_comoduli (  )  [inline]

Definition at line 111 of file crt_blocks.hpp.

Referenced by crt_blocks_transformer< WL, WH, s, V >::combine().

00111 {}

void setup_inverse (  )  [inline]
nat size (  )  const [inline]

Definition at line 146 of file crt_blocks.hpp.

References crt_blocks_transformer< WL, WH, s, V >::n.

Referenced by mmx::N().

00146                            {
00147     return n; }


Member Data Documentation

C* aux
C H
WH* high
WL** low
nat m
nat n
bool setup

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

Generated on 6 Dec 2012 for algebramix by  doxygen 1.6.1