algebramix_doc 0.3
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 
) [inline, static]

Definition at line 53 of file fft_roots.hpp.

References mmx::C, mmx::cos(), mmx::gaussian(), and mmx::sin().

Referenced by mmx::primitive_root().

                    {
    if (n == 1 || i == 0) return C (1);
    else if (n == 2) return C(-1);
    else {
      Real_type(C) angle= (2 * i * Pi(Real_type(C))) / n;
      return gaussian (cos (angle), sin (angle));
    }
  }

The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Friends Defines