31 static FixedPoint double2fp(
double d,
size_t n_digits,
size_t n_frac);
34 size_t &n_digits_out,
size_t &n_frac_out,
62 Efixedpoint(
double d,
size_t n_digits,
size_t n_frac,
bool is_signed);
100 using Einteger::operator==;
101 using Einteger::operator!=;
102 using Einteger::operator>;
103 using Einteger::operator>=;
104 using Einteger::operator<;
105 using Einteger::operator<=;
138 using Einteger::operator+;
139 using Einteger::operator+=;
140 using Einteger::operator-;
141 using Einteger::operator-=;
142 using Einteger::operator*;
143 using Einteger::operator*=;
144 using Einteger::operator/;
145 using Einteger::operator/=;
213 using Einteger::operator bool;
214 using Einteger::operator int8_t;
215 using Einteger::operator uint8_t;
216 using Einteger::operator int16_t;
217 using Einteger::operator uint16_t;
218 using Einteger::operator int32_t;
219 using Einteger::operator uint32_t;
220 using Einteger::operator int64_t;
221 using Einteger::operator uint64_t;
222 using Einteger::operator double;
224 virtual explicit operator double()
const;
328 template <
size_t TOTAL_BITS,
size_t FRAC_BITS,
bool SIGNED>
345 :
Efixedpoint(promote(other, TOTAL_BITS, FRAC_BITS), FRAC_BITS,
const Einteger operator==(double a, const Efixedpoint &b)
const Einteger operator>(double a, const Efixedpoint &b)
ostream & operator<<(ostream &out, const Efixedpoint &obj)
const Efixedpoint operator+(double a, const Efixedpoint &b)
const Einteger operator>=(double a, const Efixedpoint &b)
const Efixedpoint operator*(double a, const Efixedpoint &b)
const Einteger operator!=(double a, const Efixedpoint &b)
const Einteger operator<(double a, const Efixedpoint &b)
const Efixedpoint operator/(double a, const Efixedpoint &b)
const Einteger operator<=(double a, const Efixedpoint &b)
const Efixedpoint operator-(double a, const Efixedpoint &b)
Defines the encrypted integer representation and operations.
Template class for fixed-precision encrypted real numbers.
Definition Efixedpoint.h:336
EFix(double d=0)
Constructs an EFix from a double.
Definition Efixedpoint.h:343
Represents an encrypted fixed-point number.
Definition Efixedpoint.h:27
virtual const Einteger operator>=(double) const
Encrypted greater-than-or-equal comparison with plaintext double.
const Efixedpoint operator++()
Pre-increment.
const Efixedpoint operator++(int)
Post-increment.
virtual const Efixedpoint operator*(const Efixedpoint &) const
Encrypted multiplication (ciphertext-ciphertext). Resulting frac_size is sum of inputs.
friend const Einteger operator<(double a, const Efixedpoint &b)
Plaintext-ciphertext less-than comparison.
const Efixedpoint operator>>=(int)
Bitwise right shift assignment.
const Efixedpoint operator>>(int) const
Bitwise right shift.
Efixedpoint & operator=(double)
Assignment from a plaintext double (encrypts the value).
virtual const Efixedpoint operator*(double) const
Encrypted multiplication with plaintext double.
virtual const Efixedpoint operator/(const Efixedpoint &) const
Encrypted division (ciphertext-ciphertext).
void setFracSize(size_t)
Manually adjusts the fractional size metadata.
virtual const Efixedpoint operator+(const Efixedpoint &) const
Encrypted addition (ciphertext-ciphertext).
friend const Efixedpoint operator/(double a, const Efixedpoint &b)
Plaintext-ciphertext division.
Efixedpoint(size_t n_digits, size_t n_frac, bool is_signed)
Constructs a "zero" Efixedpoint with specific bitsize.
friend const Einteger operator>(double a, const Efixedpoint &b)
Plaintext-ciphertext greater-than comparison.
virtual const Efixedpoint operator*=(const Efixedpoint &)
Encrypted multiplication assignment (ciphertext-ciphertext).
const Efixedpoint operator<<=(int)
Bitwise left shift assignment.
virtual const Efixedpoint operator/=(double)
Encrypted division assignment with plaintext double.
Einteger toInteger() const
Converts fixed-point to integer by truncating the fractional part.
Efixedpoint(const FixedPoint &fp, size_t n_frac, bool is_signed)
Wraps an existing FixedPoint bit-vector as a fixed-point number.
virtual const Einteger operator<=(double) const
Encrypted less-than-or-equal comparison with plaintext double.
Efixedpoint(const Efixedpoint &other)
Copy constructor.
virtual const Einteger operator>(const Efixedpoint &) const
Encrypted greater-than comparison (ciphertext-ciphertext).
virtual const Efixedpoint operator+=(double)
Encrypted addition assignment with plaintext double.
virtual const Einteger operator<(const Efixedpoint &) const
Encrypted less-than comparison (ciphertext-ciphertext).
virtual const Efixedpoint operator+=(const Efixedpoint &)
Encrypted addition assignment (ciphertext-ciphertext).
virtual const Efixedpoint operator-=(const Efixedpoint &)
Encrypted subtraction assignment (ciphertext-ciphertext).
virtual const Efixedpoint operator-(double) const
Encrypted subtraction with plaintext double.
virtual const Efixedpoint operator+(double) const
Encrypted addition with plaintext double.
Efixedpoint & operator=(const Efixedpoint &)
Assignment from another Efixedpoint.
friend const Efixedpoint operator*(double a, const Efixedpoint &b)
Plaintext-ciphertext multiplication.
friend const Einteger operator>=(double a, const Efixedpoint &b)
Plaintext-ciphertext greater-than-or-equal comparison.
virtual const Einteger operator!=(const Efixedpoint &) const
Encrypted inequality comparison (ciphertext-ciphertext).
friend ostream & operator<<(ostream &out, const Efixedpoint &obj)
Decrypts and outputs the fixed-point value to a stream.
virtual const Einteger operator==(const Efixedpoint &) const
Encrypted equality comparison (ciphertext-ciphertext).
friend const Einteger operator<=(double a, const Efixedpoint &b)
Plaintext-ciphertext less-than-or-equal comparison.
const Efixedpoint operator-() const
Encrypted unary negation.
friend const Efixedpoint operator+(double a, const Efixedpoint &b)
Plaintext-ciphertext addition.
virtual const Einteger operator>=(const Efixedpoint &) const
Encrypted greater-than-or-equal comparison (ciphertext-ciphertext).
Efixedpoint(const Einteger &other)
Conversion constructor from an Einteger. The resulting fixed-point number will have a fractional part...
virtual const Efixedpoint operator/=(const Efixedpoint &)
Encrypted division assignment (ciphertext-ciphertext).
friend const Einteger operator==(double a, const Efixedpoint &b)
Plaintext-ciphertext equality comparison.
virtual const Einteger operator!=(double) const
Encrypted inequality comparison with plaintext double.
virtual const Einteger operator==(double) const
Encrypted equality comparison with plaintext double.
friend const Efixedpoint operator-(double a, const Efixedpoint &b)
Plaintext-ciphertext subtraction.
friend const Einteger operator!=(double a, const Efixedpoint &b)
Plaintext-ciphertext inequality comparison.
const Efixedpoint operator--()
Pre-decrement.
virtual const Efixedpoint operator/(double) const
Encrypted division with plaintext double.
const Efixedpoint operator--(int)
Post-decrement.
virtual const Efixedpoint operator-(const Efixedpoint &) const
Encrypted subtraction (ciphertext-ciphertext).
Efixedpoint(double d, size_t n_digits, size_t n_frac, bool is_signed)
Constructs and encrypts a plaintext double.
virtual const Einteger operator<(double) const
Encrypted less-than comparison with plaintext double.
virtual const Efixedpoint operator*=(double)
Encrypted multiplication assignment with plaintext double.
virtual const Einteger operator>(double) const
Encrypted greater-than comparison with plaintext double.
const Efixedpoint operator<<(int) const
Bitwise left shift.
Efixedpoint()
Default constructor. Initializes a "zero" encrypted fixed-point value.
size_t getFracSize() const
Gets the number of bits used for the fractional part.
virtual const Efixedpoint operator-=(double)
Encrypted subtraction assignment with plaintext double.
virtual const Einteger operator<=(const Efixedpoint &) const
Encrypted less-than-or-equal comparison (ciphertext-ciphertext).
Represents an encrypted integer.
Definition Einteger.h:27
A bit-vector representation of an encrypted or plaintext word.
Definition FixedPoint.h:118