PTile#
- class PTile#
A class representing an encoded (unencrypted) plaintext. It’s called a PTile because from a high-level point of view we’ll usually use several of these combined for holding a more complicated object such as a matrix.
- get_current_device(self: pyhelayers.PTile) pyhelayers.DeviceType #
Returns the current device of this PTile.
- Return type:
DeviceType
- is_all_zeroes(self: pyhelayers.PTile) bool #
Returns true if this PTile encodes all zeroes plaintext, and false otherwise.
- to_device(self: pyhelayers.PTile, device: pyhelayers.DeviceType) None #
Move this PTile to another device.
- Parameters:
device – The device type to move to.
-
class PTile : public helayers::Tile#
A class representing an encoded (unencrypted) plaintext.
It’s called a PTile because from a high-level point of view we’ll usually use several of these combined for holding a more complicated object such as a matrix.
Public Functions
-
PTile(const HeContext &he)#
Constructs an empty object.
- Parameters:
he – [in] the underlying context.
-
virtual ~PTile()#
-
PTile &operator=(const PTile &src)#
Copy from another object.
- Parameters:
src – [in] Object to copy.
-
virtual void toDevice(DeviceType device) override#
Move this PTile to another device.
- Parameters:
device – [in] The device type to move to.
-
virtual void reduceChainIndex() override#
Reduces the chain-index property of this object by 1.
Ignored if not supported.
- Throws:
runtime_error – If chain index is already at lowest value
-
virtual void setChainIndex(int chainIndex) override#
Sets the chain-index property of this object to equal the specified value.
Can only be used if the specified value is less than or equal to the chain index of this object. Ignored if not supported.
- Parameters:
chainIndex – [in] The terget value to set the chain index to
- Throws:
runtime_error – If the specified chain index is higher than this
-
virtual int getChainIndex() const override#
Returns the value of the chain-index property of this object, which is a non-negative integer.
Returns a negative value if not supported.
-
virtual void setScale(double scale) override#
Sets the attached meta data scale of the plaintext.
This may change the way its content are interpreted.
- Parameters:
scale – [in] the new scale
- Throws:
runtime_error – If not supported
-
virtual double getScale() const override#
Returns the attached meta data scale of the plaintext.
-
virtual int slotCount() const override#
A PTile represents a plaintext consisting of multuple slots.
This method returns the number of slots in this object.
-
bool isAllZeroes() const#
-
inline const AbstractPlaintext &getImpl() const#
Reserved for debugging and internal use.
-
virtual int64_t getEstimatedMemoryUsageBytes() const override#
Returns an estimation of the memory usage, or -1 if not supported.
-
inline virtual int32_t getContextId() const override#
Returns the contextId of the HeContext this object was initialized with.
This contextId can be used, for example, to verify heContext match when loading a saved Saveable object.
-
virtual void debugPrint(const std::string &title = "", Verbosity verbosity = VERBOSITY_REGULAR, std::ostream &out = std::cout) const override#
Prints the content of this object.
- Parameters:
title – Text to add to the print
verbosity – Verbosity level
out – Output stream
-
PTile(const HeContext &he)#