If you find this solver useful, please cite it. You are also welcome to send an email letting us know what you are using it for; then we can include it here as an example. If you would like to add some of your systems as unit tests, just create additional data files with new case identifiers and submit a pull request.
This package makes it easy to find solutions to under-determined matrix problems using the Bayesian Compressive Sensing formalism. See the writeup describing the mathematical background. To get started quickly install the fortpy package from PyPI and run the unit tests. We recommend using a virtualenv for installing fortpy.
pip install fortpy
git clone https://github.com/rosenbrockc/bcs.git
mkdir bcs/staging
cd bcs/
runtests.py . -stagedir staging/
The unit tests will compile the BCS solver on your system, execute them and make sure they get the correct results. If the unit tests are successful, you are ready to solve your own systems.
If you examine the staging/
folder that the unit tests were run in, you will find:
bcs.do_normal
bcs.do_reweighted
bcs.do_bcs
.
The normal BCS routine finds a single solution to an under-determined problem without reweighting the coefficients to enhance sparsity. Using reweighting reduces the number of coefficients in your solution vector. The do_bcs
routine performs multiple fits for either of the other routines (normal or reweighted) using randomly selected subsets from the matrix and measurement vector each time. Inside each of those folders there is a folder tests
which contains input files for the tests that were performed. For the quickest start:
- grab the executable
std.x
compiled within one of those folders. - grab the input files in one of the testing directories
- replace the contents of the files with your data.
If you are interested in using the solver in your own software, looking at the drivers std.f90
generated by fortpy
will show you how to do that. Additionally, the XML Documentation Standard described by fortpy
is adhered to so that all the subroutines and functions in the fortran modules are well documented. If you have questions, send me an email.