helib::ModuliSizes Class Reference

A helper class to map required modulo-sizes to primeSets. More...

#include <primeChain.h>

Public Types

typedef std::pair< double, IndexSetEntry
 

Public Member Functions

void init (const Context &context)
 initialize helper table for a given chain More...
 
IndexSet getSet4Size (double low, double high, const IndexSet &fromSet, bool reverse) const
 
IndexSet getSet4Size (double low, double high, const IndexSet &from1, const IndexSet &from2, bool reverse) const
 
void read (std::istream &str)
 
void write (std::ostream &str) const
 

Friends

std::istream & operator>> (std::istream &s, ModuliSizes &szs)
 
std::ostream & operator<< (std::ostream &s, const ModuliSizes &szs)
 

Detailed Description

A helper class to map required modulo-sizes to primeSets.

Member Typedef Documentation

◆ Entry

typedef std::pair<double, IndexSet> helib::ModuliSizes::Entry

Member Function Documentation

◆ getSet4Size() [1/2]

IndexSet helib::ModuliSizes::getSet4Size ( double  low,
double  high,
const IndexSet from1,
const IndexSet from2,
bool  reverse 
) const

Find a suitable IndexSet of primes whose total size is in the target interval [low,high], trying to minimize the total number of primes dropped from both from1, from2. If no IndexSet exists that fits in the target interval, returns the IndexSet that gives the largest value smaller than low. (or the smallest value greater than low if reverse flag is set).

Find a suitable IndexSet of primes whose total size is in the target interval [low,high], trying to minimize the total number of primes dropped from both from1, from2. If no IndexSet exists that fits in the target interval, returns the IndexSet that gives the largest value smaller than low.

◆ getSet4Size() [2/2]

IndexSet helib::ModuliSizes::getSet4Size ( double  low,
double  high,
const IndexSet fromSet,
bool  reverse 
) const

Find a suitable IndexSet of primes whose total size is in the target interval [low,high], trying to minimize the number of primes dropped from fromSet. If no IndexSet exists that fits in the target interval, returns the IndexSet that gives the largest value smaller than low (or the smallest value greater than low if reverse flag is set).

◆ init()

void helib::ModuliSizes::init ( const Context context)

initialize helper table for a given chain

◆ read()

void helib::ModuliSizes::read ( std::istream &  str)

◆ write()

void helib::ModuliSizes::write ( std::ostream &  str) const

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  s,
const ModuliSizes szs 
)
friend

◆ operator>>

std::istream& operator>> ( std::istream &  s,
ModuliSizes szs 
)
friend