Parcourir la source

added function to get just the real component from the CKKSPlaintext

IQ il y a 1 an
Parent
commit
046b39ca20
2 fichiers modifiés avec 12 ajouts et 0 suppressions
  1. 9 0
      src/include/docstrings/plaintext_docs.h
  2. 3 0
      src/lib/bindings.cpp

+ 9 - 0
src/include/docstrings/plaintext_docs.h

@@ -103,4 +103,13 @@ const char* ptx_GetCKKSPackedValue_docs = R"pbdoc(
 )pbdoc";
 
 
+//GetRealPackedValue
+const char* ptx_GetRealPackedValue_docs = R"pbdoc(
+    Get the real component of the packed value of the plaintext for CKKS-based plaintexts.
+
+    :return: The real-component of the packed value of the plaintext.
+    :rtype: List[float]
+)pbdoc";
+
+
 #endif // PLAINTEXT_DOCSTRINGS_H

+ 3 - 0
src/lib/bindings.cpp

@@ -895,6 +895,9 @@ void bind_encodings(py::module &m)
             ptx_Decode_docs)
         .def("GetCKKSPackedValue", &PlaintextImpl::GetCKKSPackedValue,
             ptx_GetCKKSPackedValue_docs)
+
+        .def("GetRealPackedValue", &PlaintextImpl::GetRealPackedValue,
+            ptx_GetRealPackedValue_docs)
         .def("__repr__", [](const PlaintextImpl &p)
              {
         std::stringstream ss;