Public Member Functions | |
CDFT_chinrem (const unsigned int x_size, const mpz_t x_N) | |
virtual | ~CDFT_chinrem () |
const mpz_t & | get_N (void) const |
int | mul (const TPolynom R, const int kR, const TconstPolynom P1, const int k1, const TconstPolynom P2, const int k2) |
int | mulmod (const TPolynom R, const int kR, const TconstPolynom P1, const int k1, const TconstPolynom P2, const int k2) |
int | square (const TPolynom R, const int kR, const TconstPolynom P, const int k) |
int | squaremod (const TPolynom R, const int kR, const TconstPolynom P, const int k) |
Protected Member Functions | |
void | create_nodes (tnode &node, int &count, int depth=1) |
void | delete_nodes (tnode &node) |
void | recurse_dftmul (tnode &node, const TPolynom R, const int kR, const TconstPolynom P1, const int k1, const TconstPolynom P2, const int k2) |
int | internal_mul (const TPolynom R, const int kR, const TconstPolynom P1, const int k1, const TconstPolynom P2, const int k2, const bool reduce_result_modN) |
Protected Attributes | |
tnode | root_node |
int | anz_dft |
TPolynom | Ms |
CDFT_base ** | dft |
Private Member Functions | |
void | calc_field_and_roots_and_inverse () |
Private Attributes | |
mpz_t | N |
Classes | |
struct | tnode |
Definition at line 254 of file dft.cc.
polynomial::CDFT_chinrem::CDFT_chinrem | ( | const unsigned int | x_size, | |
const mpz_t | x_N | |||
) | [inline] |
Definition at line 293 of file dft.cc.
References calc_field_and_roots_and_inverse(), cout, endl(), MARK, polynomial::CDFT_base0::max_size, mpz_init_set(), and N.
virtual polynomial::CDFT_chinrem::~CDFT_chinrem | ( | ) | [inline, virtual] |
Definition at line 303 of file dft.cc.
References anz_dft, delete_nodes(), dft, mpz_clear(), Ms, N, and root_node.
void polynomial::CDFT_chinrem::calc_field_and_roots_and_inverse | ( | ) | [private] |
Definition at line 490 of file dft.cc.
References anz_dft, count(), cout, create_nodes(), dft, endl(), polynomial::CDFT_base::get_valid_primes_for(), polynomial::CDFT_base0::max_size, mpz_clear(), mpz_init(), mpz_mul(), mpz_mul_ui(), mpz_sizeinbase(), mpz_sqrt(), Ms, N, and root_node.
Referenced by CDFT_chinrem().
void polynomial::CDFT_chinrem::create_nodes | ( | tnode & | node, | |
int & | count, | |||
int | depth = 1 | |||
) | [protected] |
Definition at line 448 of file dft.cc.
References anz_dft, cerr, cout, dft, endl(), exit(), polynomial::CDFT_chinrem::tnode::first_dft, polynomial::CDFT_chinrem::tnode::inv_first_M_mod_second_M, polynomial::CDFT_chinrem::tnode::left, polynomial::CDFT_chinrem::tnode::M, polynomial::CDFT_base::M, MARK, mpz_init(), mpz_invert(), mpz_mul(), polynomial::CDFT_chinrem::tnode::right, and polynomial::CDFT_chinrem::tnode::second_dft.
Referenced by calc_field_and_roots_and_inverse().
void polynomial::CDFT_chinrem::delete_nodes | ( | tnode & | node | ) | [protected] |
Definition at line 440 of file dft.cc.
References polynomial::CDFT_chinrem::tnode::inv_first_M_mod_second_M, polynomial::CDFT_chinrem::tnode::left, polynomial::CDFT_chinrem::tnode::M, mpz_clear(), and polynomial::CDFT_chinrem::tnode::right.
Referenced by ~CDFT_chinrem().
void polynomial::CDFT_chinrem::recurse_dftmul | ( | tnode & | node, | |
const TPolynom | R, | |||
const int | kR, | |||
const TconstPolynom | P1, | |||
const int | k1, | |||
const TconstPolynom | P2, | |||
const int | k2 | |||
) | [protected] |
Definition at line 864 of file dft.cc.
References polynomial::CDFT_base::dftmul(), polynomial::CDFT_chinrem::tnode::first_dft, polynomial::CDFT_chinrem::tnode::inv_first_M_mod_second_M, polynomial::CDFT_chinrem::tnode::left, polynomial::CDFT_base::M, polynomial::CDFT_chinrem::tnode::M, mpz_addmul(), mpz_clear(), mpz_init(), mpz_mod(), mpz_mul(), mpz_sub(), polynomial::CDFT_chinrem::tnode::right, and polynomial::CDFT_chinrem::tnode::second_dft.
Referenced by internal_mul().
int polynomial::CDFT_chinrem::internal_mul | ( | const TPolynom | R, | |
const int | kR, | |||
const TconstPolynom | P1, | |||
const int | k1, | |||
const TconstPolynom | P2, | |||
const int | k2, | |||
const bool | reduce_result_modN | |||
) | [protected] |
Definition at line 941 of file dft.cc.
References cerr, cout, endl(), exit(), MARK, mpz_clear(), mpz_init(), mpz_mod(), mpz_set(), N, recurse_dftmul(), root_node, and polynomial::CDFT_base0::use_size().
Referenced by mul(), mulmod(), square(), and squaremod().
const mpz_t& polynomial::CDFT_chinrem::get_N | ( | void | ) | const [inline] |
int polynomial::CDFT_chinrem::mul | ( | const TPolynom | R, | |
const int | kR, | |||
const TconstPolynom | P1, | |||
const int | k1, | |||
const TconstPolynom | P2, | |||
const int | k2 | |||
) | [inline] |
Definition at line 315 of file dft.cc.
References internal_mul().
Referenced by polynomial::monic_mul().
int polynomial::CDFT_chinrem::mulmod | ( | const TPolynom | R, | |
const int | kR, | |||
const TconstPolynom | P1, | |||
const int | k1, | |||
const TconstPolynom | P2, | |||
const int | k2 | |||
) | [inline] |
Definition at line 322 of file dft.cc.
References internal_mul().
Referenced by polynomial::mul().
int polynomial::CDFT_chinrem::square | ( | const TPolynom | R, | |
const int | kR, | |||
const TconstPolynom | P, | |||
const int | k | |||
) | [inline] |
Definition at line 329 of file dft.cc.
References internal_mul().
Referenced by polynomial::monic_square(), and polynomial::square().
int polynomial::CDFT_chinrem::squaremod | ( | const TPolynom | R, | |
const int | kR, | |||
const TconstPolynom | P, | |||
const int | k | |||
) | [inline] |
Definition at line 335 of file dft.cc.
References internal_mul().
Referenced by polynomial::square().
mpz_t polynomial::CDFT_chinrem::N [private] |
Definition at line 257 of file dft.cc.
Referenced by calc_field_and_roots_and_inverse(), CDFT_chinrem(), get_N(), internal_mul(), and ~CDFT_chinrem().
tnode polynomial::CDFT_chinrem::root_node [protected] |
Definition at line 277 of file dft.cc.
Referenced by calc_field_and_roots_and_inverse(), internal_mul(), and ~CDFT_chinrem().
int polynomial::CDFT_chinrem::anz_dft [protected] |
Definition at line 279 of file dft.cc.
Referenced by calc_field_and_roots_and_inverse(), create_nodes(), and ~CDFT_chinrem().
TPolynom polynomial::CDFT_chinrem::Ms [protected] |
Definition at line 280 of file dft.cc.
Referenced by calc_field_and_roots_and_inverse(), and ~CDFT_chinrem().
CDFT_base** polynomial::CDFT_chinrem::dft [protected] |
Definition at line 281 of file dft.cc.
Referenced by calc_field_and_roots_and_inverse(), create_nodes(), and ~CDFT_chinrem().