From be315ba8da8801502053bad1c727c7a7fe9e167c Mon Sep 17 00:00:00 2001 From: akielaries Date: Sun, 12 May 2024 12:42:46 -0700 Subject: [PATCH] #pygpmp: updates to SWIG interface files --- README.md | 2 +- pygpmp/arithmetic/arithmetic.i | 4 ++-- pygpmp/calculus/calculus.i | 4 ++-- pygpmp/core/core.i | 8 ++++---- pygpmp/core/core.py | 10 ++++++++++ pygpmp/linalg/linalg.i | 4 ++-- pygpmp/ml/ml.i | 4 ++-- pygpmp/nt/nt.i | 28 ++++++++++++++-------------- 8 files changed, 37 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index cae1862e5..0e55786d5 100644 --- a/README.md +++ b/README.md @@ -174,7 +174,7 @@ A Python example showing the same functionalities. >>> from pygpmp import nt >>> c = nt.Cipher() >>> text0 = c.caesar('Plaintext', 5) ->>> print(ciphertext_0) +>>> print(text0) Uqfnsyjcy >>> >>> text1 = c.caesar('ATTACKATONCE', 4) diff --git a/pygpmp/arithmetic/arithmetic.i b/pygpmp/arithmetic/arithmetic.i index b39f82d91..e1e6f4132 100644 --- a/pygpmp/arithmetic/arithmetic.i +++ b/pygpmp/arithmetic/arithmetic.i @@ -7,9 +7,9 @@ %include "std_string.i" %{ - #include "../../include/arithmetic.hpp" + #include "../../include/openGPMP/arithmetic.hpp" using namespace gpmp; %} -%include "../../include/arithmetic.hpp" +%include "../../include/openGPMP/arithmetic.hpp" diff --git a/pygpmp/calculus/calculus.i b/pygpmp/calculus/calculus.i index 8c89d8915..3ec1631bb 100644 --- a/pygpmp/calculus/calculus.i +++ b/pygpmp/calculus/calculus.i @@ -8,9 +8,9 @@ %include "std_string.i" %{ - #include "../../include/calculus/differential.hpp" + #include "../../include/openGPMP/calculus/differential.hpp" using namespace gpmp; %} -%include "../../include/calculus/differential.hpp" +%include "../../include/openGPMP/calculus/differential.hpp" diff --git a/pygpmp/core/core.i b/pygpmp/core/core.i index 45805b5c7..a5943308b 100644 --- a/pygpmp/core/core.i +++ b/pygpmp/core/core.i @@ -6,13 +6,13 @@ %include %{ - #include "../../include/core/datatable.hpp" - #include "../../include/core/utils.hpp" + #include "../../include/openGPMP/core/datatable.hpp" + #include "../../include/openGPMP/core/utils.hpp" //#include "../../include/core/threads.hpp" using namespace gpmp; %} -%include "../../include/core/datatable.hpp" -%include "../../include/core/utils.hpp" +%include "../../include/openGPMP/core/datatable.hpp" +%include "../../include/openGPMP/core/utils.hpp" //%include "../../include/core/threads.hpp" diff --git a/pygpmp/core/core.py b/pygpmp/core/core.py index 0626a8fbe..6d17e2b19 100644 --- a/pygpmp/core/core.py +++ b/pygpmp/core/core.py @@ -215,4 +215,14 @@ def log(self, level, message): # Register Logger in _core: _core.Logger_swigregister(Logger) +class Misc(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def __init__(self): + _core.Misc_swiginit(self, _core.new_Misc()) + __swig_destroy__ = _core.delete_Misc + +# Register Misc in _core: +_core.Misc_swigregister(Misc) diff --git a/pygpmp/linalg/linalg.i b/pygpmp/linalg/linalg.i index 431d91995..2d9d08ebb 100644 --- a/pygpmp/linalg/linalg.i +++ b/pygpmp/linalg/linalg.i @@ -9,9 +9,9 @@ %module linalg %{ - #include "../../include/linalg/mtx.hpp" + #include "../../include/openGPMP/linalg/mtx.hpp" using namespace gpmp; %} -%include "../../include/linalg/mtx.hpp" +%include "../../include/openGPMP/linalg/mtx.hpp" diff --git a/pygpmp/ml/ml.i b/pygpmp/ml/ml.i index 77da22d9d..6f1883921 100644 --- a/pygpmp/ml/ml.i +++ b/pygpmp/ml/ml.i @@ -6,9 +6,9 @@ %include %{ - #include "../../include/ml/linreg.hpp" + #include "../../include/openGPMP/ml/linreg.hpp" using namespace gpmp; %} -%include "../../include/ml/linreg.hpp" +%include "../../include/openGPMP/ml/linreg.hpp" diff --git a/pygpmp/nt/nt.i b/pygpmp/nt/nt.i index f60cc1f6d..d00cd680a 100644 --- a/pygpmp/nt/nt.i +++ b/pygpmp/nt/nt.i @@ -9,21 +9,21 @@ %module nt %{ - #include "../../include/arithmetic.hpp" - #include "../../include/nt/prime_test.hpp" - #include "../../include/nt/prime_gen.hpp" - #include "../../include/nt/logarithms.hpp" - #include "../../include/nt/factorization.hpp" - #include "../../include/nt/rc4.hpp" - #include "../../include/nt/cipher.hpp" + #include "../../include/openGPMP/arithmetic.hpp" + #include "../../include/openGPMP/nt/prime_test.hpp" + #include "../../include/openGPMP/nt/prime_gen.hpp" + #include "../../include/openGPMP/nt/logarithms.hpp" + #include "../../include/openGPMP/nt/factorization.hpp" + #include "../../include/openGPMP/nt/rc4.hpp" + #include "../../include/openGPMP/nt/cipher.hpp" using namespace gpmp; %} -%include "../../include/arithmetic.hpp" -%include "../../include/nt/prime_test.hpp" -%include "../../include/nt/prime_gen.hpp" -%include "../../include/nt/logarithms.hpp" -%include "../../include/nt/factorization.hpp" -%include "../../include/nt/rc4.hpp" -%include "../../include/nt/cipher.hpp" +%include "../../include/openGPMP/arithmetic.hpp" +%include "../../include/openGPMP/nt/prime_test.hpp" +%include "../../include/openGPMP/nt/prime_gen.hpp" +%include "../../include/openGPMP/nt/logarithms.hpp" +%include "../../include/openGPMP/nt/factorization.hpp" +%include "../../include/openGPMP/nt/rc4.hpp" +%include "../../include/openGPMP/nt/cipher.hpp"