Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ckormanyos/mathematica_mathlink
C++ template header for interacting with the Mathematica(R) kernel
https://github.com/ckormanyos/mathematica_mathlink
cpp mathematica
Last synced: 24 days ago
JSON representation
C++ template header for interacting with the Mathematica(R) kernel
- Host: GitHub
- URL: https://github.com/ckormanyos/mathematica_mathlink
- Owner: ckormanyos
- License: bsl-1.0
- Created: 2023-07-25T14:21:13.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-13T10:29:25.000Z (about 1 year ago)
- Last Synced: 2024-04-28T03:19:38.325Z (6 months ago)
- Topics: cpp, mathematica
- Language: C++
- Homepage:
- Size: 12 MB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE_1_0.txt
Awesome Lists containing this project
README
mathematica_mathlink
==================mathematica_mathlink provides a C++ template header for interacting with the Mathematica(R) kernel.
## Implementation Goals
- Interact directly with the Mathematica(R) kernel by sending/receiving _packets_.
- Clean header-only C++14 design.
- Seamless portability to any modern C++14, 17, 20, 23 compiler and beyond.
- Support an easy-to-use MSVC solution for simple build.
- Include a selection of non-trivial examples.## Test Examples
Several completely worked out test examples are available in the
[`test`](./test) directory of the repository.- [test_bessel_j_versus_boost.cpp](./test/test_bessel_j_versus_boost.cpp) tests a variety of high-precision cylindrical Bessel function values comparing them with results from the kernel. This test requires the `Boost.Math` and `Boost.Multiprecision` libraries.
- [test_divmod.cpp](./test/test_divmod.cpp) generates pseudo-random wide integers and tests the `divmod` function versus the kernel. This function is equivalent to Python-3's double-divide (`//`) function or Mathematica(R)'s `QuotientRemainder` function. This test program requires the [ckormanyos/wide-integer](https://github.com/ckormanyos/wide-integer) header-only C++ _wide_-_integer_ library.
- [test_gcd.cpp](./test/test_gcd.cpp) generate pairs of pseudo-random wide-integers, compute their `gcd` (GCD, greatest common divisor) and confirm the GCD results with the kernel. This test program requires the [ckormanyos/wide-integer](https://github.com/ckormanyos/wide-integer) header-only C++ _wide_-_integer_ library.
- [test_prime.cpp](./test/test_prime.cpp) generate pseudo-random wide-integer prime numbers and verify their primality them with the kernel. This test program requires the [ckormanyos/wide-integer](https://github.com/ckormanyos/wide-integer) header-only C++ _wide_-_integer_ library.## Additional information
- At the moment, mathematica_mathlink can only handle single return packets.
- The path strings for finding/locating the Mathematica(R) kernel are only available for `Win*`, not for `*nix`.
- Link with wstp64i4.lib and run in the presence of wstp64i4.dll (proprietary libraries).
- CI compiles the test examples to object only (and does not link). Compilation is checked using GCC and clang compilers.