Bladeren bron

added function to get just the real component from the CKKSPlaintext

IQ 1 jaar geleden
bovenliggende
commit
046b39ca20
2 gewijzigde bestanden met toevoegingen van 12 en 0 verwijderingen
  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;