This module computes the matrix-function vector product by means of the approximation of based on quadrature formula, i.e., having computed the poles and the scalings of the formula solves linear systems to approximate the product.
Method 1 of Hale, Nicholas; Higham, Nicholas J.; Trefethen, Lloyd N. Computing , and related matrix functions by contour integrals. SIAM J. Numer. Anal. 46 (2008), no. 5, 2505--2523.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
procedure(zquadfun), | intent(in), | pointer | :: | zfun | Function to integrate |
|
complex(kind=psb_dpk_), | intent(out), | allocatable, dimension(:) | :: | xi | Poles of the formula |
|
complex(kind=psb_dpk_), | intent(out), | allocatable, dimension(:) | :: | c | Scaling of the formula |
|
real(kind=psb_dpk_), | intent(out) | :: | eta | Global Scaling |
||
real(kind=psb_dpk_), | intent(out) | :: | sign | Sign for A |
||
integer(kind=psb_ipk_), | intent(in) | :: | N | Number of Poles |
||
integer(kind=psb_ipk_), | intent(out) | :: | info | Flag on the results |
||
complex(kind=psb_dpk_), | intent(in), | optional | dimension(:) | :: | cparams | Optional complex parameters |
real(kind=psb_dpk_), | intent(in), | optional | dimension(:) | :: | rparams | Optional real parameters |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=psb_dpk_), | intent(in) | :: | z |
To integrate a function that take as inputs complex number and gives as output complex numbers
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
procedure(zquadfun), | intent(in), | pointer | :: | zfun | Function to integrate |
|
complex(kind=psb_dpk_), | intent(out), | allocatable, dimension(:) | :: | xi | Poles of the formula |
|
complex(kind=psb_dpk_), | intent(out), | allocatable, dimension(:) | :: | c | Scaling of the formula |
|
real(kind=psb_dpk_), | intent(out) | :: | eta | Global Scaling |
||
real(kind=psb_dpk_), | intent(out) | :: | sign | Sign for A |
||
integer(kind=psb_ipk_), | intent(in) | :: | N | Number of Poles |
||
integer(kind=psb_ipk_), | intent(out) | :: | info | Flag on the results |
||
complex(kind=psb_dpk_), | intent(in), | optional | dimension(:) | :: | cparams | Optional complex parameters |
real(kind=psb_dpk_), | intent(in), | optional | dimension(:) | :: | rparams | Optional real parameters |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(psb_dspmat_type), | public, | pointer | :: | a | Matrix on which we work |
||
complex(kind=psb_dpk_), | public, | allocatable, dimension(:) | :: | c | Scaling of the formula |
||
type(psb_desc_type), | public | :: | desc_a | Descriptor for parallel environment |
|||
real(kind=psb_dpk_), | public | :: | eta | Global Scaling |
|||
type(psb_dprec_type), | public, | pointer | :: | prec | Preconditioner for the solution of the associate linear systems |
||
real(kind=psb_dpk_), | public | :: | sign | Sign for |
|||
complex(kind=psb_dpk_), | public, | allocatable, dimension(:) | :: | xi | Poles of the formula |
procedure, public, pass(quad) :: computepoles => psfun_z_computepoles | |
procedure, public, pass(quad) :: plot => psfun_z_quadratureplot | |
generic, public :: set => setmatrix, setpreconditioner | |
procedure, public, pass(quad) :: setmatrix => psfun_z_setmatrix | |
procedure, public, pass(quad) :: setpreconditioner => psfun_z_setpreconditioner |
Compute the poles for a given combination of quadrature rule and quadrature formula
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(psfun_z_quadrature), | intent(inout) | :: | quad | Quadrature type |
||
procedure(zquadrule), | intent(in), | pointer | :: | quadformula | Quadrature formula |
|
procedure(zquadfun), | intent(in), | pointer | :: | zfun | Function to integrate |
|
integer(kind=psb_ipk_), | intent(in) | :: | N | Number of poles |
||
integer(kind=psb_ipk_), | intent(out) | :: | info | Flag on the results |
||
complex(kind=psb_dpk_), | intent(in), | optional | dimension(:) | :: | cparams | Optional complex parameters |
real(kind=psb_dpk_), | intent(in), | optional | dimension(:) | :: | rparams | Optional real parameters |
Plots on the complex plane the quadrature poles, and plots the weights of the formula
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(psfun_z_quadrature), | intent(in) | :: | quad | Quadrature rule |
||
procedure(zquadfun), | intent(in), | pointer | :: | zfun | Function to integrate |
|
integer(kind=psb_ipk_), | intent(out) | :: | info | |||
character(len=*), | intent(in), | optional | :: | filename |
Set the matrix for
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(psfun_z_quadrature), | intent(inout) | :: | quad | Quadrature type |
||
type(psb_dspmat_type), | target | :: | a | Matrix on which we work |
Set the preconditioner to use for the given quadrature formula
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(psfun_z_quadrature), | intent(inout) | :: | quad | Quadrature type |
||
type(psb_dprec_type), | target | :: | prec | Preconditioner for the solution of the associate linear systems |