fft_prime_sequence_int< s > Struct Template Reference

#include <crt_int.hpp>

List of all members.

Static Public Member Functions


Detailed Description

template<nat s>
struct mmx::fft_prime_sequence_int< s >

Definition at line 195 of file crt_int.hpp.


Member Function Documentation

static bool extend ( vector< modulus< C, V > > &  v,
nat  n 
) [inline, static]

Definition at line 209 of file crt_int.hpp.

References mmx::C, mmx::is_prime(), M, mmx::N(), and mmx::value().

00209                                            {
00210     // construct prime moduli of s bits exactly,
00211     // starting with those which have a maximal number of
00212     // primitive 2^k-th roots of unity
00213     typedef modulus<C,V> M;
00214     const nat b= V::template maximum_size_helper<C>::value;
00215     ASSERT (s <= b, "bitsize overflow");
00216     ASSERT (b <= 8 * sizeof (nat), "bitsize overflow");
00217     if (s < 2 && n > 0) return false;
00218     const C m= 1 + MMX_SAFE_LEFT_SHIFT_INT (C, 1, (s-1));
00219     const C l= MMX_SAFE_LEFT_SHIFT_INT (C, 1, s);
00220     for (nat i= N(v); i < n; i++) {
00221       C j= i == 0 ? m : (bit_reverse (* v[i-1], s) + 2), k;
00222       for (; j <= l - 1 && j >= m; j += 2)
00223         if (is_prime (k= bit_reverse (j, s))) break;
00224       if (j > l - 1 || j < m) return false;
00225       v << M(k); }
00226     return true; }


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

Generated on 6 Dec 2012 for algebramix by  doxygen 1.6.1