16 #ifndef _FHEcontext_H_
17 #define _FHEcontext_H_
22 #include <NTL/xdouble.h>
39 long FindM(
long k,
long L,
long c,
long p,
long d,
long s,
long chosen_m,
bool verbose=
false);
46 vector<Cmodulus> moduli;
104 bool operator==(
const FHEcontext& other)
const;
105 bool operator!=(
const FHEcontext& other)
const {
return !(*
this==other); }
109 {
return (i<moduli.size())? moduli[i].getQ() :0; }
119 for (
unsigned i=0; i<moduli.size(); i++)
120 if (divide(num,moduli[i].getQ()))
return true;
126 for (
unsigned i=0; i<moduli.size(); i++)
127 if (p==moduli[i].getQ())
return true;
148 Error(
"FHEContext::logOfProduct: IndexSet has too many rows");
157 void AddPrime(
long p,
bool special);
201 friend void readContextBase(istream& str,
unsigned& m,
unsigned& p,
unsigned& r);
209 void writeContextBase(ostream& s,
const FHEcontext& context);
211 void readContextBase(istream& s,
unsigned& m,
unsigned& p,
unsigned& r);
220 double AddPrimesBySize(
FHEcontext& context,
double totalSize,
225 double AddPrimesByNumber(
FHEcontext& context,
long nPrimes,
230 void buildModChain(
FHEcontext &context,
long nLvls,
long c=3);
233 #endif // ifndef _FHEcontext_H_