Template Class TernaryUniformGeneratorImpl
Defined in File ternaryuniformgenerator.h
Page Contents
Template Parameter Order
typename VecType
Class Documentation
-
template<typename VecType>
class lbcrypto::TernaryUniformGeneratorImpl A generator of the Ternary Uniform Distribution.
Public Functions
-
TernaryUniformGeneratorImpl() = default
Basic constructor for Binary Uniform Generator.
-
~TernaryUniformGeneratorImpl() = default
-
VecType GenerateVector(usint size, const typename VecType::Integer &modulus, usint h = 0) const
Generates a vector of random values within the Ternary Uniform Distribution.
- Parameters
size – length of the vector.
modulus – the modulus applied to all values of the vector.
h – - Hamming weight for sparse ternary distribution (by default, when h = 0, the distribution is NOT sparse)
- Returns
A vector of random values within the Ternary Uniform Distribution.
-
std::shared_ptr<int32_t> GenerateIntVector(usint size, usint h = 0) const
Returns a generated vector of integers.
- Parameters
size – The number of values to return.
h – - Hamming weight for sparse ternary distribution (by default, when h = 0, the distribution is NOT sparse)
- Returns
A pointer to an array of integer values generated with the distribution.
-
TernaryUniformGeneratorImpl() = default