{"id":24419170,"url":"https://github.com/akielaries/opengpmp","last_synced_at":"2025-04-12T06:05:36.613Z","repository":{"id":61586706,"uuid":"552664614","full_name":"akielaries/openGPMP","owner":"akielaries","description":"Hardware Accelerated General Purpose Mathematics Package","archived":false,"fork":false,"pushed_at":"2024-12-24T02:27:47.000Z","size":131746,"stargazers_count":7,"open_issues_count":19,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-12T06:05:08.520Z","etag":null,"topics":["computational-mathematics","cpp","linear-algebra","machine-learning","number-theory","opengpmp","simd"],"latest_commit_sha":null,"homepage":"https://akielaries.github.io/openGPMP/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/akielaries.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-10-17T03:10:07.000Z","updated_at":"2025-01-26T11:05:18.000Z","dependencies_parsed_at":"2022-10-20T11:30:46.814Z","dependency_job_id":"a9c75303-b012-48cf-b2fd-daf145bf1c5f","html_url":"https://github.com/akielaries/openGPMP","commit_stats":null,"previous_names":["akielaries/opengpmp","akielaries/openmtpk"],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akielaries%2FopenGPMP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akielaries%2FopenGPMP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akielaries%2FopenGPMP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akielaries%2FopenGPMP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akielaries","download_url":"https://codeload.github.com/akielaries/openGPMP/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248525144,"owners_count":21118618,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computational-mathematics","cpp","linear-algebra","machine-learning","number-theory","opengpmp","simd"],"created_at":"2025-01-20T09:19:08.490Z","updated_at":"2025-04-12T06:05:36.587Z","avatar_url":"https://github.com/akielaries.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/akielaries/openGPMP/main/docs/openGPMP_logo_med.png\" /\u003e\n\u003c/p\u003e\n\n![Version](https://img.shields.io/github/v/release/akielaries/openGPMP?color=%23BF40BF)\n[![PyPi](https://img.shields.io/pypi/v/pygpmp.svg)](https://pypi.python.org/pypi/pygpmp)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/cccab2412bac4217827559131efea8ee)](https://www.codacy.com/gh/akielaries/openGPMP/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=akielaries/openGPMP\u0026amp;utm_campaign=Badge_Grade)\n[![license](https://img.shields.io/github/license/akielaries/openGPMP?color=23228B22)](https://github.com/akielaries/openGPMP/blob/main/LICENSE)\n[![codecov](https://codecov.io/gh/akielaries/openGPMP/branch/main/graph/badge.svg?token=KJBGLP8DYJ)](https://codecov.io/gh/akielaries/openGPMP)\n![clones](https://raw.githubusercontent.com/akielaries/openGPMP/traffic/traffic-openGPMP/clones.svg)\n[![openGPMP](https://github.com/akielaries/openGPMP/actions/workflows/opengpmp.yml/badge.svg)](https://github.com/akielaries/openGPMP/actions/)\n![](https://tokei.rs/b1/github/akielaries/openGPMP)\n\n\n# Overview\n**openGPMP** is an open-source, multi-threaded, mathematics package written in C++, C, Fortran and Assembly with \nno runtime dependencies. The primary focus in Number Theory and Cryptographic algorithms, Linear Algebra, Calculus, \nStatistics, and Machine Learning concepts, and more. openGPMP aims to serve as a warehouse and one-stop shop for \nmathematical operations. Additional acceleration methods are featured for optional use and installation via OpenCL \nand CUDA. By default, SIMD intrinsics will be used for the supported platforms.\n\nLook in the [samples](https://github.com/akielaries/openGPMP/tree/main/samples) folder for examples \non how to use some of openGPMP's functionalities and the in-depth [documentation](https://akielaries.github.io/openGPMP/).\n\n# Installation\n## C++ (source)\n### Requirements\n* Linux/OSX\n* CMake v3.18+ (build from source for latest version)\n* C++20\n* gcc, g++, gfortran v12+ (clang, clang++, and flang are being tested)\n\n### Build\nClone the repository or download the codebase from a release:\n\n```\n# clone repo\n$ git clone git@github.com:akielaries/openGPMP.git\n$ cd openGPMP\n```\n\nCreate a build directory and configure with CMake:\n```\n$ mkdir build \u0026\u0026 cd build\n$ cmake -S ../\n```\n* Additional CMake options include:\n    * `-DBUILD_TESTS=ON`\n    * `-DCMAKE_C_COMPILER=/path/to/C/compiler`\n    * `-DCMAKE_CXX_COMPILER=/path/to/CPP/compiler`\n    * `-DCMAKE_FC_COMPILER=/path/to/Fortran/compiler`\n\n\u003e **Note** For now, OSX requires GCC for compilation\n\nInstall the compiled static library and headers:\n```\n$ make\n$ sudo make install\n```\n\n\u003e **Note**\n\u003e Keep the build directory for easy uninstallation.\n\n## Python (pygpmp)\nTo install the Python interface, use the pip package manager and run the following, `pip install\npygpmp`. Additional hardware support is available with [SWIG](https://github.com/swig/swig) as a dependency for the pip\ninstallation.\n\n### From source\nBuilding the Python pip wheel from source is easy as well. Run the following:\n```\n# install dependencies\n$ pip install -r requirements.txt\n# create CMake files in py_build dir\n$ cmake -B py_build -DBUILD_PYGPMP=ON\n# install\n$ pip install .\n```\n\n## Julia (gpmp.jl)\n\u003e **Note** In progress\nThe Julia interface is built with the help of [wrapit](https://github.com/grasph/wrapit).\n\n## tinygpmp\n\u003e **Note** In progress\n[`tinygpmp`](/tinygpmp) targets low-voltage, resource-constrained devices and is currently aiming to support\nAVR series MCUs, STM32 chips, and other embedded devices.\n\ntinygpmp can be built using the following CMake options:\n```\n    * `-DTINYGPMP_AVR=ON` ***todo***\n    * `-DTINYGPMP_ARM32=ON` ***todo***\n    * `-DTINYGPMP_DYN=ON` ***todo***\n    * `-DTINYGPMP_STAT=ON` ***todo***\n```\n# Uninstall\nTo uninstall files related to openGPMP, simply run the following:\n\n```\n# enter the build dir from installation\n$ cd build\n$ sudo make uninstall\n```\n\n## Modules\n\nDuring early stages, modules will be developed in breadth while focusing on depth\nin later stages of the `PRE-V1.0.0` phase. The modules below are all in progress.\n\n0. Core (utilities \u0026 common interfaces)\n1. Arithmetic\n2. Calculus\n3. Discrete Mathematics\n4. Linear Algebra\n5. Machine/Deep Learning\n6. Number Theory\n7. Complex\n8. Statistics\n9. Optimization\n\nFor more details view the project [documentation](https://akielaries.github.io/openGPMP/).\n\n\n# Examples\n\nView the simple examples on how to use some of the modules in different languages [here](https://github.com/akielaries/openGPMP/tree/main/samples).\n\n```\n# clone the repo and enter the samples dir\n$ git clone git@github.com:akielaries/openGPMP.git \n$ cd samples\n# compile an example and link against openGPMP\n$ g++ cpp/linreg.cpp -lopenGPMP -o example\n$ ./example\n```\n\nExample C++ driver file for running Caesar Cipher \u0026 Mono-Alphabetic Substitution\nKeyword cipher:\n\n```cpp\n#include \u003ciostream\u003e\n#include \u003cstring\u003e\n// include the number theory module header\n#include \u003copenGPMP/nt.hpp\u003e\n\nint main() {\n    // declare CIPHER class obj\n    gpmp::Cipher cc;\n\n    /* CAESAR CIPHER */\n    std::string text0 = \"Plaintext\";\n    int shift_key_0 = 5;\n    std::string hashtext_0 = cc.caesar(text0, shift_key_0);\n    std::cout \u003c\u003c \"Hashtext0 = \" \u003c\u003c hashtext_0 \u003c\u003c std::endl;\n\n    /* TESTING MONOALPHABETIC SUBSTITUION KEYWORD CIPHER */\n    std::string shift_key_2 = \"Computer\";\n    std::string text2 = \"Password\";\n    // encode the plaintext\n    std::string encoded_text = cc.keyword_encode(shift_key_2);\n    // call the cipher function\n    std::string hashtext_2 = cc.keyword(text2 , encoded_text);\n\n    std::cout \u003c\u003c \"Hashtext2 = \" \u003c\u003c hashtext_2 \u003c\u003c std::endl;\n\n    return 0;\n}\n```\n\n\nA Python example showing the same functionalities.\n\n```python\n\u003e\u003e\u003e from pygpmp import nt\n\u003e\u003e\u003e c = nt.Cipher()\n\u003e\u003e\u003e text0 = c.caesar('Plaintext', 5)\n\u003e\u003e\u003e print(text0)\nUqfnsyjcy\n\u003e\u003e\u003e \n\u003e\u003e\u003e text1 = c.caesar('ATTACKATONCE', 4)\n\u003e\u003e\u003e print(text1)\nEXXEGOEXSRGI\n\u003e\u003e\u003e \n\u003e\u003e\u003e text = \"Password\"\n\u003e\u003e\u003e shift = \"Computer\"\n\u003e\u003e\u003e encoded_text = c.keyword_encode(shift);\n\u003e\u003e\u003e hashtext = c.keyword(text, encoded_text);\n\u003e\u003e\u003e print(hashtext)\nJCNNWILP\n```\n\n# Why?\nThe rationale/why behind this project is mostly because I find high \nperformance \u0026 numerical computing, low level programming, computational\nmathematics, C, C++, Fortran, Assembly, Julia, etc, etc all interesting.\nAs far as usability and practicality, that may become more solidified \nwith more contributors and time spent but I do aim to design and implement\nthe project with real-world usage as a focus...\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakielaries%2Fopengpmp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakielaries%2Fopengpmp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakielaries%2Fopengpmp/lists"}