primitive_root_helper< C > Struct Template Reference

#include <fft_roots.hpp>

Inheritance diagram for primitive_root_helper< C >:
primitive_root_helper< modular< modulus< polynomial< C, U >, V >, W > > primitive_root_helper< polynomial< C, V > >

List of all members.

Static Public Member Functions


Detailed Description

template<typename C>
struct mmx::primitive_root_helper< C >

Definition at line 46 of file fft_roots.hpp.


Member Function Documentation

static nat max_order ( nat  b  )  [inline, static]
static C op ( nat  n,
nat  i,
const format< C > &  fm 
) [inline, static]

Definition at line 53 of file fft_roots.hpp.

References mmx::C, mmx::exp(), promote(), mmx::set_pi(), and mmx::times_i().

Referenced by mmx::primitive_root().

00053                                          {
00054     if (n == 1 || i == 0) return promote (1, fm);
00055     else if (n == 2) return promote (-1, fm);
00056     else {
00057       C z= promote (1, fm);
00058       set_pi (z);
00059       z= times_i (z);
00060       z= (promote ((int) (i+i), z) / promote ((int) n, z)) * z;
00061       return exp (z);
00062       //Real_type(C) angle= (2 * i * Pi(Real_type(C))) / n;
00063       //return gaussian (cos (angle), sin (angle));
00064     }
00065   }


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

Generated on 6 Dec 2012 for algebramix by  doxygen 1.6.1