Skip to content

Commit

Permalink
updates to Python API. Including Derivatives + Matrix and Vector oper…
Browse files Browse the repository at this point in the history
…ations
  • Loading branch information
akielaries committed Jan 8, 2023
1 parent 3e63ca1 commit 917ad98
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 6 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ include *x86_64-linux-gnu.so
include *.md
include LICENSE
global-exclude *.cxx
global-exclude __pycache__
recursive-include modules *.cpp
recursive-include include *.hpp

Expand Down
10 changes: 7 additions & 3 deletions Python/openmtpk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,13 @@ run-swig:
##############################################################################
primes = $(MOD_DIR)/number_theory/primes.cpp
arith = $(MOD_DIR)/arithmetic/arith.cpp
calc = $(MOD_DIR)/calculus/deriv.cpp
linalg = $(MOD_DIR)/linalg/lao.cpp
linreg = $(MOD_DIR)/ml/linreg.cpp
cipher = $(MOD_DIR)/number_theory/cipher.cpp
rc4 = $(MOD_DIR)/number_theory/rc4.cpp
compile:
${CXX} ${STD} ${CXX_DBG} -O2 -fPIC -c ${arith} ${primes} ${cipher} ${rc4}
${CXX} ${STD} ${CXX_DBG} -O2 -fPIC -c ${arith} ${calc} ${primes} ${linalg} ${linreg} ${cipher} ${rc4}

##############################################################################
# COMPILE WRAPPED SOURCE FILE
Expand All @@ -55,9 +58,9 @@ endif
# COMPILE SOURCE OBJECTS
##############################################################################
pkgLINUX = _openmtpk.so
pkgOSX = _openmtpk.co
pkgOSX = _openmtpk.so

src_objs = arith.o primes.o cipher.o rc4.o openmtpk_wrap.o
src_objs = arith.o deriv.o lao.o linreg.o primes.o cipher.o rc4.o openmtpk_wrap.o
compile-lib:
# LINUX
ifeq ($(OS), Linux)
Expand All @@ -73,6 +76,7 @@ endif
clean:
rm -rf */__pycache__
rm -f *.o
rm -f *.so
rm -f *.cxx
rm -f openmtpk.py

20 changes: 17 additions & 3 deletions Python/openmtpk/openmtpk.i
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,30 @@
%include "std_string.i"
%{
#include "../../include/arithmetic/arith_ops.hpp"

#include "../../include/calculus/deriv.hpp"

#include "../../include/ml/bayes_network.hpp"
#include "../../include/ml/k-foldCV.hpp"
#include "../../include/ml/linreg.hpp"
#include "../../include/ml/nearest_neighbor.hpp"

#include "../../include/number_theory/primes.hpp"
#include "../../include/number_theory/rc4.hpp"
#include "../../include/number_theory/cipher.hpp"
%}

/*
%include "../../include/arithmetic/arith.hpp"
*/
%include "../../include/arithmetic/arith_ops.hpp"

%include "../../include/calculus/deriv.hpp"

%include "../../include/ml/bayes_network.hpp"
%include "../../include/ml/k-foldCV.hpp"
%include "../../include/ml/linreg.hpp"
%include "../../include/ml/nearest_neighbor.hpp"

%include "../../include/number_theory/primes.hpp"
%include "../../include/number_theory/rc4.hpp"
%include "../../include/number_theory/cipher.hpp"


5 changes: 5 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
"""
Main entrypoint for building the openMTPK Python API.
Leverages SWIG, setuptools, and a few other dependencies.
"""

#from setuptools import setup, find_packages
import setuptools
from setuptools import setup, dist
Expand Down

0 comments on commit 917ad98

Please sign in to comment.