See full documentation on http://solnp.readthedocs.io.
This is a C++ implementation of the SOLNP algorithm by Yinyu Ye (1989) with Python Wrappers. The algorithm was originally implemented in Matlab, and have gained some fame through it's R implementation (RSOLNP). Various implementations of the algorithm exists already, however, this version utilizes the power of DLIB and C++11.
This algorithm solves the general nonlinear optimization problem on the form:
minimize f(x)
subject to
g(x) = 0
l_h <= h(x) <= u_h
l_x < x < u_X
where f(x), g(x) and h(x) are smooth functions.
Simply install the package:
pip install pysolnp
See the /python_examples
folder for examples.
The files are header-only and only rely on dlib.
Import solnp.hpp
and call the solnp function.
See the /test
folder for examples.
The sources for all prerequisites are linked using github submodules. To compile the tests, run the CMake script.
Prerequisites for running the C++ SOLNP tests are:
- dlib - A C++ mathematical library
- catch2 (for tests) - A testing library
Additionally, when building the Python wheels you need:
- pybind11 - Bindings for C++ to Python
Run the tests in the solnp_test
and export the results to xml by running below in the solnp root folder:
$ cmake .
$ make solnp_tests
$ ./solnp_tests -r junit > solnp_tests_result.xml
$ make utils_tests
$ ./utils_tests -r junit > utils_tests_result.xml
This project uses CI to automatically build wheels for a wide range of distributions. Notably currently only builds for CPython are available on PyPi, but one can also manually installing the package from source as explained above. Apple Silicon (M1 etc) compiling is not currently available on Github Actions.
Github Actions:
- Windows with Visual Studio
- Mac OS with Clang
manylinux2014
Docker with GCC- CodeCov
ReadTheDocs CI:
- Building and hosting the docs
Libraries:
- dlib - C++ math library
- pybind11 - Bindings for building Python Wheels with C++11
- manylinux - Docker images for building Linux wheels
- cibuildwheels - Library for building Python Wheels through CI
Tools:
- CMake - Build tools
- CLion - IDE by JetBrains
- Github Actions - Building binary Wheels
- Krister S Jakobsson - Implementation - krister.s.jakobsson@gmail.com
This project is licensed under the Boost License - see the license file for details
- Yinyu Ye - Publisher and mastermind behind the original SOLNP algorithm, Original Sources
- Alexios Ghalanos and Stefan Theussl - The people behind RSOLNP, Github repository
- Davis King - The mastermind behind Dlib, check out his blog! Blog