psfun_z_quadrature_mod Module

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.


Uses

  • module~~psfun_z_quadrature_mod~~UsesGraph module~psfun_z_quadrature_mod psfun_z_quadrature_mod ogpf ogpf module~psfun_z_quadrature_mod->ogpf psb_base_mod psb_base_mod module~psfun_z_quadrature_mod->psb_base_mod module~psfun_base_quadrature_mod psfun_base_quadrature_mod module~psfun_z_quadrature_mod->module~psfun_base_quadrature_mod module~psfun_utils_mod psfun_utils_mod module~psfun_z_quadrature_mod->module~psfun_utils_mod module~psfun_base_quadrature_mod->psb_base_mod module~psfun_base_quadrature_mod->module~psfun_utils_mod psb_krylov_mod psb_krylov_mod module~psfun_base_quadrature_mod->psb_krylov_mod psb_prec_mod psb_prec_mod module~psfun_base_quadrature_mod->psb_prec_mod module~psfun_utils_mod->psb_base_mod

Used by

  • module~~psfun_z_quadrature_mod~~UsedByGraph module~psfun_z_quadrature_mod psfun_z_quadrature_mod module~psfun_z_quadrules_mod psfun_z_quadrules_mod module~psfun_z_quadrules_mod->module~psfun_z_quadrature_mod module~psfun_quadrature_mod psfun_quadrature_mod module~psfun_quadrature_mod->module~psfun_z_quadrature_mod program~quadraturetest quadraturetest program~quadraturetest->module~psfun_quadrature_mod

Contents


Interfaces

public interface hhtmethod1

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.

  • public subroutine hhtmethod1(zfun, xi, c, eta, sign, N, info, cparams, rparams)

    Arguments

    Type IntentOptional AttributesName
    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


Abstract Interfaces

abstract interface

  • public function zquadfun(z) result(res)

    Arguments

    Type IntentOptional AttributesName
    complex(kind=psb_dpk_), intent(in) :: z

    Return Value complex(kind=psb_dpk_)

abstract interface

  • public subroutine zquadrule(zfun, xi, c, eta, sign, N, info, cparams, rparams)

    To integrate a function that take as inputs complex number and gives as output complex numbers

    Arguments

    Type IntentOptional AttributesName
    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


Derived Types

type, public, extends(psfun_quadrature) :: psfun_z_quadrature

Components

TypeVisibility AttributesNameInitial
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

Type-Bound Procedures

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

Subroutines

public subroutine psfun_z_computepoles(quad, quadformula, zfun, N, info, cparams, rparams)

Compute the poles for a given combination of quadrature rule and quadrature formula

Arguments

Type IntentOptional AttributesName
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

public subroutine psfun_z_quadratureplot(quad, zfun, info, filename)

Plots on the complex plane the quadrature poles, and plots the weights of the formula

Arguments

Type IntentOptional AttributesName
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

public subroutine psfun_z_setmatrix(quad, a)

Set the matrix for

Arguments

Type IntentOptional AttributesName
class(psfun_z_quadrature), intent(inout) :: quad

Quadrature type

type(psb_dspmat_type), target:: a

Matrix on which we work

public subroutine psfun_z_setpreconditioner(quad, prec)

Set the preconditioner to use for the given quadrature formula

Arguments

Type IntentOptional AttributesName
class(psfun_z_quadrature), intent(inout) :: quad

Quadrature type

type(psb_dprec_type), target:: prec

Preconditioner for the solution of the associate linear systems