This module contains the generic interfaces for the computation of the different matrix functions included in the library. The idea is that this modules computes, in a serial way, .
For symmetric matrices we implement the Schur algorithm for the
computation of . For this reason we need the psfun_d_serial
type to have a member pointing to a function name for f. It is already
defined to get also a second optional argument that tells the function
to compute instead the kth derivative of f. This is done in light of
the nonsymmetric case in which the Schur-Parlett algorithm should be used
instead.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=psb_dpk_), | intent(in) | :: | x | Value to be computed |
||
integer(kind=psb_ipk_), | intent(in), | optional | :: | k | Computes kth derivative |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
procedure(func), | public, | pointer, nopass | :: | f_ptr | => | null() | Pointer of a function |
character(len=20), | public | :: | fname | = | 'EXP' | Name of the function |
|
integer(kind=psb_ipk_), | public | :: | padedegree | = | 6_psb_ipk_ | Degree of Padé expansion |
|
integer(kind=psb_ipk_), | public | :: | phiorder | = | 1_psb_ipk_ | Order of the -function |
|
real(kind=psb_dpk_), | public | :: | scaling | = | 1.0_psb_dpk_ | of |
|
character(len=20), | public | :: | variant | = | 'EXPOKIT' | Implementatio variant |
generic, public :: apply => applya, applys | |
procedure, public, pass(fun) :: applya => psfun_d_serial_apply_array | |
procedure, public, pass(fun) :: applys => psfun_d_serial_apply_sparse | |
generic, public :: set => setstring, setreal, setinteger, setfunction | |
procedure, public, pass(fun) :: setfunction => psfun_d_setpointer | |
procedure, public, pass(fun) :: setinteger => psfun_d_setinteger | |
procedure, public, pass(fun) :: setreal => psfun_d_setreal | |
procedure, public, pass(fun) :: setstring => psfun_d_setstring |
This is the core of the function apply on a serial matrix to compute . It calls on the specific routines implementing the different functions. It is the function to modify if ones want to interface a new function that was not previously available or a new algorithm (variant) for an already existing function.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(psfun_d_serial), | intent(inout) | :: | fun | Function information |
||
real(kind=psb_dpk_), | intent(in) | :: | a(:,:) | Matrix |
||
real(kind=psb_dpk_), | intent(out) | :: | y(:) | Output vector |
||
real(kind=psb_dpk_), | intent(in) | :: | x(:) | Input vector |
||
integer(kind=psb_ipk_), | intent(out) | :: | info | Information on the output |
This is the core of the function apply on a serial matrix to compute when A is memorized in a sparse storage. In this case the routine converts it to a dense storage and then calls the array version of itself. That is the one implementing the different functions. It is the function to modify if ones want to interface a new function that was not previously available or a new algorithm (variant) for an already existing function.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(psfun_d_serial), | intent(inout) | :: | fun | Function information |
||
type(psb_dspmat_type), | intent(inout) | :: | a | Matrix |
||
real(kind=psb_dpk_), | intent(out) | :: | y(:) | Output vector |
||
real(kind=psb_dpk_), | intent(in) | :: | x(:) | Input vector |
||
integer(kind=psb_ipk_), | intent(out) | :: | info | Information on the output |