helayers::PTile Class Reference

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...
 
PTileoperator= (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 AbstractPlaintextgetImpl () 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]hethe underlying context.

◆ PTile() [2/2]

helayers::PTile::PTile ( const PTile src)

Copy constructor.

Parameters
[in]srcObject 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]titleA title to be included in the printing.
[in]maxElementsThe number of elements/slots to be included in the printing.
[in]verboseLevel of vebosity.
[in]outAn 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)

Loads this PTile from a file saved by save()

Parameters
[in]streaminput stream to read from

◆ loadFromFile()

void helayers::PTile::loadFromFile ( const std::string &  fileName)

Loads this PTile from a file saved by saveToFile()

Parameters
[in]fileNamename of file to read from

◆ operator=()

PTile & helayers::PTile::operator= ( const PTile src)

Copy from another object.

Parameters
[in]srcObject to copy.

◆ reduceChainIndex()

void helayers::PTile::reduceChainIndex ( )

Reduces the chain-index property of this object by 1.

Ignored if not supported.

Exceptions
runtime_errorIf 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]streamoutput 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]fileNamename 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]otherobject to get chain index from
Exceptions
runtime_errorIf 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]chainIndexThe terget value to set the chain index to
Exceptions
runtime_errorIf 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