A class representing an encoded (unencrypted) plaintext. More...
#include <PTile.h>
Public Member Functions | |
PTile (HeContext &he) | |
Constructs an empty object. More... | |
PTile (const PTile &src) | |
Copy constructor. More... | |
PTile & | operator= (const PTile &src) |
Copy from another object. More... | |
void | reduceChainIndex () |
Reduces the chain-index property of this object by 1. More... | |
void | setChainIndex (const PTile &other) |
Sets the chain-index property of this object to equal other object. More... | |
void | setChainIndex (int chainIndex) |
Sets the chain-index property of this object to equal the specified value. More... | |
int | getChainIndex () const |
Returns the value of the chain-index property of this object, which is a non-negative integer. More... | |
int | slotCount () const |
A PTile represents a plaintext consisting of multuple slots. More... | |
void | saveToFile (const std::string &fileName) const |
Saves this PTile to a file in binary form. More... | |
void | loadFromFile (const std::string &fileName) |
Loads this PTile from a file saved by saveToFile() More... | |
std::streamoff | save (std::ostream &stream) const |
Saves this PTile to a stream in binary form. More... | |
std::streamoff | load (std::istream &stream) |
Loads this PTile from a file saved by save() More... | |
void | debugPrint (const std::string &title="", int maxElements=-1, int verbose=0, std::ostream &out=std::cout) const |
Prints information regarding this object for debug purposes. More... | |
const AbstractPlaintext & | getImpl () const |
Reserved for debugging and internal use. | |
Friends | |
class | CTile |
class | Encoder |
Detailed Description
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.
Constructor & Destructor Documentation
◆ PTile() [1/2]
helayers::PTile::PTile | ( | HeContext & | he | ) |
Constructs an empty object.
- Parameters
-
[in] he the underlying context.
◆ PTile() [2/2]
helayers::PTile::PTile | ( | const PTile & | src | ) |
Copy constructor.
- Parameters
-
[in] src Object to copy.
Member Function Documentation
◆ debugPrint()
void helayers::PTile::debugPrint | ( | const std::string & | title = "" , |
int | maxElements = -1 , |
||
int | verbose = 0 , |
||
std::ostream & | out = std::cout |
||
) | const |
Prints information regarding this object for debug purposes.
- Parameters
-
[in] title A title to be included in the printing. [in] maxElements The number of elements/slots to be included in the printing. [in] verbose Level of vebosity. [in] out An output stream to print the information into.
◆ getChainIndex()
int helayers::PTile::getChainIndex | ( | ) | const |
Returns the value of the chain-index property of this object, which is a non-negative integer.
Returns a negative value if not supported.
◆ load()
streamoff helayers::PTile::load | ( | std::istream & | stream | ) |
◆ loadFromFile()
void helayers::PTile::loadFromFile | ( | const std::string & | fileName | ) |
Loads this PTile from a file saved by saveToFile()
- Parameters
-
[in] fileName name of file to read from
◆ operator=()
Copy from another object.
- Parameters
-
[in] src Object to copy.
◆ reduceChainIndex()
void helayers::PTile::reduceChainIndex | ( | ) |
Reduces the chain-index property of this object by 1.
Ignored if not supported.
- Exceptions
-
runtime_error If chain index is already at lowest value
◆ save()
streamoff helayers::PTile::save | ( | std::ostream & | stream | ) | const |
Saves this PTile to a stream in binary form.
- Parameters
-
[in] stream output stream to write to
◆ saveToFile()
void helayers::PTile::saveToFile | ( | const std::string & | fileName | ) | const |
Saves this PTile to a file in binary form.
- Parameters
-
[in] fileName name of file to write to
◆ setChainIndex() [1/2]
void helayers::PTile::setChainIndex | ( | const PTile & | other | ) |
Sets the chain-index property of this object to equal other object.
Can only be used if other object's chain index is less than or equal to the chain index of this object. Ignored if not supported.
- Parameters
-
[in] other object to get chain index from
- Exceptions
-
runtime_error If chain index of other higher than this
◆ setChainIndex() [2/2]
void helayers::PTile::setChainIndex | ( | int | chainIndex | ) |
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
-
[in] chainIndex The terget value to set the chain index to
- Exceptions
-
runtime_error If the specified chain index is higher than this
◆ slotCount()
int helayers::PTile::slotCount | ( | ) | const |
A PTile represents a plaintext consisting of multuple slots.
This method returns the number of slots in this object.
The documentation for this class was generated from the following files:
- /opt/IBM/FHE-distro/ML-HElib/src/helayers/hebase/PTile.h
- /opt/IBM/FHE-distro/ML-HElib/src/helayers/hebase/PTile.cpp