Retrieve or set fields on a Plaintext object. Each accessor
wraps the corresponding upstream PlaintextImpl::Get*/Set*
method and returns its value unchanged.
Usage
get_noise_scale_deg(x, ...)
get_length(x, ...)
get_level(x, ...)
get_scaling_factor(x, ...)
get_log_precision(x, ...)
get_formatted_values(x, ...)
set_ckks_data_type(x, ...)
get_encoding_type(x, ...)
get_scaling_factor_int(x, ...)
get_scheme_id(x, ...)
is_encoded(x, ...)
low_bound(x, ...)
high_bound(x, ...)
get_slots(x, ...)
get_log_error(x, ...)
get_coef_packed_value(x, ...)
get_string_value(x, ...)
get_element_ring_dimension(x, ...)
set_scaling_factor(x, ...)
set_scaling_factor_int(x, ...)
set_noise_scale_deg(x, ...)
set_level(x, ...)
set_slots(x, ...)
set_string_value(x, ...)
set_int_vector_value(x, ...)Details
Several base-class accessors are declared virtual and throw
OPENFHE_THROW in the base implementation (e.g. get_string_value
on a non-string plaintext, get_log_precision on a non-CKKS
plaintext). Calling an accessor on the wrong kind of plaintext
therefore raises an R error via cli::cli_abort, not a silent
wrong value.
Functions
get_noise_scale_deg: Integer noise-scale-degree of a CKKS plaintext. After construction the degree is the value passed tomake_ckks_packed_plaintext(..., noise_scale_deg)underFIXEDMANUALscaling; underFLEXIBLEAUTOthe scheme overrides the user-supplied value at context-generation time (see discovery D011). Incremented by each multiplication before a rescale. The harness Signal 2 differential fixture forMakeCKKSPackedPlaintextreads this value to verify thenoise_scale_degargument reached the C++ call site.get_length: Integer effective length of a packed plaintext — the number of slots that hold user-supplied values. Defaults to the full batch size at construction;set_length()can shorten it for display or decryption purposes.get_level: Integer level of the plaintext in the RNS modulus chain.0for a fresh plaintext; incremented by eachrescale()the plaintext survives. For CKKS-packed plaintexts the level must match the ciphertext level at every homomorphic operation, or the evaluator rejects the pair. The harness Signal 2 fixture reads this value to verify thelevelargument reached the C++ call site.get_scaling_factor: Numeric scaling factor for CKKS-based plaintexts — the multiplier the real vector is scaled by before encoding. Equals2^scaling_mod_sizefor a freshly-encoded plaintext under FLEXIBLEAUTO; halves after each rescale. For BFV/BGV plaintexts this is returned as a default value (no rescaling applies).get_log_precision: Numeric log2 of the precision lost during CKKS encoding. Only meaningful for CKKS plaintexts; throws viaOPENFHE_THROWfor BFV/BGV and is surfaced as an R error bycli::cli_abort.get_formatted_values: String-format the plaintext's encoded values withprecisiondecimal digits. Implemented on the concrete plaintext subclass (packed, CKKS, string, coefficient); throws on plaintexts whose subclass does not override.set_ckks_data_type: Set the CKKS data type toCKKSDataType$REALorCKKSDataType$COMPLEX. Only meaningful for CKKS plaintexts. Most R vignettes use the defaultREALtype; set toCOMPLEXonly when you are constructing a CKKS plaintext from a complex vector.get_encoding_type:parity-deferred:integer encoding type (seePlaintextEncodingsfor the enum values).get_scaling_factor_int:parity-deferred:BGV integer scaling factor. Returned as a double carrying a losslessly rounded 53-bit integer per design.md §7.get_scheme_id:parity-deferred:scheme identifier (seeSchemeIdenum).is_encoded:parity-deferred:logical "has the plaintext been encoded yet?" The factory methods typically encode plaintexts eagerly, so this isTRUEfor fresh plaintexts. ReturnsFALSEonly for plaintexts constructed in a two-step uninitialised form.low_bound:parity-deferred:integer lower bound that can be encoded with the current plaintext modulus:-floor(t / 2).high_bound:parity-deferred:integer upper bound that can be encoded with the current plaintext modulus:floor(t / 2).get_slots:parity-deferred:integer CKKS slot count. ForPlaintextdispatch this is theGetSlots()value set at construction. The harness Signal 2 fixture reads this value to verify theslotsargument reached the C++ call site.get_log_error:parity-deferred:numeric log2 of the error estimate. Only meaningful for CKKS plaintexts; throws for BFV/BGV.get_coef_packed_value:parity-deferred:integer vector of the underlying coef-packed encoding. Throws for plaintexts whose subclass is not coef-packed.get_string_value:parity-deferred:string value of a string-encoded plaintext. Throws for plaintexts whose subclass is not string-encoded.get_element_ring_dimension:parity-deferred:integer ring dimension of the underlyingElement. This is the plaintext's view of the lattice ring dimension; typically matches the crypto context's ring dimension.set_scaling_factor:parity-deferred:set the CKKS plaintext scaling factor.set_scaling_factor_int:parity-deferred:set the BGV plaintext integer scaling factor.set_noise_scale_deg:parity-deferred:set the plaintext noise scale degree. Most users should not call this directly — the factory methods and the evaluator managenoise_scale_degautomatically.set_level:parity-deferred:set the plaintext level. As withset_noise_scale_deg, most users should not call this directly.set_slots:parity-deferred:set the CKKS slot count. As withset_length, this is typically managed by the factory methods.set_string_value:parity-deferred:set the string value of a string-encoded plaintext. Throws for plaintexts whose subclass is not string-encoded.set_int_vector_value:parity-deferred:set the integer-vector value of an integer-encoded plaintext. Throws for plaintexts whose subclass does not support an integer vector.
