|
ZerSol Library
0.0.0
Solver for all zeros of an analytic function that lie within a rectangular region of a complex plane
|
The Fortran language bindings for the ZerSol C++ library functions. More...
Functions/Subroutines | |
| subroutine | template_subroutine (z, f, p) |
| The template subroutine for complex analytic function f(z) and its derivative f'(z). | |
| subroutine | create_solver (solver, f, df, data, xmin, xmax, ymin, ymax) |
| Create a data structure needed for the subsequent calls of the solver functions. | |
| subroutine | find_zeros (solver, N, Z, V, n_zeros, status) |
| Run the zeros search procedure. | |
| subroutine | print_status (solver, file_name, length) |
| Print the status of the zeros search. | |
| subroutine | print_dump (solver, file_name, length) |
| Print the dump of the solver data. | |
| subroutine | free_solver (solver) |
| Free the memory allocated by the solver. | |
| subroutine | set_nd_method (solver, method) |
| Set a finite difference method for numerical evaluation of the function derivative. | |
| subroutine | set_nd_step (solver, h) |
| Set a step size (dz) for numerical evaluation of the function derivative. | |
| subroutine | set_min_rec_lev (solver, min_rec_lev) |
| Set the minimum recursion level for the winding number evaluation procedure. | |
| subroutine | set_max_rec_lev (solver, max_rec_lev) |
| Set the maximum recursion level for the winding number evaluation procedure. | |
| subroutine | set_interp_err (solver, interp_err) |
| Set a tolerance of interpolation for the winding number evaluation procedure. | |
| subroutine | set_jump_err (solver, jump_err) |
| Set a tolerance of test for discontinuities for the winding number evaluation procedure. | |
| subroutine | set_n_target (solver, n_target) |
| Set a desired number of the function zeros. | |
| subroutine | set_start_array (solver, n_start, start) |
| Set the array of a user supplied starting values for the Newton's iterations. | |
| subroutine | set_n_split_x (solver, n_split_x) |
| Set the number of automatic starting points along Re{z}. | |
| subroutine | set_n_split_y (solver, n_split_y) |
| Set the number of automatic starting points along Im{z}. | |
| subroutine | set_max_iter_num (solver, max_iter_num) |
| Set the maximum number of the Newton's iterations for each starting point. | |
| subroutine | set_multiplicity (solver, multiplicity) |
| Set the multiplicity of a zero. | |
| subroutine | set_eps_for_arg (solver, abs_eps_z, rel_eps_z) |
| Set the absolute and relative tolerances for the convergence condition on z. | |
| subroutine | set_eps_for_func (solver, abs_eps_f, rel_eps_f) |
| Set the absolute and relative tolerances for the convergence condition on f(z). | |
| subroutine | set_use_winding (solver, use_winding) |
| Set a flag that defines whether the solver will use the winding number evaluation or just Newton iterations. | |
| subroutine | set_max_part_level (solver, max_part_level) |
| Set the maximum allowed level of the rectangle partition. | |
| subroutine | set_debug_level (solver, debug_level) |
| Set the debug level (determines the amount of internal checks). | |
| subroutine | set_print_level (solver, print_level) |
| Set the print level (determines the amount of details printed). | |
| subroutine | get_nd_method (solver, method) |
| Get a finite difference method for numerical evaluation of the function derivative. | |
| subroutine | get_nd_step (solver, h) |
| Get a step size (dz) for numerical evaluation of the function derivative. | |
| subroutine | get_min_rec_lev (solver, min_rec_lev) |
| Get the minimum recursion level for the winding number evaluation procedure. | |
| subroutine | get_max_rec_lev (solver, max_rec_lev) |
| Get the maximum recursion level for the winding number evaluation procedure. | |
| subroutine | get_interp_err (solver, interp_err) |
| Get a tolerance of interpolation for the winding number evaluation procedure. | |
| subroutine | get_jump_err (solver, jump_err) |
| Get a tolerance of test for discontinuities for the winding number evaluation procedure. | |
| subroutine | get_n_target (solver, n_target) |
| Get a desired number of the function zeros. | |
| subroutine | get_start_array (solver, n_start, start) |
| Get the array of a user supplied starting values for the Newton's iterations. | |
| subroutine | get_n_split_x (solver, n_split_x) |
| Get the number of automatic starting points along Re{z}. | |
| subroutine | get_n_split_y (solver, n_split_y) |
| Get the number of automatic starting points along Im{z}. | |
| subroutine | get_max_iter_num (solver, max_iter_num) |
| Get the maximum number of the Newton's iterations for each starting point. | |
| subroutine | get_multiplicity (solver, multiplicity) |
| Get the multiplicity of a zero. | |
| subroutine | get_eps_for_arg (solver, abs_eps_z, rel_eps_z) |
| Get the absolute and relative tolerances for the convergence condition on z. | |
| subroutine | get_eps_for_func (solver, abs_eps_f, rel_eps_f) |
| Get the absolute and relative tolerances for the convergence condition on f(z). | |
| subroutine | get_use_winding (solver, use_winding) |
| Get a flag that defines whether the solver will use the winding number evaluation or just Newton iterations. | |
| subroutine | get_max_part_level (solver, max_part_level) |
| Get the maximum allowed level of the rectangle partition. | |
| subroutine | get_debug_level (solver, debug_level) |
| Get the debug level (determines the amount of internal checks). | |
| subroutine | get_print_level (solver, print_level) |
| Get the print level (determines the amount of details printed). | |
The Fortran language bindings for the ZerSol C++ library functions.
The following subroutines demonstrate the Fortran interface of the ZerSol library functions. Make sure that precision of floating point numbers in your Fortran code
is consistent with that used in the ZerSol Fortran bindings. You can change the type of floating point numbers used in the ZerSol interface in the file zersolf.cpp in line:
Don't forget to rebuild the ZerSol Fortran bindings after that!
Please note, that pp parameter defined in a user Fortran code (see test cases) must conform the architecture of your machine:
| subroutine template_subroutine | ( | complex(prec) | z, |
| complex(prec) | f, | ||
| p | |||
| ) |
The template subroutine for complex analytic function f(z) and its derivative f'(z).
| z | value of independent complex variable |
| f | the function value at z |
| p | any additional parameter: a number, an array, etc... |
| subroutine create_solver | ( | integer(pp) | solver, |
| integer(pp) | f, | ||
| integer(pp) | df, | ||
| data, | |||
| real(prec) | xmin, | ||
| real(prec) | xmax, | ||
| real(prec) | ymin, | ||
| real(prec) | ymax | ||
| ) |
Create a data structure needed for the subsequent calls of the solver functions.
| solver | address of the solver structure |
| f | address of a Fortran subroutine that evaluates the complex function value |
| df | address of a Fortran subroutine that evaluates the complex function derivative |
| data | a structure (a number, an array, etc) that can be used to pass any data into the function and its derivative |
| xmin | minimum x-coordinate of the rectangular region |
| xmax | maximum x-coordinate of the rectangular region |
| ymin | minimum y-coordinate of the rectangular region |
| ymax | maximum y-coordinate of the rectangular region |
| subroutine find_zeros | ( | integer(pp) | solver, |
| integer | N, | ||
| complex(prec), dimension(n) | Z, | ||
| complex(prec), dimension(n) | V, | ||
| integer | n_zeros, | ||
| integer | status | ||
| ) |
Run the zeros search procedure.
| solver | address of the solver structure |
| N | length of the passed Z and V arrays |
| Z | array for the function zeros |
| V | array for the function values V = F(Z) |
| n_zeros | number of the zeros found |
| status | search status |
| subroutine print_status | ( | integer(pp) | solver, |
| character(length+1) | file_name, | ||
| integer | length | ||
| ) |
Print the status of the zeros search.
| solver | address of the solver structure |
| file_name | name of a file to store the search status |
| length | length of the trimmed file_name character array |
| subroutine print_dump | ( | integer(pp) | solver, |
| character(length+1) | file_name, | ||
| integer | length | ||
| ) |
Print the dump of the solver data.
| solver | address of the solver structure |
| file_name | name of a file to store the solver dump |
| length | length of the trimmed file_name character array |
| subroutine free_solver | ( | integer(pp) | solver | ) |
Free the memory allocated by the solver.
| solver | address of the solver structure |
| subroutine set_nd_method | ( | integer(pp) | solver, |
| integer | method | ||
| ) |
Set a finite difference method for numerical evaluation of the function derivative.
| solver | address of the solver structure |
| method | finite difference method: pass method = 0 for 3-point stencil approximation (second order) and method = 1 for 5-point stencil approximation (fourth order) |
| subroutine set_nd_step | ( | integer(pp) | solver, |
| real(prec) | h | ||
| ) |
Set a step size (dz) for numerical evaluation of the function derivative.
| solver | address of the solver structure |
| h | step size |
| subroutine set_min_rec_lev | ( | integer(pp) | solver, |
| integer | min_rec_lev | ||
| ) |
Set the minimum recursion level for the winding number evaluation procedure.
| solver | address of the solver structure |
| min_rec_lev | minimum recursion level |
| subroutine set_max_rec_lev | ( | integer(pp) | solver, |
| integer | max_rec_lev | ||
| ) |
Set the maximum recursion level for the winding number evaluation procedure.
| solver | address of the solver structure |
| max_rec_lev | maximum recursion level |
| subroutine set_interp_err | ( | integer(pp) | solver, |
| real(prec) | interp_err | ||
| ) |
Set a tolerance of interpolation for the winding number evaluation procedure.
| solver | address of the solver structure |
| interp_err | tolerance of interpolation |
| subroutine set_jump_err | ( | integer(pp) | solver, |
| real(prec) | jump_err | ||
| ) |
Set a tolerance of test for discontinuities for the winding number evaluation procedure.
| solver | address of the solver structure |
| jump_err | tolerance of test for discontinuities |
| subroutine set_n_target | ( | integer(pp) | solver, |
| integer | n_target | ||
| ) |
Set a desired number of the function zeros.
| solver | address of the solver structure |
| n_target | target number of zeros |
| subroutine set_start_array | ( | integer(pp) | solver, |
| integer | n_start, | ||
| complex(prec), dimension(n_start) | start | ||
| ) |
Set the array of a user supplied starting values for the Newton's iterations.
| solver | address of the solver structure |
| n_start | number of starting values |
| start | array of starting values |
| subroutine set_n_split_x | ( | integer(pp) | solver, |
| integer | n_split_x | ||
| ) |
Set the number of automatic starting points along Re{z}.
| solver | address of the solver structure |
| n_split_x | number of starting points |
| subroutine set_n_split_y | ( | integer(pp) | solver, |
| integer | n_split_y | ||
| ) |
Set the number of automatic starting points along Im{z}.
| solver | address of the solver structure |
| n_split_y | number of starting points |
| subroutine set_max_iter_num | ( | integer(pp) | solver, |
| integer | max_iter_num | ||
| ) |
Set the maximum number of the Newton's iterations for each starting point.
| solver | address of the solver structure |
| max_iter_num | maximum number of iterations |
| subroutine set_multiplicity | ( | integer(pp) | solver, |
| integer | multiplicity | ||
| ) |
Set the multiplicity of a zero.
| solver | address of the solver structure |
| multiplicity | expected multiplicity of a zero |
| subroutine set_eps_for_arg | ( | integer(pp) | solver, |
| real(prec) | abs_eps_z, | ||
| real(prec) | rel_eps_z | ||
| ) |
Set the absolute and relative tolerances for the convergence condition on z.
| solver | address of the solver structure |
| abs_eps_z | absolute tolerance |
| rel_eps_z | relative tolerance |
| subroutine set_eps_for_func | ( | integer(pp) | solver, |
| real(prec) | abs_eps_f, | ||
| real(prec) | rel_eps_f | ||
| ) |
Set the absolute and relative tolerances for the convergence condition on f(z).
| solver | address of the solver structure |
| abs_eps_f | absolute tolerance |
| rel_eps_f | relative tolerance |
| subroutine set_use_winding | ( | integer(pp) | solver, |
| integer | use_winding | ||
| ) |
Set a flag that defines whether the solver will use the winding number evaluation or just Newton iterations.
| solver | address of the solver structure |
| use_winding | flag: true - use the winding number evaluation, false - use the Newton's iterations only |
| subroutine set_max_part_level | ( | integer(pp) | solver, |
| integer | max_part_level | ||
| ) |
Set the maximum allowed level of the rectangle partition.
| solver | address of the solver structure |
| max_part_level | partition level |
| subroutine set_debug_level | ( | integer(pp) | solver, |
| integer | debug_level | ||
| ) |
Set the debug level (determines the amount of internal checks).
| solver | address of the solver structure |
| debug_level | debug level |
| subroutine set_print_level | ( | integer(pp) | solver, |
| integer | print_level | ||
| ) |
Set the print level (determines the amount of details printed).
| solver | address of the solver structure |
| print_level | print level |
| subroutine get_nd_method | ( | integer(pp) | solver, |
| integer | method | ||
| ) |
Get a finite difference method for numerical evaluation of the function derivative.
| solver | address of the solver structure |
| method | finite difference method: method = 0 for 3-point stencil approximation (second order) and method = 1 for 5-point stencil approximation (fourth order) |
| subroutine get_nd_step | ( | integer(pp) | solver, |
| real(prec) | h | ||
| ) |
Get a step size (dz) for numerical evaluation of the function derivative.
| solver | address of the solver structure |
| h | step size |
| subroutine get_min_rec_lev | ( | integer(pp) | solver, |
| integer | min_rec_lev | ||
| ) |
Get the minimum recursion level for the winding number evaluation procedure.
| solver | address of the solver structure |
| min_rec_lev | minimum recursion level |
| subroutine get_max_rec_lev | ( | integer(pp) | solver, |
| integer | max_rec_lev | ||
| ) |
Get the maximum recursion level for the winding number evaluation procedure.
| solver | address of the solver structure |
| max_rec_lev | maximum recursion level |
| subroutine get_interp_err | ( | integer(pp) | solver, |
| real(prec) | interp_err | ||
| ) |
Get a tolerance of interpolation for the winding number evaluation procedure.
| solver | address of the solver structure |
| interp_err | tolerance of interpolation |
| subroutine get_jump_err | ( | integer(pp) | solver, |
| real(prec) | jump_err | ||
| ) |
Get a tolerance of test for discontinuities for the winding number evaluation procedure.
| solver | address of the solver structure |
| jump_err | tolerance of test for discontinuities |
| subroutine get_n_target | ( | integer(pp) | solver, |
| integer | n_target | ||
| ) |
Get a desired number of the function zeros.
| solver | address of the solver structure |
| n_target | target number of zeros |
| subroutine get_start_array | ( | integer(pp) | solver, |
| integer | n_start, | ||
| complex(prec) | start | ||
| ) |
Get the array of a user supplied starting values for the Newton's iterations.
| solver | address of the solver structure |
| n_start | number of starting values |
| start | array of starting values to be filled in |
| subroutine get_n_split_x | ( | integer(pp) | solver, |
| integer | n_split_x | ||
| ) |
Get the number of automatic starting points along Re{z}.
| solver | address of the solver structure |
| n_split_x | number of starting points |
| subroutine get_n_split_y | ( | integer(pp) | solver, |
| integer | n_split_y | ||
| ) |
Get the number of automatic starting points along Im{z}.
| solver | address of the solver structure |
| n_split_y | number of starting points |
| subroutine get_max_iter_num | ( | integer(pp) | solver, |
| integer | max_iter_num | ||
| ) |
Get the maximum number of the Newton's iterations for each starting point.
| solver | address of the solver structure |
| max_iter_num | maximum number of iterations |
| subroutine get_multiplicity | ( | integer(pp) | solver, |
| integer | multiplicity | ||
| ) |
Get the multiplicity of a zero.
| solver | address of the solver structure |
| multiplicity | expected multiplicity of a zero |
| subroutine get_eps_for_arg | ( | integer(pp) | solver, |
| real(prec) | abs_eps_z, | ||
| real(prec) | rel_eps_z | ||
| ) |
Get the absolute and relative tolerances for the convergence condition on z.
| solver | address of the solver structure |
| abs_eps_z | absolute tolerance |
| rel_eps_z | relative tolerance |
| subroutine get_eps_for_func | ( | integer(pp) | solver, |
| real(prec) | abs_eps_f, | ||
| real(prec) | rel_eps_f | ||
| ) |
Get the absolute and relative tolerances for the convergence condition on f(z).
| solver | address of the solver structure |
| abs_eps_f | absolute tolerance |
| rel_eps_f | relative tolerance |
| subroutine get_use_winding | ( | integer(pp) | solver, |
| integer | use_winding | ||
| ) |
Get a flag that defines whether the solver will use the winding number evaluation or just Newton iterations.
| solver | address of the solver structure |
| use_winding | flag: true - use the winding number evaluation, false - use the Newton's iterations only |
| subroutine get_max_part_level | ( | integer(pp) | solver, |
| integer | max_part_level | ||
| ) |
Get the maximum allowed level of the rectangle partition.
| solver | address of the solver structure |
| max_part_level | maximum partition level |
| subroutine get_debug_level | ( | integer(pp) | solver, |
| integer | debug_level | ||
| ) |
Get the debug level (determines the amount of internal checks).
| solver | address of the solver structure |
| debug_level | debug level |
| subroutine get_print_level | ( | integer(pp) | solver, |
| integer | print_level | ||
| ) |
Get the print level (determines the amount of details printed).
| solver | address of the solver structure |
| print_level | print level |
1.8.2