This class hold integer polynomials modulo many small primes. More...
#include <SingleCRT.h>
Public Member Functions | |
SingleCRT (const ZZX &poly, const FHEcontext &_context, const IndexSet &s) | |
SingleCRT (const ZZX &poly, const FHEcontext &_context) | |
SingleCRT (const ZZX &poly) | |
SingleCRT (const FHEcontext &_context, const IndexSet &s) | |
SingleCRT (const FHEcontext &_context) | |
SingleCRT & | operator= (const SingleCRT &other) |
SingleCRT & | operator= (const DoubleCRT &dcrt) |
SingleCRT & | operator= (const ZZX &poly) |
SingleCRT & | operator= (const ZZ &num) |
SingleCRT & | operator= (const long num) |
bool | operator== (const SingleCRT &other) const |
bool | operator!= (const SingleCRT &other) const |
SingleCRT & | setZero () |
SingleCRT & | setOne () |
void | addPrimes (const IndexSet &s1) |
void | removePrimes (const IndexSet &s1) |
SingleCRT & | operator+= (const SingleCRT &other) |
SingleCRT & | operator+= (const ZZX &poly) |
SingleCRT & | operator+= (const ZZ &num) |
SingleCRT & | operator+= (long num) |
SingleCRT & | operator-= (const SingleCRT &other) |
SingleCRT & | operator-= (const ZZX &poly) |
SingleCRT & | operator-= (const ZZ &num) |
SingleCRT & | operator-= (long num) |
void | Add (const SingleCRT &other, bool matchIndexSet=true) |
void | Sub (const SingleCRT &other, bool matchIndexSet=true) |
SingleCRT & | operator++ () |
SingleCRT & | operator-- () |
void | operator++ (int) |
void | operator-- (int) |
SingleCRT & | operator*= (const ZZ &num) |
SingleCRT & | operator*= (long num) |
SingleCRT & | operator/= (const ZZ &num) |
SingleCRT & | operator/= (long num) |
void | toPoly (ZZX &p, const IndexSet &s) const |
void | toPoly (ZZX &p) const |
const IndexMap< ZZX > & | getMap () const |
const FHEcontext & | getContext () const |
Friends | |
class | DoubleCRT |
This class hold integer polynomials modulo many small primes.
SingleCRT form is a map from an index set to (ZZX) polynomials, where the i'th polynomial contains the coefficients wrt the ith prime in the chain of moduli. The polynomial thus represented is defined modulo the product of all the primes in use.
This is mostly a helper class for DoubleCRT, and all the rules that apply to DoubleCRT wrt moduli sets apply also to SingleCRT objects. Although SingleCRT and DoubleCRT objects can interact in principle, translation back and forth are expensive since they involve FFT/iFFT. Hence support for interaction between them is limited to explicit conversions.