The purpose of the ZerSol library is the finding all zeros of an analytic function that are contained in a given rectangular region of a complex plane. It is based on the argument principle and recursive subdivisions of the region coupled with the Newton's iterations at the final stage of the search. The ZerSol library assumes that evaluation of the function is expensive and tries to minimize the number of the function calls by using efficient algorithms and special data structures. The library provides an extensive set of interface functions for the search customization and it outputs detailed diagnostic messages in case of failures.
Copyright © 2012 - 2017 by Ivan B. Ivanov. The ZerSol library and its documentation are distributed under the terms of the GNU General Public License v3. No representations are made about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. See the GNU General Public License for more details.
Please, download and unpack the latest version of the library.
In the following we assume that the top level ZerSol directory is zersol-x.x.x
.
The further steps depend on an operating system and a language you are going to use to call the library functions:
This is the simplest case since no further installation steps are needed.
In this case you should compile and build the ZerSol bindings as described below.
Linux / Unix users may edit zersol-x.x.x/Makefile.in
to set desired compilation settings.
To build C or Fortran bindings run in a terminal:
make lang=c
or
make lang=fortran
and similar for other languages. The lib/libzersol*.a
library should appear after a successful build.
Windows and other users that do not have the GNU build tools should build the bindings manually in their favorite IDE. The bindings source codes are contained in:
src/zersolc.cpp
- C bindings
src/zersolf.cpp
- Fortran bindings
src/zersol*.cpp - other bindings
To build a bindings library you will need a C++ compiler installed in your system. We recommend excellent and free of charge gcc ports, e.g. MinGW gcc port for Windows.
Let us demonstrate how to apply the ZerSol library
to find all zeros of the complex analytic function f(z) = exp(3*z) + 2*z*cos(z) - 1
located in the rectangular region [-2,2] x [-2,3] of complex plane (z).
The test function is taken from the paper of P. Kravanja et al. / Computer Physics Communications, 124, (2000), 212-232.
In this short example only the basic steps are shown with all default settings of the solver.
For more detailed and comprehensive examples that can be easily adapted for your particular needs have
a look at zersol-x.x.x/tests/case*
directories where the source codes for several languages are provided.
Linux / Unix users may immediately build any test case in a terminal:
cd zersol-x.x.x/tests/case* && make lang=c++
cd zersol-x.x.x/tests/case* && make lang=c
cd zersol-x.x.x/tests/case* && make lang=fortran
and similar for other languages. Windows and other users that do not have the GNU build tools should build the test cases manually in their favorite IDE by compilation of the test case source code and linking the object file with appropriate ZerSol bindings.
To use the ZerSol library functions in your C++ code you have to #include "zerosolver.hpp"
in the source
file and add zersol-x.x.x/src
path to the list of directories searched by your C++ compiler.
To use the ZerSol library functions in your C code you have to #include "zersolc.h"
in the source
file, add zersol-x.x.x/src
path to the list of directories searched by your C compiler and link the object file
with the precompiled C bindings library.
To use the ZerSol library functions in your Fortran code you have to link the object file with the precompiled Fortran bindings library.
Please, find here the detailed information about the ZerSol C++ classes and functions.
Please, find here the detailed information about the ZerSol C interface typedefs and functions.
Please, find here the detailed information about the ZerSol Fortran interface subroutines.