12 #ifndef HELIB_CMODULUS_H
13 #define HELIB_CMODULUS_H
20 #include <helib/NumbTh.h>
21 #include <helib/PAlgebra.h>
22 #include <helib/bluestein.h>
23 #include <helib/clonedPtr.h>
50 NTL::zz_pContext context;
64 copied_ptr<NTL::zz_pX> powers;
65 NTL::Vec<NTL::mulmod_precon_t> powers_aux;
66 copied_ptr<NTL::fftRep> Rb;
69 copied_ptr<NTL::zz_pX> ipowers;
70 NTL::Vec<NTL::mulmod_precon_t> ipowers_aux;
71 copied_ptr<NTL::fftRep> iRb;
74 copied_ptr<zz_pXModulus1> phimx;
77 void privateInit(
const PAlgebra&,
long rt);
81 SmartPtr<AltFFTPrimeInfo> altFFTInfo;
106 unsigned long getM()
const {
return zMStar->
getM(); }
108 long getQ()
const {
return q; }
109 NTL::mulmod_t
getQInv()
const {
return qinv; }
120 void FFT(NTL::vec_long& y,
const NTL::ZZX& x)
const;
122 void FFT(NTL::vec_long& y,
const zzX& x)
const;
125 void FFT_aux(NTL::vec_long& y, NTL::zz_pX& tmp)
const;
129 void iFFT(NTL::zz_pX& x,
const NTL::vec_long& y)
const;
146 #endif // ifndef HELIB_CMODULUS_H
long getM() const
Returns m.
Definition: PAlgebra.h:162
NTL::Vec< long > zzX
Definition: zzX.h:24
void FFT_aux(NTL::vec_long &y, NTL::zz_pX &tmp) const
Definition: CModulus.cpp:345
void iFFT(NTL::zz_pX &x, const NTL::vec_long &y) const
Definition: CModulus.cpp:450
Cmodulus(const Cmodulus &other)
Definition: CModulus.h:91
void restoreModulus() const
Restore NTL's current modulus.
Definition: CModulus.h:114
static NTL::fftRep & getScratch_fftRep(long k)
Definition: CModulus.cpp:540
The structure of (Z/mZ)* /(p)
Definition: PAlgebra.h:77
const zz_pXModulus1 & getPhimX() const
Definition: CModulus.h:111
static NTL::Vec< long > & getScratch_vec_long()
Definition: CModulus.cpp:534
Provides FFT and iFFT routines modulo a single-precision prime.
Definition: CModulus.h:43
Auxiliary classes to facilitate faster reduction mod Phi_m(X) when the input has degree less than m.
Definition: NumbTh.h:799
Definition: apiAttributes.h:21
long getQ() const
Definition: CModulus.h:108
Cmodulus()
Default constructor.
Definition: CModulus.h:89
unsigned long getPhiM() const
Definition: CModulus.h:107
void FFT(NTL::vec_long &y, const NTL::ZZX &x) const
Definition: CModulus.cpp:418
long getPhiM() const
Returns phi(m)
Definition: PAlgebra.h:168
NTL::mulmod_t getQInv() const
Definition: CModulus.h:109
const PAlgebra & getZMStar() const
Definition: CModulus.h:105
Cmodulus & operator=(const Cmodulus &other)
Copy assignment operator.
Definition: CModulus.cpp:168
unsigned long getM() const
Definition: CModulus.h:106
long getRoot() const
Definition: CModulus.h:110
static NTL::zz_pX & getScratch_zz_pX()
Definition: CModulus.cpp:528